TC::Math::Box< COORD_TYPE > Class Template Reference

Class defining a box with two coordinates The minimum and maximum pos in all components and the. More...

#include <TCMathBox.h>

Collaboration diagram for TC::Math::Box< COORD_TYPE >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Box ()
 Construct an empty box.
 Box (const Box &box)
 Copy an existing box.
 Box (const COORD_TYPE &min, const COORD_TYPE &max)
 Construct a box out of minimum and maximum coordinate.
Boxoperator= (const Box &box)
 assign one box tho this box
const COORD_TYPE & GetMin () const
 Get min coordinate of the box.
const COORD_TYPE & GetMax () const
 Get max coordinate of the box.
void SetMin (const COORD_TYPE &top)
 Set min coordinate of the box.
void SetMax (const COORD_TYPE &bottom)
 Set max coordinate of the box.
COORD_TYPE & operator[] (uint32 i)
 Get by index 0 = min 1 = max.
const COORD_TYPE & operator[] (uint32 i) const
 Get by index 0 = min 1 = max.
bool operator== (const Box &box) const
 compare two boxes
bool operator!= (const Box &box) const
 compare two boxes
DataType GetWidth () const
 Width of box.
DataType GetHeight () const
 Height of box.
DataType GetDepth () const
 Depth of box.
DataType GetLongest () const
 Longest side.
DataType GetShortest () const
 shortest side
double GetDiameter () const
double GetRadius () const
COORD_TYPE GetDiagonal () const
 Compute diagonal.
COORD_TYPE GetCenter () const
 Get center of box.
bool IsEmpty () const
 Test if empty.
bool Contains (const COORD_TYPE &p) const
 Check if the specified point is inside the box area.
bool Contains (const Box &r) const
 Check if this box contains the specified box.

Static Public Member Functions

static Box Unite (const Box &box1, const Box &box2)
 Get the combined box out of two boxes.
static Box BoundingBox (const std::vector< COORD_TYPE > &coords)
 Create bounding box out of an vector of coordinates.

Private Types

typedef COORD_TYPE CoordType
typedef COORD_TYPE::DataType DataType

Private Attributes

COORD_TYPE m_min
COORD_TYPE m_max


Detailed Description

template<class COORD_TYPE>
class TC::Math::Box< COORD_TYPE >

Class defining a box with two coordinates The minimum and maximum pos in all components and the.

Definition at line 54 of file TCMathBox.h.


Member Typedef Documentation

template<class COORD_TYPE >
typedef COORD_TYPE TC::Math::Box< COORD_TYPE >::CoordType [private]

Definition at line 57 of file TCMathBox.h.

template<class COORD_TYPE >
typedef COORD_TYPE::DataType TC::Math::Box< COORD_TYPE >::DataType [private]

Definition at line 58 of file TCMathBox.h.


Constructor & Destructor Documentation

template<class COORD_TYPE >
TC::Math::Box< COORD_TYPE >::Box (  )  [inline]

Construct an empty box.

Definition at line 62 of file TCMathBox.h.

Referenced by TC::Math::Box< COORD_TYPE >::BoundingBox(), and TC::Math::Box< COORD_TYPE >::Unite().

Here is the caller graph for this function:

template<class COORD_TYPE >
TC::Math::Box< COORD_TYPE >::Box ( const Box< COORD_TYPE > &  box  )  [inline]

Copy an existing box.

Definition at line 67 of file TCMathBox.h.

template<class COORD_TYPE >
TC::Math::Box< COORD_TYPE >::Box ( const COORD_TYPE &  min,
const COORD_TYPE &  max 
) [inline]

Construct a box out of minimum and maximum coordinate.

Parameters:
min Min coordinate
max Max coordinate

Definition at line 79 of file TCMathBox.h.


Member Function Documentation

template<class COORD_TYPE >
Box& TC::Math::Box< COORD_TYPE >::operator= ( const Box< COORD_TYPE > &  box  )  [inline]

assign one box tho this box

Definition at line 86 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
const COORD_TYPE& TC::Math::Box< COORD_TYPE >::GetMin (  )  const [inline]

Get min coordinate of the box.

Definition at line 94 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_min.

Referenced by TC::Math::Box< COORD_TYPE >::Unite().

Here is the caller graph for this function:

template<class COORD_TYPE >
const COORD_TYPE& TC::Math::Box< COORD_TYPE >::GetMax (  )  const [inline]

Get max coordinate of the box.

Definition at line 96 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max.

Referenced by TC::Math::Box< COORD_TYPE >::Unite().

Here is the caller graph for this function:

template<class COORD_TYPE >
void TC::Math::Box< COORD_TYPE >::SetMin ( const COORD_TYPE &  top  )  [inline]

Set min coordinate of the box.

Definition at line 99 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
void TC::Math::Box< COORD_TYPE >::SetMax ( const COORD_TYPE &  bottom  )  [inline]

Set max coordinate of the box.

Definition at line 101 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max.

template<class COORD_TYPE >
COORD_TYPE& TC::Math::Box< COORD_TYPE >::operator[] ( uint32  i  )  [inline]

Get by index 0 = min 1 = max.

Definition at line 104 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
const COORD_TYPE& TC::Math::Box< COORD_TYPE >::operator[] ( uint32  i  )  const [inline]

Get by index 0 = min 1 = max.

Definition at line 106 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
bool TC::Math::Box< COORD_TYPE >::operator== ( const Box< COORD_TYPE > &  box  )  const [inline]

compare two boxes

Definition at line 109 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
bool TC::Math::Box< COORD_TYPE >::operator!= ( const Box< COORD_TYPE > &  box  )  const [inline]

compare two boxes

Definition at line 111 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
DataType TC::Math::Box< COORD_TYPE >::GetWidth (  )  const [inline]

Width of box.

Definition at line 115 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
DataType TC::Math::Box< COORD_TYPE >::GetHeight (  )  const [inline]

Height of box.

Definition at line 117 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
DataType TC::Math::Box< COORD_TYPE >::GetDepth (  )  const [inline]

Depth of box.

Definition at line 119 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
DataType TC::Math::Box< COORD_TYPE >::GetLongest (  )  const [inline]

Longest side.

Definition at line 122 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::GetDiagonal(), and TC::Math::Max().

Here is the call graph for this function:

template<class COORD_TYPE >
DataType TC::Math::Box< COORD_TYPE >::GetShortest (  )  const [inline]

shortest side

Definition at line 129 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::GetDiagonal(), and TC::Math::Min().

Here is the call graph for this function:

template<class COORD_TYPE >
double TC::Math::Box< COORD_TYPE >::GetDiameter (  )  const [inline]

Definition at line 135 of file TCMathBox.h.

References TC::Math::Distance(), TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

Referenced by TC::Math::Box< COORD_TYPE >::GetRadius().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class COORD_TYPE >
double TC::Math::Box< COORD_TYPE >::GetRadius (  )  const [inline]

Definition at line 139 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::GetDiameter().

Here is the call graph for this function:

template<class COORD_TYPE >
COORD_TYPE TC::Math::Box< COORD_TYPE >::GetDiagonal (  )  const [inline]

Compute diagonal.

Definition at line 145 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

Referenced by TC::Math::Box< COORD_TYPE >::GetLongest(), and TC::Math::Box< COORD_TYPE >::GetShortest().

Here is the caller graph for this function:

template<class COORD_TYPE >
COORD_TYPE TC::Math::Box< COORD_TYPE >::GetCenter (  )  const [inline]

Get center of box.

Definition at line 148 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

template<class COORD_TYPE >
bool TC::Math::Box< COORD_TYPE >::IsEmpty (  )  const [inline]

Test if empty.

Definition at line 151 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

Referenced by TC::Math::Box< COORD_TYPE >::Unite().

Here is the caller graph for this function:

template<class COORD_TYPE >
bool TC::Math::Box< COORD_TYPE >::Contains ( const COORD_TYPE &  p  )  const [inline]

Check if the specified point is inside the box area.

Definition at line 159 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

Referenced by TC::Math::Box< COORD_TYPE >::Contains().

Here is the caller graph for this function:

template<class COORD_TYPE >
bool TC::Math::Box< COORD_TYPE >::Contains ( const Box< COORD_TYPE > &  r  )  const [inline]

Check if this box contains the specified box.

Definition at line 176 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::Contains(), TC::Math::Box< COORD_TYPE >::m_max, and TC::Math::Box< COORD_TYPE >::m_min.

Here is the call graph for this function:

template<class COORD_TYPE >
static Box TC::Math::Box< COORD_TYPE >::Unite ( const Box< COORD_TYPE > &  box1,
const Box< COORD_TYPE > &  box2 
) [inline, static]

Get the combined box out of two boxes.

Parameters:
box1 First box to combine
box2 Second box to combine
Returns:
The combined box out of box1 and box2

Definition at line 188 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::Box(), TC::Math::Box< COORD_TYPE >::GetMax(), TC::Math::Box< COORD_TYPE >::GetMin(), TC::Math::Box< COORD_TYPE >::IsEmpty(), TC::Math::Max(), and TC::Math::Min().

Here is the call graph for this function:

template<class COORD_TYPE >
static Box TC::Math::Box< COORD_TYPE >::BoundingBox ( const std::vector< COORD_TYPE > &  coords  )  [inline, static]

Create bounding box out of an vector of coordinates.

Parameters:
coords Vector of coordinates for setting up the bounding box
Returns:
The created bounding box

Definition at line 210 of file TCMathBox.h.

References TC::Math::Box< COORD_TYPE >::Box(), TC::Math::Max(), and TC::Math::Min().

Here is the call graph for this function:


Member Data Documentation

template<class COORD_TYPE >
COORD_TYPE TC::Math::Box< COORD_TYPE >::m_min [private]

template<class COORD_TYPE >
COORD_TYPE TC::Math::Box< COORD_TYPE >::m_max [private]


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

Copyright (c) Thomas Goessler 2003 - 2008