00001 #ifndef CEP_INTERSECTION_ISO_CUBOID_3_ISO_CUBOID_3_H
00002 #define CEP_INTERSECTION_ISO_CUBOID_3_ISO_CUBOID_3_H
00003
00004 #include <CGAL/Iso_cuboid_3.h>
00005
00006 namespace CEP {
00007 namespace intersection {
00008
00009
00011 namespace Iso_cuboid_3_Iso_cuboid_3 {
00012
00014 template <class R>
00015 inline
00016 bool do_intersect( const CGAL::Iso_cuboid_3<R>& c1,
00017 const CGAL::Iso_cuboid_3<R>& c2, int d )
00018 {
00019 switch(d) {
00020 case 0: return c1.xmin() <= c2.xmax()
00021 && c2.xmin() <= c1.xmax();
00022 case 1: return c1.ymin() <= c2.ymax()
00023 && c2.ymin() <= c1.ymax();
00024 case 2: return c1.zmin() <= c2.zmax()
00025 && c2.zmin() <= c1.zmax();
00026 }
00027 CGAL_assertion_msg(0,"should not reach here");
00028 return false;
00029 }
00030 }
00031
00032
00034
00036 template<class R>
00037 inline bool do_intersect( const CGAL::Iso_cuboid_3<R> & c1,
00038 const CGAL::Iso_cuboid_3<R> & c2 )
00039 {
00040 return Iso_cuboid_3_Iso_cuboid_3::do_intersect( c1, c2, 0 )
00041 && Iso_cuboid_3_Iso_cuboid_3::do_intersect( c1, c2, 1 )
00042 && Iso_cuboid_3_Iso_cuboid_3::do_intersect( c1, c2, 2 );
00043 }
00044
00045
00046 }
00047 }
00048
00049 #endif
00050