creaContoursFactory.cpp
Go to the documentation of this file.00001 #include "creaContoursFactory.h"
00002
00003 creaContoursFactory::creaContoursFactory()
00004 {
00005
00006 }
00007
00008
00009 creaContoursFactory::~creaContoursFactory()
00010 {
00011
00012 }
00013
00014 manualContourBaseControler* creaContoursFactory::getContourControler(int typeContour)
00015 {
00016 manualContourBaseControler *manContourControl;
00017
00018 if (typeContour==1)
00019 {
00020 manContourControl = new manualContourControler();
00021 }
00022
00023
00024 if (typeContour==2)
00025 {
00026 manContourControl = new manualRoiControler();
00027 }
00028
00029
00030 if (typeContour==3)
00031 {
00032 manContourControl = new manualCircleControler();
00033 }
00034
00035
00036 if (typeContour==4)
00037 {
00038 manContourControl = new manualRoiControler();
00039 }
00040
00041
00042 if (typeContour==6)
00043 {
00044 manContourControl = new manualLineControler();
00045 }
00046
00047
00048 if (typeContour==7)
00049 {
00050 manContourControl = new manualContourControler();
00051 }
00052
00053
00054 if (typeContour==8)
00055 {
00056 manContourControl = new manualRotationToolControler();
00057 }
00058
00059
00060 if (typeContour==10)
00061 {
00062 manContourControl = new manualContourControler();
00063 }
00064 return manContourControl;
00065
00066
00067
00068 }
00069
00070 manualContourBaseControler* creaContoursFactory::getContourControler(std::string typeContour)
00071 {
00072 manualContourBaseControler *manContourControl;
00073 if (typeContour.compare("spline")==0)
00074 {
00075 manContourControl = getContourControler(1);
00076 }
00077
00078 if (typeContour.compare("rectangle")==0)
00079 {
00080 manContourControl = getContourControler(2);
00081 }
00082
00083 if (typeContour.compare("circle")==0)
00084 {
00085 manContourControl = getContourControler(3);
00086 }
00087
00088 if (typeContour.compare("bullEye")==0)
00089 {
00090 manContourControl = getContourControler(4);
00091 }
00092
00093 if (typeContour.compare("line")==0)
00094 {
00095 manContourControl = getContourControler(6);
00096 }
00097
00098 if (typeContour.compare("points")==0)
00099 {
00100 manContourControl = getContourControler(7);
00101 }
00102
00103 if (typeContour.compare("rotationTool")==0)
00104 {
00105 manContourControl = getContourControler(8);
00106 }
00107
00108 if (typeContour.compare("polygon")==0)
00109 {
00110 manContourControl = getContourControler(10);
00111 }
00112
00113 return manContourControl;
00114 }
00115
00116 manualViewBaseContour* creaContoursFactory::getCountourView (int typeContour)
00117 {
00118
00119 manualViewBaseContour *manViewerContour;
00120
00121 if (typeContour==1)
00122 {
00123 manViewerContour = new manualViewContour();
00124 }
00125
00126
00127 if (typeContour==2)
00128 {
00129 manViewerContour = new manualViewRoi();
00130 }
00131
00132
00133 if (typeContour==3)
00134 {
00135 manViewerContour = new manualViewCircle();
00136 }
00137
00138
00139 if (typeContour==4)
00140 {
00141 manViewerContour = new manualViewBullEye();
00142 }
00143
00144
00145 if (typeContour==6)
00146 {
00147 manViewerContour = new manualViewLine();
00148 }
00149
00150
00151 if (typeContour==7)
00152 {
00153 manViewerContour = new manualViewPoints();
00154 }
00155
00156
00157 if (typeContour==8)
00158 {
00159 manViewerContour = new manualViewRotationTool();
00160 }
00161
00162
00163 if (typeContour==10)
00164 {
00165 manViewerContour = new manualViewContour();
00166 }
00167 return manViewerContour;
00168 }
00169
00170 manualViewBaseContour* creaContoursFactory::getCountourView (std::string typeContour)
00171 {
00172
00173 manualViewBaseContour *manViewerContour;
00174
00175 if (typeContour.compare("spline")==0)
00176 {
00177 manViewerContour = getCountourView(1);
00178 }
00179
00180 if (typeContour.compare("rectangle")==0)
00181 {
00182 manViewerContour = getCountourView(2);
00183 }
00184
00185 if (typeContour.compare("circle")==0)
00186 {
00187 manViewerContour = getCountourView(3);
00188 }
00189
00190 if (typeContour.compare("bullEye")==0)
00191 {
00192 manViewerContour = getCountourView(4);
00193 }
00194
00195 if (typeContour.compare("line")==0)
00196 {
00197 manViewerContour = getCountourView(6);
00198 }
00199
00200 if (typeContour.compare("points")==0)
00201 {
00202 manViewerContour = getCountourView(7);
00203 }
00204
00205 if (typeContour.compare("rotationTool")==0)
00206 {
00207 manViewerContour = getCountourView(8);
00208 }
00209
00210 if (typeContour.compare("polygon")==0)
00211 {
00212 manViewerContour = getCountourView(10);
00213 }
00214 return manViewerContour;
00215
00216 }
00217
00218 manualBaseModel* creaContoursFactory::getContourModel(int typeContour)
00219 {
00220 manualBaseModel *manModelContour=NULL;
00221
00222
00223 if (typeContour==1)
00224 {
00225 manModelContour = new manualContourModel();
00226 }
00227
00228
00229 if (typeContour==2)
00230 {
00231 manModelContour = new manualContourModelRoi();
00232 }
00233
00234
00235 if (typeContour==3)
00236 {
00237 manModelContour = new manualContourModelCircle();
00238 }
00239
00240
00241 if(typeContour==4)
00242 {
00243
00244 manualContourModelBullEye *manModelContourBullEye = new manualContourModelBullEye();
00245
00246 int iCrown,sizeCrowns,iSector,sizeSectors;
00247 double radioA,radioB,ang,angDelta,radioA2,radioB2 ;
00248
00249 sizeCrowns = 3;
00250 radioA=33;
00251 radioB=0;
00252 angDelta= 72;
00253 for ( iCrown=0 ; iCrown<sizeCrowns ; iCrown++ )
00254 {
00255 sizeSectors = 5;
00256 radioB = radioA;
00257 if (iCrown==sizeCrowns-1)
00258 {
00259 radioA = 0;
00260 }
00261 else
00262 {
00263 radioA = radioA+33;
00264 }
00265 radioA2=radioA/100.0;
00266 radioB2=radioB/100.0;
00267 ang=0;
00268 for ( iSector=0 ; iSector<sizeSectors ; iSector++ )
00269 {
00270 ang = ang+angDelta;
00271 manModelContourBullEye->AddSector(radioA2,radioB2,ang,angDelta);
00272 }
00273 }
00274 manModelContour = manModelContourBullEye;
00275 }
00276
00277
00278 if (typeContour==6)
00279 {
00280 manModelContour = new manualContourModelLine();
00281 }
00282
00283
00284 if (typeContour==7)
00285 {
00286 manModelContour = new manualBaseModel();
00287 }
00288
00289
00290 if(typeContour==8)
00291 {
00292 manModelContour = new manualContourModelRotationTool();
00293 }
00294
00295
00296 if(typeContour==10)
00297 {
00298 manModelContour = new manualContourModelPolygon();
00299 }
00300
00301 return manModelContour;
00302 }
00303
00304
00305 manualBaseModel* creaContoursFactory::getContourModel(std::string typeContour)
00306 {
00307 manualBaseModel *manModelContour=NULL;
00308
00309 if (typeContour.compare("spline")==0)
00310 {
00311 manModelContour = getContourModel(1);
00312 }
00313
00314 if (typeContour.compare("rectangle")==0)
00315 {
00316 manModelContour = getContourModel(2);
00317 }
00318
00319 if (typeContour.compare("circle")==0)
00320 {
00321 manModelContour = getContourModel(3);
00322 }
00323
00324 if (typeContour.compare("bullEye")==0)
00325 {
00326 manModelContour = getContourModel(4);
00327
00328 }
00329
00330 if (typeContour.compare("line")==0)
00331 {
00332 manModelContour = getContourModel(6);
00333 }
00334
00335 if (typeContour.compare("points")==0)
00336 {
00337 manModelContour = getContourModel(7);
00338 }
00339
00340 if (typeContour.compare("rotationTool")==0)
00341 {
00342 manModelContour = getContourModel(8);
00343 }
00344
00345 if (typeContour.compare("polygon")==0)
00346 {
00347 manModelContour = getContourModel(10);
00348 }
00349
00350 return manModelContour;
00351 }