aabbcc
Public Member Functions | Public Attributes | List of all members
aabb::AABB Class Reference

The axis-aligned bounding box object. More...

#include <AABB.h>

Public Member Functions

 AABB ()
 Constructor.
 
 AABB (unsigned int)
 Constructor. More...
 
 AABB (const std::vector< double > &, const std::vector< double > &)
 Constructor. More...
 
double computeSurfaceArea () const
 Compute the surface area of the box.
 
double getSurfaceArea () const
 Get the surface area of the box.
 
void merge (const AABB &, const AABB &)
 Merge two AABBs into this one. More...
 
bool contains (const AABB &) const
 Test whether the AABB is contained within this one. More...
 
bool overlaps (const AABB &) const
 Test whether the AABB overlaps this one. More...
 
std::vector< double > computeCentre ()
 Compute the centre of the AABB. More...
 
void setDimension (unsigned int)
 Set the dimensionality of the AABB. More...
 

Public Attributes

std::vector< double > lowerBound
 Lower bound of AABB in each dimension.
 
std::vector< double > upperBound
 Upper bound of AABB in each dimension.
 
std::vector< double > centre
 The position of the AABB centre.
 
double surfaceArea
 The AABB's surface area.
 

Detailed Description

The axis-aligned bounding box object.

Axis-aligned bounding boxes (AABBs) store information for the minimum orthorhombic bounding-box for an object in two- or three-dimensional space (the bounding box is either a rectangle, or rectangular prism).

Class member functions provide functionality for merging AABB objects and testing overlap with other AABBs.

Constructor & Destructor Documentation

§ AABB() [1/2]

aabb::AABB::AABB ( unsigned int  dimension)

Constructor.

Parameters
dimensionThe dimensionality of the system.

§ AABB() [2/2]

aabb::AABB::AABB ( const std::vector< double > &  lowerBound_,
const std::vector< double > &  upperBound_ 
)

Constructor.

Parameters
lowerBound_The lower bound in each dimension.
upperBound_The upper bound in each dimension.

Member Function Documentation

§ computeCentre()

std::vector< double > aabb::AABB::computeCentre ( )

Compute the centre of the AABB.

Returns
The position vector of the AABB centre.

§ contains()

bool aabb::AABB::contains ( const AABB aabb) const

Test whether the AABB is contained within this one.

Parameters
aabbA reference to the AABB.
Returns
Whether the AABB is fully contained.

§ merge()

void aabb::AABB::merge ( const AABB aabb1,
const AABB aabb2 
)

Merge two AABBs into this one.

Parameters
aabb1A reference to the first AABB.
aabb2A reference to the second AABB.

§ overlaps()

bool aabb::AABB::overlaps ( const AABB aabb) const

Test whether the AABB overlaps this one.

Parameters
aabbA reference to the AABB.
Returns
Whether the AABB overlaps.

§ setDimension()

void aabb::AABB::setDimension ( unsigned int  dimension)

Set the dimensionality of the AABB.

Parameters
dimensionThe dimensionality of the system.

The documentation for this class was generated from the following files: