Main Page   Modules   Namespace List   Compound List   File List   Namespace Members   Compound Members  

Box_d_Box_d.h

00001 #ifndef CEP_INTERSECTION_BOX_D_BOX_D_H
00002 #define CEP_INTERSECTION_BOX_D_BOX_D_H
00003 
00004 
00005 namespace CEP {    
00006 namespace intersection {
00007 
00008 
00011     namespace Box_d_Box_d {
00012 
00014         template <class Box>
00015         inline 
00016         bool do_intersect( const Box& b1, const Box& b2, int d )
00017         {
00018             return b1.min(d) <= b2.max(d) && b2.min(d) <= b1.max(d);
00019         }
00020     }
00021 
00022 
00024 
00026 template <class Box>
00027 inline 
00028 bool do_intersect( const Box& b1, const Box& b2 )
00029 {
00030     for( int d = 0; d < Box::dimension; ++d )
00031         if ( !Box_d_Box_d::do_intersect(b1,b2,d) )
00032             return false;
00033     return true;
00034 }
00035 
00036 
00037 
00038 }
00039 }
00040 
00041 
00042 #endif

Generated on Sun Jun 8 17:38:22 2003 for CEP::intersection by doxygen1.3-rc3