Public Types | Public Member Functions | Public Attributes

gmtl::Sphere< DATA_TYPE > 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< DATA_TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef DATA_TYPE DataType

Public Member Functions

 Sphere ()
 Constructs a sphere centered at the origin with a radius of 0.
 Sphere (const Point< DATA_TYPE, 3 > &center, const DATA_TYPE &radius)
 Constructs a sphere with the given center and radius.
 Sphere (const Sphere< DATA_TYPE > &sphere)
 Constructs a duplicate of the given sphere.
const Point< DATA_TYPE, 3 > & getCenter () const
 Gets the center of the sphere.
const DATA_TYPE & getRadius () const
 Gets the radius of the sphere.
void setCenter (const Point< DATA_TYPE, 3 > &center)
 Sets the center point of the sphere.
void setRadius (const DATA_TYPE &radius)
 Sets the radius of the sphere.

Public Attributes

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

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 21 of file Sphere.h.


Member Typedef Documentation

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

Definition at line 24 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 30 of file Sphere.h.

      : mRadius( 0 )
   {}

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 40 of file Sphere.h.

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

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 49 of file Sphere.h.

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


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 58 of file Sphere.h.

   {
      return mCenter;
   }

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 68 of file Sphere.h.

   {
      return mRadius;
   }

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 78 of file Sphere.h.

   {
      mCenter = center;
   }

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 88 of file Sphere.h.

   {
      mRadius = radius;
   }


Member Data Documentation

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

The center of the sphere.

Definition at line 97 of file Sphere.h.

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

The radius of the sphere.

Definition at line 102 of file Sphere.h.


The documentation for this class was generated from the following file: