#include #include #include #include //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Logical BoxedSolid::TestClass() { //ofstream testout("gene.dat",ios::app); //GY Tell("Start BoxedSolid::TestClass()..\n"); BoxedSolidTree tree; BoxedSolidList list; Point3D test_point; ExtentBox eb; BoxedSolid* solids[TEST_CLASS]; BoxedSolid *list_ptr; BoxedSolid *tree_ptr; // //------------------------------------------------------------ // Create a bunch of boxes to test, and add them into the tree //------------------------------------------------------------ // int i; for (i=0; iminX + solids[i]->maxX) * 0.5f; test_point.y = (solids[i]->minY + solids[i]->maxY) * 0.5f; test_point.z = (solids[i]->minZ + solids[i]->maxZ) * 0.5f; tree_ptr = tree.FindBoundingBoxContaining(test_point); list_ptr = list.FindBoundingBoxContaining(test_point); Test(tree_ptr == list_ptr); } // //--------------------------------------------------- // Now test a bunch of random points against the tree //--------------------------------------------------- // for (i=0; i