00001 #include "Polyhedron_Interval.h"
00002
00003
00004
00009 template <typename Facet_output_iterator>
00010 inline Polyhedron::Facet*
00011 cutting( Polyhedron& poly,
00012 Polyhedron::Facet& facet,
00013 const Box_3& box,
00014 Facet_output_iterator facets_out )
00015 {
00016 FacetTriple ft = cutting( poly, facet, 0, box.min(0),box.max(0) );
00017
00018 if ( ft.low != 0 ) *facets_out++ = ft.low;
00019 if ( ft.high != 0 ) *facets_out++ = ft.high;
00020 if ( ft.middle == 0 )
00021 return 0;
00022
00023 ft = cutting( poly, *ft.middle, 1, box.min(1),box.max(1) );
00024
00025 if ( ft.low != 0 ) *facets_out++ = ft.low;
00026 if ( ft.high != 0 ) *facets_out++ = ft.high;
00027 if ( ft.middle == 0 )
00028 return 0;
00029
00030 ft = cutting( poly, *ft.middle, 2, box.min(2),box.max(2) );
00031
00032 if ( ft.low != 0 ) *facets_out++ = ft.low;
00033 if ( ft.high != 0 ) *facets_out++ = ft.high;
00034 return ft.middle;
00035 }