Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

point.h

Go to the documentation of this file.
00001 00003 00004 // / 00005 // Projet : Générateur de cylindres généralisés / 00006 // / 00007 // Nom du fichier : point.h / 00008 // / 00009 // Creation : 20/11/2005 / 00010 // / 00011 // Description : La classe Point3D permet de spécifier des points dans l'espace 3D. / 00012 // / 00013 // Auteurs : - Guitteny Fabrice / 00014 // - Idiart Baptiste / 00015 // - Le Goff Erwan / 00016 // / 00018 00019 #ifndef POINT_3D_H 00020 #define POINT_3D_H 00021 00022 #include<iostream> 00023 00024 using namespace std; 00025 00026 00034 00035 // Classe Point3D // 00037 00038 class Point3D { 00039 00045 friend std::ostream& operator<<(std::ostream& os,const Point3D& pt); 00046 00052 friend Point3D operator+(const Point3D& p1,const Point3D& p2); 00053 00059 friend Point3D operator-(const Point3D& p1,const Point3D& p2); 00060 00066 friend Point3D operator*(const Point3D& p1,const double scalaire); 00067 00073 friend Point3D operator*(const double scalaire, const Point3D& p1); 00074 00080 friend bool operator==(const Point3D& p1, const Point3D& p2); 00081 00087 friend Point3D operator*(const Point3D& p1, const Point3D& p2); 00088 00089 00090 private: 00091 00092 double x, y, z; // coordonnées 3D d'un point 00093 00094 public: 00095 00099 Point3D(const Point3D &point); 00100 00106 Point3D(const double xx=0,const double yy=0,const double zz=0); 00107 00112 double operator[](int i) const; 00113 00118 double& operator[](int i); 00119 00124 double& getCoordinate(int i); 00125 00129 double distance (Point3D &point); 00130 00135 Point3D& operator*=(const double scalaire); 00136 00141 Point3D& operator+=(const Point3D& point); 00142 00147 Point3D& operator-=(const Point3D& point); 00148 }; 00149 00150 std::ostream& operator<<(std::ostream &os,const Point3D& point); 00151 00152 Point3D operator+(const Point3D& p1,const Point3D& p2); 00153 00154 Point3D operator-(const Point3D& p1,const Point3D& p2); 00155 00156 Point3D operator*(const Point3D& p1,const double scalaire); 00157 00158 Point3D operator*(const double scalaire, const Point3D& p1); 00159 00160 bool operator==(const Point3D& p1, const Point3D& p2); 00161 00162 Point3D operator*(const Point3D& p1, const Point3D& p2); 00163 00164 #endif

Generated on Tue Nov 29 21:58:58 2005 for CylinderGenerator by doxygen 1.3.7