1 #include "creaContoursFactory.h"
3 creaContoursFactory::creaContoursFactory()
9 creaContoursFactory::~creaContoursFactory()
14 manualContourBaseControler* creaContoursFactory::getContourControler(int typeContour)
16 manualContourBaseControler *manContourControl = NULL;
20 manContourControl = new manualContourControler();
26 manContourControl = new manualRoiControler();
32 manContourControl = new manualCircleControler();
38 manContourControl = new manualRoiControler();
44 manContourControl = new manualLineControler();
50 manContourControl = new manualContourControler();
56 manContourControl = new manualRotationToolControler();
62 manContourControl = new manualContourControler();
70 printf("JPReyes %p creaContoursFactory::getContourControler pasando por el Contour 12 \n",this);
71 manContourControl = new manualContour3V3DControler();
74 return manContourControl;
78 manualContourBaseControler* creaContoursFactory::getContourControler(std::string typeContour)
80 manualContourBaseControler *manContourControl = NULL;
81 if (typeContour.compare("spline")==0)
83 manContourControl = getContourControler(1);
86 if (typeContour.compare("rectangle")==0)
88 manContourControl = getContourControler(2);
91 if (typeContour.compare("circle")==0)
93 manContourControl = getContourControler(3);
96 if (typeContour.compare("bullEye")==0)
98 manContourControl = getContourControler(4);
101 if (typeContour.compare("line")==0)
103 manContourControl = getContourControler(6);
106 if (typeContour.compare("points")==0)
108 manContourControl = getContourControler(7);
111 if (typeContour.compare("rotationTool")==0)
113 manContourControl = getContourControler(8);
116 if (typeContour.compare("polygon")==0)
118 manContourControl = getContourControler(10);
123 if(typeContour.compare("spline3D")==0)
125 manContourControl = getContourControler(12);
130 return manContourControl;
133 manualViewBaseContour* creaContoursFactory::getCountourView (int typeContour)
136 manualViewBaseContour *manViewerContour = NULL;
140 manViewerContour = new manualViewContour();
146 manViewerContour = new manualViewRoi();
152 manViewerContour = new manualViewCircle();
158 manViewerContour = new manualViewBullEye();
164 manViewerContour = new manualViewLine();
170 manViewerContour = new manualViewPoints();
176 manViewerContour = new manualViewRotationTool();
182 manViewerContour = new manualViewContour();
189 manViewerContour = new manualView3DContour();
191 return manViewerContour;
194 manualViewBaseContour* creaContoursFactory::getCountourView (std::string typeContour)
197 manualViewBaseContour *manViewerContour = NULL;
199 if (typeContour.compare("spline")==0)
201 manViewerContour = getCountourView(1);
204 if (typeContour.compare("rectangle")==0)
206 manViewerContour = getCountourView(2);
209 if (typeContour.compare("circle")==0)
211 manViewerContour = getCountourView(3);
214 if (typeContour.compare("bullEye")==0)
216 manViewerContour = getCountourView(4);
219 if (typeContour.compare("line")==0)
221 manViewerContour = getCountourView(6);
224 if (typeContour.compare("points")==0)
226 manViewerContour = getCountourView(7);
229 if (typeContour.compare("rotationTool")==0)
231 manViewerContour = getCountourView(8);
234 if (typeContour.compare("polygon")==0)
236 manViewerContour = getCountourView(10);
241 if (typeContour.compare("spline3D")==0)
243 manViewerContour = getCountourView(12);
246 return manViewerContour;
250 manualBaseModel* creaContoursFactory::getContourModel(int typeContour)
252 manualBaseModel *manModelContour=NULL;
257 manModelContour = new manualContourModel();
263 manModelContour = new manualContourModelRoi();
269 manModelContour = new manualContourModelCircle();
275 //Here we create a bullEye with 3 crowns and 5 sectors.
276 manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
278 int iCrown,sizeCrowns,iSector,sizeSectors;
279 double radioA,radioB,ang,angDelta,radioA2,radioB2 ;
285 for ( iCrown=0 ; iCrown<sizeCrowns ; iCrown++ )
289 if (iCrown==sizeCrowns-1)
297 radioA2=radioA/100.0;
298 radioB2=radioB/100.0;
300 for ( iSector=0 ; iSector<sizeSectors ; iSector++ )
303 manModelContourBullEye->AddSector(radioA2,radioB2,ang,angDelta);
306 manModelContour = manModelContourBullEye;
312 manModelContour = new manualContourModelLine();
318 manModelContour = new manualBaseModel();
324 manModelContour = new manualContourModelRotationTool();
330 manModelContour = new manualContourModelPolygon();
338 manModelContour = new manualContourModel();
341 return manModelContour;
345 manualBaseModel* creaContoursFactory::getContourModel(std::string typeContour)
347 manualBaseModel *manModelContour=NULL;
349 if (typeContour.compare("spline")==0)
351 manModelContour = getContourModel(1);
354 if (typeContour.compare("rectangle")==0)
356 manModelContour = getContourModel(2);
359 if (typeContour.compare("circle")==0)
361 manModelContour = getContourModel(3);
364 if (typeContour.compare("bullEye")==0)
366 manModelContour = getContourModel(4);
370 if (typeContour.compare("line")==0)
372 manModelContour = getContourModel(6);
375 if (typeContour.compare("points")==0)
377 manModelContour = getContourModel(7);
380 if (typeContour.compare("rotationTool")==0)
382 manModelContour = getContourModel(8);
385 if (typeContour.compare("polygon")==0)
387 manModelContour = getContourModel(10);
393 if (typeContour.compare("spline3D")==0)
395 manModelContour = getContourModel(12);
398 return manModelContour;