GitHub link
Polygon Mesh Processing Library
BoundingBox Class Reference

Simple class for representing a bounding box. More...

#include <pmp/BoundingBox.h>

Public Member Functions

 BoundingBox ()
 Construct infinite/invalid bounding box. More...
 
 BoundingBox (const Point &min, const Point &max)
 Construct from min and max points. More...
 
BoundingBoxoperator+= (const Point &p)
 Add point to the bounding box. More...
 
BoundingBoxoperator+= (const BoundingBox &bb)
 Add two bounding boxes. More...
 
Pointmin ()
 Get min point. More...
 
Pointmax ()
 Get max point. More...
 
Point center () const
 Get center point. More...
 
bool is_empty () const
 Indicate if the bounding box is empty. More...
 
Scalar size () const
 Get the size of the bounding box. More...
 

Detailed Description

Simple class for representing a bounding box.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

BoundingBox ( )
inline

Construct infinite/invalid bounding box.

◆ BoundingBox() [2/2]

BoundingBox ( const Point min,
const Point max 
)
inline

Construct from min and max points.

Member Function Documentation

◆ center()

Point center ( ) const
inline

Get center point.

◆ is_empty()

bool is_empty ( ) const
inline

Indicate if the bounding box is empty.

◆ max()

Point & max ( )
inline

Get max point.

◆ min()

Point & min ( )
inline

Get min point.

◆ operator+=() [1/2]

BoundingBox & operator+= ( const BoundingBox bb)
inline

Add two bounding boxes.

◆ operator+=() [2/2]

BoundingBox & operator+= ( const Point p)
inline

Add point to the bounding box.

◆ size()

Scalar size ( ) const
inline

Get the size of the bounding box.