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

cylinder.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 : cylinder.h / 00008 // / 00009 // Creation : 20/11/2005 / 00010 // / 00011 // Description : La classe Cylinder permet de créer des cylindres généralisés et de leur / 00012 // appliquer soit la méthode d'extrusion simple soit celle d'extrusion / 00013 // profil. 00014 // / 00015 // Auteurs : - Guitteny Fabrice / 00016 // - Idiart Baptiste / 00017 // - Le Goff Erwan / 00018 // / 00020 00021 #ifndef CYLINDER_H 00022 #define CYLINDER_H 00023 00024 #include <vector> 00025 #include <math.h> 00026 00027 #include "../primitives/point.h" 00028 #include "../primitives/vector3D.h" 00029 #include "../primitives/primitive.h" 00030 #include "../interface/utilities.h" 00031 00032 using namespace std; 00033 00035 const int SCALE_FACTOR_SIMPLE = 4; 00036 00038 const int SCALE_FACTOR_PROFILE = 20; 00039 00040 00049 class Cylinder 00050 { 00051 private : 00052 00054 int nbSections; 00055 00057 vector<Point3D *> points; 00058 00060 vector<int> facets; 00061 00063 vector<Point3D *> axis; 00064 00066 vector<Point3D *> section; 00067 00069 vector<Point3D *> profile; 00070 00072 bool closedShape; 00073 00075 int twistAngle; 00076 00078 void clearVectors(); 00079 00083 vector<Vector3D *> calculateTangents(); 00084 00089 void calculatePoints(vector<Point3D *> &points, 00090 const vector<Vector3D *> &tangents); 00091 00098 void calculateProfilePoints(vector<Point3D *> &points, 00099 const vector<Vector3D *> &tangents, 00100 vector<double> &radius, 00101 vector<int> &indexes); 00102 00106 void calculateFacets(vector<int> &facets); 00107 00108 public : 00109 00111 Cylinder(); 00112 00116 Cylinder(const Cylinder &cyl); 00117 00122 Cylinder( const vector<Primitive *> &primAxis, 00123 const vector<Primitive *> &primSection); 00124 00130 Cylinder( const vector<Primitive *> &primAxis, 00131 const vector<Primitive *> &primSection, 00132 const vector<Primitive *> &primProfile); 00133 00134 // destructeur 00135 ~Cylinder(); 00136 00142 Vector3D * approximationTangent(Point3D *pt1, Point3D *pt2); 00143 00148 void simpleExtrusion(vector<Point3D *> &points, 00149 vector<int> &facets); 00150 00155 void profileExtrusion(vector<Point3D *> &points, 00156 vector<int> &facets); 00157 00161 inline void setClosedSection(bool closed) {closedShape = closed;} 00162 00166 inline void setTwist(int angle) {twistAngle = angle;} 00167 00168 }; 00169 00170 #endif 00171

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