#ifndef D3MESHPARTITION_H
#define D3MESHPARTITION_H

#include <partitionspace.h>
#include <d3tess.h>

typedef point2<double> pt2;
typedef point2<double> const pt2c;
typedef point3<double> pt3;
typedef point3<double> const pt3c;

/*!
\brief Brute force (quadratic) general mesh subtraction.

All the meshes simplexes are transversed for isInside and 
 intersection.  This becomes expensive as if there are
 m simplexes in mesh A and n simplexes in mesh B
 then A - B is O(m)O(n).

The method is robust and easy to implement.
*/
class d3meshpartition : public partitionspace<pt3,double>
{
public:

  d3tess & meshB;

  d3meshpartition(d3tess & meshB_)
    : meshB(meshB_) {}

  
  bool const isInside(pt3c & x) const;
  bool const intersection(pt3 & x, pt3c & w, pt3c & b) const;

  /** The boundary is interpreted as a simplex face having no neighbor. */
  bool const isOnBoundary(pt3c & w, double const zero) const;

};


#endif



