Sphere ->Sphere3
This commit is contained in:
parent
38150e9fde
commit
b7a9093265
|
@ -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;
|
||||||
|
@ -107,4 +113,4 @@ template <class T> bool Sphere<T>::IsIn(const Point3<T> &p) const {
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue