proj home

Files   Classes   Functions   Hierarchy  

main.cpp

Go to the documentation of this file.
00001 
00002 
00003 #include <cassert>
00004 #include <iostream>
00005 using namespace std;
00006 
00007 #include <boxOBBhalfspaceD2test.h>
00008 #include <circleD2test.h>
00009 #include <commandline.h>
00010 #include <d2simplextest.h>
00011 #include <diskinttest.h>
00012 #include <planeinttest.h>
00013 #include <zero.h>
00014 
00015 template<>
00016 double zero<double>::val = 1E-13;
00017   
00018 
00019 int main(int argc, char** argv)
00020 {
00021   commandline cmd(argc,argv);
00022   uint prog(0);
00023   cmd.mapvar(prog,"prog");
00024 
00025   switch (prog)
00026   {
00027     case 0:
00028       cout << "Test programs for intersection tests" << endl << endl;
00029 
00030       cout << "Simplex to Simplex Intersection (Separate Axis)" << endl;
00031       cout << "  ./main prog=1   " << endl;
00032 
00033       cout << "Plane to Plane Intersection." << endl;
00034       cout << "  /main prog=2 in=planes01.txt" << endl;
00035       cout << "  The text file has two planes of form N.x N.y N.z d  where N*X=d eg" << endl;
00036       cout << "  0.0 2.0 1.0 1.0" << endl;
00037       cout << "  0.0 1.0 0.0 6.0" << endl;
00038 
00039       cout << "Disk to Plane Intersection." << endl;
00040       cout << "  ./main prog=3 in=diskplane01.txt" << endl;
00041       cout << "  The text file has a disk with N.x N.y N.z pos.x pos.y pos.z radius, followed by a plane. eg" << endl;
00042       cout << "  0.0 0.0 1.0  0.0 0.0 0.0  1.0" << endl;
00043       cout << "  0.0 1.0 0.0 0.0" << endl;
00044 
00045       cout << "Disk to Disk Intersection." << endl;
00046       cout << "  ./main prog=4 in=diskdisk01.txt" << endl;
00047       cout << "  The text file has two disks with N.x N.y N.z pos.x pos.y pos.z radius format." << endl;
00048       cout << "  0.0 0.0 1.0  0.0 0.0 0.0  1.0" << endl;
00049       cout << "  0.2 1.0 1.0  0.0 0.0 0.0  10.0" << endl;
00050 
00051       cout << "OBB to OBB intersection." << endl;
00052       cout << "  ./main prog=10 in=OBBhalfspaceD2_01.txt" << endl;
00053       cout << "  The text file has center, arm1, arm2, arm1len, arm2len format." << endl;
00054       cout << "  0.0 0.0  1.0 0.0  0.0 1.0  1.2  0.6" << endl;
00055       cout << "  3.0 1.0  1.0 0.0  0.0 1.0  2.0  1.5" << endl;
00056 
00057       cout << "Circle and box 2D test." << endl;
00058       cout << "  ./main prog=11 in=circleD2testfile01.txt" << endl;
00059       cout << "  The text file has circle then OBB." << endl; 
00060 
00061       cout << "Cylinder and Cylinder Intersection(Experimental)." << endl;
00062       cout << "  ./main prog=5 in=cylindercylinder02.txt" << endl;
00063 
00064       break;
00065 
00066     case 1: d2simplextest(argc,argv).test01(); break;
00067     case 2: planeinttest().test01(argc,argv); break;
00068     case 3: diskinttest().test01(argc,argv); break;
00069     case 4: diskinttest().test02(argc,argv); break;
00070     case 5: diskinttest().test03(argc,argv); break;
00071 
00072     case 10: boxOBBhalfspaceD2test().test01(argc,argv); break;
00073     case 11: circleD2test().test01(argc,argv); break;
00074     case 12: return boxOBBhalfspaceD2test::unittest01();
00075     case 13: return boxOBBhalfspaceD2test::unittest02(argc,argv);
00076 
00077 
00078     default: cout << "error:  No case handled." << endl; return 1;
00079   }
00080 
00081   return 0;
00082 }
00083 
00084 
00085 

Generated on Fri Mar 4 00:49:25 2011 for Chelton Evans Source by  doxygen 1.5.8