# TBBox3D Class Reference
[Data Structures]

Inheritance diagram for TBBox3D:

List of all members.

## Public Member Functions
| TBBox3D ()
| TBBox3D (const TVector3 &min, const TVector3 &max)
| TBBox3D (const TVector3 &max)
void | Init ()
| Sets fMin and fMax to TVector3::kZero.
void | SetMax (const TVector3 &max)
| Setter function for fMax.
void | SetMin (const TVector3 &min)
| Setter function for fMin.
void | GetCenter (TVector3 &center) const
void | GetDelta (TVector3 &delta) const
real | GetMax () const
real | GetVolume () const
| Returns the volume of the box.
boolean | IsEmpty () const
boolean | IsFlat () const
void | AddPoint (const TVector3 &PP)
void | Inset (const TVector3 &PP)
TVector3 | operator[] (int16 ii) const
void | operator+= (const TBBox3D &box)
void | FixInvertedFields ()
void | GetPoint (int16 index, TVector3 &PP) const
boolean | IsInside (const TVector3 &point) const
| Returns true if the point is inside the box.
boolean | Valid () const
| Returns true if every coordinate of fMin is smaller than its fMax counterpart.
boolean | Intersect (const TBBox3D &boundingBox) const
real | GetWidth () const
| Returns the width (in x) of the box.
real | GetHeight () const
| Returns the height (in y) of the box.
real | GetDepth (void) const
| Returns the depth (in z) of the box.
## Public Attributes
TVector3 | fMin
| The lower corner of the box.
TVector3 | fMax
| The upper corner of the box.

## Detailed Description

TBBox3D defines a three dimentional bounding box. It uses two TVector3 to store the lower (fMin) and the upper (fMax) corners of the rectangle

## Constructor & Destructor Documentation

TBBox3D::TBBox3D | ( |  | ) |

Default constructor: fMin is initialized with kRealMax, fMax with kRealMin

TBBox3D::TBBox3D | ( | const TVector3 & | min,
|  | const TVector3 & | max |
| ) |  |  |

Init constructor

Parameters:

  | min | initial value for fMin.
  | max | initial value for fMax.

TBBox3D::TBBox3D | ( | const TVector3 & | max | ) |

Init constructor

Parameters:

  | max | initial value for fMax. fMin is initialized with -max

## Member Function Documentation

void TBBox3D::AddPoint | ( | const TVector3 & | PP | ) |

Expands the box to encompass the given point

Parameters:

  | PP | the point to add to the box

void TBBox3D::FixInvertedFields | ( |  | ) |

if (fMin .x > fMax .x) {fMin .x= fMax .x= kRealZero;} and same for y

void TBBox3D::GetCenter | ( | TVector3 & | center | ) | const

Computes the center of the box

Parameters:

  | center | the return value for the center of the box

void TBBox3D::GetDelta | ( | TVector3 & | delta | ) | const

Computes the main diagonal of the box (fMax - fMin)

Parameters:

  | delta | the return value

real TBBox3D::GetDepth | ( | void |  | ) | const`[inline]`

Returns the depth (in z) of the box.

real TBBox3D::GetHeight | ( |  | ) | const`[inline]`

Returns the height (in y) of the box.

real TBBox3D::GetMax | ( |  | ) | const

Returns the bigger coordinate of the diagonal

void TBBox3D::GetPoint | ( | int16 | index,
|  | TVector3 & | PP |
| ) |  |  | const

Returns the coordinates of one of the corners of the box

Parameters:

  | index | the corner index ( 0<=index<8 )
  | PP | the returned corner coordinates

real TBBox3D::GetVolume | ( |  | ) | const

Returns the volume of the box.

real TBBox3D::GetWidth | ( |  | ) | const`[inline]`

Returns the width (in x) of the box.

void TBBox3D::Init | ( | void |  | ) | `[inline]`

Sets fMin and fMax to TVector3::kZero.

void TBBox3D::Inset | ( | const TVector3 & | PP | ) |

Shrinks the box by adding PP to fMin, and substracting it from fMax

Parameters:

  | PP | the amount to shrink the box with

boolean TBBox3D::Intersect | ( | const TBBox3D & | boundingBox | ) | const

Returns true if the two boxes intersect

Parameters:

  | boundingBox | the box to test for intersection with this box

boolean TBBox3D::IsEmpty | ( |  | ) | const

Returns true if the box is empty

boolean TBBox3D::IsFlat | ( |  | ) | const

Returns true if the box is flat

boolean TBBox3D::IsInside | ( | const TVector3 & | point | ) | const

Returns true if the point is inside the box.

void TBBox3D::operator+= | ( | const TBBox3D & | box | ) |

Expands the box to encompass the given box

Parameters:

  | box | the box to add to this box

TVector3 TBBox3D::operator[] | ( | int16 | ii | ) | const

Returns one of the corners of the box (or its center)

         2_____6      Z
       3/|___7/|      ^
       | |   | |      |-->Y
       |/0---|/4     /
       1_____5      X

Parameters:

  | ii | the corner index. For values between 0 and 7 retruns the point shown in the diagram above. For 8 returns the center. Otherwise zero is returned.

void TBBox3D::SetMax | ( | const TVector3 & | max | ) | `[inline]`

Setter function for fMax.

void TBBox3D::SetMin | ( | const TVector3 & | min | ) | `[inline]`

Setter function for fMin.

boolean TBBox3D::Valid | ( |  | ) | const`[inline]`

Returns true if every coordinate of fMin is smaller than its fMax counterpart.

## Member Data Documentation

TVector3 TBBox3D::fMax

The upper corner of the box.

TVector3 TBBox3D::fMin

The lower corner of the box.

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

- TBBox.h