• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

Sphere.h

Go to the documentation of this file.
00001 // GMTL is (C) Copyright 2001-2010 by Allen Bierbaum
00002 // Distributed under the GNU Lesser General Public License 2.1 with an
00003 // addendum covering inlined code. (See accompanying files LICENSE and
00004 // LICENSE.addendum or http://www.gnu.org/copyleft/lesser.txt)
00005 
00006 #ifndef _GMTL_SPHERE_H_
00007 #define _GMTL_SPHERE_H_
00008 
00009 #include <gmtl/Point.h>
00010 
00011 namespace gmtl
00012 {
00013 
00020 template<class DATA_TYPE>
00021 class Sphere
00022 {
00023 public:
00024    typedef DATA_TYPE DataType;
00025 
00026 public:
00030    Sphere()
00031       : mRadius( 0 )
00032    {}
00033 
00040    Sphere( const Point<DATA_TYPE, 3>& center, const DATA_TYPE& radius )
00041       : mCenter( center ), mRadius( radius )
00042    {}
00043 
00049    Sphere( const Sphere<DATA_TYPE>& sphere )
00050       : mCenter( sphere.mCenter ), mRadius( sphere.mRadius )
00051    {}
00052 
00058    const Point<DATA_TYPE, 3>& getCenter() const
00059    {
00060       return mCenter;
00061    }
00062 
00068    const DATA_TYPE& getRadius() const
00069    {
00070       return mRadius;
00071    }
00072 
00078    void setCenter( const Point<DATA_TYPE, 3>& center )
00079    {
00080       mCenter = center;
00081    }
00082 
00088    void setRadius( const DATA_TYPE& radius )
00089    {
00090       mRadius = radius;
00091    }
00092 
00093 public:
00097    Point<DATA_TYPE, 3> mCenter;
00098 
00102    DATA_TYPE mRadius;
00103 };
00104 
00105 // --- helper types --- //
00106 typedef Sphere<float>   Spheref;
00107 typedef Sphere<double>  Sphered;
00108 
00109 };
00110 
00111 #endif

Generated on Sun Sep 19 2010 14:35:14 for GenericMathTemplateLibrary by  doxygen 1.7.1