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

TSphere3< T > Class Template Reference
[Sphere]

Generic Sphere Class. More...

#include <sphere3.h>

Inheritance diagram for TSphere3< T >:

VIEW::Sphere List of all members.

Public Member Functions

Constructors and Destructors
 TSphere3 () throw ()
 Default constructor.
 TSphere3 (const TSphere3 &sphere) throw ()
 Copy constructor.
 TSphere3 (const TVector3< T > &point, const T &radius) throw ()
 Detailed constructor.
virtual ~TSphere3 () throw ()
 Destructor.
virtual void clear () throw ()
 Default initialisation.
Assignment
void swap (TSphere3 &sphere) throw ()
 Swap the contents of two instances of Sphere3.
void set (const TSphere3 &sphere) throw ()
 Assign from another instance of Sphere3.
void set (const TVector3< T > &point, const T &r) throw ()
 Assign from a point and a radius.
TSphere3operator= (const TSphere3 &sphere) throw ()
 Assignment operator.
void get (TSphere3 &sphere) const throw ()
 Assign to another instance of Sphere.
void get (TVector3< T > &point, T &r) const throw ()
 Assign to an instance of Vector3 and a variable of type T.
Predicates
bool operator== (const TSphere3 &sphere) const throw ()
 Equality operator.
bool operator!= (const TSphere3 &sphere) const throw ()
 Inequality operator.
bool has (const TVector3< T > &point, bool on_surface=false) const throw ()
 Test whether a given point is a member of the Sphere.
bool isEmpty () const throw ()
 Test whether the Sphere is empty (radius = 0).
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

Attributes
TVector3< T > p
 The midpoint of the sphere.
radius
 The radius of the sphere.

Detailed Description

template<typename T>
class TSphere3< T >

Generic Sphere Class.


Constructor & Destructor Documentation

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

Default constructor.

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

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

Copy constructor.

Create a new Sphere3 object from another.

Parameters:
sphere the Sphere3 object to be copied

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

Detailed constructor.

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

Parameters:
point assigned to the point
radius assigned to the radius

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

Destructor.

As there are no dynamic data structures, nothing happens.


Member Function Documentation

template<typename T>
void TSphere3< 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::Sphere.

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

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

Parameters:
point the point component
r the radius component

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

Assign to another instance of Sphere.

Assigns the components to another Sphere.

Parameters:
sphere the sphere to be assigned to

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

Test whether a given point is a member of the Sphere.

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 TSphere3< T >::isEmpty  )  const throw ()
 

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

Returns:
bool, true or false

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

Test whether instance is valid.

Always returns true

Returns:
bool true

Reimplemented in VIEW::Sphere.

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

Inequality operator.

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

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

Assignment operator.

Assign the components from another instance of Sphere.

Parameters:
sphere the sphere to assign from

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

Equality operator.

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

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

Assign from a point and a radius.

Parameters:
point the point to assign from
r the radius to assign from

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

Assign from another instance of Sphere3.

Parameters:
sphere the Sphere3 object to assign from

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

Swap the contents of two instances of Sphere3.

Parameters:
sphere the Sphere3 to swap contents with


Member Data Documentation

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

The midpoint of the sphere.

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

The radius of the sphere.