From: Eduardo DAVILA Date: Wed, 25 Sep 2019 13:20:21 +0000 (+0200) Subject: #3306 creaMaracasVisu Feature New Normal - Clean Code X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8d98be3be01708e837d47f63a4eb515aca1476dd;p=creaMaracasVisu.git #3306 creaMaracasVisu Feature New Normal - Clean Code --- diff --git a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx index eee2c19..9a20b5f 100644 --- a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx @@ -27,9 +27,7 @@ void ManualContourModel_Box::ProcessBySegment( creaContoursFactory f; manualContourModel *m; int i,size=iGeneral+sizeSegment; - double x,y,z; - m = (manualContourModel*)f.getContourModel( bbGetInputType() ); m->SetNumberOfPointsSpline( bbGetInputNbPoints() ); m->SetCloseContour( open ); @@ -57,24 +55,18 @@ void ManualContourModel_Box::RedistributionPoints( std::vector *lstOutX, std::vector *lstOutZ, std::vector *lstIndexsOut ) { - printf("EED Warnning! ManualContourModel_Box::RedistributionPoints Start\n"); - std::vector lstRstX; std::vector lstRstY; std::vector lstRstZ; - int iLstIndexOut,sizeLstIndexOut=lstIndexsOut->size(); int ii, iGeneral=0; int size; - for (iLstIndexOut=0; iLstIndexOut2) { @@ -89,7 +81,6 @@ void ManualContourModel_Box::RedistributionPoints( std::vector *lstOutX, dist = dist+sqrt( dx*dx + dy*dy + dz*dz ); } //for delta=dist/(size-1); - lstRstX.push_back( (*lstOutX)[iGeneral] ); lstRstY.push_back( (*lstOutY)[iGeneral] ); lstRstZ.push_back( (*lstOutZ)[iGeneral] ); @@ -129,13 +120,10 @@ void ManualContourModel_Box::RedistributionPoints( std::vector *lstOutX, dist2=dist2+distSeg; } // for k } //for i - - if (lstRstX.size()!=size) { printf("EED Warnning! ManualContourModel_Box::RedistributionPoints >> This list is not coherent iLstIndexOut=%d lstRstX.size()=%d size=%d\n",iLstIndexOut, lstRstX.size(), size); } - for (i=iGeneral; i *lstOutX, (*lstOutY)[i] = lstRstY[ii]; (*lstOutZ)[i] = lstRstZ[ii]; } // for i - } // if size>2 - iGeneral=iGeneral+size; - }// for iLstIndexOut - - printf("EED Warnning! ManualContourModel_Box::RedistributionPoints End\n"); - } @@ -167,18 +149,15 @@ void ManualContourModel_Box::ShiftValues( std::vector *lstInX, double dist,distMin; int i,iBack; double dx,dy,dz; - std::vector LstTmpX; std::vector LstTmpY; std::vector LstTmpZ; - if (sizeLstIndexIn>=2) { for (iLstIndexIn=0; iLstIndexIn *lstInX, distMin = dist; } } // for dist - - if (iBack!=0) { LstTmpX.clear(); @@ -215,7 +192,6 @@ void ManualContourModel_Box::ShiftValues( std::vector *lstInX, (*lstInZ)[iGeneral+size+i] = LstTmpZ[i]; } // for i } - iGeneral=iGeneral+size; } // for iLstIndexIn } // sizeLstIndexIn @@ -240,35 +216,28 @@ void ManualContourModel_Box::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < lstInX=bbGetInputLstControlPointsX(); std::vector lstInY=bbGetInputLstControlPointsY(); std::vector lstInZ=bbGetInputLstControlPointsZ(); - if ( (lstInX.size()!=lstInY.size()) || (lstInY.size()!=lstInZ.size()) ) { printf("Warnning !! .. ManualContourModel_Box: The list X Y Z, no have the same number of elements \n"); return; } - std::vector lstIndexsIn=bbGetInputLstIndexsIn(); std::vector lstIndexsOut; std::vector lstOutX; std::vector lstOutY; std::vector lstOutZ; - if (bbGetInputLstIndexsIn().size()==0) { lstIndexsIn.push_back( lstInX.size() ); } - - if (bbGetInputDoubleContour()==1) { ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn ); } // DoubleContour - int i,size=lstIndexsIn.size(); int iGeneral=0; for (i=0;i