00001 #ifndef POINT3D_H_ 00002 #define POINT3D_H_ 00003 00004 #include "Vec3D.h" 00005 00006 namespace rcrt 00007 { 00008 00009 class Point3D 00010 { 00011 private: 00012 float values[3]; 00013 void assign(const Point3D& vec); 00014 00015 public: 00016 Point3D(); 00017 Point3D(const float& val); 00018 Point3D(const float& xc, const float& yc, const float& zc); 00019 Point3D(const Point3D& vec); 00020 Point3D(const Vec3D& vec); 00021 virtual ~Point3D(); 00022 00023 const Point3D& operator= (const Point3D& p); 00024 Point3D operator+ (const Vec3D& vec) const; 00025 Point3D operator- (const Vec3D& vec) const; 00026 Vec3D operator+ (const Point3D& p) const; 00027 Vec3D operator- (const Point3D& p) const; 00028 float operator[] (int i) const; 00029 float& operator[] (int i); 00030 bool operator!= (const Point3D& p) const; 00031 bool operator== (const Point3D& p) const; 00032 00033 Point3D operator* (const float& f) const; 00034 Point3D operator/ (const float& f) const; 00035 00036 Vec3D getPosVec3D() const; 00037 Point3D abs() const; 00038 bool equals(const Point3D& p) const; 00039 00040 const float& x() const; 00041 const float& y() const; 00042 const float& z() const; 00043 }; 00044 00045 00046 inline std::ostream& operator<<(std::ostream& o, const Point3D& v) 00047 { 00048 o << "P3D(" << v.x() << "," << v.y() << "," << v.z() << ")"; 00049 return o; 00050 } 00051 00052 } 00053 00054 #endif /*POINT3D_H_*/