#ifndef D2SIMPLEXINTERSECTION_H
#define D2SIMPLEXINTERSECTION_H

#include <gobj.h>

#include <d2simplex.h>

/*! \brief Draw the triangle's edges as lines. */
class d2simplexOutline : public gobj
{
  d2simplex & s;
public:

  d2simplexOutline(d2simplex & _s);

  void draw();
};

/*! \brief Draw a filled triangle. */
class d2simplexFill : public gobj
{
  d2simplex & s;
public:

  d2simplexFill(d2simplex & _s);

  void draw();
};

/*! \brief Draw the simplexes half spaces. */
class d2simplexNormals : public gobj
{
  d2simplex & s;
public:

  double arrowlength;
  double headlength;

  d2simplexNormals(d2simplex & _s);

  void draw();
};



/*!
\brief Display two triangles in 2D and visually identify
  when they intersect.
*/
class d2simplexintersection : public gobj
{
public:

  /** Triangle 1. */
  d2simplex & s1;
  /** Triangle 2. */
  d2simplex & s2;

  /** Draw triangle 1's edges. */
  d2simplexOutline s1g;
  /** Draw triangle 2's edges. */
  d2simplexOutline s2g;

  /** Set to true when intersection occures. */
  bool intersection;

  /** Constructor. */
  d2simplexintersection
  (
    d2simplex & s1,
    d2simplex & s2
  );

  /** Draws the two triangles and colors them in if 
      they intersect. */
  void draw();

};




#endif



