32 #include "geometry.hh"
33 #include "transformation-matrix.hh"
36 using namespace GMap3d;
40 AParameterObjectTransformation,
42 AParameterObjectTranslation,
44 AParameterObjectRotation,
46 AParameterObjectScale,
48 AParameterObjectPonderation) :
49 FParameterObjectTransformation(AParameterObjectTransformation),
50 FParameterObjectTranslation (AParameterObjectTranslation),
51 FParameterObjectRotation (AParameterObjectRotation),
52 FParameterObjectScale (AParameterObjectScale),
53 FParameterObjectPonderation (AParameterObjectPonderation),
56 assert(FParameterObjectTransformation!=NULL);
60 if (FParameterObjectTranslation!=NULL)
63 if (FParameterObjectRotation!=NULL)
66 if (FParameterObjectScale!=NULL)
69 if (FParameterObjectPonderation!=NULL)
80 (APrecompile.FParameterObjectTransformation->copy())),
81 FParameterObjectTranslation (APrecompile.FParameterObjectTranslation),
82 FParameterObjectRotation (APrecompile.FParameterObjectRotation),
83 FParameterObjectScale (APrecompile.FParameterObjectScale),
84 FParameterObjectPonderation (APrecompile.FParameterObjectPonderation),
87 assert(FParameterObjectTransformation!=NULL);
91 if (FParameterObjectTranslation!=NULL)
94 if (FParameterObjectRotation!=NULL)
97 if (FParameterObjectScale!=NULL)
100 if (FParameterObjectPonderation!=NULL)
110 if (FParameterObjectTranslation!=NULL)
113 if (FParameterObjectRotation!=NULL)
116 if (FParameterObjectScale!=NULL)
119 if (FParameterObjectPonderation!=NULL)
128 if ( AMode!=FCurrentMode )
130 FCurrentMode = AMode;
158 {
return FParameterObjectTransformation; }
163 assert(AObjectTransformation != NULL);
166 FParameterObjectTransformation = AObjectTransformation;
173 if (AObjectTranslation != NULL)
176 if (FParameterObjectTranslation!= NULL)
179 FParameterObjectTranslation = AObjectTranslation;
186 if (AObjectRotation != NULL)
189 if (FParameterObjectRotation!= NULL)
192 FParameterObjectRotation = AObjectRotation;
199 if (AObjectScale != NULL)
202 if (FParameterObjectScale!= NULL)
205 FParameterObjectScale = AObjectScale;
212 if (AObjectPonderation != NULL)
215 if (FParameterObjectPonderation!= NULL)
218 FParameterObjectPonderation = AObjectPonderation;
225 #define AXIAL_EDGES (10)
226 #define PLANAR_EDGES (4)
236 if ( FParameterObjectTranslation!=NULL &&
241 if (FParameterObjectRotation!=NULL)
254 if (FParameterObjectScale!=NULL)
257 CVertex C = FParameterObjectScale->
getCenter();
258 CVertex V = FParameterObjectScale->
getVector();
302 P = C -
K*(OX+OY);
PLOT(&P);
303 P = C +
K*(OX+OY);
PLOT(&P);
305 P = C -
K*(OX-OY);
PLOT(&P);
306 P = C +
K*(OX-OY);
PLOT(&P);
308 P = C -
K*OZ;
PLOT(&P);
309 P = C +
K*OZ;
PLOT(&P);
312 for (
int i=0; i<2; ++i)
313 for (
int j=0; j<2; ++j)
315 P = C+
K*CVertex(2*i-1,2*j-1,-1);
PLOT(&P);
316 P = C-
K*CVertex(2*i-1,2*j-1,-1);
PLOT(&P);
325 #define N (21) // doit être impair!
326 CVertex VV = 2*V/V.norm();
330 int i = ponderation ? 0 : 1;
334 P = C + VV*(float(i )/
N - 0.5);
PLOT(&P);
335 P = C + VV*(float(i+1)/
N - 0.5);
PLOT(&P);
341 CVertex
N = CGeometry::getNormalVector(V);
342 CVertex E = C + N/N.norm()/circleNbEdges;
344 glBegin(GL_LINE_LOOP);
346 CTransformationMatrix
347 rotationMatrix(CTransformationMatrix::IdentityMatrix);
348 rotationMatrix.rotate(C, V, 360.0/circleNbEdges);
350 for (
int i=0; i<circleNbEdges; ++i)
353 rotationMatrix.applyOn(E);
362 if (FParameterObjectPonderation==NULL)
return;