#include <iostream>
using namespace std;

#include <GL/glut.h>

#include <commandline.h>
#include <partitionstest.h>


int main(int argc, char** argv)
{
  commandline cmd(argc,argv);
  uint prog(0);
  cmd.mapvar(prog,"prog");

  switch (prog)
  {
    case 0:
      cout << "There are a few test programs." << endl;
      cout << endl << endl;
      cout << "The first 1..5 programs are interactive. The user\n"
           << " uses the mouse as a paint brush to see the partition.\n"
           << " Red is inside and blue outside" << endl << endl;
     
      cout << "$./main prog=1        - test d2halfspace / straight line partition." << endl;
      cout << "$./main prog=2        - test the triangle partition class." << endl;
      cout << "$./main prog=3        - test boomerang from an equation." << endl;
      cout << "      L[0]*L[1]*(L[2]+L[3])." << endl;
      cout << "$./main prog=4        - test inverted square from equation." << endl;
      cout << "$./main prog=5        - test subtraction of circle from rectangle." << endl;
      cout << "$./main prog=6        - test tetrahedron partition by drawing thousands of points" << endl;
      break;

    case 1: partitionstest(argc,argv).test01(); break;
    case 2: partitionstest(argc,argv).test02(); break;
    case 3: partitionstest(argc,argv).test03(); break;
    case 4: partitionstest(argc,argv).test04(); break;
    case 5: partitionstest(argc,argv).test05(); break;
    case 6: partitionstest().test06(argc,argv); break;

    default: cout << "error:  No case handled." << endl; return 1; 
  };

  return 0;
}




