BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
BALL::TSimpleBox3< T > Class Template Reference

#include <BALL/MATHS/simpleBox3.h>

Public Member Functions

Constructors and Destructors
 TSimpleBox3 ()
 
 TSimpleBox3 (const TSimpleBox3 &box)
 
 TSimpleBox3 (const TVector3< T > &a, const TVector3< T > &b)
 
 TSimpleBox3 (const T &ax, const T &ay, const T &az, const T &bx, const T &by, const T &bz)
 
virtual ~TSimpleBox3 ()
 
virtual void clear ()
 
Assignment
void set (const TSimpleBox3 &box)
 
void set (const TVector3< T > &lower, const TVector3< T > &upper)
 
void set (const T &ax, const T &ay, const T &az, const T &bx, const T &by, const T &bz)
 
const TSimpleBox3operator= (const TSimpleBox3 &box)
 
void get (TSimpleBox3 &box) const
 
void get (TVector3< T > &lower, TVector3< T > &upper) const
 
void get (T &ax, T &ay, T &az, T &bx, T &by, T &bz) const
 
void swap (TSimpleBox3 &box)
 
Accessors
getSurface () const
 
getVolume () const
 
getWidth () const
 
getHeight () const
 
getDepth () const
 
void join (const TSimpleBox3 &box)
 
Predicates
bool operator== (const TSimpleBox3 &box) const
 
bool operator!= (const TSimpleBox3 &box) const
 
bool has (const TVector3< T > &point, bool on_surface=false) const
 
bool isIntersecting (const TSimpleBox3 &box) const
 
Debugging and Diagnostics
bool isValid () const
 
void dump (std::ostream &s=std::cout, Size depth=0) const
 

Public Attributes

Public members
TVector3< T > a
 
TVector3< T > b
 

Detailed Description

template<typename T>
class BALL::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.\

Definition at line 31 of file simpleBox3.h.

Constructor & Destructor Documentation

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

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

Definition at line 249 of file simpleBox3.h.

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

Copy constructor. Create a new TSimpleBox3 object from another.

Parameters
boxthe TSimpleBox3 object to be copied

Definition at line 256 of file simpleBox3.h.

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

Detailed constructor. Create a new TSimpleBox3 object from two instances of TVector3.

Parameters
aassigned to a
bassigned to b

Definition at line 263 of file simpleBox3.h.

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

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

Parameters
axassigned to a.x
ayassigned to a.y
azassigned to a.z
bxassigned to b.x
byassigned to b.y
bzassigned to b.z

Definition at line 271 of file simpleBox3.h.

template<typename T>
virtual BALL::TSimpleBox3< T >::~TSimpleBox3 ( )
inlinevirtual

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

Definition at line 76 of file simpleBox3.h.

Member Function Documentation

template<typename T >
BALL_INLINE void BALL::TSimpleBox3< T >::clear ( )
virtual

Clear method. The values are set to 0.

Reimplemented in BALL::VIEW::SimpleBox.

Definition at line 353 of file simpleBox3.h.

template<typename T >
void BALL::TSimpleBox3< 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

Definition at line 564 of file simpleBox3.h.

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

Assign to another instance of TSimpleBox3. Assigns the box components to another box.

Parameters
boxthe box to be assigned to

Definition at line 318 of file simpleBox3.h.

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

Assign to two variables of type TVector3 .

Parameters
lowerthe lower corner of the box
upperthe upper corner of the box

Definition at line 326 of file simpleBox3.h.

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

Assign to six variables of type T .

Parameters
axis assigned a.x
ayis assigned a.y
azis assigned a.z
bxis assigned b.x
byis assigned b.y
bzis assigned b.z

Definition at line 335 of file simpleBox3.h.

template<typename T >
BALL_INLINE T BALL::TSimpleBox3< T >::getDepth ( ) const

Return the depth of the box.

Returns
T the depth

Definition at line 402 of file simpleBox3.h.

template<typename T >
BALL_INLINE T BALL::TSimpleBox3< T >::getHeight ( ) const

Return the height of the box.

Returns
T the height

Definition at line 394 of file simpleBox3.h.

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

Calculate the surface area.

Returns
T the surface

Definition at line 362 of file simpleBox3.h.

template<typename T >
BALL_INLINE T BALL::TSimpleBox3< T >::getVolume ( ) const

Calculate the volume.

Returns
T the volume

Definition at line 374 of file simpleBox3.h.

template<typename T >
BALL_INLINE T BALL::TSimpleBox3< T >::getWidth ( ) const

Return the width of the box.

Returns
T the width

Definition at line 386 of file simpleBox3.h.

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

Test if a given point is a member of the box. Optional it can be testet, if the point lies on the surface.

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

Definition at line 477 of file simpleBox3.h.

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

Test if two boxes intersect.

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

Definition at line 518 of file simpleBox3.h.

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

Test whether instance is valid. Always returns true.

Returns
bool true

Definition at line 470 of file simpleBox3.h.

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

Join the box with an other. Instance is set to the box containing both, this box and a given box.

Parameters
boxthe box to join with

Definition at line 409 of file simpleBox3.h.

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

Inequality operator.

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

Definition at line 462 of file simpleBox3.h.

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

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

Parameters
boxthe TSimpleBox3 to assign from

Definition at line 309 of file simpleBox3.h.

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

Equality operator.

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

Definition at line 454 of file simpleBox3.h.

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

Assign from another instance of TSimpleBox3.

Parameters
boxthe TSimpleBox3 object to assign from

Definition at line 281 of file simpleBox3.h.

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

Assign from two points.

Parameters
lowerthe lower corner of the box
upperthe upper corner of the box

Definition at line 290 of file simpleBox3.h.

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

Assign from six values of type T .

Parameters
axassigned to a.x
ayassigned to a.y
azassigned to a.z
bxassigned to b.x
byassigned to b.y
bzassigned to b.z

Definition at line 299 of file simpleBox3.h.

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

Swap the contents of two instances.

Parameters
boxthe box to swap contents with

Definition at line 344 of file simpleBox3.h.

Member Data Documentation

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

First point of the box.

Definition at line 239 of file simpleBox3.h.

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

Second point of the box.

Definition at line 243 of file simpleBox3.h.