Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

poly_intersect.cc

00001 #include "poly_intersect.h"
00002 #include "tester.h"
00003 
00004 
00005 class poly_intersect_test : public CppUnit::TestCase
00006 {
00007     //typedef CGAL::Point_3<Exact_rep>   Point;
00008     typedef Polyhedron::Point          Point;
00009     typedef CGAL::Plane_3<Exact_rep>   Plane;
00010     typedef Polyhedron::Facet          Facet;
00011 
00012 
00013     // points for polyhedron definition
00014     Point a,b,c,d;
00015 
00016     Polyhedron poly;
00017 
00018     // Slicing planes
00019     Plane planeX, planeY, planeZ;
00020     Plane p_list[3];
00021 
00022 
00023 public:
00024     void setUp() 
00025     {
00026         a = Point(2,2,2);
00027         b = Point(4,3,5);
00028         c = Point(39,23,42);
00029 
00030         planeX = Plane(1,0,0,0);   // plane X = 0
00031         planeY = Plane(0,1,0,0);   // plane Y = 0
00032         planeZ = Plane(0,0,1,0);   // plane Z = 0
00033 
00034         p_list[0] = planeX;
00035         p_list[1] = planeY;
00036         p_list[2] = planeZ;
00037     }
00038 
00039     void tearDown()
00040     {
00041         poly.erase_all();
00042     }
00043 
00044 
00045 
00046     void intersect_single_single()
00047     {
00048         poly.make_triangle(a,b,c);
00049         Facet f = *(poly.facets_begin());
00050 
00051         CPPUNIT_ASSERT( do_intersect_positive(f,planeX) );
00052         CPPUNIT_ASSERT( do_intersect_positive(f,planeY) );
00053         CPPUNIT_ASSERT( do_intersect_positive(f,planeZ) );
00054     }
00055 
00056 
00057     void intersect_single_multiple()
00058     {
00059         poly.make_triangle(a,b,c);
00060         Facet f = *(poly.facets_begin());
00061 
00062         CPPUNIT_ASSERT( do_intersect_positive(f,&p_list[0],&p_list[3]) );
00063     }
00064 
00065 
00066 
00067     CPPUNIT_TEST_SUITE( poly_intersect_test );
00068     CPPUNIT_TEST( intersect_single_single );
00069     CPPUNIT_TEST( intersect_single_multiple );
00070     CPPUNIT_TEST_SUITE_END();
00071 };
00072 
00073 
00074 CPPUNIT_TEST_SUITE_REGISTRATION( poly_intersect_test );
00075 
00076 

Generated on Fri Oct 26 23:38:11 2001 for bicobj-intersection by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001