1 #include "creaContoursFactory.h"
3 creaContoursFactory::creaContoursFactory()
9 creaContoursFactory::~creaContoursFactory()
14 manualContourBaseControler* creaContoursFactory::getContourControler(int typeContour)
16 manualContourBaseControler *manContourControl;
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();
64 return manContourControl;
70 manualContourBaseControler* creaContoursFactory::getContourControler(std::string typeContour)
72 manualContourBaseControler *manContourControl;
73 if (typeContour.compare("spline")==0)
75 manContourControl = getContourControler(1);
78 if (typeContour.compare("rectangle")==0)
80 manContourControl = getContourControler(2);
83 if (typeContour.compare("circle")==0)
85 manContourControl = getContourControler(3);
88 if (typeContour.compare("bullEye")==0)
90 manContourControl = getContourControler(4);
93 if (typeContour.compare("line")==0)
95 manContourControl = getContourControler(6);
98 if (typeContour.compare("points")==0)
100 manContourControl = getContourControler(7);
103 if (typeContour.compare("rotationTool")==0)
105 manContourControl = getContourControler(8);
108 if (typeContour.compare("polygon")==0)
110 manContourControl = getContourControler(10);
113 return manContourControl;
116 manualViewBaseContour* creaContoursFactory::getCountourView (int typeContour)
119 manualViewBaseContour *manViewerContour;
123 manViewerContour = new manualViewContour();
129 manViewerContour = new manualViewRoi();
135 manViewerContour = new manualViewCircle();
141 manViewerContour = new manualViewBullEye();
147 manViewerContour = new manualViewLine();
153 manViewerContour = new manualViewPoints();
159 manViewerContour = new manualViewRotationTool();
165 manViewerContour = new manualViewContour();
167 return manViewerContour;
170 manualViewBaseContour* creaContoursFactory::getCountourView (std::string typeContour)
173 manualViewBaseContour *manViewerContour;
175 if (typeContour.compare("spline")==0)
177 manViewerContour = getCountourView(1);
180 if (typeContour.compare("rectangle")==0)
182 manViewerContour = getCountourView(2);
185 if (typeContour.compare("circle")==0)
187 manViewerContour = getCountourView(3);
190 if (typeContour.compare("bullEye")==0)
192 manViewerContour = getCountourView(4);
195 if (typeContour.compare("line")==0)
197 manViewerContour = getCountourView(6);
200 if (typeContour.compare("points")==0)
202 manViewerContour = getCountourView(7);
205 if (typeContour.compare("rotationTool")==0)
207 manViewerContour = getCountourView(8);
210 if (typeContour.compare("polygon")==0)
212 manViewerContour = getCountourView(10);
214 return manViewerContour;
218 manualBaseModel* creaContoursFactory::getContourModel(int typeContour)
220 manualBaseModel *manModelContour=NULL;
225 manModelContour = new manualContourModel();
231 manModelContour = new manualContourModelRoi();
237 manModelContour = new manualContourModelCircle();
243 //Here we create a bullEye with 3 crowns and 5 sectors.
244 manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
246 int iCrown,sizeCrowns,iSector,sizeSectors;
247 double radioA,radioB,ang,angDelta,radioA2,radioB2 ;
253 for ( iCrown=0 ; iCrown<sizeCrowns ; iCrown++ )
257 if (iCrown==sizeCrowns-1)
265 radioA2=radioA/100.0;
266 radioB2=radioB/100.0;
268 for ( iSector=0 ; iSector<sizeSectors ; iSector++ )
271 manModelContourBullEye->AddSector(radioA2,radioB2,ang,angDelta);
274 manModelContour = manModelContourBullEye;
280 manModelContour = new manualContourModelLine();
286 manModelContour = new manualBaseModel();
292 manModelContour = new manualContourModelRotationTool();
298 manModelContour = new manualContourModelPolygon();
301 return manModelContour;
305 manualBaseModel* creaContoursFactory::getContourModel(std::string typeContour)
307 manualBaseModel *manModelContour=NULL;
309 if (typeContour.compare("spline")==0)
311 manModelContour = getContourModel(1);
314 if (typeContour.compare("rectangle")==0)
316 manModelContour = getContourModel(2);
319 if (typeContour.compare("circle")==0)
321 manModelContour = getContourModel(3);
324 if (typeContour.compare("bullEye")==0)
326 manModelContour = getContourModel(4);
330 if (typeContour.compare("line")==0)
332 manModelContour = getContourModel(6);
335 if (typeContour.compare("points")==0)
337 manModelContour = getContourModel(7);
340 if (typeContour.compare("rotationTool")==0)
342 manModelContour = getContourModel(8);
345 if (typeContour.compare("polygon")==0)
347 manModelContour = getContourModel(10);
350 return manModelContour;