X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbcreaMaracasVisuManualContourModel_Box.cxx;h=8ad078e6d20b6ae2669f8a5a6975edc9ae60e0da;hb=4b2a99534d79424c7892e09160a1488604741064;hp=9a20b5f9946f5446ed7decb03e0cee07424f6f44;hpb=8d98be3be01708e837d47f63a4eb515aca1476dd;p=creaMaracasVisu.git diff --git a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx index 9a20b5f..8ad078e 100644 --- a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx @@ -137,6 +137,107 @@ void ManualContourModel_Box::RedistributionPoints( std::vector *lstOutX, } +void ManualContourModel_Box::ClockwisePoints( std::vector *lstInX, + std::vector *lstInY, + std::vector *lstInZ, + std::vector *lstIndexsIn ) +{ + int iLstIndexIn,sizeLstIndexIn=lstIndexsIn->size(); + int i,iGeneral=0; + int size,size2; + double cx,cy,cz; + double px,py,pz; + double backpx,backpy,backpz; + double ang; + char dir=-1; + bool dirx,diry,dirz; + int flagAng=0; + float backang; + double tmp; + + // For each contour + for (iLstIndexIn=0; iLstIndexIn2) // for contour with more than 2 points + { + cx = 0; + cy = 0; + cz = 0; + dirx = true; + diry = true; + dirz = true; + for ( i=0 ; i0) + { + if (backang2 + iGeneral = iGeneral+size; + } // for iLstIndexIn +} void ManualContourModel_Box::ShiftValues( std::vector *lstInX, std::vector *lstInY, @@ -236,6 +337,7 @@ void ManualContourModel_Box::Process() } if (bbGetInputDoubleContour()==1) { + ClockwisePoints( &lstInX , &lstInY , &lstInZ , &lstIndexsIn ); ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn ); } // DoubleContour int i,size=lstIndexsIn.size();