00001 #include <cutting/Polyhedron_Box_3.h>
00002 #include <vector>
00003
00004 typedef Polyhedron::Facet Facet;
00005 typedef Polyhedron::Point Point;
00006
00007
00008
00009
00010 ostream& operator<< ( ostream& os, Facet* fp )
00011 {
00012 if ( fp == 0 )
00013 return os << "NULL";
00014
00015 return os << *fp;
00016 }
00017
00018
00019 int main()
00020 {
00021 CGAL::set_pretty_mode( cout );
00022
00023 Polyhedron poly;
00024 poly.make_triangle( Point(0,0,0),
00025 Point(100,0,0),
00026 Point(0,100,0) );
00027
00028 Facet& facet = *(poly.facets_begin());
00029
00030 cout << "Polyhedron (before): " << endl
00031 << poly << endl;
00032
00033 Box_3 box( 10,20, 10,20, -1,+1 );
00034
00035 std::vector<Facet*> exterior_list;
00036 Facet* interior = cutting( poly, facet, box,
00037 std::back_inserter(exterior_list) );
00038
00039 cout << "Polyhedron (after): " << endl
00040 << poly << endl;
00041
00042 cout << "Interior facet:" << endl
00043 << interior << endl << endl;
00044
00045 cout << exterior_list.size() << " exterior facets." << endl;
00046
00047 return 0;
00048 }
00049
00050
00051
00052 void switchon()
00053 {
00054 CORE::Expr e(3.3);
00055 e.approx();
00056 }