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

TBox3< T > Class Template Reference
[Generic three-dimensional box.]

Generic three-dimensional Box. More...

#include <box3.h>

List of all members.

Public Member Functions

Constructors and Destructors
 TBox3 () throw ()
 Default constructor.
 TBox3 (const TBox3 &box) throw ()
 Copy constructor.
 TBox3 (const TVector3< T > &point, const TVector3< T > &right_vector=TVector3< T >((T) 0,(T) 1,(T) 0), const TVector3< T > &height_vector=TVector3< T >((T)-1,(T) 0,(T) 0), const T &depth=1) throw ()
 Detailed constructor.
virtual ~TBox3 () throw ()
 Destructor.
virtual void clear () throw ()
 Clear method.
Assignment
void set (const TBox3 &box) throw ()
 Assign from another instance of TBox3.
const TBox3operator= (const TBox3 &box) throw ()
 Assignment operator.
void swap (TBox3 &box) throw ()
 Swap the contents of two instances.
Accessors
void setWidth (T width) throw ()
 Set width.
getWidth () const throw ()
 Get width.
void setHeight (T height) throw ()
 Set height.
getHeight () const throw ()
 Get height.
void setDepth (T depth) throw ()
 Set depth.
getDepth () const throw ()
 Get depth.
const TVector3< T > & getPoint () const throw ()
 Get the point.
void setPoint (const TVector3< T > &point) throw ()
 Set the point.
const TVector3< T > & getRightVector () const throw ()
 Get the right vector.
void setRightVector (const TVector3< T > &v) throw ()
 Set the right vector.
const TVector3< T > & getHeightVector () const throw ()
 Get the height vector.
void setHeightVector (const TVector3< T > &v) throw ()
 Set the height vector.
getSurface () const throw ()
 Calculate the surface area.
getVolume () const throw ()
 Calculate the volume.
TVector3< T > getDiagonalVector () const throw ()
Predicates
bool operator== (const TBox3 &box) const throw ()
 Equality operator.
bool operator!= (const TBox3 &box) const throw ()
 Inequality operator.
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.

Protected Attributes

TVector3< T > point_
TVector3< T > right_vector_
TVector3< T > height_vector_
width_
height_
depth_


Detailed Description

template<typename T>
class TBox3< T >

Generic three-dimensional Box.

This class describes a three-dimensional box. A box is given by the coordinates of the lower left front corner, width, height, depth and the right vector.\


Constructor & Destructor Documentation

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

Default constructor.

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

Copy constructor.

Parameters:
box the TBox3 object to be copied

template<typename T>
TBox3< T >::TBox3 const TVector3< T > &  point,
const TVector3< T > &  right_vector = TVector3< T >((T) 0,(T) 1,(T) 0),
const TVector3< T > &  height_vector = TVector3< T >((T)-1,(T) 0,(T) 0),
const T &  depth = 1
throw ()
 

Detailed constructor.

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

Destructor.


Member Function Documentation

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

Clear method.

The values are set to 0.

Reimplemented in VIEW::Box.

template<typename T>
void TBox3< 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::Box.

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

Calculate the surface area.

Returns:
T the surface

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

Calculate the volume.

Returns:
T the volume

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

Test whether instance is valid.

Always returns true.

Returns:
bool true

Reimplemented in VIEW::Box.

template<typename T>
bool TBox3< T >::operator!= const TBox3< 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 TBox3< T > & TBox3< T >::operator= const TBox3< T > &  box  )  throw ()
 

Assignment operator.

Assign the box components from another instance of TBox3.

Parameters:
box the TBox3 to assign from

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

Equality operator.

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

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

Assign from another instance of TBox3.

Parameters:
box the TBox3 object to assign from

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

Swap the contents of two instances.

Parameters:
box the box to swap contents with