#include <sphere3.h>
Public Member Functions |
|
Constructors and Destructors
|
|
TSphere3 () | |
Default constructor. |
|
TSphere3 (const TSphere3 &sphere) | |
Copy constructor. |
|
TSphere3 (const TVector3< T > &point, const T &radius) | |
Detailed constructor. |
|
virtual | ~TSphere3 () |
Destructor. |
|
virtual void | clear () |
Default initialisation. |
|
Assignment
|
|
void | swap (TSphere3 &sphere) |
Swap the contents of two instances
of Sphere3. |
|
void | set (const TSphere3 &sphere) |
Assign from another instance of
Sphere3. |
|
void | set (const TVector3< T > &point, const T &r) |
Assign from a point and a radius.
|
|
TSphere3 & | operator= (const TSphere3 &sphere) |
Assignment operator. |
|
void | get (TSphere3 &sphere) const |
Assign to another instance of
Sphere. |
|
void | get (TVector3< T > &point, T &r) const |
Assign to an instance of Vector3 and
a variable of type T . |
|
Predicates
|
|
bool | operator== (const TSphere3 &sphere) const |
Equality operator. |
|
bool | operator!= (const TSphere3 &sphere) const |
Inequality operator. |
|
bool | has (const TVector3< T > &point, bool on_surface=false) const |
Test whether a given point is a
member of the Sphere. |
|
bool | isEmpty () const |
Test whether the Sphere is empty
(radius = 0). |
|
Debugging and Diagnostics
|
|
bool | isValid () const |
Test whether instance is valid.
|
|
void | dump (std::ostream &s=std::cout, Size depth=0) const |
Internal state dump. |
|
Public Attributes |
|
Attributes
|
|
TVector3< T > | p |
The midpoint of the
sphere. |
|
T | radius |
The radius of the sphere. |
BALL::TSphere3< T >::TSphere3 | ( | ) |
Default constructor.
This method creates a new TSphere3 object. The three
components are initialized to (T)0
.
BALL::TSphere3< T >::TSphere3 | ( | const TSphere3< T > & | sphere | ) |
Copy constructor.
Create a new Sphere3 object from another.
sphere | the Sphere3 object to be copied |
BALL::TSphere3< T >::TSphere3 | ( | const TVector3< T > & | point, | |
const T & | radius | |||
) |
Detailed constructor.
Create a new Sphere3 object from a point and a radius.
point | assigned to the point | |
radius | assigned to the radius |
virtual BALL::TSphere3< T >::~TSphere3 | ( | ) | [virtual] |
Destructor.
As there are no dynamic data structures, nothing happens.
void BALL::TSphere3< 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 .
s | - output stream where to output the internal state of {*this} | |
depth | - the dumping depth |
Reimplemented in BALL::VIEW::Sphere.
void BALL::TSphere3< T >::get | ( | TVector3< T > & | point, | |
T & | r | |||
) | const |
Assign to an instance of Vector3 and a variable of type
T
.
point | the point component | |
r | the radius component |
void BALL::TSphere3< T >::get | ( | TSphere3< T > & | sphere | ) | const |
Assign to another instance of Sphere.
Assigns the components to another Sphere.
sphere | the sphere to be assigned to |
bool BALL::TSphere3< T >::has | ( | const TVector3< T > & | point, | |
bool | on_surface =
false |
|||
) | const |
Test whether a given point is a member of the Sphere.
Optional it can be testet, if the point lies on the surface.
point | the point to be tested | |
on_surface | true to test the surface (default = false) |
bool BALL::TSphere3< T >::isEmpty | ( | ) | const |
Test whether the Sphere is empty (radius = 0).
bool BALL::TSphere3< T >::isValid | ( | ) | const |
Test whether instance is valid.
Always returns true
Reimplemented in BALL::VIEW::Sphere.
bool BALL::TSphere3< T >::operator!= | ( | const TSphere3< T > & | sphere | ) | const |
Inequality operator.
TSphere3& BALL::TSphere3< T >::operator= | ( | const TSphere3< T > & | sphere | ) |
Assignment operator.
Assign the components from another instance of Sphere.
sphere | the sphere to assign from |
bool BALL::TSphere3< T >::operator== | ( | const TSphere3< T > & | sphere | ) | const |
Equality operator.
void BALL::TSphere3< T >::set | ( | const TVector3< T > & | point, | |
const T & | r | |||
) |
Assign from a point and a radius.
point | the point to assign from | |
r | the radius to assign from |
void BALL::TSphere3< T >::set | ( | const TSphere3< T > & | sphere | ) |
Assign from another instance of Sphere3.
sphere | the Sphere3 object to assign from |
void BALL::TSphere3< T >::swap | ( | TSphere3< T > & | sphere | ) |
Swap the contents of two instances of Sphere3.
sphere | the Sphere3 to swap contents with |