BALL::TBox3< T > Class Template Reference

#include <BALL/MATHS/box3.h>

Inheritance diagram for BALL::TBox3< T >:
BALL::VIEW::Box

List of all members.

Public Member Functions

Constructors and Destructors
 TBox3 ()
 TBox3 (const TBox3 &box)
 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)
virtual ~TBox3 ()
virtual void clear ()
Assignment
void set (const TBox3 &box)
const TBox3operator= (const TBox3 &box)
void swap (TBox3 &box)
Accessors
void setWidth (T width)
 Set width.
getWidth () const
 Get width.
void setHeight (T height)
 Set height.
getHeight () const
 Get height.
void setDepth (T depth)
 Set depth.
getDepth () const
 Get depth.
const TVector3< T > & getPoint () const
 Get the point.
void setPoint (const TVector3< T > &point)
 Set the point.
const TVector3< T > & getRightVector () const
 Get the right vector.
void setRightVector (const TVector3< T > &v)
 Set the right vector.
const TVector3< T > & getHeightVector () const
 Get the height vector.
void setHeightVector (const TVector3< T > &v)
 Set the height vector.
getSurface () const
getVolume () const
TVector3< T > getDiagonalVector () const
Predicates
bool operator== (const TBox3 &box) const
bool operator!= (const TBox3 &box) const
Debugging and Diagnostics
bool isValid () const
void dump (std::ostream &s=std::cout, Size depth=0) const

Protected Attributes

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

Detailed Description

template<typename T>
class BALL::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 >
BALL::TBox3< T >::TBox3 ( )

Default constructor.

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

Copy constructor.

Parameters:
boxthe TBox3 object to be copied
template<typename T >
BALL::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 
)

Detailed constructor.

template<typename T>
virtual BALL::TBox3< T >::~TBox3 ( ) [inline, virtual]

Destructor.


Member Function Documentation

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

Clear method. The values are set to 0.

Reimplemented in BALL::VIEW::Box.

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

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 BALL::VIEW::Box.

References BALL_DUMP_DEPTH, BALL_DUMP_HEADER, BALL_DUMP_STREAM_PREFIX, and BALL_DUMP_STREAM_SUFFIX.

template<typename T>
T BALL::TBox3< T >::getDepth ( ) const [inline]

Get depth.

References BALL::TBox3< T >::depth_.

template<typename T >
TVector3< T > BALL::TBox3< T >::getDiagonalVector ( ) const
template<typename T>
T BALL::TBox3< T >::getHeight ( ) const [inline]

Get height.

References BALL::TBox3< T >::height_.

template<typename T>
const TVector3<T>& BALL::TBox3< T >::getHeightVector ( ) const [inline]

Get the height vector.

References BALL::TBox3< T >::height_vector_.

template<typename T>
const TVector3<T>& BALL::TBox3< T >::getPoint ( ) const [inline]

Get the point.

References BALL::TBox3< T >::point_.

template<typename T>
const TVector3<T>& BALL::TBox3< T >::getRightVector ( ) const [inline]

Get the right vector.

References BALL::TBox3< T >::right_vector_.

template<typename T >
BALL_INLINE T BALL::TBox3< T >::getSurface ( ) const

Calculate the surface area.

Returns:
T the surface
template<typename T >
BALL_INLINE T BALL::TBox3< T >::getVolume ( ) const

Calculate the volume.

Returns:
T the volume
template<typename T>
T BALL::TBox3< T >::getWidth ( ) const [inline]

Get width.

References BALL::TBox3< T >::width_.

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

Test whether instance is valid. Always returns true.

Returns:
bool true

Reimplemented in BALL::VIEW::Box.

template<typename T >
BALL_INLINE bool BALL::TBox3< T >::operator!= ( const TBox3< T > &  box) const

Inequality operator.

Returns:
bool, true if the two boxes differ in at least one component, false otherwise
template<typename T >
BALL_INLINE const TBox3< T > & BALL::TBox3< T >::operator= ( const TBox3< T > &  box)

Assignment operator. Assign the box components from another instance of TBox3.

Parameters:
boxthe TBox3 to assign from
template<typename T >
bool BALL::TBox3< T >::operator== ( const TBox3< T > &  box) const

Equality operator.

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

References BALL::TBox3< T >::depth_, BALL::TBox3< T >::height_, BALL::TBox3< T >::height_vector_, BALL::TBox3< T >::point_, BALL::TBox3< T >::right_vector_, and BALL::TBox3< T >::width_.

template<typename T >
void BALL::TBox3< T >::set ( const TBox3< T > &  box)
template<typename T>
void BALL::TBox3< T >::setDepth ( depth) [inline]

Set depth.

References BALL::TBox3< T >::depth_.

Referenced by BALL::operator>>().

template<typename T >
BALL_INLINE void BALL::TBox3< T >::setHeight ( height)

Set height.

template<typename T >
BALL_INLINE void BALL::TBox3< T >::setHeightVector ( const TVector3< T > &  v)

Set the height vector.

References BALL::TVector3< T >::getLength().

Referenced by BALL::operator>>().

template<typename T>
void BALL::TBox3< T >::setPoint ( const TVector3< T > &  point) [inline]

Set the point.

References BALL::TBox3< T >::point_.

Referenced by BALL::operator>>().

template<typename T >
BALL_INLINE void BALL::TBox3< T >::setRightVector ( const TVector3< T > &  v)

Set the right vector.

References BALL::TVector3< T >::getLength().

Referenced by BALL::operator>>().

template<typename T >
BALL_INLINE void BALL::TBox3< T >::setWidth ( width)

Set width.

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

Swap the contents of two instances.

Parameters:
boxthe box to swap contents with

References BALL::TBox3< T >::depth_, BALL::TBox3< T >::height_, BALL::TBox3< T >::height_vector_, BALL::TBox3< T >::point_, BALL::TBox3< T >::right_vector_, and BALL::TBox3< T >::width_.


Member Data Documentation