Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gmtl::Sphere Class Template Reference
[Abstract Data Types: Matrix, Vec, Quat, Coord, Sphere, Plane]

Describes a sphere in 3D space by its center point and its radius. More...

#include <Sphere.h>

Collaboration diagram for gmtl::Sphere:

Collaboration graph
[legend]
List of all members.

Public Types

typedef DATA_TYPE DataType

Public Methods

 Sphere ()
 Constructs a sphere centered at the origin with a radius of 0. More...

 Sphere (const Point< DATA_TYPE, 3 > &center, const DATA_TYPE &radius)
 Constructs a sphere with the given center and radius. More...

 Sphere (const Sphere< DATA_TYPE > &sphere)
 Constructs a duplicate of the given sphere. More...

const Point< DATA_TYPE, 3 > & getCenter () const
 Gets the center of the sphere. More...

const DATA_TYPE & getRadius () const
 Gets the radius of the sphere. More...

void setCenter (const Point< DATA_TYPE, 3 > &center)
 Sets the center point of the sphere. More...

void setRadius (const DATA_TYPE &radius)
 Sets the radius of the sphere. More...


Public Attributes

Point< DATA_TYPE, 3 > mCenter
 The center of the sphere. More...

DATA_TYPE mRadius
 The radius of the sphere. More...


Detailed Description

template<class DATA_TYPE>
class gmtl::Sphere< DATA_TYPE >

Describes a sphere in 3D space by its center point and its radius.

Parameters:
DATA_TYPE  the internal type used for the point and radius

Definition at line 50 of file Sphere.h.


Member Typedef Documentation

template<class DATA_TYPE>
typedef DATA_TYPE gmtl::Sphere::DataType
 

Definition at line 53 of file Sphere.h.


Constructor & Destructor Documentation

template<class DATA_TYPE>
gmtl::Sphere< DATA_TYPE >::Sphere   [inline]
 

Constructs a sphere centered at the origin with a radius of 0.

Definition at line 59 of file Sphere.h.

References mRadius.

00060       : mRadius( 0 )
00061    {}

template<class DATA_TYPE>
gmtl::Sphere< DATA_TYPE >::Sphere const Point< DATA_TYPE, 3 > &    center,
const DATA_TYPE &    radius
[inline]
 

Constructs a sphere with the given center and radius.

Parameters:
center  the point at which to center the sphere
radius  the radius of the sphere

Definition at line 69 of file Sphere.h.

References gmtl::center, mCenter, and mRadius.

00070       : mCenter( center ), mRadius( radius )
00071    {}

template<class DATA_TYPE>
gmtl::Sphere< DATA_TYPE >::Sphere const Sphere< DATA_TYPE > &    sphere [inline]
 

Constructs a duplicate of the given sphere.

Parameters:
sphere  the sphere to make a copy of

Definition at line 78 of file Sphere.h.

References mCenter, and mRadius.

00079       : mCenter( sphere.mCenter ), mRadius( sphere.mRadius )
00080    {}


Member Function Documentation

template<class DATA_TYPE>
const Point<DATA_TYPE, 3>& gmtl::Sphere< DATA_TYPE >::getCenter   const [inline]
 

Gets the center of the sphere.

Returns:
the center point of the sphere

Definition at line 87 of file Sphere.h.

References mCenter.

00088    {
00089       return mCenter;
00090    }

template<class DATA_TYPE>
const DATA_TYPE& gmtl::Sphere< DATA_TYPE >::getRadius   const [inline]
 

Gets the radius of the sphere.

Returns:
the radius of the sphere

Definition at line 97 of file Sphere.h.

References mRadius.

00098    {
00099       return mRadius;
00100    }

template<class DATA_TYPE>
void gmtl::Sphere< DATA_TYPE >::setCenter const Point< DATA_TYPE, 3 > &    center [inline]
 

Sets the center point of the sphere.

Parameters:
center  the new point at which to center the sphere

Definition at line 107 of file Sphere.h.

References gmtl::center, and mCenter.

00108    {
00109       mCenter = center;
00110    }

template<class DATA_TYPE>
void gmtl::Sphere< DATA_TYPE >::setRadius const DATA_TYPE &    radius [inline]
 

Sets the radius of the sphere.

Parameters:
radius  the new radius of the sphere

Definition at line 117 of file Sphere.h.

References mRadius.

00118    {
00119       mRadius = radius;
00120    }


Member Data Documentation

template<class DATA_TYPE>
Point<DATA_TYPE, 3> gmtl::Sphere::mCenter
 

The center of the sphere.

Definition at line 126 of file Sphere.h.

Referenced by getCenter, setCenter, and Sphere.

template<class DATA_TYPE>
DATA_TYPE gmtl::Sphere::mRadius
 

The radius of the sphere.

Definition at line 131 of file Sphere.h.

Referenced by getRadius, setRadius, and Sphere.


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 15:29:32 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002