#ifndef DELAUNAY_5_H
#define DELAUNAY_5_H

#include <vector>
using namespace std;

#include <point.h>
#include <typedefs.h>

/*!
\brief O(n^5) 3D tessellation algorithm.

Recommend n being a very small number of points(eg 20).
*/
class delaunay3D
{
  uint n;

  /** Vector of Points. */
  vector< point3<double> > const & vi;
public:

  /** Pass in the vector of points at construction time. */
  delaunay3D( vector< point3<double> > const & vi_);

  /** Vector of Tetrahedrons where the
      integer index refers to a point in v. */
  vector< point4<uint> > tet;

  /** O(n^5) tessellation of the given vector of points.
      Places the tetrahedrons in tet.
      The tets faces have an anticlockwise winding as viewed 
      from outside the tetrahedron. */
  void eval();

private:

  bool const evaluateTetrahedron
  (
    uintc i,
    uintc j,
    uintc k,
    uintc z
  );

};



#endif


