Sphere ->Sphere3

This commit is contained in:
Federico Ponchio 2004-04-02 09:44:13 +00:00
parent 38150e9fde
commit b7a9093265
1 changed files with 9 additions and 3 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.2 2004/03/25 17:25:46 ponchio
#include sbagliato.
Revision 1.1 2004/03/21 17:51:57 ponchio Revision 1.1 2004/03/21 17:51:57 ponchio
First version. First version.
@ -46,7 +49,7 @@ Templated class for 3D sphere.
Various policy could be added to improve efficience (keeping square of radius for instance). Various policy could be added to improve efficience (keeping square of radius for instance).
*/ */
template <class T> class Sphere { template <class T> class Sphere3 {
protected: protected:
Point3<T> _center; Point3<T> _center;
T _radius; T _radius;
@ -64,10 +67,13 @@ public:
bool IsIn(const Point3<T> &p) const; bool IsIn(const Point3<T> &p) const;
void Add(Point3<T> &p); void Add(Point3<T> &p);
void Add(const Sphere &sphere); void Add(const Sphere3 &sphere);
}; };
typedef Sphere3<float> Sphere3f;
typedef Sphere3<double> Sphere3d;
template <class T> void Sphere<T>::Add(const Sphere<T> &sphere) { template <class T> void Sphere<T>::Add(const Sphere<T> &sphere) {
if(IsEmpty()) { if(IsEmpty()) {
*this = sphere; *this = sphere;