Files Classes Functions Hierarchy
#include <treeindexedD2test.h>
Public Types | |
| typedef point2< double > | pt2 |
| typedef point2< double > | pt2 |
Public Member Functions | |
| void | test03 (int argc, char **argv) |
| Visually see and interact with a bsp tree. | |
| int | test05 (int argc, char **argv) |
| Passageway collision detection. | |
| void | test03 (int argc, char **argv) |
| Visually see and interact with a bsp tree. | |
| int | test05 (int argc, char **argv) |
| Passageway collision detection. | |
Static Public Member Functions | |
| static void | test01 () |
| Basic printing and inserting. | |
| static void | test02 () |
| Building and printing a simple tree. | |
| static void | test04 () |
| Testing treeindexedD2iter.h classes. | |
| static int | unittest01 (int argc, char **argv) |
| Reading a tree from a text file. | |
| static int | unittest02 () |
| Build a bsp tree in 2D. | |
| static int | unittest04 () |
| Testing move(T const bpath,T const nsteps). | |
| static void | test01 () |
| Basic printing and inserting. | |
| static void | test02 () |
| Building and printing a simple tree. | |
| static void | test04 () |
| Testing treeindexedD2iter.h classes. | |
| static int | unittest01 (int argc, char **argv) |
| Reading a tree from a text file. | |
| static int | unittest02 () |
| Build a bsp tree in 2D. | |
| static int | unittest04 () |
| Testing move(T const bpath,T const nsteps). | |
This class has small unit tests and two interactive graphics programs test03 and test05.
The graphics aims to visually impart information about the data structures(WYSIWYG).
Definition at line 23 of file treeindexedD2test.h.
| typedef point2<double> treeindexedD2test::pt2 |
Definition at line 26 of file treeindexedtest.h.
| typedef point2<double> treeindexedD2test::pt2 |
Definition at line 26 of file treeindexedD2test.h.
| static void treeindexedD2test::test01 | ( | ) | [static] |
Basic printing and inserting.
| void treeindexedD2test::test01 | ( | ) | [static] |
Basic printing and inserting.
Definition at line 48 of file treeindexedD2test.cpp.
References treeindexedD2< INDX >::addleft(), and treeindexedD2< INDX >::addright().
Referenced by main().
00049 { 00050 cout << "Testing treeindexedD2 printing and addleft, addright." << endl; 00051 00052 treeindexedD2<uint> t1; 00053 00054 cout << "Created a root node." << endl; 00055 cout << (stringc)t1 << endl << endl; 00056 00057 cout << "addleft" << endl; 00058 t1.addleft(); 00059 cout << (stringc)t1 << endl << endl; 00060 00061 cout << "Created another root node." << endl; 00062 treeindexedD2<uint> t2; 00063 cout << (stringc)t2 << endl << endl; 00064 cout << "addright" << endl; 00065 t2.addright(); 00066 cout << (stringc)t2 << endl << endl; 00067 00068 00069 }
| static void treeindexedD2test::test02 | ( | ) | [static] |
Building and printing a simple tree.
| void treeindexedD2test::test02 | ( | ) | [static] |
Building and printing a simple tree.
Definition at line 72 of file treeindexedD2test.cpp.
References treeindexedD2< INDX >::addleft(), treeindexedD2< INDX >::addright(), treeindexedD2< INDX >::moveleft(), and treeindexedD2< INDX >::reset().
Referenced by main().
00073 { 00074 cout << "Builing and printing a simple tree." << endl; 00075 treeindexedD2<uint> t1; 00076 00077 t1.addleft(); 00078 cout << "addleft" << endl; 00079 cout << (stringc)t1 << endl; 00080 00081 t1.moveleft(); 00082 t1.addleft(); 00083 cout << "moveleft, addleft" << endl; 00084 cout << (stringc)t1 << endl; 00085 00086 t1.reset(); 00087 t1.moveleft(); 00088 t1.addright(); 00089 cout << "reset, moveleft, addright" << endl; 00090 00091 cout << (stringc)t1 << endl; 00092 00093 }
| void treeindexedD2test::test03 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Visually see and interact with a bsp tree.
| void treeindexedD2test::test03 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Visually see and interact with a bsp tree.
Definition at line 258 of file treeindexedD2test.cpp.
References treeindexedD2< INDX >::addleft(), treeindexedD2< INDX >::addright(), bsptreeD2dispregions01< PT, PD, INDX >::delta, menusystem::fontcolor, menusystem::fontcolorenable(), gobjpush, gobjSwitch< BOOL >::isdrawn, gobjQuadric::loops, treeindexedD2< INDX >::moveright(), gobjQuadric::radius, treeindexedD2< INDX >::reset(), gobjContainer::set(), gobjQuadric::slices, bsptreeD2< PT, PD, INDX >::tree, zpr::update(), bsptreeD2dispregions01< PT, PD, INDX >::update(), bsptreeD2disp03< PT, PD, INDX >::update(), and bsptreeD2< PT, PD, INDX >::vi.
00259 { 00260 glutInit(&argc,argv); 00261 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00262 glutInitWindowSize(800,600); 00263 glutCreateWindow(""); 00264 glutDisplayFunc(display01); 00265 00266 // TURNED OFF FOR TESTING. 00267 glutKeyboardFunc(keyboard03); 00268 glutSpecialFunc(special03); 00269 00270 OpenGLinitialisation(); 00271 00272 glEnable(GL_CULL_FACE); 00273 glEnable(GL_NORMALIZE); 00274 00275 xGraphics.set(); 00276 00277 commandline cmd(argc,argv); 00278 00279 gobjpush(new myaxes(1.0)); 00280 00281 targetg = new gobjContainer(true); 00282 00283 gobjpush(targetg); 00284 00285 00286 gobjQuadric * q2 = new gobjQuadric(); 00287 q2->radius = 0.2; 00288 q2->slices=30; 00289 q2->loops=7; 00290 gobjpush(q2); 00291 00292 targetsphere = new gobjMySphereDraw(target,q2); 00293 00294 00295 00296 typedef point2<double> pt2; 00297 00298 cout << "Building a simple 2D partition." << endl; 00299 cout << " Using manual insertion commands : move to the node before" << endl; 00300 cout << " inserting new node, then adding associated half-space to vi." << endl << endl; 00301 00302 bsp.vi.push_back( 00303 halfspaceD2<pt2,double>(pt2(0.0,0.0),pt2(0.0,1.0)) ); 00304 00305 bsp.tree.reset(); 00306 bsp.tree.addleft(); 00307 bsp.vi.push_back( 00308 halfspaceD2<pt2,double>(pt2(-1.0,1.0),pt2(0.0,1.0)) ); 00309 00310 bsp.tree.reset(); 00311 bsp.tree.addright(); 00312 bsp.vi.push_back( 00313 halfspaceD2<pt2,double>(pt2(0.0,-0.5),pt2(1.0,-0.5)) ); 00314 00315 bsp.tree.reset(); 00316 bsp.tree.moveright(); 00317 bsp.tree.addleft(); 00318 bsp.vi.push_back( 00319 halfspaceD2<pt2,double>(pt2(4.0,0.0),pt2(4.0,1.0)) ); 00320 00321 00322 00323 bsptreeD2disp03<pt2,double,uint> * disp 00324 = new bsptreeD2disp03<pt2,double,uint>(bsp,0.02); 00325 //= new bsptreeD2disp03<pt2,double,uint>(bsp,-10000.0,10000.0,0.02); 00326 disp->update(); 00327 gobjpush(disp); 00328 00329 bsptreeD2dispregions01<pt2,double,uint> *dispregions 00330 = new bsptreeD2dispregions01<pt2,double,uint>(bsp); 00331 dispregions->delta=0.4; 00332 dispregions->update(); 00333 gobjpush(dispregions); 00334 00335 gobjpush(new gobjglDisable(GL_LIGHTING)); 00336 00337 00338 menusystem * menu = 00339 new menusystem(point2<GLint>(60,30),10); 00340 menu->fontcolor = point4<float>(218.0/255.0,165.0/255.0,32.0/255.0,0.75); 00341 00342 menu->fontcolorenable(); 00343 00344 gobjSwitch<> * menuswitch = new gobjSwitch<>(menu,true); 00345 help = & menuswitch->isdrawn; 00346 gobjpush(menuswitch); 00347 00348 00349 gobjpush(new gobjglEnable(GL_LIGHTING)); 00350 00351 menu->addfont12("BSP Tree Demo",2); 00352 00353 menu->addfont10("[page up] move up",1); 00354 menu->addfont10("[page down] move down",1); 00355 menu->addfont10("[< home] move left",1); 00356 menu->addfont10("[end >] move right",2); 00357 00358 // menu->addfont10("j J Move ball right or left.",1); 00359 // menu->addfont10("k K Move ball up or down.",2); 00360 00361 menu->addfont10("+ - Increase or decrease change.",1); 00362 menu->addfont10("h Toggle this help menu.",2); 00363 menu->addfont10("ESC Quit"); 00364 00365 00366 00367 gobjpush(new gobjglEnable(GL_LIGHTING)); 00368 00369 // glMatrixMode(GL_MODELVIEW); 00370 // glLoadIdentity(); 00371 00372 zpr zz; 00373 00374 // Unable to work out why this does not work. 00375 // glMatrixMode(GL_MODELVIEW); 00376 // glLoadIdentity(); 00377 // gluLookAt( 00378 // 0.0,0.0,0.0, // COP target 00379 // 0.0,0.0,5.0, // Reference 00380 // 0.0,1.0,0.0); // Up 00381 00382 zz.update(); 00383 00384 update03(); 00385 00386 glutMainLoop(); 00387 00388 }
| static void treeindexedD2test::test04 | ( | ) | [static] |
Testing treeindexedD2iter.h classes.
| void treeindexedD2test::test04 | ( | ) | [static] |
Testing treeindexedD2iter.h classes.
Definition at line 430 of file treeindexedD2test.cpp.
References treeindexedD2iter< T >::reset().
Referenced by main().
00431 { 00432 treeindexedD2<uint> t1; 00433 string s( 00434 "4 \ 00435 1 2 2 0 0 \ 00436 2 3 4 1 0 \ 00437 3 1 4 2 0 \ 00438 4 3 5 2 1"); 00439 stringstream ss(s); 00440 ss >> t1; 00441 00442 00443 treeindexedD2iter<uint> i1(t1,false); 00444 00445 cout << "Iterating over every node." << endl; 00446 for ( i1.reset(); !i1; ++i1) 00447 cout << i1()->index << " "; 00448 cout << endl << endl; 00449 00450 cout << "Iterating over the leaves." << endl; 00451 for ( i1.reset(); !i1; ++i1) 00452 if (i1()->isleaf()) 00453 cout << i1()->index << " "; 00454 cout << endl << endl; 00455 00456 cout << "Iterating over the internal nodes." << endl; 00457 for ( i1.reset(); !i1; ++i1) 00458 if (!i1()->isleaf()) 00459 cout << i1()->index << " "; 00460 cout << endl << endl; 00461 00462 00463 cout << "Iterating over the leaves." << endl; 00464 treeindexedD2iterleaf<uint> i2(t1); 00465 for ( i2.reset(); !i2; ++i2) 00466 cout << i2()->index << " "; 00467 cout << endl << endl; 00468 00469 cout << "Iterating over the internal nodes." << endl; 00470 for ( treeindexedD2iterleaf<uint> i3(t1); !i3; ++i3 ) 00471 cout << i3()->index << " "; 00472 cout << endl << endl; 00473 }
| int treeindexedD2test::test05 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Passageway collision detection.
| int treeindexedD2test::test05 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Passageway collision detection.
Definition at line 637 of file treeindexedD2test.cpp.
References menusystem::addfont12start(), bsptreeD2dispregions01< PT, PD, INDX >::delta, menusystem::fontcolor, menusystem::fontcolorenable(), gobj::global, gobjpush, gobjSwitch< BOOL >::isdrawn, textoverlay::lightingdisable(), gobjQuadric::loops, commandline::mapvar(), gobjContainer::push(), gobjQuadric::radius, gobjContainer::set(), gobjQuadric::slices, zpr::update(), bsptreeD2dispregions01< PT, PD, INDX >::update(), bsptreeD2disp03< PT, PD, INDX >::update(), and bsptreeD2< PT, PD, INDX >::validhalfspaces().
00638 { 00639 glutInit(&argc,argv); 00640 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00641 glutInitWindowSize(800,600); 00642 glutCreateWindow(""); 00643 glutDisplayFunc(display01); 00644 glutKeyboardFunc(keyboard05); 00645 glutSpecialFunc(special05); 00646 00647 OpenGLinitialisation(); 00648 00649 glEnable(GL_DEPTH_TEST); 00650 glEnable(GL_CULL_FACE); 00651 glEnable(GL_NORMALIZE); 00652 00653 xGraphics.set(); 00654 00655 commandline cmd(argc,argv); 00656 00657 typedef point2<double> pt2; 00658 00659 viboxesbuild(); 00660 00661 vector<string> ptlabels; 00662 vector<pt2> ptlist; 00663 for (uint i=1; i<viboxes.size(); ++i) 00664 { 00665 { 00666 stringstream ss; 00667 ss << i; 00668 ptlabels.push_back(ss.str()); 00669 ptlist.push_back(viboxes[i].center); 00670 } 00671 } 00672 gobjpush(new gobjglPushAttrib(GL_LIGHTING)); 00673 gobjpush(new gobjglPushAttrib(GL_CURRENT_BIT)); 00674 gobjpush(new gobjglDisable(GL_LIGHTING)); 00675 00676 gobjpush(new gobjglColor3f(0.0,0.0,1.0)); 00677 pointsdisplay2D< pt2 > pd( *gobj::global, ptlist, ptlabels ); 00678 00679 gobjpush(new gobjglPopAttrib()); 00680 gobjpush(new gobjglPopAttrib()); 00681 00682 glEnable(GL_BLEND); 00683 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); 00684 00685 gobjContainer * geom = new gobjContainer(true); 00686 //geom->push(new gobjglEnable(GL_BLEND)); 00687 //geom->push( 00688 // new gobjglBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) ); 00689 geom->push(new gobjglColor4f(0.0,0.0,191.0/255.0,0.8)); 00690 geom->push(new gobjglEnable(GL_LIGHTING)); 00691 geom->push(new gobjglBegin(GL_QUADS)); 00692 00693 pt2 pi[4]; 00694 for (uint k=1; k<viboxes.size(); ++k) 00695 { 00696 viboxes[k].cornerpoints(pi[0],pi[1],pi[2],pi[3]); 00697 for (uint i=0; i<4; ++i) 00698 geom->push(new gobjglVertex2f(pi[i].x,pi[i].y)); 00699 } 00700 00701 geom->push(new gobjglEnd()); 00702 //geom->push(new gobjglDisable(GL_BLEND)); 00703 00704 gobjpush(geom); 00705 00706 gridsquare * gs = new gridsquare(1,0xaaaa,7,6,7.0,6.0); 00707 gobjpush(gs); 00708 00709 00710 string in; 00711 cmd.mapvar(in,"in"); 00712 if ( in.empty() ) 00713 { 00714 cout << "error: in=filename expected" << endl; 00715 return 1; 00716 } 00717 00718 ifstream filein(in.c_str()); 00719 assert(filein.good()==true); 00720 if (filein.good()==false) 00721 { 00722 cout << "error: " << in << " file can not be opened." << endl; 00723 return 1; 00724 } 00725 00726 messages = 00727 new menusystem(0,0,true,point2<GLint>(60,250),10); 00728 gobjpush(messages); 00729 messages->fontcolor = point4<float>(1.0,0.0,0.0,0.8); 00730 messages->fontcolorenable(); 00731 messages->lightingdisable(); 00732 00733 filein >> bsp; 00734 uint errorh, errorhparent; 00735 //cout << SHOW( << " "; 00736 //cout << SHOW(errorh) << " " << SHOW(errorhparent) << endl; 00737 bool errorres = bsp.validhalfspaces(errorh,errorhparent); 00738 if (errorres==false) 00739 { 00740 string str; 00741 str += "error: errorh="; 00742 { stringstream ss; ss << errorh; str += ss.str(); } 00743 str += " errorhparent="; 00744 { stringstream ss; ss << errorhparent; str += ss.str(); } 00745 00746 messages->addfont12start(str,1); 00747 } 00748 00749 gobjpush(new gobjglDisable(GL_LIGHTING)); 00750 bsptreeD2disp03<pt2,double,uint> * disp 00751 = new bsptreeD2disp03<pt2,double,uint>(bsp,0.04); 00752 disp->update(); 00753 gobjpush(disp); 00754 00755 bsptreeD2dispregions01<pt2,double,uint> *dispregions 00756 = new bsptreeD2dispregions01<pt2,double,uint>(bsp); 00757 dispregions->delta=0.4; 00758 dispregions->update(); 00759 gobjpush(dispregions); 00760 00761 //cout << (stringc)bsp.tree << endl; 00762 00763 gobjQuadric * q2 = new gobjQuadric(); 00764 q2->radius = 0.1; 00765 q2->slices=30; 00766 q2->loops=7; 00767 gobjpush(q2); 00768 00769 gobjpush(new gobjglPushAttrib(GL_CURRENT_BIT)); 00770 gobjpush(new gobjglPushAttrib(GL_LIGHTING)); 00771 gobjpush(new gobjglEnable(GL_LIGHTING)); 00772 targetsphere = new gobjMySphereDraw(target,q2); 00773 gobjpush( new 00774 gobjglColor4f( 153.0/255.0, 50.0/255.0, 204.0/255.0, 0.92)); 00775 gobjpush(targetsphere); 00776 gobjpush( new gobjglPopAttrib() ); 00777 gobjpush( new gobjglPopAttrib() ); 00778 00779 target=pt2(2.5,0.5); 00780 update05(); 00781 00782 //gobjpush(new gobjglDisable(GL_LIGHTING)); 00783 menusystem * menu = 00784 new menusystem(0,0,true,point2<GLint>(60,30),10); 00785 menu->fontcolor = point4<float>(218.0/255.0,165.0/255.0,32.0/255.0,0.75); 00786 00787 gobjSwitch<> * menuswitch = new gobjSwitch<>(menu,true); 00788 help = & menuswitch->isdrawn; 00789 gobjpush(menuswitch); 00790 //gobjpush(new gobjglEnable(GL_LIGHTING)); 00791 00792 menu->addfont12("BSP Tree Demo",2); 00793 00794 menu->addfont10("[page up] move up",1); 00795 menu->addfont10("[page down] move down",1); 00796 menu->addfont10("[< home] move left",1); 00797 menu->addfont10("[end >] move right",2); 00798 // menu->addfont10("j k Move ball left or right.",1); 00799 // menu->addfont10("d f Move ball down or up.",2); 00800 00801 menu->addfont10("t Print the targets position.",1); 00802 menu->addfont10("r Print the targets region.",1); 00803 menu->addfont10("T Print the tree.",1); 00804 menu->addfont10("v Print the visibility",2); 00805 00806 menu->addfont10("+ - Increase or decrease change.",1); 00807 menu->addfont10("h Toggle this help menu.",2); 00808 menu->addfont10("ESC Quit"); 00809 00810 zpr zz; 00811 00812 zz.update(); 00813 glutMainLoop(); 00814 00815 return 0; 00816 }
| static int treeindexedD2test::unittest01 | ( | int | argc, | |
| char ** | argv | |||
| ) | [static] |
Reading a tree from a text file.
| int treeindexedD2test::unittest01 | ( | int | argc, | |
| char ** | argv | |||
| ) | [static] |
Reading a tree from a text file.
Definition at line 96 of file treeindexedD2test.cpp.
References assertreturnOS, tokenizermisc::comparewithoutspace(), commandline::mapvar(), and tokenizermisc::readfile().
Referenced by main().
00097 { 00098 commandline cmd(argc,argv); 00099 00100 string in; 00101 cmd.mapvar(in,"in"); 00102 if ( in.empty() ) 00103 { 00104 cout << "error: in=filename expected" << endl; 00105 return 1; 00106 } 00107 00108 ifstream filein(in.c_str()); 00109 assert(filein.good()==true); 00110 if (filein.good()==false) 00111 { 00112 cout << "error: " << in << " file can not be opened." << endl; 00113 return 1; 00114 } 00115 00116 treeindexedD2<uint> t1; 00117 filein >> t1; 00118 00119 cout << (stringc)t1 << endl; 00120 00121 string s1; 00122 assertreturnOS(tokenizermisc::readfile(s1,in.c_str())); 00123 00124 string s2( (stringc)t1 ); 00125 00126 assertreturnOS(tokenizermisc::comparewithoutspace(s1,s2)); 00127 00128 return 0; 00129 }
| static int treeindexedD2test::unittest02 | ( | ) | [static] |
Build a bsp tree in 2D.
Test 5 points in their 5 regions.
| int treeindexedD2test::unittest02 | ( | ) | [static] |
Build a bsp tree in 2D.
Test 5 points in their 5 regions.
Definition at line 131 of file treeindexedD2test.cpp.
References treeindexedD2< INDX >::addleft(), treeindexedD2< INDX >::addright(), assertreturnOS, bsptreeD2< PT, PD, INDX >::find(), treeindexedD2< INDX >::moveright(), treeindexedD2< INDX >::reset(), bsptreeD2< PT, PD, INDX >::tree, and bsptreeD2< PT, PD, INDX >::vi.
Referenced by main().
00132 { 00133 typedef point2<double> pt2; 00134 bsptreeD2<pt2,double,uint> t1; 00135 00136 cout << "Building a simple 2D partition." << endl; 00137 cout << " Using manual insertion commands : move to the node before" << endl; 00138 cout << " inserting new node, then adding associated half-space to vi." << endl << endl; 00139 00140 t1.vi.push_back( 00141 halfspaceD2<pt2,double>(pt2(0.0,0.0),pt2(0.0,1.0)) ); 00142 00143 t1.tree.reset(); 00144 t1.tree.addleft(); 00145 t1.vi.push_back( 00146 halfspaceD2<pt2,double>(pt2(-1.0,1.0),pt2(0.0,1.0)) ); 00147 00148 t1.tree.reset(); 00149 t1.tree.addright(); 00150 t1.vi.push_back( 00151 halfspaceD2<pt2,double>(pt2(0.0,-0.5),pt2(1.0,-0.5)) ); 00152 00153 t1.tree.reset(); 00154 t1.tree.moveright(); 00155 t1.tree.addleft(); 00156 t1.vi.push_back( 00157 halfspaceD2<pt2,double>(pt2(4.0,0.0),pt2(4.0,1.0)) ); 00158 00159 cout << (stringc)t1.tree << endl << endl; 00160 00161 cout << "Testing if points are in correct regions." << endl; 00162 00163 uint i[5]; 00164 t1.find(i[0],pt2(1.0,1.0)); 00165 assertreturnOS(i[0]==2); 00166 t1.find(i[1],pt2(-2.0,-10.0)); 00167 assertreturnOS(i[1]==3); 00168 t1.find(i[2],pt2(-5.0,-5.0)); 00169 assertreturnOS(i[2]==3); 00170 t1.find(i[3],pt2(1.0,-2.0)); 00171 assertreturnOS(i[3]==4); 00172 t1.find(i[4],pt2(6.0,2.0)); 00173 assertreturnOS(i[4]==5); 00174 00175 return 0; 00176 }
| static int treeindexedD2test::unittest04 | ( | ) | [static] |
Testing move(T const bpath,T const nsteps).
| int treeindexedD2test::unittest04 | ( | ) | [static] |
Testing move(T const bpath,T const nsteps).
Definition at line 390 of file treeindexedD2test.cpp.
References assertreturnOS, and treeindexedD2< INDX >::move().
Referenced by main().
00391 { 00392 treeindexedD2<uint> t1; 00393 string s( 00394 "4 \ 00395 1 2 2 0 0 \ 00396 2 3 4 1 0 \ 00397 3 1 4 2 0 \ 00398 4 3 5 2 1"); 00399 stringstream ss(s); 00400 ss >> t1; 00401 00402 cout << (stringc)t1 << endl << endl; 00403 00404 t1.move(0*1+1*2,2); 00405 assertreturnOS(t1.current->index==4); 00406 t1.move(1*1,1); 00407 assertreturnOS(t1.current->index==2); 00408 t1.move(0*1+1*2+0*4,3); 00409 assertreturnOS(t1.current->index==3); 00410 t1.move(0*1+1*2+1*4,3); 00411 assertreturnOS(t1.current->index==5); 00412 t1.move(0*1+0*2+1*4,3); 00413 assertreturnOS(t1.current->index==4); 00414 t1.move(0*1+0*2+0*4,3); 00415 assertreturnOS(t1.current->index==1); 00416 00417 vector< uint > v; 00418 t1.pathindex(v,0*1+0*2+0*4,3); 00419 assertreturnOS(v[0]==1); 00420 assertreturnOS(v[1]==2); 00421 assertreturnOS(v[2]==3); 00422 t1.pathindex(v,0*1+1*2+1*4,3); 00423 assertreturnOS(v[0]==1); 00424 assertreturnOS(v[1]==2); 00425 assertreturnOS(v[2]==4); 00426 00427 return 0; 00428 }
1.5.8