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
$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
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).
*/
template <class T> class Sphere {
template <class T> class Sphere3 {
protected:
Point3<T> _center;
T _radius;
@ -64,10 +67,13 @@ public:
bool IsIn(const Point3<T> &p) const;
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) {
if(IsEmpty()) {
*this = sphere;
@ -107,4 +113,4 @@ template <class T> bool Sphere<T>::IsIn(const Point3<T> &p) const {
} //namespace
#endif
#endif