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