File tree Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Expand file tree Collapse file tree 4 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 3535        .def( pybind11::init<>() )                                             \
3636        .def( " add_box"  , &BoundingBox##dimension##D::add_box )                 \
3737        .def( " add_point"  , &BoundingBox##dimension##D::add_point )             \
38-         .def( " contains"  , &BoundingBox##dimension##D::contains )               \
38+         .def( " contains_point"  ,                                                \
39+             static_cast < bool  ( BoundingBox##dimension##D::* )(                \
40+                 const  Point< dimension >& ) const  >(                           \
41+                 &BoundingBox##dimension##D::contains ) )                       \
42+         .def( " contains_bbox"  ,                                                 \
43+             static_cast < bool  ( BoundingBox##dimension##D::* )(                \
44+                 const  BoundingBox< dimension >& ) const  >(                     \
45+                 &BoundingBox##dimension##D::contains ) )                       \
3946        .def( " intersects_bbox"  ,                                               \
4047            static_cast < bool  ( BoundingBox##dimension##D::* )(                \
4148                const  BoundingBox< dimension >& ) const  >(                     \
Original file line number Diff line number Diff line change 4343    if  box2 .max () !=  geom .Point2D ([1 , 1 ]):
4444        raise  ValueError ("[Test] Error in BoundingBox union computation" )
4545
46-     if  not  box2 .contains (geom .Point2D ([0 , 0 ])):
46+     if  not  box2 .contains_point (geom .Point2D ([0 , 0 ])):
4747        raise  ValueError ("[Test] BBox should contain this point" )
48-     if  box2 .contains (geom .Point2D ([10 , 0 ])):
48+     if  box2 .contains_point (geom .Point2D ([10 , 0 ])):
4949        raise  ValueError ("[Test] BBox should not contain this point" )
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ namespace geode
6161
6262        bool  contains ( const  Point< dimension >& point ) const ;
6363
64+         bool  contains ( const  BoundingBox< dimension >& bbox ) const ;
65+ 
6466        [[nodiscard]] bool  intersects (
6567            const  BoundingBox< dimension >& bbox ) const ;
6668
Original file line number Diff line number Diff line change @@ -209,6 +209,13 @@ namespace geode
209209        return  true ;
210210    }
211211
212+     template  < index_t  dimension >
213+     bool  BoundingBox< dimension >::contains(
214+         const  BoundingBox< dimension >& bbox ) const 
215+     {
216+         return  contains ( bbox.min_  ) && contains ( bbox.max_  );
217+     }
218+ 
212219    template  < index_t  dimension >
213220    bool  BoundingBox< dimension >::intersects(
214221        const  BoundingBox< dimension >& box ) const 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments