ALBA
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
albaOBB Class Reference

#include <albaOBB.h>

Inheritance diagram for albaOBB:
Inheritance graph
[legend]
Collaboration diagram for albaOBB:
Collaboration graph
[legend]

Public Member Functions

 albaOBB ()
 
 albaOBB (double source[6])
 
 ~albaOBB ()
 
bool Equals (float bounds[6]) const
 
bool Equals (double bounds[6]) const
 
bool Equals (albaOBB &bounds) const
 
bool Equals (albaOBB *bounds)
 
bool IsValid () const
 
void Reset ()
 
void DeepCopy (double bounds[6])
 
void DeepCopy (float bounds[6])
 
void DeepCopy (albaOBB *)
 
void DeepCopy (albaOBB &source)
 
void CopyTo (double target[6]) const
 
void CopyTo (float target[6]) const
 
void ApplyTransform ()
 
void ApplyTransform (albaOBB &newbounds)
 
void ApplyTransform (const albaMatrix &mat)
 
void MergeBounds (albaOBB &bounds)
 
bool IsInside (double point[3]) const
 
bool IsInside (float point[3]) const
 
bool IsInside (double x, double y, double z) const
 
void GetDimensions (float dims[3]) const
 
void GetDimensions (double dims[3]) const
 
void GetCenter (float center[3]) const
 
void GetCenter (double center[3]) const
 
void SetCenter (double center[3])
 
void SetCenter (float center[3])
 
void SetDimensions (double dims[3])
 
void SetDimensions (float dims[3])
 
double GetWidth () const
 
double GetHeight () const
 
double GetDepth () const
 
void SetOrientation (double rx, double ry, double rz)
 
void GetOrientation (double rxyz[3])
 
virtual void Print (std::ostream &os, const int tabs=0) const
 
- Public Member Functions inherited from albaTimeStamped
virtual void Modified ()
 
virtual unsigned long GetMTime ()
 

Static Public Member Functions

static albaOBBNew ()
 
static void ApplyTransform (const albaMatrix &mat, albaOBB &newbounds)
 
static void MergeBounds (double b1[6], double b2[6])
 

Public Attributes

albaMatrix m_Matrix
 
double m_Bounds [6]
 

Additional Inherited Members

- Protected Attributes inherited from albaTimeStamped
albaMTime m_MTime
 

Detailed Description

This class simply stores a Box boundary (i.e.

an array of 6 doubles). This class stores a Box Boundary (i.e. array of 6 double), plus a Modified timestamp of the boundary to be used when re-computing.

Todo:
  • a Test program

Definition at line 36 of file albaOBB.h.

Constructor & Destructor Documentation

◆ albaOBB() [1/2]

albaOBB::albaOBB ( )

◆ albaOBB() [2/2]

albaOBB::albaOBB ( double  source[6])

◆ ~albaOBB()

albaOBB::~albaOBB ( )

Member Function Documentation

◆ New()

static albaOBB * albaOBB::New ( )
inlinestatic

Definition at line 43 of file albaOBB.h.

◆ Equals() [1/4]

bool albaOBB::Equals ( float  bounds[6]) const

Return 1 if the two bounds are equivalent.

Use the float overload to compare with VTK bounds, since VTK manages bounds as floats!

◆ Equals() [2/4]

bool albaOBB::Equals ( double  bounds[6]) const

◆ Equals() [3/4]

bool albaOBB::Equals ( albaOBB bounds) const

◆ Equals() [4/4]

bool albaOBB::Equals ( albaOBB bounds)
inline

Definition at line 51 of file albaOBB.h.

References Equals().

Referenced by Equals().

Here is the call graph for this function:

◆ IsValid()

bool albaOBB::IsValid ( ) const
inline

Return true if the BBox is valid.

Definition at line 56 of file albaOBB.h.

◆ Reset()

void albaOBB::Reset ( )

Reset this object bounds to an invalid value [0,-1,0,-1,0,-1].

◆ DeepCopy() [1/4]

void albaOBB::DeepCopy ( double  bounds[6])

Copy another bounds from another object.

◆ DeepCopy() [2/4]

void albaOBB::DeepCopy ( float  bounds[6])

◆ DeepCopy() [3/4]

void albaOBB::DeepCopy ( albaOBB )

◆ DeepCopy() [4/4]

void albaOBB::DeepCopy ( albaOBB source)
inline

Definition at line 70 of file albaOBB.h.

References DeepCopy().

Referenced by DeepCopy().

Here is the call graph for this function:

◆ CopyTo() [1/2]

void albaOBB::CopyTo ( double  target[6]) const

◆ CopyTo() [2/2]

void albaOBB::CopyTo ( float  target[6]) const

◆ ApplyTransform() [1/4]

void albaOBB::ApplyTransform ( )
inline

Apply the internally stored transform to the bounding box, recompute the internally stored bounding box.

Definition at line 77 of file albaOBB.h.

References ApplyTransform().

Referenced by ApplyTransform().

Here is the call graph for this function:

◆ ApplyTransform() [2/4]

void albaOBB::ApplyTransform ( albaOBB newbounds)
inline

Apply the internally stored transform to the bounding box, recompute the bounding box and stores new BBOx in the given object.

This version doesn't change the internal representation but simply return the result in 'newbounds'

Definition at line 83 of file albaOBB.h.

References ApplyTransform().

Referenced by ApplyTransform().

Here is the call graph for this function:

◆ ApplyTransform() [3/4]

static void albaOBB::ApplyTransform ( const albaMatrix mat,
albaOBB newbounds 
)
static

Apply the given transform to the internal bounds (do not concatenate to the internal Matrix).

◆ ApplyTransform() [4/4]

void albaOBB::ApplyTransform ( const albaMatrix mat)
inline

Definition at line 89 of file albaOBB.h.

References ApplyTransform().

Referenced by ApplyTransform().

Here is the call graph for this function:

◆ MergeBounds() [1/2]

void albaOBB::MergeBounds ( albaOBB bounds)

Merge this objects's bounds with the given one.

If one of the two bounds is invalid the other one is chosen.

◆ IsInside() [1/3]

bool albaOBB::IsInside ( double  point[3]) const
inline

Return true if the point is inside the bounds.

Definition at line 154 of file albaOBB.h.

◆ IsInside() [2/3]

bool albaOBB::IsInside ( float  point[3]) const
inline

Definition at line 161 of file albaOBB.h.

◆ IsInside() [3/3]

bool albaOBB::IsInside ( double  x,
double  y,
double  z 
) const
inline

Definition at line 168 of file albaOBB.h.

◆ MergeBounds() [2/2]

static void albaOBB::MergeBounds ( double  b1[6],
double  b2[6] 
)
static

This is a static function to merge two different space bounds.

The two bounds are merged and the result is placed in the first argument.

◆ GetDimensions() [1/2]

void albaOBB::GetDimensions ( float  dims[3]) const

return dimensions of this box

◆ GetDimensions() [2/2]

void albaOBB::GetDimensions ( double  dims[3]) const

return dimensions of this box

◆ GetCenter() [1/2]

void albaOBB::GetCenter ( float  center[3]) const

return center of the box

◆ GetCenter() [2/2]

void albaOBB::GetCenter ( double  center[3]) const

return center of the box

◆ SetCenter() [1/2]

void albaOBB::SetCenter ( double  center[3])

translate the box to the new center

◆ SetCenter() [2/2]

void albaOBB::SetCenter ( float  center[3])

translate the box to the new center

◆ SetDimensions() [1/2]

void albaOBB::SetDimensions ( double  dims[3])

set dimensions of the box preserving its center

◆ SetDimensions() [2/2]

void albaOBB::SetDimensions ( float  dims[3])

set dimensions of the box preserving its center

◆ GetWidth()

double albaOBB::GetWidth ( ) const

return the X dimension

◆ GetHeight()

double albaOBB::GetHeight ( ) const

return the Y dimension

◆ GetDepth()

double albaOBB::GetDepth ( ) const

return the Z dimension

◆ SetOrientation()

void albaOBB::SetOrientation ( double  rx,
double  ry,
double  rz 
)

set orientation of the internal matrix

◆ GetOrientation()

void albaOBB::GetOrientation ( double  rxyz[3])

extract orientation from internal matrix

◆ Print()

virtual void albaOBB::Print ( std::ostream &  os,
const int  tabs = 0 
) const
virtual

dump the bounding box

Member Data Documentation

◆ m_Matrix

albaMatrix albaOBB::m_Matrix

the pose matrix of the OBB

Definition at line 149 of file albaOBB.h.

◆ m_Bounds

double albaOBB::m_Bounds[6]

the bounding box

Definition at line 150 of file albaOBB.h.


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