]> Creatis software - creaMaracasVisu.git/commitdiff
#3558 ShowNPoints_Tools::LoadCollection vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 29 May 2024 08:37:12 +0000 (10:37 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Wed, 29 May 2024 08:37:12 +0000 (10:37 +0200)
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h

index fb3a57ff4d4bbd2133e626af984f541d21c5e591..f0eb286efc5c17116cb8308038c225492190662b 100644 (file)
@@ -1086,6 +1086,16 @@ std::vector<double> ShowNPoints_Tools::GetProjectionPointOnAxis(double pointToPr
        return result;
 }
 
        return result;
 }
 
+void ShowNPoints_Tools::LoadCollection()
+{
+    WidgetShowNPoints* wsp = bbGetInputWidgetShowNPoints();
+    if ((wsp!=NULL) && (bbGetInputParamsStr().size()==1))
+    {
+        std::string filename = bbGetInputParamsStr()[0];
+        wsp->OnLoadCollections_( filename );
+    }
+}
+
 
 //=====
 // 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)
 
 //=====
 // 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)
@@ -1107,7 +1117,7 @@ void ShowNPoints_Tools::Process()
 
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
 
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
+    
     if (bbGetInputWidgetShowNPoints()!=NULL)
     {
         if (bbGetInputType()==1)
     if (bbGetInputWidgetShowNPoints()!=NULL)
     {
         if (bbGetInputType()==1)
@@ -1207,6 +1217,10 @@ void ShowNPoints_Tools::Process()
         {
                SeparateSplines();
         } // if Type
         {
                SeparateSplines();
         } // if Type
+        if(bbGetInputType()==500)
+        {
+            LoadCollection();
+        } // if Type
     } // if bbGetInputWidgetShowNPoints
 }
 //===== 
     } // if bbGetInputWidgetShowNPoints
 }
 //===== 
index b521f6b88c8bc83ed6fceb6ab3b4630b84e90589..580f6cce322b64f6d21b051eb24a861d879c869b 100644 (file)
@@ -31,6 +31,7 @@ class bbcreaMaracasVisu_EXPORT ShowNPoints_Tools
     BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
     BBTK_DECLARE_INPUT(Type,int);
     BBTK_DECLARE_INPUT(Params, std::vector<double>);
     BBTK_DECLARE_INPUT(Mesh,vtkPolyData*);
     BBTK_DECLARE_INPUT(Type,int);
     BBTK_DECLARE_INPUT(Params, std::vector<double>);
+    BBTK_DECLARE_INPUT(ParamsStr, std::vector<std::string>);
     BBTK_DECLARE_OUTPUT(Out, std::vector<double>);
 //  BBTK_DECLARE_OUTPUT(Out,double);
   BBTK_PROCESS(Process);
     BBTK_DECLARE_OUTPUT(Out, std::vector<double>);
 //  BBTK_DECLARE_OUTPUT(Out,double);
   BBTK_PROCESS(Process);
@@ -53,6 +54,7 @@ class bbcreaMaracasVisu_EXPORT ShowNPoints_Tools
     void JoinPoints();
     void SetMesh();
     void SeparateSplines();
     void JoinPoints();
     void SetMesh();
     void SeparateSplines();
+    void LoadCollection();
     std::vector<double> GetProjectionPointOnAxis(double pointToProject[3], double originAxis[3], double axisDir[3]);
     std::vector<std::vector<std::vector<double>>> GetOrderedPointsAroundPlane(std::vector<double> planeOrigin, std::vector<double> planeNormal,  std::vector<double> rotAxis, std::vector<double> pX, std::vector<double> pY, std::vector<double> pZ);
     std::vector<double> GetPlaneNormalFromPointsRefPoint(std::vector<double> pointsX, std::vector<double> pointsY, std::vector<double> pointsZ, std::vector<double> refPoint);
     std::vector<double> GetProjectionPointOnAxis(double pointToProject[3], double originAxis[3], double axisDir[3]);
     std::vector<std::vector<std::vector<double>>> GetOrderedPointsAroundPlane(std::vector<double> planeOrigin, std::vector<double> planeNormal,  std::vector<double> rotAxis, std::vector<double> pX, std::vector<double> pY, std::vector<double> pZ);
     std::vector<double> GetPlaneNormalFromPointsRefPoint(std::vector<double> pointsX, std::vector<double> pointsY, std::vector<double> pointsZ, std::vector<double> refPoint);
@@ -70,9 +72,10 @@ BBTK_CATEGORY("empty");
   BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,"");
   BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector<double>,"");
   BBTK_INPUT(ShowNPoints_Tools,Mesh,"Mesh en format vtkPolyData ",vtkPolyData*,"");
   BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,"");
   BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector<double>,"");
   BBTK_INPUT(ShowNPoints_Tools,Mesh,"Mesh en format vtkPolyData ",vtkPolyData*,"");
-  BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add poits   5:Add Point  10:Insert Point  20:TrackPoint  30:Set nearest point  40:Erase point  50:Deleta all points  100:Insert  group after   110:Delete group  120:Reset colletion  200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points)   205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points)   210: Invert points   220: Move patch center (param is the step ex [-1] or [1])      230: Move point in normal of surface (Params [-1] or [1])       235: ChangeCurrentPoint (Params [-1] or [1])  240: Join all start-end points to the start-end points on selected spline  250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2)   300: Create expanded surface   310: Create wide expanded surface     320: Expand Surface,   330: Widen surface,   340: Expand patch,   400: Separate and Order Splines given a rotation origin",int,"");
+  BBTK_INPUT(ShowNPoints_Tools,Type,"(default 0) 0:Nothing 1:Auto add poits   5:Add Point  10:Insert Point  20:TrackPoint  30:Set nearest point  40:Erase point  50:Deleta all points  100:Insert  group after   110:Delete group  120:Reset collection  200:Tool 3 or 4 points to patch surface - Create Mesh (based on 1 group and 3 or 4 points)   205:Tool 3 or 4 points to volume surface - Create Mesh (based on 1 group and 3 or 4 points)   210: Invert points  220: Move patch center (param is the step ex [-1] or [1])      230: Move point in normal of surface (Params [-1] or [1])       235: ChangeCurrentPoint (Params [-1] or [1])  240: Join all start-end points to the start-end points on selected spline  250: Set Mesh SPC (Params: [0]:Patch [1]:CloseSpline1 [2]:CloseSpline2)   300: Create expanded surface   310: Create wide expanded surface     320: Expand Surface,   330: Widen surface,   340: Expand patch,   400: Separate and Order Splines given a rotation origin,   500:Load collection (ParamStr filenaname.xls)",int,"");
   BBTK_INPUT(ShowNPoints_Tools, Params,"Optional params for the tools, required for 200: normal and direction, 320: centroid and direction, 330: normal and direction, 340: centroid and direction,    400: reference point", std::vector<double>,"");
   BBTK_INPUT(ShowNPoints_Tools, Params,"Optional params for the tools, required for 200: normal and direction, 320: centroid and direction, 330: normal and direction, 340: centroid and direction,    400: reference point", std::vector<double>,"");
-  
+BBTK_INPUT(ShowNPoints_Tools, ParamsStr,"Optional params for the tools, required for 500:filename.xls", std::vector<std::string>,"");
+
   BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
 //  BBTK_OUTPUT(ShowNPoints_Tools,Out,"First output",double,"");
 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints_Tools);
   BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
 //  BBTK_OUTPUT(ShowNPoints_Tools,Out,"First output",double,"");
 BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints_Tools);