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

#include <BALL/MATHS/sphere3.h>

Inheritance diagram for BALL::TSphere3< T >:
BALL::VIEW::Sphere

Public Member Functions

Constructors and Destructors
 TSphere3 ()
 
 TSphere3 (const TSphere3 &sphere)
 
 TSphere3 (const TVector3< T > &point, const T &radius)
 
virtual ~TSphere3 ()
 
virtual void clear ()
 
Assignment
void swap (TSphere3 &sphere)
 
void set (const TSphere3 &sphere)
 
void set (const TVector3< T > &point, const T &r)
 
TSphere3operator= (const TSphere3 &sphere)
 
void get (TSphere3 &sphere) const
 
void get (TVector3< T > &point, T &r) const
 
Predicates
bool operator== (const TSphere3 &sphere) const
 
bool operator!= (const TSphere3 &sphere) const
 
bool has (const TVector3< T > &point, bool on_surface=false) const
 
bool isEmpty () const
 
Debugging and Diagnostics
bool isValid () const
 
void dump (std::ostream &s=std::cout, Size depth=0) const
 

Public Attributes

Attributes
TVector3< T > p
 
radius
 

Detailed Description

template<typename T>
class BALL::TSphere3< T >

Generic Sphere Class.

Definition at line 32 of file sphere3.h.

Constructor & Destructor Documentation

template<typename T>
BALL::TSphere3< T >::TSphere3 ( )
inline

Default constructor. This method creates a new TSphere3 object. The three components are initialized to (T)0.

Definition at line 46 of file sphere3.h.

template<typename T>
BALL::TSphere3< T >::TSphere3 ( const TSphere3< T > &  sphere)
inline

Copy constructor. Create a new Sphere3 object from another.

Parameters
spherethe Sphere3 object to be copied

Definition at line 56 of file sphere3.h.

template<typename T>
BALL::TSphere3< T >::TSphere3 ( const TVector3< T > &  point,
const T &  radius 
)
inline

Detailed constructor. Create a new Sphere3 object from a point and a radius.

Parameters
pointassigned to the point
radiusassigned to the radius

Definition at line 67 of file sphere3.h.

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

Destructor. As there are no dynamic data structures, nothing happens.

Definition at line 76 of file sphere3.h.

Member Function Documentation

template<typename T>
virtual void BALL::TSphere3< T >::clear ( )
inlinevirtual

Default initialisation

Reimplemented in BALL::VIEW::Sphere.

Definition at line 82 of file sphere3.h.

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

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 227 of file sphere3.h.

template<typename T>
void BALL::TSphere3< T >::get ( TSphere3< T > &  sphere) const
inline

Assign to another instance of Sphere. Assigns the components to another Sphere.

Parameters
spherethe sphere to be assigned to

Definition at line 142 of file sphere3.h.

template<typename T>
void BALL::TSphere3< T >::get ( TVector3< T > &  point,
T &  r 
) const
inline

Assign to an instance of Vector3 and a variable of type T.

Parameters
pointthe point component
rthe radius component

Definition at line 152 of file sphere3.h.

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

Test whether a given point is a member of the Sphere. Optional it can be tested 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 185 of file sphere3.h.

template<typename T>
bool BALL::TSphere3< T >::isEmpty ( ) const
inline

Test whether the Sphere is empty (radius = 0).

Returns
bool, true or false

Definition at line 200 of file sphere3.h.

template<typename T>
bool BALL::TSphere3< T >::isValid ( ) const
inline

Test whether instance is valid. Always returns true

Returns
bool true

Definition at line 215 of file sphere3.h.

template<typename T>
bool BALL::TSphere3< T >::operator!= ( const TSphere3< T > &  sphere) const
inline

Inequality operator.

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

Definition at line 174 of file sphere3.h.

template<typename T>
TSphere3& BALL::TSphere3< T >::operator= ( const TSphere3< T > &  sphere)
inline

Assignment operator. Assign the components from another instance of Sphere.

Parameters
spherethe sphere to assign from

Definition at line 131 of file sphere3.h.

template<typename T>
bool BALL::TSphere3< T >::operator== ( const TSphere3< T > &  sphere) const
inline

Equality operator.

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

Definition at line 166 of file sphere3.h.

template<typename T>
void BALL::TSphere3< T >::set ( const TSphere3< T > &  sphere)
inline

Assign from another instance of Sphere3.

Parameters
spherethe Sphere3 object to assign from

Definition at line 110 of file sphere3.h.

template<typename T>
void BALL::TSphere3< T >::set ( const TVector3< T > &  point,
const T &  r 
)
inline

Assign from a point and a radius.

Parameters
pointthe point to assign from
rthe radius to assign from

Definition at line 121 of file sphere3.h.

template<typename T>
void BALL::TSphere3< T >::swap ( TSphere3< T > &  sphere)
inline

Swap the contents of two instances of Sphere3.

Parameters
spherethe Sphere3 to swap contents with

Definition at line 96 of file sphere3.h.

Member Data Documentation

template<typename T>
TVector3<T> BALL::TSphere3< T >::p

The midpoint of the sphere.

Definition at line 250 of file sphere3.h.

template<typename T>
T BALL::TSphere3< T >::radius

The radius of the sphere.

Definition at line 254 of file sphere3.h.