30 using namespace GMap3d;
32 #define DEFAULT_SPHERE_NB_MERIDIANS (12)
33 #define DEFAULT_SPHERE_NB_PARALLELS ( 6)
35 #define DEFAULT_CYLINDER_NB_MERIDIANS (10)
36 #define DEFAULT_CYLINDER_NB_PARALLELS ( 4)
38 #define DEFAULT_PYRAMID_NB_MERIDIANS ( 8)
39 #define DEFAULT_PYRAMID_NB_PARALLELS ( 8)
41 #define DEFAULT_TORUS_NB_MERIDIANS (12)
42 #define DEFAULT_TORUS_NB_PARALLELS ( 6)
44 CParameterCreation::CParameterCreation(
int ANbRef) :
48 FMeshSubdivisionDimension(0),
52 FCylinderClosedUp (true),
53 FCylinderClosedDown (true),
56 FPyramidClosed (true),
61 FTorusRadiusRapport (0.5)
64 FMeshNbSubdivisions[0] = 3;
65 FMeshNbSubdivisions[1] = 3;
66 FMeshNbSubdivisions[2] = 3;
71 FPolygonNbEdges (AParam.FPolygonNbEdges),
72 FMeshDimension (AParam.FMeshDimension),
73 FMeshSubdivisionDimension(AParam.FMeshSubdivisionDimension),
74 FCreatedFaces (AParam.FCreatedFaces),
75 FCylinderNbMeridians (AParam.FCylinderNbMeridians),
76 FCylinderNbParallels (AParam.FCylinderNbParallels),
77 FCylinderClosedUp (AParam.FCylinderClosedUp),
78 FCylinderClosedDown (AParam.FCylinderClosedDown),
79 FPyramidNbMeridians (AParam.FPyramidNbMeridians),
80 FPyramidNbParallels (AParam.FPyramidNbParallels),
81 FPyramidClosed (AParam.FPyramidClosed),
82 FSphereNbMeridians (AParam.FSphereNbMeridians),
83 FSphereNbParallels (AParam.FSphereNbParallels),
84 FTorusNbMeridians (AParam.FTorusNbMeridians),
85 FTorusNbParallels (AParam.FTorusNbParallels),
86 FTorusRadiusRapport (AParam.FTorusRadiusRapport)
88 FMeshNbSubdivisions[0] = AParam.FMeshNbSubdivisions[0];
89 FMeshNbSubdivisions[1] = AParam.FMeshNbSubdivisions[1];
90 FMeshNbSubdivisions[2] = AParam.FMeshNbSubdivisions[2];
100 {
return FPolygonNbEdges; }
104 assert(ANbEdges >= 2);
106 if ( FPolygonNbEdges!=ANbEdges )
109 FPolygonNbEdges= ANbEdges;
115 return FMeshNbSubdivisions[0];
120 return FMeshNbSubdivisions[1];
125 return FMeshNbSubdivisions[2];
131 if ( FMeshNbSubdivisions[0]!=ASx )
134 FMeshNbSubdivisions[0]= ASx;
141 if ( FMeshNbSubdivisions[1]!=ASy )
144 FMeshNbSubdivisions[1]= ASy;
151 if ( FMeshNbSubdivisions[2]!=ASz )
154 FMeshNbSubdivisions[2] = ASz;
160 return FMeshDimension;
165 assert(1 <= ADimension && ADimension <= 3);
167 if ( FMeshDimension!=ADimension )
170 FMeshDimension= ADimension;
172 if (FMeshDimension < FMeshSubdivisionDimension)
173 FMeshSubdivisionDimension= FMeshDimension;
179 return FMeshSubdivisionDimension;
184 assert(0 <= ADimension && ADimension <= 3);
186 if ( FMeshSubdivisionDimension!=ADimension )
189 FMeshSubdivisionDimension= ADimension;
191 if (FMeshDimension < FMeshSubdivisionDimension)
192 FMeshDimension= FMeshSubdivisionDimension;
198 return FMeshSubdivisionDimension < 3;
203 return FCreatedFaces;
212 return FCreatedFaces & AFace;
218 if ( FCreatedFaces!=AFaces )
221 FCreatedFaces= AFaces;
233 FCreatedFaces |= AFace;
235 FCreatedFaces &= ~ AFace;
240 return FCylinderNbMeridians;
246 if ( FCylinderNbMeridians!=ANb )
249 FCylinderNbMeridians = ANb;
255 return FCylinderNbParallels;
261 if ( FCylinderNbParallels!=ANb )
264 FCylinderNbParallels= ANb;
270 return FCylinderClosedUp;
275 if ( FCylinderClosedUp!= AClosed )
278 FCylinderClosedUp= AClosed;
284 return FCylinderClosedDown;
289 if ( FCylinderClosedDown!=AClosed )
292 FCylinderClosedDown= AClosed;
298 return FPyramidNbMeridians;
304 if ( FPyramidNbMeridians!=ANb )
307 FPyramidNbMeridians= ANb;
313 return FPyramidNbParallels;
319 if ( FPyramidNbParallels!=ANb )
322 FPyramidNbParallels= ANb;
328 return FPyramidClosed;
333 if ( FPyramidClosed!=AClosed )
336 FPyramidClosed= AClosed;
342 return FSphereNbMeridians;
348 if ( FSphereNbMeridians!=ANb )
351 FSphereNbMeridians= ANb;
357 return FSphereNbParallels;
363 if ( FSphereNbParallels!=ANb )
366 FSphereNbParallels= ANb;
372 return FTorusNbMeridians;
378 if ( FTorusNbMeridians!=ANb )
381 FTorusNbMeridians= ANb;
387 return FTorusNbParallels;
393 if ( FTorusNbParallels!=ANb )
396 FTorusNbParallels= ANb;
402 return FTorusRadiusRapport;
407 assert(0.0 <= AValue && AValue <= 1.0);
408 if ( FTorusRadiusRapport!=AValue )
411 FTorusRadiusRapport= AValue;