Volume Cartographer 2.27.0
Public Types | Public Member Functions | Private Attributes | List of all members
volcart::BoundingBox< T, Dim, typename > Class Template Reference

Generic axis-aligned bounding box class for operations in N-dimensions. More...

#include <vc/core/types/BoundingBox.hpp>

Inheritance diagram for volcart::BoundingBox< T, Dim, typename >:
[legend]

Public Types

using Point = cv::Vec< T, Dim >
 

Public Member Functions

 BoundingBox ()=default
 Default constructor.
 
 BoundingBox (Point lower, Point upper)
 Constructor with lower and upper bounds initialization. More...
 
Point getLowerBound () const
 Get the lower boundary for each axis. More...
 
Point getUpperBound () const
 Get the upper boundary for each axis. More...
 
getLowerBoundByIndex (int i)
 Get the lower boundary for a specific axis by axis index. More...
 
getUpperBoundByIndex (int i)
 Get the upper boundary for a specific axis by axis index. More...
 
void setLowerBound (Point p)
 Set the lower boundary for each axis. More...
 
void setUpperBound (Point p)
 Set the upper boundary for each axis. More...
 
void setLowerBoundByIndex (int i, T val)
 Set the lower boundary for a specific axis by axis index. More...
 
void setUpperBoundByIndex (int i, T val)
 Set the upper boundary for a specific axis by axis index. More...
 
bool isInBounds (const Point &p) const
 Check if a Point is within the bounds of the box. More...
 

Private Attributes

Point p0_ {0, 0, 0}
 
Point p1_ {0, 0, 0}
 

Detailed Description

template<typename T, int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
class volcart::BoundingBox< T, Dim, typename >

Generic axis-aligned bounding box class for operations in N-dimensions.

Author
Seth Parker

Provides functions for inside/outside box checks. Lower boundary is inclusive and upper boundary is exclusive: [lower, upper)

Template Parameters
TFundamental type of coordinate system
DimNumber of dimensions

Definition at line 27 of file BoundingBox.hpp.

Member Typedef Documentation

◆ Point

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
using volcart::BoundingBox< T, Dim, typename >::Point = cv::Vec<T, Dim>

Bounding box position type

Definition at line 31 of file BoundingBox.hpp.

Constructor & Destructor Documentation

◆ BoundingBox()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
volcart::BoundingBox< T, Dim, typename >::BoundingBox ( Point  lower,
Point  upper 
)
inline

Constructor with lower and upper bounds initialization.

Definition at line 37 of file BoundingBox.hpp.

Member Function Documentation

◆ getLowerBound()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Point volcart::BoundingBox< T, Dim, typename >::getLowerBound ( ) const
inline

Get the lower boundary for each axis.

Definition at line 40 of file BoundingBox.hpp.

◆ getLowerBoundByIndex()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
T volcart::BoundingBox< T, Dim, typename >::getLowerBoundByIndex ( int  i)
inline

Get the lower boundary for a specific axis by axis index.

Definition at line 46 of file BoundingBox.hpp.

◆ getUpperBound()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Point volcart::BoundingBox< T, Dim, typename >::getUpperBound ( ) const
inline

Get the upper boundary for each axis.

Definition at line 43 of file BoundingBox.hpp.

◆ getUpperBoundByIndex()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
T volcart::BoundingBox< T, Dim, typename >::getUpperBoundByIndex ( int  i)
inline

Get the upper boundary for a specific axis by axis index.

Definition at line 55 of file BoundingBox.hpp.

◆ isInBounds()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
bool volcart::BoundingBox< T, Dim, typename >::isInBounds ( const Point p) const
inline

Check if a Point is within the bounds of the box.

Definition at line 88 of file BoundingBox.hpp.

◆ setLowerBound()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
void volcart::BoundingBox< T, Dim, typename >::setLowerBound ( Point  p)
inline

Set the lower boundary for each axis.

Definition at line 64 of file BoundingBox.hpp.

◆ setLowerBoundByIndex()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
void volcart::BoundingBox< T, Dim, typename >::setLowerBoundByIndex ( int  i,
val 
)
inline

Set the lower boundary for a specific axis by axis index.

Definition at line 70 of file BoundingBox.hpp.

◆ setUpperBound()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
void volcart::BoundingBox< T, Dim, typename >::setUpperBound ( Point  p)
inline

Set the upper boundary for each axis.

Definition at line 67 of file BoundingBox.hpp.

◆ setUpperBoundByIndex()

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
void volcart::BoundingBox< T, Dim, typename >::setUpperBoundByIndex ( int  i,
val 
)
inline

Set the upper boundary for a specific axis by axis index.

Definition at line 79 of file BoundingBox.hpp.

Member Data Documentation

◆ p0_

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Point volcart::BoundingBox< T, Dim, typename >::p0_ {0, 0, 0}
private

Lower bound

Definition at line 100 of file BoundingBox.hpp.

◆ p1_

template<typename T , int Dim, typename = typename std::enable_if<std::is_arithmetic<T>::value, T>::type>
Point volcart::BoundingBox< T, Dim, typename >::p1_ {0, 0, 0}
private

Upper bound

Definition at line 102 of file BoundingBox.hpp.


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