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);
127 return manContourControl;
130 manualViewBaseContour* creaContoursFactory::getCountourView (int typeContour)
133 manualViewBaseContour *manViewerContour = NULL;
137 manViewerContour = new manualViewContour();
143 manViewerContour = new manualViewRoi();
149 manViewerContour = new manualViewCircle();
155 manViewerContour = new manualViewBullEye();
161 manViewerContour = new manualViewLine();
167 manViewerContour = new manualViewPoints();
173 manViewerContour = new manualViewRotationTool();
179 manViewerContour = new manualViewContour();
186 manViewerContour = new manualView3DContour();
188 return manViewerContour;
191 manualViewBaseContour* creaContoursFactory::getCountourView (std::string typeContour)
194 manualViewBaseContour *manViewerContour = NULL;
196 if (typeContour.compare("spline")==0)
198 manViewerContour = getCountourView(1);
201 if (typeContour.compare("rectangle")==0)
203 manViewerContour = getCountourView(2);
206 if (typeContour.compare("circle")==0)
208 manViewerContour = getCountourView(3);
211 if (typeContour.compare("bullEye")==0)
213 manViewerContour = getCountourView(4);
216 if (typeContour.compare("line")==0)
218 manViewerContour = getCountourView(6);
221 if (typeContour.compare("points")==0)
223 manViewerContour = getCountourView(7);
226 if (typeContour.compare("rotationTool")==0)
228 manViewerContour = getCountourView(8);
231 if (typeContour.compare("polygon")==0)
233 manViewerContour = getCountourView(10);
238 if (typeContour.compare("spline3D")==0)
240 manViewerContour = getCountourView(12);
243 return manViewerContour;
247 manualBaseModel* creaContoursFactory::getContourModel(int typeContour)
249 manualBaseModel *manModelContour=NULL;
254 manModelContour = new manualContourModel();
260 manModelContour = new manualContourModelRoi();
266 manModelContour = new manualContourModelCircle();
272 //Here we create a bullEye with 3 crowns and 5 sectors.
273 manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
275 int iCrown,sizeCrowns,iSector,sizeSectors;
276 double radioA,radioB,ang,angDelta,radioA2,radioB2 ;
282 for ( iCrown=0 ; iCrown<sizeCrowns ; iCrown++ )
286 if (iCrown==sizeCrowns-1)
294 radioA2=radioA/100.0;
295 radioB2=radioB/100.0;
297 for ( iSector=0 ; iSector<sizeSectors ; iSector++ )
300 manModelContourBullEye->AddSector(radioA2,radioB2,ang,angDelta);
303 manModelContour = manModelContourBullEye;
309 manModelContour = new manualContourModelLine();
315 manModelContour = new manualBaseModel();
321 manModelContour = new manualContourModelRotationTool();
327 manModelContour = new manualContourModelPolygon();
335 manModelContour = new manualContourModel();
338 return manModelContour;
342 manualBaseModel* creaContoursFactory::getContourModel(std::string typeContour)
344 manualBaseModel *manModelContour=NULL;
346 if (typeContour.compare("spline")==0)
348 manModelContour = getContourModel(1);
351 if (typeContour.compare("rectangle")==0)
353 manModelContour = getContourModel(2);
356 if (typeContour.compare("circle")==0)
358 manModelContour = getContourModel(3);
361 if (typeContour.compare("bullEye")==0)
363 manModelContour = getContourModel(4);
367 if (typeContour.compare("line")==0)
369 manModelContour = getContourModel(6);
372 if (typeContour.compare("points")==0)
374 manModelContour = getContourModel(7);
377 if (typeContour.compare("rotationTool")==0)
379 manModelContour = getContourModel(8);
382 if (typeContour.compare("polygon")==0)
384 manModelContour = getContourModel(10);
390 if (typeContour.compare("spline3D")==0)
392 manModelContour = getContourModel(12);
395 return manModelContour;