Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

TSimpleBox3< T > Class Template Reference
[Box]

Generic three-dimensional Box. More...

#include <simpleBox3.h>

List of all members.

Public Member Functions

Constructors and Destructors
 TSimpleBox3 () throw ()
 Default constructor.
 TSimpleBox3 (const TSimpleBox3 &box) throw ()
 Copy constructor.
 TSimpleBox3 (const TVector3< T > &a, const TVector3< T > &b) throw ()
 Detailed constructor.
 TSimpleBox3 (const T &ax, const T &ay, const T &az, const T &bx, const T &by, const T &bz) throw ()
 Detailed constructor.
virtual ~TSimpleBox3 () throw ()
 Destructor.
virtual void clear () throw ()
 Clear method.
Assignment
void set (const TSimpleBox3 &box) throw ()
 Assign from another instance of TSimpleBox3.
void set (const TVector3< T > &lower, const TVector3< T > &upper) throw ()
 Assign from two points.
void set (const T &ax, const T &ay, const T &az, const T &bx, const T &by, const T &bz) throw ()
 Assign from six values of type T .
const TSimpleBox3operator= (const TSimpleBox3 &box) throw ()
 Assignment operator.
void get (TSimpleBox3 &box) const throw ()
 Assign to another instance of TSimpleBox3.
void get (TVector3< T > &lower, TVector3< T > &upper) const throw ()
 Assign to two variables of type TVector3 .
void get (T &ax, T &ay, T &az, T &bx, T &by, T &bz) const throw ()
 Assign to six variables of type T .
void swap (TSimpleBox3 &box) throw ()
 Swap the contents of two instances.
Accessors
getSurface () const throw ()
 Calculate the surface area.
getVolume () const throw ()
 Calculate the volume.
getWidth () const throw ()
 Return the width of the box.
getHeight () const throw ()
 Return the height of the box.
getDepth () const throw ()
 Return the depth of the box.
void join (const TSimpleBox3 &box) throw ()
 Join the box with an other.
Predicates
bool operator== (const TSimpleBox3 &box) const throw ()
 Equality operator.
bool operator!= (const TSimpleBox3 &box) const throw ()
 Inequality operator.
bool has (const TVector3< T > &point, bool on_surface=false) const throw ()
 Test if a given point is a member of the box.
bool isIntersecting (const TSimpleBox3 &box) const throw ()
 Test if two boxes intersect.
Debugging and Diagnostics
bool isValid () const throw ()
 Test whether instance is valid.
void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal state dump.

Public Attributes

Public members
TVector3< T > a
 First point of the box.
TVector3< T > b
 Second point of the box.


Detailed Description

template<typename T>
class TSimpleBox3< T >

Generic three-dimensional Box.

This class describes a three-dimensional box with edges parallel to the coordinate system. Hence, a box is given by the coordinates of the lower left front corner and ther upper right back corner.\


Constructor & Destructor Documentation

template<typename T>
TSimpleBox3< T >::TSimpleBox3  )  throw ()
 

Default constructor.

This method creates a new TSimpleBox3 object. The three components of the two TVector3 are initialized to { (T)0}.

template<typename T>
TSimpleBox3< T >::TSimpleBox3 const TSimpleBox3< T > &  box  )  throw ()
 

Copy constructor.

Create a new TSimpleBox3 object from another.

Parameters:
box the TSimpleBox3 object to be copied

template<typename T>
TSimpleBox3< T >::TSimpleBox3 const TVector3< T > &  a,
const TVector3< T > &  b
throw ()
 

Detailed constructor.

Create a new TSimpleBox3 object from two instances of TVector3.

Parameters:
a assigned to a
b assigned to b

template<typename T>
TSimpleBox3< T >::TSimpleBox3 const T &  ax,
const T &  ay,
const T &  az,
const T &  bx,
const T &  by,
const T &  bz
throw ()
 

Detailed constructor.

Create a new TSimpleBox3 object from six variables of type T .

Parameters:
ax assigned to a.x
ay assigned to a.y
az assigned to a.z
bx assigned to b.x
by assigned to b.y
bz assigned to b.z

template<typename T>
virtual TSimpleBox3< T >::~TSimpleBox3  )  throw () [virtual]
 

Destructor.

Destructs the TSimpleBox3 object. As there are no dynamic data structures, nothing happens.


Member Function Documentation

template<typename T>
void TSimpleBox3< T >::clear  )  throw () [virtual]
 

Clear method.

The values are set to 0.

Reimplemented in VIEW::SimpleBox.

template<typename T>
void TSimpleBox3< T >::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw ()
 

Internal state dump.

Dump the current internal state of {*this} to the output ostream s with dumping depth depth .

Parameters:
s - output stream where to output the internal state of {*this}
depth - the dumping depth

Reimplemented in VIEW::SimpleBox.

template<typename T>
void TSimpleBox3< T >::get T &  ax,
T &  ay,
T &  az,
T &  bx,
T &  by,
T &  bz
const throw ()
 

Assign to six variables of type T .

Parameters:
ax is assigned a.x
ay is assigned a.y
az is assigned a.z
bx is assigned b.x
by is assigned b.y
bz is assigned b.z

template<typename T>
void TSimpleBox3< T >::get TVector3< T > &  lower,
TVector3< T > &  upper
const throw ()
 

Assign to two variables of type TVector3 .

Parameters:
lower the lower corner of the box
upper the upper corner of the box

template<typename T>
void TSimpleBox3< T >::get TSimpleBox3< T > &  box  )  const throw ()
 

Assign to another instance of TSimpleBox3.

Assigns the box components to another box.

Parameters:
box the box to be assigned to

template<typename T>
T TSimpleBox3< T >::getDepth  )  const throw ()
 

Return the depth of the box.

Returns:
T the depth

template<typename T>
T TSimpleBox3< T >::getHeight  )  const throw ()
 

Return the height of the box.

Returns:
T the height

template<typename T>
T TSimpleBox3< T >::getSurface  )  const throw ()
 

Calculate the surface area.

Returns:
T the surface

template<typename T>
T TSimpleBox3< T >::getVolume  )  const throw ()
 

Calculate the volume.

Returns:
T the volume

template<typename T>
T TSimpleBox3< T >::getWidth  )  const throw ()
 

Return the width of the box.

Returns:
T the width

template<typename T>
bool TSimpleBox3< T >::has const TVector3< T > &  point,
bool  on_surface = false
const throw ()
 

Test if a given point is a member of the box.

Optional it can be testet, if the point lies on the surface.

Parameters:
point the point to be tested
on_surface true to test the surface (default = false)
Returns:
bool, true or false

template<typename T>
bool TSimpleBox3< T >::isIntersecting const TSimpleBox3< T > &  box  )  const throw ()
 

Test if two boxes intersect.

Parameters:
box the box to be tested
Returns:
bool, true if the two boxes are intersecting, false otherwise

template<typename T>
bool TSimpleBox3< T >::isValid  )  const throw ()
 

Test whether instance is valid.

Always returns true.

Returns:
bool true

Reimplemented in VIEW::SimpleBox.

template<typename T>
void TSimpleBox3< T >::join const TSimpleBox3< T > &  box  )  throw ()
 

Join the box with an other.

Instance is set to the box containing both, this box and a given box.

Parameters:
box the box to join with

template<typename T>
bool TSimpleBox3< T >::operator!= const TSimpleBox3< T > &  box  )  const throw ()
 

Inequality operator.

Returns:
bool, true if the two boxes differ in at least one component, false otherwise

template<typename T>
const TSimpleBox3< T > & TSimpleBox3< T >::operator= const TSimpleBox3< T > &  box  )  throw ()
 

Assignment operator.

Assign the box components from another instance of TSimpleBox3.

Parameters:
box the TSimpleBox3 to assign from

template<typename T>
bool TSimpleBox3< T >::operator== const TSimpleBox3< T > &  box  )  const throw ()
 

Equality operator.

Returns:
bool, true if all box components are equal, false otherwise

template<typename T>
void TSimpleBox3< T >::set const T &  ax,
const T &  ay,
const T &  az,
const T &  bx,
const T &  by,
const T &  bz
throw ()
 

Assign from six values of type T .

Parameters:
ax assigned to a.x
ay assigned to a.y
az assigned to a.z
bx assigned to b.x
by assigned to b.y
bz assigned to b.z

template<typename T>
void TSimpleBox3< T >::set const TVector3< T > &  lower,
const TVector3< T > &  upper
throw ()
 

Assign from two points.

Parameters:
lower the lower corner of the box
upper the upper corner of the box

template<typename T>
void TSimpleBox3< T >::set const TSimpleBox3< T > &  box  )  throw ()
 

Assign from another instance of TSimpleBox3.

Parameters:
box the TSimpleBox3 object to assign from

template<typename T>
void TSimpleBox3< T >::swap TSimpleBox3< T > &  box  )  throw ()
 

Swap the contents of two instances.

Parameters:
box the box to swap contents with


Member Data Documentation

template<typename T>
TVector3<T> TSimpleBox3< T >::a
 

First point of the box.

template<typename T>
TVector3<T> TSimpleBox3< T >::b
 

Second point of the box.