Added testPolytope entry

This commit is contained in:
Robert Osfield 2007-12-04 14:43:14 +00:00
parent 6cd4cc682c
commit 3d7fbeca28

View File

@ -21,6 +21,7 @@
#include <osg/Vec3> #include <osg/Vec3>
#include <osg/Matrix> #include <osg/Matrix>
#include <osg/Polytope>
#include <osg/Timer> #include <osg/Timer>
#include <osg/io_utils> #include <osg/io_utils>
@ -403,6 +404,22 @@ void testThreadInitAndExit()
std::cout<<"pass thread start and delete test"<<std::endl<<std::endl; std::cout<<"pass thread start and delete test"<<std::endl<<std::endl;
} }
void testPolytope()
{
osg::Polytope pt;
pt.setToBoundingBox(osg::BoundingBox(-1000, -1000, -1000, 1000, 1000, 1000));
bool bContains = pt.contains(osg::Vec3(0, 0, 0));
if (bContains)
{
std::cout<<"Polytope pt.contains(osg::Vec3(0, 0, 0)) has succeeded."<<std::endl;
}
else
{
std::cout<<"Polytope pt.contains(osg::Vec3(0, 0, 0)) has failed."<<std::endl;
}
}
int main( int argc, char** argv ) int main( int argc, char** argv )
{ {
@ -437,6 +454,9 @@ int main( int argc, char** argv )
bool printQuatTest = false; bool printQuatTest = false;
while (arguments.read("quat")) printQuatTest = true; while (arguments.read("quat")) printQuatTest = true;
bool printPolytopeTest = false;
while (arguments.read("polytope")) printPolytopeTest = true;
bool doTestThreadInitAndExit = false; bool doTestThreadInitAndExit = false;
while (arguments.read("thread")) doTestThreadInitAndExit = true; while (arguments.read("thread")) doTestThreadInitAndExit = true;
@ -470,7 +490,6 @@ int main( int argc, char** argv )
testQuat(quat_scale); testQuat(quat_scale);
} }
if (printMatrixTest) if (printMatrixTest)
{ {
std::cout<<"****** Running matrix tests ******"<<std::endl; std::cout<<"****** Running matrix tests ******"<<std::endl;
@ -516,6 +535,11 @@ int main( int argc, char** argv )
runPerformanceTests(); runPerformanceTests();
} }
if (printPolytopeTest)
{
testPolytope();
}
if (printQualifiedTest) if (printQualifiedTest)
{ {