#include <TCMathBox.h>
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. | |
Box & | operator= (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 |
Definition at line 54 of file TCMathBox.h.
typedef COORD_TYPE TC::Math::Box< COORD_TYPE >::CoordType [private] |
Definition at line 57 of file TCMathBox.h.
typedef COORD_TYPE::DataType TC::Math::Box< COORD_TYPE >::DataType [private] |
Definition at line 58 of file TCMathBox.h.
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().
TC::Math::Box< COORD_TYPE >::Box | ( | const Box< COORD_TYPE > & | box | ) | [inline] |
TC::Math::Box< COORD_TYPE >::Box | ( | const COORD_TYPE & | min, | |
const COORD_TYPE & | max | |||
) | [inline] |
Construct a box out of minimum and maximum coordinate.
min | Min coordinate | |
max | Max coordinate |
Definition at line 79 of file TCMathBox.h.
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.
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().
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().
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.
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.
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.
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.
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.
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.
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.
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.
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.
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().
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().
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().
double TC::Math::Box< COORD_TYPE >::GetRadius | ( | ) | const [inline] |
Definition at line 139 of file TCMathBox.h.
References TC::Math::Box< COORD_TYPE >::GetDiameter().
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().
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.
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().
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().
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.
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.
box1 | First box to combine | |
box2 | Second box to combine |
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().
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.
coords | Vector of coordinates for setting up the bounding box |
Definition at line 210 of file TCMathBox.h.
References TC::Math::Box< COORD_TYPE >::Box(), TC::Math::Max(), and TC::Math::Min().
COORD_TYPE TC::Math::Box< COORD_TYPE >::m_min [private] |
Definition at line 225 of file TCMathBox.h.
Referenced by TC::Math::Box< COORD_TYPE >::Contains(), TC::Math::Box< COORD_TYPE >::GetCenter(), TC::Math::Box< COORD_TYPE >::GetDepth(), TC::Math::Box< COORD_TYPE >::GetDiagonal(), TC::Math::Box< COORD_TYPE >::GetDiameter(), TC::Math::Box< COORD_TYPE >::GetHeight(), TC::Math::Box< COORD_TYPE >::GetMin(), TC::Math::Box< COORD_TYPE >::GetWidth(), TC::Math::Box< COORD_TYPE >::IsEmpty(), TC::Math::Box< COORD_TYPE >::operator!=(), TC::Math::Box< COORD_TYPE >::operator=(), TC::Math::Box< COORD_TYPE >::operator==(), TC::Math::Box< COORD_TYPE >::operator[](), and TC::Math::Box< COORD_TYPE >::SetMin().
COORD_TYPE TC::Math::Box< COORD_TYPE >::m_max [private] |
Definition at line 226 of file TCMathBox.h.
Referenced by TC::Math::Box< COORD_TYPE >::Contains(), TC::Math::Box< COORD_TYPE >::GetCenter(), TC::Math::Box< COORD_TYPE >::GetDepth(), TC::Math::Box< COORD_TYPE >::GetDiagonal(), TC::Math::Box< COORD_TYPE >::GetDiameter(), TC::Math::Box< COORD_TYPE >::GetHeight(), TC::Math::Box< COORD_TYPE >::GetMax(), TC::Math::Box< COORD_TYPE >::GetWidth(), TC::Math::Box< COORD_TYPE >::IsEmpty(), TC::Math::Box< COORD_TYPE >::operator!=(), TC::Math::Box< COORD_TYPE >::operator=(), TC::Math::Box< COORD_TYPE >::operator==(), and TC::Math::Box< COORD_TYPE >::SetMax().