Public Types | Public Member Functions | Public Attributes

gmtl::AABox< DATA_TYPE > Class Template Reference
[Abstract Data Types: Matrix, Vec, Quat, Coord, Sphere, Plane]

Describes an axially aligned box in 3D space. More...

#include <AABox.h>

Collaboration diagram for gmtl::AABox< DATA_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef DATA_TYPE DataType

Public Member Functions

 AABox ()
 Creates a new empty box.
 AABox (const Point< DATA_TYPE, 3 > &min, const Point< DATA_TYPE, 3 > &max)
 Creates a new box with the given min and max points.
 AABox (const AABox< DATA_TYPE > &box)
 Construcst a duplicate of the given box.
const Point< DATA_TYPE, 3 > & getMin () const
 Gets the minimum point of the box.
const Point< DATA_TYPE, 3 > & getMax () const
 Gets the maximum point of the box.
bool isEmpty () const
 Tests if this box occupies no space.
void setMin (const Point< DATA_TYPE, 3 > &min)
 Sets the minimum point of the box.
void setMax (const Point< DATA_TYPE, 3 > &max)
 Sets the maximum point of the box.
void setEmpty (bool empty)
 Sets the empty flag on this box.

Public Attributes

Point< DATA_TYPE, 3 > mMin
 The minimum point of the box.
Point< DATA_TYPE, 3 > mMax
 The maximum point on the box.
bool mEmpty
 Flag for empty box.

Detailed Description

template<class DATA_TYPE>
class gmtl::AABox< DATA_TYPE >

Describes an axially aligned box in 3D space.

This is usually used for graphics applications. It is defined by its minimum and maximum points.

Parameters:
DATA_TYPE the internal type used for the points

Definition at line 22 of file AABox.h.


Member Typedef Documentation

template<class DATA_TYPE>
typedef DATA_TYPE gmtl::AABox< DATA_TYPE >::DataType

Definition at line 33 of file AABox.h.


Constructor & Destructor Documentation

template<class DATA_TYPE>
gmtl::AABox< DATA_TYPE >::AABox (  )  [inline]

Creates a new empty box.

Definition at line 39 of file AABox.h.

         : mMin(0,0,0), mMax(0,0,0), mEmpty(true)
      {}

template<class DATA_TYPE>
gmtl::AABox< DATA_TYPE >::AABox ( const Point< DATA_TYPE, 3 > &  min,
const Point< DATA_TYPE, 3 > &  max 
) [inline]

Creates a new box with the given min and max points.

Parameters:
min the minimum point on the box
max the maximum point on the box
Precondition:
all elements of min are less than max
bot min and max are not zero

Definition at line 52 of file AABox.h.

         : mMin(min), mMax(max), mEmpty(false)
      {}

template<class DATA_TYPE>
gmtl::AABox< DATA_TYPE >::AABox ( const AABox< DATA_TYPE > &  box  )  [inline]

Construcst a duplicate of the given box.

Parameters:
box the box the make a copy of

Definition at line 61 of file AABox.h.

         : mMin(box.mMin), mMax(box.mMax), mEmpty(box.mEmpty)
      {}


Member Function Documentation

template<class DATA_TYPE>
const Point<DATA_TYPE, 3>& gmtl::AABox< DATA_TYPE >::getMax (  )  const [inline]

Gets the maximum point of the box.

Returns:
the max point

Definition at line 80 of file AABox.h.

      {
         return mMax;
      }

template<class DATA_TYPE>
const Point<DATA_TYPE, 3>& gmtl::AABox< DATA_TYPE >::getMin (  )  const [inline]

Gets the minimum point of the box.

Returns:
the min point

Definition at line 70 of file AABox.h.

      {
         return mMin;
      }

template<class DATA_TYPE>
bool gmtl::AABox< DATA_TYPE >::isEmpty (  )  const [inline]

Tests if this box occupies no space.

Returns:
true if the box is empty, false otherwise

Definition at line 90 of file AABox.h.

      {
         return mEmpty;
      }

template<class DATA_TYPE>
void gmtl::AABox< DATA_TYPE >::setEmpty ( bool  empty  )  [inline]

Sets the empty flag on this box.

Parameters:
empty true to make the box empty, false otherwise

Definition at line 120 of file AABox.h.

      {
         mEmpty = empty;
      }

template<class DATA_TYPE>
void gmtl::AABox< DATA_TYPE >::setMax ( const Point< DATA_TYPE, 3 > &  max  )  [inline]

Sets the maximum point of the box.

Parameters:
max the max point

Definition at line 110 of file AABox.h.

      {
         mMax = max;
      }

template<class DATA_TYPE>
void gmtl::AABox< DATA_TYPE >::setMin ( const Point< DATA_TYPE, 3 > &  min  )  [inline]

Sets the minimum point of the box.

Parameters:
min the min point

Definition at line 100 of file AABox.h.

      {
         mMin = min;
      }


Member Data Documentation

template<class DATA_TYPE>
bool gmtl::AABox< DATA_TYPE >::mEmpty

Flag for empty box.

True if the box is empty.

Definition at line 139 of file AABox.h.

template<class DATA_TYPE>
Point<DATA_TYPE, 3> gmtl::AABox< DATA_TYPE >::mMax

The maximum point on the box.

Definition at line 134 of file AABox.h.

template<class DATA_TYPE>
Point<DATA_TYPE, 3> gmtl::AABox< DATA_TYPE >::mMin

The minimum point of the box.

Definition at line 129 of file AABox.h.


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