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

primitive.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 : primitive.h / 00008 // / 00009 // Creation : 20/11/2005 / 00010 // / 00011 // Description : La classe Primitive permet de spécifier et de dessiner une primitive. / 00012 // / 00013 // Auteurs : - Guitteny Fabrice / 00014 // - Idiart Baptiste / 00015 // - Le Goff Erwan / 00016 // / 00018 00019 #ifndef PRIMITIVE_H 00020 #define PRIMITIVE_H 00021 00022 #include<iostream> 00023 #include <qpainter.h> 00024 #include <qdom.h> 00025 #include <vector> 00026 00027 #include "point.h" 00028 #include "../interface/utilities.h" 00029 00030 using namespace std; 00031 00032 // types de primitives 00033 const int SEGMENT = 0; 00034 const int CIRCLE = 1; 00035 const int BEZIER = 2; 00036 const int BSPLINE = 3; 00037 00038 // valeurs des échantillonage 00039 const int LOW_SAMPLE = 30; 00040 const int NORMAL_SAMPLE = 15; 00041 const int ACCURATE_SAMPLE = 9; 00042 00050 00051 // Classe Primitive // 00053 00054 class Primitive 00055 { 00056 public : 00057 00059 vector<Point3D*> pointsList; 00060 00062 vector<Point3D*> samplesPointsList; 00063 00065 double nbSamples; 00066 00070 int type; 00071 00073 int nbPoints() {return pointsList.size();} 00074 00076 virtual ~Primitive() {clearVector(pointsList); clearVector(samplesPointsList);} 00077 00081 inline double getNbSamples() {return nbSamples;} 00082 00086 inline void setNbSamples(double sample) 00087 { 00088 if (type == CIRCLE) 00089 nbSamples = sample / 3; 00090 else 00091 nbSamples = sample; 00092 } 00093 00097 virtual void display(QPainter & paint) = 0; 00098 00103 virtual void setPrimitive(QPoint & refPoint, QPoint & modifPoint) = 0; 00104 00108 virtual void toXML(QDomElement &elem) = 0 ; 00109 }; 00110 00111 #endif

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