V-ART
Public Member Functions | Public Attributes | Friends | List of all members
VART::BoundingBox Class Reference

Axis aligned bounding box. More...

#include <boundingbox.h>

Public Member Functions

 BoundingBox ()
 Creates an uninitialized bounding box. More...
 
 BoundingBox (double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
 
 BoundingBox (const BoundingBox &box)
 
BoundingBoxoperator= (const BoundingBox &box)
 
void ProcessCenter ()
 
void ApplyTransform (const Transform &trans)
 Applies transformation to a BoundingBox. More...
 
double GetGreaterX () const
 
double GetGreaterY () const
 
double GetGreaterZ () const
 
double GetGreaterEdge () const
 Returns the length of the greater edge. More...
 
double GetSmallerEdge () const
 Returns the length of the smaller edge. More...
 
double GetEdgeX () const
 Returns the length of the X edge. More...
 
double GetEdgeY () const
 Returns the length of the Y edge. More...
 
double GetEdgeZ () const
 Returns the length of the Z edge. More...
 
void SetGreaterX (double v)
 
void SetGreaterY (double v)
 
void SetGreaterZ (double v)
 
double GetSmallerX () const
 
double GetSmallerY () const
 
double GetSmallerZ () const
 
void SetSmallerX (double v)
 
void SetSmallerY (double v)
 
void SetSmallerZ (double v)
 
void SetBoundingBox (double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
 
const Point4DGetCenter () const
 
void ConditionalUpdate (double x, double y, double z)
 Updates the bounding box if any given coordinate is outside it. More...
 
void ConditionalUpdate (const Point4D &point)
 Updates the bounding box if any given coordinate is outside it. More...
 
void MergeWith (const BoundingBox &box)
 Merges a bounding with another, expanding it. More...
 
bool DrawInstanceOGL () const
 Draws a bounding box. More...
 
void SetVisibility (const bool value)
 Sets the bounding box visibility. More...
 
void ToggleVisibility ()
 Toggles the visibility. More...
 
bool testAABBAABB (BoundingBox &b)
 Test intersection among AABBs. More...
 
bool testPoint (VART::Point4D p)
 Test if a point is included in the bbox. More...
 
void SetColor (const Color &value)
 Sets the bounding box color. More...
 
void CopyGeometryFrom (const BoundingBox &box)
 Copies geometry data from other bounding box. More...
 
void CutBBox (const BoundingBox &box)
 Test against other bounding box and update itself if its outside the given bbox. More...
 

Public Attributes

bool visible
 Indicates wether the bounding box is visible. More...
 

Friends

std::ostream & operator<< (std::ostream &output, const BoundingBox &box)
 Output operator. More...
 

Detailed Description

Axis aligned bounding box.

FixMe: A detailed class description is needed here.

Definition at line 23 of file boundingbox.h.

Constructor & Destructor Documentation

VART::BoundingBox::BoundingBox ( )

Creates an uninitialized bounding box.

Definition at line 10 of file boundingbox.cpp.

References VART::Color::RED().

VART::BoundingBox::BoundingBox ( double  minX,
double  minY,
double  minZ,
double  maxX,
double  maxY,
double  maxZ 
)

Definition at line 15 of file boundingbox.cpp.

References VART::Color::RED().

VART::BoundingBox::BoundingBox ( const BoundingBox box)

Definition at line 28 of file boundingbox.cpp.

References visible.

Member Function Documentation

void VART::BoundingBox::ApplyTransform ( const Transform trans)

Applies transformation to a BoundingBox.

Parameters
trans[in] transformation matrix to be applied in bbox

Definition at line 70 of file boundingbox.cpp.

References GetGreaterX(), GetGreaterY(), GetGreaterZ(), GetSmallerX(), GetSmallerY(), GetSmallerZ(), VART::Point4D::GetX(), VART::Point4D::GetY(), and VART::Point4D::GetZ().

Referenced by VART::Transform::RecursiveBoundingBox().

void VART::BoundingBox::ConditionalUpdate ( double  x,
double  y,
double  z 
)

Updates the bounding box if any given coordinate is outside it.

Definition at line 148 of file boundingbox.cpp.

Referenced by VART::MeshObject::ComputeBoundingBox(), and VART::MeshObject::ComputeSubBBoxes().

void VART::BoundingBox::ConditionalUpdate ( const Point4D point)

Updates the bounding box if any given coordinate is outside it.

Definition at line 166 of file boundingbox.cpp.

References VART::Point4D::GetX(), VART::Point4D::GetY(), and VART::Point4D::GetZ().

void VART::BoundingBox::CopyGeometryFrom ( const BoundingBox box)

Copies geometry data from other bounding box.

Definition at line 53 of file boundingbox.cpp.

Referenced by VART::Transform::RecursiveBoundingBox().

void VART::BoundingBox::CutBBox ( const BoundingBox box)

Test against other bounding box and update itself if its outside the given bbox.

Definition at line 277 of file boundingbox.cpp.

bool VART::BoundingBox::DrawInstanceOGL ( ) const

Draws a bounding box.

Definition at line 204 of file boundingbox.cpp.

const VART::Point4D & VART::BoundingBox::GetCenter ( ) const

Definition at line 144 of file boundingbox.cpp.

double VART::BoundingBox::GetEdgeX ( ) const
inline

Returns the length of the X edge.

Definition at line 50 of file boundingbox.h.

double VART::BoundingBox::GetEdgeY ( ) const
inline

Returns the length of the Y edge.

Definition at line 52 of file boundingbox.h.

double VART::BoundingBox::GetEdgeZ ( ) const
inline

Returns the length of the Z edge.

Definition at line 54 of file boundingbox.h.

double VART::BoundingBox::GetGreaterEdge ( ) const

Returns the length of the greater edge.

Definition at line 175 of file boundingbox.cpp.

double VART::BoundingBox::GetGreaterX ( ) const

Definition at line 85 of file boundingbox.cpp.

Referenced by ApplyTransform().

double VART::BoundingBox::GetGreaterY ( ) const

Definition at line 89 of file boundingbox.cpp.

Referenced by ApplyTransform().

double VART::BoundingBox::GetGreaterZ ( ) const

Definition at line 93 of file boundingbox.cpp.

Referenced by ApplyTransform().

double VART::BoundingBox::GetSmallerEdge ( ) const

Returns the length of the smaller edge.

Definition at line 187 of file boundingbox.cpp.

double VART::BoundingBox::GetSmallerX ( ) const

Definition at line 109 of file boundingbox.cpp.

Referenced by ApplyTransform().

double VART::BoundingBox::GetSmallerY ( ) const

Definition at line 113 of file boundingbox.cpp.

Referenced by ApplyTransform().

double VART::BoundingBox::GetSmallerZ ( ) const

Definition at line 117 of file boundingbox.cpp.

Referenced by ApplyTransform().

void VART::BoundingBox::MergeWith ( const BoundingBox box)

Merges a bounding with another, expanding it.

Definition at line 170 of file boundingbox.cpp.

Referenced by VART::Transform::RecursiveBoundingBox().

VART::BoundingBox & VART::BoundingBox::operator= ( const BoundingBox box)

Definition at line 40 of file boundingbox.cpp.

References visible.

void VART::BoundingBox::ProcessCenter ( )

Definition at line 64 of file boundingbox.cpp.

Referenced by VART::Transform::RecursiveBoundingBox().

void VART::BoundingBox::SetBoundingBox ( double  minX,
double  minY,
double  minZ,
double  maxX,
double  maxY,
double  maxZ 
)
void VART::BoundingBox::SetColor ( const Color value)
inline

Sets the bounding box color.

Definition at line 93 of file boundingbox.h.

Referenced by VART::Scene::Scene(), and VART::GraphicObj::SetBBoxColor().

void VART::BoundingBox::SetGreaterX ( double  v)

Definition at line 97 of file boundingbox.cpp.

void VART::BoundingBox::SetGreaterY ( double  v)

Definition at line 101 of file boundingbox.cpp.

void VART::BoundingBox::SetGreaterZ ( double  v)

Definition at line 105 of file boundingbox.cpp.

void VART::BoundingBox::SetSmallerX ( double  v)

Definition at line 121 of file boundingbox.cpp.

void VART::BoundingBox::SetSmallerY ( double  v)

Definition at line 125 of file boundingbox.cpp.

void VART::BoundingBox::SetSmallerZ ( double  v)

Definition at line 129 of file boundingbox.cpp.

void VART::BoundingBox::SetVisibility ( const bool  value)
inline

Sets the bounding box visibility.

Definition at line 83 of file boundingbox.h.

References visible.

bool VART::BoundingBox::testAABBAABB ( VART::BoundingBox b)

Test intersection among AABBs.

Definition at line 242 of file boundingbox.cpp.

bool VART::BoundingBox::testPoint ( VART::Point4D  p)

Test if a point is included in the bbox.

Definition at line 259 of file boundingbox.cpp.

References VART::Point4D::GetX(), VART::Point4D::GetY(), and VART::Point4D::GetZ().

void VART::BoundingBox::ToggleVisibility ( )

Toggles the visibility.

Definition at line 199 of file boundingbox.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const BoundingBox box 
)
friend

Output operator.

Member Data Documentation

bool VART::BoundingBox::visible

Indicates wether the bounding box is visible.

Definition at line 91 of file boundingbox.h.

Referenced by BoundingBox(), operator=(), VART::GraphicObj::SetBBoxVisibility(), VART::Scene::SetBBoxVisibility(), SetVisibility(), and VART::Scene::ToggleBBoxVisibility().


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