1 #include "creaContoursFactory.h"
3 #include "manualContourControler.h"
4 #include "manualCircleControler.h"
5 #include "manualContourModelCircle.h"
6 #include "manualViewCircle.h"
7 #include "manualLineControler.h"
8 #include "manualContourModelLine.h"
9 #include "manualViewLine.h"
10 #include "manualRoiControler.h"
11 #include "manualViewRoi.h"
12 #include "manualContourModelRoi.h"
13 #include "manualViewBullEye.h"
14 #include "manualContourModelBullEye.h"
15 #include "manualViewPoints.h"
16 #include "manualRotationToolControler.h"
17 #include "manualContourModelRotationTool.h"
18 #include "manualViewRotationTool.h"
19 #include "manualContourModelPolygon.h"
20 #include "manualView3DContour.h"
21 #include "manualContour3DControler.h"
22 #include "manualContour3V3DControler.h"
25 creaContoursFactory::creaContoursFactory()
31 creaContoursFactory::~creaContoursFactory()
36 manualContourBaseControler* creaContoursFactory::getContourControler(int typeContour)
38 manualContourBaseControler *manContourControl = NULL;
42 manContourControl = new manualContourControler();
48 manContourControl = new manualRoiControler();
54 manContourControl = new manualCircleControler();
60 manContourControl = new manualRoiControler();
66 manContourControl = new manualLineControler();
72 manContourControl = new manualContourControler();
78 manContourControl = new manualRotationToolControler();
84 manContourControl = new manualContourControler();
92 printf("JPReyes %p creaContoursFactory::getContourControler pasando por el Contour 12 \n",this);
93 manContourControl = new manualContour3V3DControler();
96 return manContourControl;
100 manualContourBaseControler* creaContoursFactory::getContourControler(std::string typeContour)
102 manualContourBaseControler *manContourControl = NULL;
103 if (typeContour.compare("spline")==0)
105 manContourControl = getContourControler(1);
108 if (typeContour.compare("rectangle")==0)
110 manContourControl = getContourControler(2);
113 if (typeContour.compare("circle")==0)
115 manContourControl = getContourControler(3);
118 if (typeContour.compare("bullEye")==0)
120 manContourControl = getContourControler(4);
123 if (typeContour.compare("line")==0)
125 manContourControl = getContourControler(6);
128 if (typeContour.compare("points")==0)
130 manContourControl = getContourControler(7);
133 if (typeContour.compare("rotationTool")==0)
135 manContourControl = getContourControler(8);
138 if (typeContour.compare("polygon")==0)
140 manContourControl = getContourControler(10);
145 if(typeContour.compare("spline3D")==0)
147 manContourControl = getContourControler(12);
149 return manContourControl;
152 manualViewBaseContour* creaContoursFactory::getCountourView (int typeContour)
155 manualViewBaseContour *manViewerContour = NULL;
159 manViewerContour = new manualViewContour();
165 manViewerContour = new manualViewRoi();
171 manViewerContour = new manualViewCircle();
177 manViewerContour = new manualViewBullEye();
183 manViewerContour = new manualViewLine();
189 manViewerContour = new manualViewPoints();
195 manViewerContour = new manualViewRotationTool();
201 manViewerContour = new manualViewContour();
208 manViewerContour = new manualView3DContour();
210 return manViewerContour;
213 manualViewBaseContour* creaContoursFactory::getCountourView (std::string typeContour)
216 manualViewBaseContour *manViewerContour = NULL;
218 if (typeContour.compare("spline")==0)
220 manViewerContour = getCountourView(1);
223 if (typeContour.compare("rectangle")==0)
225 manViewerContour = getCountourView(2);
228 if (typeContour.compare("circle")==0)
230 manViewerContour = getCountourView(3);
233 if (typeContour.compare("bullEye")==0)
235 manViewerContour = getCountourView(4);
238 if (typeContour.compare("line")==0)
240 manViewerContour = getCountourView(6);
243 if (typeContour.compare("points")==0)
245 manViewerContour = getCountourView(7);
248 if (typeContour.compare("rotationTool")==0)
250 manViewerContour = getCountourView(8);
253 if (typeContour.compare("polygon")==0)
255 manViewerContour = getCountourView(10);
260 if (typeContour.compare("spline3D")==0)
262 manViewerContour = getCountourView(12);
265 return manViewerContour;
269 manualBaseModel* creaContoursFactory::getContourModel(int typeContour)
271 manualBaseModel *manModelContour=NULL;
276 manModelContour = new manualContourModel();
282 manModelContour = new manualContourModelRoi();
288 manModelContour = new manualContourModelCircle();
294 //Here we create a bullEye with 3 crowns and 5 sectors.
295 manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
297 int iCrown,sizeCrowns,iSector,sizeSectors;
298 double radioA,radioB,ang,angDelta,radioA2,radioB2 ;
304 for ( iCrown=0 ; iCrown<sizeCrowns ; iCrown++ )
308 if (iCrown==sizeCrowns-1)
316 radioA2=radioA/100.0;
317 radioB2=radioB/100.0;
319 for ( iSector=0 ; iSector<sizeSectors ; iSector++ )
322 manModelContourBullEye->AddSector(radioA2,radioB2,ang,angDelta);
325 manModelContour = manModelContourBullEye;
331 manModelContour = new manualContourModelLine();
337 manModelContour = new manualBaseModel();
343 manModelContour = new manualContourModelRotationTool();
349 manModelContour = new manualContourModelPolygon();
357 manModelContour = new manualContourModel();
360 return manModelContour;
364 manualBaseModel* creaContoursFactory::getContourModel(std::string typeContour)
366 manualBaseModel *manModelContour=NULL;
368 if (typeContour.compare("spline")==0)
370 manModelContour = getContourModel(1);
373 if (typeContour.compare("rectangle")==0)
375 manModelContour = getContourModel(2);
378 if (typeContour.compare("circle")==0)
380 manModelContour = getContourModel(3);
383 if (typeContour.compare("bullEye")==0)
385 manModelContour = getContourModel(4);
389 if (typeContour.compare("line")==0)
391 manModelContour = getContourModel(6);
394 if (typeContour.compare("points")==0)
396 manModelContour = getContourModel(7);
399 if (typeContour.compare("rotationTool")==0)
401 manModelContour = getContourModel(8);
404 if (typeContour.compare("polygon")==0)
406 manModelContour = getContourModel(10);
412 if (typeContour.compare("spline3D")==0)
414 manModelContour = getContourModel(12);
417 return manModelContour;