Public Member Functions | Private Attributes

lssr::BoundingBox< VertexT > Class Template Reference

A dynamic bounding box class. More...

#include <BoundingBox.hpp>

List of all members.

Public Member Functions

 BoundingBox ()
 Default constructor.
 BoundingBox (VertexT v1, VertexT v2)
 Constructs a bounding box with from the given vertices.
 BoundingBox (float x_min, float y_min, float z_min, float x_max, float y_max, float z_max)
 Constructs a bounding box from the given coordinates.
virtual ~BoundingBox ()
void expand (VertexT v)
 Expands the bounding box if the given point v} is outside the current volume.
void expand (float x, float y, float z)
 Expands the bounding box if the given point is outside the current volume.
void expand (BoundingBox< VertexT > &bb)
 Calculates the surrounding bounding box of the current volume and the other given bounding box.
float getRadius ()
 Returns the radius of the current volume, i.e. the distance between the centroid and the most distance corner from this point.
bool isValid ()
 Returns true if the bounding box has been expanded before or was initialized with a preset size.
VertexT getCentroid ()
 Returns the center point of the bounding box.
float getLongestSide ()
 Returns the longest side of the bounding box.
float getXSize ()
 Returns the x-size of the bounding box.
float getYSize ()
 Returns the y-size of the bounding box.
float getZSize ()
 Returns the z-size of the bounding box.
VertexT getMax () const
 Returns the upper right coordinates.
VertexT getMin () const
 Returns the lower left coordinates.

Private Attributes

VertexT m_min
 The lower right point of the bounding box.
VertexT m_max
 The upper right point of the bounding box.
VertexT m_centroid
 The center point of the bounding box.
float m_xSize
 The 'width' of the bounding box.
float m_ySize
 The 'height' of the bounding box.
float m_zSize
 The 'depth' of the bounding box.

Detailed Description

template<typename VertexT>
class lssr::BoundingBox< VertexT >

A dynamic bounding box class.

Definition at line 24 of file BoundingBox.hpp.


Constructor & Destructor Documentation

template<typename VertexT>
lssr::BoundingBox< VertexT >::BoundingBox (  ) 

Default constructor.

template<typename VertexT>
lssr::BoundingBox< VertexT >::BoundingBox ( VertexT  v1,
VertexT  v2 
)

Constructs a bounding box with from the given vertices.

Parameters:
v1 Lower left corner of the BoundingBox
v2 Upper right corner of the BoundingBox
Returns:
template<typename VertexT>
lssr::BoundingBox< VertexT >::BoundingBox ( float  x_min,
float  y_min,
float  z_min,
float  x_max,
float  y_max,
float  z_max 
)

Constructs a bounding box from the given coordinates.

Parameters:
x_min x value of the lower left corner
y_min y value of the lower left corner
z_min z value of the lower left corner
x_max x value of the upper right corner
y_max y value of the upper right corner
z_max z value of the upper right corner
Returns:
template<typename VertexT>
virtual lssr::BoundingBox< VertexT >::~BoundingBox (  )  [inline, virtual]

Definition at line 49 of file BoundingBox.hpp.


Member Function Documentation

template<typename VertexT>
void lssr::BoundingBox< VertexT >::expand ( VertexT  v  )  [inline]

Expands the bounding box if the given point v} is outside the current volume.

Parameters:
v A 3d point
template<typename VertexT>
void lssr::BoundingBox< VertexT >::expand ( float  x,
float  y,
float  z 
) [inline]

Expands the bounding box if the given point is outside the current volume.

Parameters:
x The x coordinate of the check point
y The y coordinate of the check point
z The z coordinate of the check point
template<typename VertexT>
void lssr::BoundingBox< VertexT >::expand ( BoundingBox< VertexT > &  bb  )  [inline]

Calculates the surrounding bounding box of the current volume and the other given bounding box.

Parameters:
bb Another bounding box
template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::getCentroid (  )  [inline]

Returns the center point of the bounding box.

Definition at line 93 of file BoundingBox.hpp.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::getLongestSide (  ) 

Returns the longest side of the bounding box.

template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::getMax (  )  const

Returns the upper right coordinates.

template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::getMin (  )  const

Returns the lower left coordinates.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::getRadius (  ) 

Returns the radius of the current volume, i.e. the distance between the centroid and the most distance corner from this point.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::getXSize (  ) 

Returns the x-size of the bounding box.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::getYSize (  ) 

Returns the y-size of the bounding box.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::getZSize (  ) 

Returns the z-size of the bounding box.

template<typename VertexT>
bool lssr::BoundingBox< VertexT >::isValid (  ) 

Returns true if the bounding box has been expanded before or was initialized with a preset size.


Member Data Documentation

template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::m_centroid [private]

The center point of the bounding box.

Definition at line 135 of file BoundingBox.hpp.

template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::m_max [private]

The upper right point of the bounding box.

Definition at line 132 of file BoundingBox.hpp.

template<typename VertexT>
VertexT lssr::BoundingBox< VertexT >::m_min [private]

The lower right point of the bounding box.

Definition at line 129 of file BoundingBox.hpp.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::m_xSize [private]

The 'width' of the bounding box.

Definition at line 138 of file BoundingBox.hpp.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::m_ySize [private]

The 'height' of the bounding box.

Definition at line 141 of file BoundingBox.hpp.

template<typename VertexT>
float lssr::BoundingBox< VertexT >::m_zSize [private]

The 'depth' of the bounding box.

Definition at line 144 of file BoundingBox.hpp.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Defines