#ifndef D4MINOPERATOR_H
#define D4MINOPERATOR_H

typedef unsigned int uint;
typedef unsigned int const uintc;

class d4tess;

class d4minoperator
{
public:

  d4tess & tess;

  d4minoperator(d4tess & _tess);
  virtual ~d4minoperator() {}

  // If the tessellation is changed return true.
  //   a and b are generally neighbouring tetrahedrons
  virtual bool const eval(uintc a, uintc b)
    { return false; }

  
  // Iterate around all faces except index evaluating until
  //   a successful eval(a,i) or no more faces. 
  //   I consider this operator a mathematical complement to eval.
  //   Let eval be operator M then let this be operator M'.
  bool const evalInvert(uintc a, uintc index);

  bool const twotetrahedronMInvert
  (
    uintc a, 
    uintc ai, 
    uintc b, 
    uintc bi
  );


   

/*
  // Are tetrahedrons a and b connected?
  // ai and bi are local indexes to B and A respectively.
  bool const isconnected
  (
    uint & ai, 
    uint & bi,
    uintc a,
    uintc b
  ) const;  

  // Do the two adjacent tetrahedrons joined form a convex shape?
  bool const isconvex( uintc a, uintc b ) const;
*/

protected:

  // A small fraction used in approximatelyequal function.
  //   ie set this ratio to a small fraction.
  static double delta;

  // Are a and b approximately equal in magnitude?
  bool const approximatelyequal
  (
    double const a, 
    double const b
  );

};




#endif


