00001 
00002
00003 /******************************************************************************
00004
00005 Copyright 2008 Departamento de Realidad Virtual
00006 y Unidad de Cómputo Aplicado DGSGA, UNAM.
00007
00008
00009 This file is part of RBF++.
00010
00011 RBF++ is free software: you can redistribute it and/or modify
00012 it under the terms of the GNU General Public License as published by
00013 the Free Software Foundation, either version 3 of the License, or
00014 (at your option) any later version.
00015
00016 RBF++ is distributed in the hope that it will be useful,
00017 but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 GNU General Public License for more details.
00020
00021 You should have received a copy of the GNU General Public License
00022 along with RBF++. If not, see <http://www.gnu.org/licenses/>.
00023
00024
00025 *******************************************************************************/
00026
00027
00028
00029
00030 #ifndef POINT3DT_H_
00031 # define POINT3DT_H_
00032
00033
00034
00035 #include <LA/Point.h>
00036
00037 namespace LA{
00038
00056 template<typename T>
00057 class Point3dT : public Point<T>{
00058
00059 public:
00060 Point3dT():Point<T>(3){};
00061 Point3dT(T x,T y,T z):Point<T>(3)
00062 {
00063 Point<T>::_v[0] = x;
00064 Point<T>::_v[1] = y;
00065 Point<T>::_v[1] = Z;
00066 }
00067 //explicit conversion
00068 template<typename U>
00069 Point<U> & operator=(const Point<U> & p){
00070
00071 Point<U>::_v[0] = p[0];
00072 Point<U>::_v[1] = p[1];
00073 Point<U>::_v[2] = p[2];
00074 return *this;
00075 }
00076
00077 T& X(){return Point<T>::_v[0];}
00078 T& Y(){return Point<T>::_v[1];}
00079 T& Z(){return Point<T>::_v[2];}
00080
00081 };
00082
00083 typedef Point3dT<float> Point3df;
00084 typedef Point3dT<double> Point3dd;
00085
00086 };
00087
00088
00089 #endif /* !POINT2DT_H_ */
00090
Superior

Tenemos 31 visitantes y ningun miembro en Línea