#ifndef PARTITIONSTEST_H
#define PARTITIONSTEST_H

#include <vector>
using namespace std;

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

/*!
\brief Testing 2D partitions.
*/
class partitionstest
{
public:

  typedef point2<double> pt2;
  typedef point3<double> pt3;

  /** The points in space. */
  vector<pt2> vec;

  /** Global pointer to this class. */
  static partitionstest * global;
  /** Set the global pointer to this class. */
  void set()
    { partitionstest::global=this; }

  /** The points in the red partition. */
  vector<uint> red;
  /** The points in the blue partition. */
  vector<uint> blue;

  /** The current partition. */
  partitionspace<pt2> * ps;

  /** Initialize for 2D. */
  partitionstest(int argc, char** argv);

  /** Initialize for 3D. */
  partitionstest();
  
  /** Screen width. */
  uint width;
  /** Screen height. */
  uint height;

  /** Default keyboard handler - ESC to quit. */
  static void keyboard01(unsigned char key, int x, int y);
  /** Displays the gobj::global with double buffering. */
  static void display01();

  static void display02();

  /** Needing rework, the screen size can be reshaped. */
  static void reshape(GLsizei w1, GLsizei h1);

  /** Clicking the mouse adds points to the screen. */
  static void mousefunc01(int button, int state, int x, int y);

  /** Paint a pixel. */
  void addpoint(intc x, intc y);
  /** Paint a few pixels. */
  void addstar( intc k, intc x, intc y );
  /** Paint a snowflake. */
  void addstarbig(intc x, intc y);

  /** Test a straight line partition. */
  void test01();

  /** Test a triangle partition. */
  void test02();

  /** Test a boomerang partition compiled from an equation. */
  void test03();

  /** Inverted square from compiled equation. */
  void test04();
  /** Subtract a circle from a square. */
  void test05();
  /** Test a tetrahedron partition. */
  void test06(int argc, char** argv);

  /** Container used for 3D graphics. */
  gobjContainer xGraphics;
};


#endif



