00001 /* 00002 * point_T.hh 00003 * 00004 * Created on: 12-01-2012 00005 * Author: Paweł Macioł 00006 */ 00007 00008 #ifndef POINT_T_hh__ 00009 #define POINT_T_hh__ 00010 00011 #include"vector_T.hh" 00012 00013 template<typename T> 00014 class CPoint3 : public CVecT<T,3> 00015 { 00016 public: 00017 CPoint3() {} 00018 00019 CPoint3(T x_, T y_, T z_) 00020 { 00021 (*this)(0) = x_; 00022 (*this)(1) = y_; 00023 (*this)(2) = z_; 00024 } 00025 00026 CPoint3(const CVecT<T,3>& v_) : CVecT<T,3><T,3>(v_) 00027 {} 00028 00029 const T& x() const { return this->at(0); } 00030 const T& y() const { return this->at(1); } 00031 const T& z() const { return this->at(2); } 00032 T& x() { return (*this)(0); } 00033 T& y() { return (*this)(1); } 00034 T& z() { return (*this)(2); } 00035 }; 00036 00037 typedef CPoint3<float > Point3f; 00038 typedef CPoint3<double> Point3d; 00039 00040 #endif /* POINT_T_hh__ */