]> Creatis software - creaMaracasVisu.git/commitdiff
#3266 creaMaracasVisu Feature New Normal - ManualContour_Box by segments
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 4 Jul 2019 07:29:48 +0000 (09:29 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 4 Jul 2019 07:29:48 +0000 (09:29 +0200)
bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx
bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h

index 1aa1c53867598b4e53585e270f65168a9654a6fb..eee2c1958b6b44cca78c413eb5b588cceb343279 100644 (file)
@@ -263,8 +263,11 @@ void ManualContourModel_Box::Process()
                lstIndexsIn.push_back( lstInX.size() );
        }
 
-       ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
-
+       
+       if (bbGetInputDoubleContour()==1)
+       {
+               ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
+       } // DoubleContour
 
        int i,size=lstIndexsIn.size();
        int iGeneral=0;
@@ -277,93 +280,77 @@ void ManualContourModel_Box::Process()
                                                        &lstIndexsOut,bbGetInputOpenClose() );
        } // for
 
-       RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
-
-
-
-    // Second Step Transpose the vectors   
-       lstInX.clear();
-       lstInY.clear();
-       lstInZ.clear();
-       lstIndexsIn.clear();
-       size  = bbGetInputNbPoints();
-       int j,size2 = lstIndexsOut.size();
-       for (i=0;i<size;i++)
+       if (bbGetInputDoubleContour()==0)
        {
-               for (j=0;j<size2;j++)
+               //////////////////// Set Out   DoubleContour = 0
+               bbSetOutputLstContourPointsX(lstOutX);  
+               bbSetOutputLstContourPointsY(lstOutY);  
+               bbSetOutputLstContourPointsZ(lstOutZ);
+               bbSetOutputLstIndexsOut(lstIndexsOut);  
+       } else {
+               RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
+               ///////////// Second Step Transpose the vectors   
+               lstInX.clear();
+               lstInY.clear();
+               lstInZ.clear();
+               lstIndexsIn.clear();
+               size  = bbGetInputNbPoints();
+               int j,size2 = lstIndexsOut.size();
+               for (i=0;i<size;i++)
                {
-                       lstInX.push_back( lstOutX[ j*lstIndexsOut[j] + i ] );
-                       lstInY.push_back( lstOutY[ j*lstIndexsOut[j] + i ] );
-                       lstInZ.push_back( lstOutZ[ j*lstIndexsOut[j] + i ] );
-               } // for j
-               lstIndexsIn.push_back( size2 );
-       } // for i
-       lstOutX.clear();
-       lstOutY.clear();
-       lstOutZ.clear();
-       lstIndexsOut.clear();
-
-
-    // Third step Interponation 2
-       size=lstIndexsIn.size();
-       iGeneral=0;
-       for (i=0;i<size;i++)
-       {
-               ProcessBySegment(       bbGetInputType() , 
-                                                       iGeneral, lstIndexsIn[i] ,
-                                                       &lstInX,&lstInY,&lstInZ,
-                                                       &lstOutX,&lstOutY,&lstOutZ,
-                                                       &lstIndexsOut,false);
-       } // for
-
-
-       RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
-
-
-    // Second Step Transpose the vectors   
-       lstInX.clear();
-       lstInY.clear();
-       lstInZ.clear();
-       lstIndexsIn.clear();
-       size  = bbGetInputNbPoints();
-       size2 = lstIndexsOut.size();
-       for (i=0;i<size;i++)
-       {
-               for (j=0;j<size2;j++)
+                       for (j=0;j<size2;j++)
+                       {
+                               lstInX.push_back( lstOutX[ j*lstIndexsOut[j] + i ] );
+                               lstInY.push_back( lstOutY[ j*lstIndexsOut[j] + i ] );
+                               lstInZ.push_back( lstOutZ[ j*lstIndexsOut[j] + i ] );
+                       } // for j
+                       lstIndexsIn.push_back( size2 );
+               } // for i
+               lstOutX.clear();
+               lstOutY.clear();
+               lstOutZ.clear();
+               lstIndexsOut.clear();
+               ///////////////////// Third step Interponation 2
+               size=lstIndexsIn.size();
+               iGeneral=0;
+               for (i=0;i<size;i++)
                {
-                       lstInX.push_back( lstOutX[ j*lstIndexsOut[j] + i ] );
-                       lstInY.push_back( lstOutY[ j*lstIndexsOut[j] + i ] );
-                       lstInZ.push_back( lstOutZ[ j*lstIndexsOut[j] + i ] );
-               } // for j
-               lstIndexsIn.push_back( size2 );
-       } // for i
-       lstOutX.clear();
-       lstOutY.clear();
-       lstOutZ.clear();
-       lstIndexsOut.clear();
-
-       bbSetOutputLstContourPointsX(lstInX);   
-       bbSetOutputLstContourPointsY(lstInY);   
-       bbSetOutputLstContourPointsZ(lstInZ);
-       bbSetOutputLstIndexsOut(lstIndexsIn);   
-
-
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-printf("EED Warnning ..... ManualContourModel_Box::Process    Clean this ...............\n");
-
-/*
-       bbSetOutputLstContourPointsX(lstOutX);  
-       bbSetOutputLstContourPointsY(lstOutY);  
-       bbSetOutputLstContourPointsZ(lstOutZ);
-       bbSetOutputLstIndexsOut(lstIndexsOut);  
-*/
+                       ProcessBySegment(       bbGetInputType() , 
+                                                               iGeneral, lstIndexsIn[i] ,
+                                                               &lstInX,&lstInY,&lstInZ,
+                                                               &lstOutX,&lstOutY,&lstOutZ,
+                                                               &lstIndexsOut,bbGetInputOpenClose2());
+               } // for
+               RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
+               //////////////////// Forth step Transpose the vectors   
+               lstInX.clear();
+               lstInY.clear();
+               lstInZ.clear();
+               lstIndexsIn.clear();
+               size  = bbGetInputNbPoints();
+               size2 = lstIndexsOut.size();
+               for (i=0;i<size;i++)
+               {
+                       for (j=0;j<size2;j++)
+                       {
+                               lstInX.push_back( lstOutX[ j*lstIndexsOut[j] + i ] );
+                               lstInY.push_back( lstOutY[ j*lstIndexsOut[j] + i ] );
+                               lstInZ.push_back( lstOutZ[ j*lstIndexsOut[j] + i ] );
+                       } // for j
+                       lstIndexsIn.push_back( size2 );
+               } // for i
+               lstOutX.clear();
+               lstOutY.clear();
+               lstOutZ.clear();
+               lstIndexsOut.clear();
+
+               //////////////////// Set Out   DoubleContour = 1
+               bbSetOutputLstContourPointsX(lstInX);   
+               bbSetOutputLstContourPointsY(lstInY);   
+               bbSetOutputLstContourPointsZ(lstInZ);
+               bbSetOutputLstIndexsOut(lstIndexsIn);   
+
+       } // if DoubleContour 
 
 }
 //===== 
@@ -375,7 +362,9 @@ void ManualContourModel_Box::bbUserSetDefaultValues()
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
    bbSetInputType(1);
+   bbSetInputDoubleContour(0);
    bbSetInputOpenClose(false);
+   bbSetInputOpenClose2(false);
    bbSetInputNbPoints(100);
   
 }
index 4a97fe1cb21d2d762af65f79bcbbe54c8f050bab..651eb3dd09740aec4dad99b6527bed78601d339b 100644 (file)
@@ -19,7 +19,9 @@ class bbcreaMaracasVisu_EXPORT ManualContourModel_Box
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
   BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_INPUT(DoubleContour,int);
   BBTK_DECLARE_INPUT(OpenClose,bool);
+  BBTK_DECLARE_INPUT(OpenClose2,bool);
   BBTK_DECLARE_INPUT(NbPoints,int);
 
   BBTK_DECLARE_INPUT(LstIndexsIn,std::vector<int>);
@@ -28,6 +30,7 @@ class bbcreaMaracasVisu_EXPORT ManualContourModel_Box
   BBTK_DECLARE_INPUT(LstControlPointsY,std::vector<double>);
   BBTK_DECLARE_INPUT(LstControlPointsZ,std::vector<double>);
 
+
   BBTK_DECLARE_OUTPUT(LstContourPointsX,std::vector<double>);
   BBTK_DECLARE_OUTPUT(LstContourPointsY,std::vector<double>);
   BBTK_DECLARE_OUTPUT(LstContourPointsZ,std::vector<double>);
@@ -69,7 +72,9 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualContourModel_Box,bbtk::AtomicBlackBox);
   BBTK_CATEGORY("empty");
 
   BBTK_INPUT(ManualContourModel_Box,Type,"(1 default) 1=spline, 2=rectangle, 3=circle, 4=bullEye, 6=Line, 7=points, 8=rotationTool, 10=polygon, 12=Spline3D",int,"");
+  BBTK_INPUT(ManualContourModel_Box,DoubleContour,"(0 default) 0=Simple, 1=Double (This is used to construct surface, use LstIndexesIn)",int,"");
   BBTK_INPUT(ManualContourModel_Box,OpenClose,"(false default) false=open, true=close",bool,"");
+  BBTK_INPUT(ManualContourModel_Box,OpenClose2,"(false default) false=open, true=close.  Used with the DoubleContour option.",bool,"");
   BBTK_INPUT(ManualContourModel_Box,NbPoints,"(100 default) Number of points int the spline",int,"");
   BBTK_INPUT(ManualContourModel_Box,LstIndexsIn,"Lst number of points by segment",std::vector<int>,"");