]> Creatis software - creaMaracasVisu.git/commitdiff
#3581 Options ShowNPoint tools vtk9itk5wx3-macos
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sun, 3 Aug 2025 13:36:36 +0000 (15:36 +0200)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sun, 3 Aug 2025 13:36:36 +0000 (15:36 +0200)
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h

index fcca0cea5e80b5c1c252d341ba21e8ab1ecc4a3c..cf789b82edecb0a0b5067fa83e23640343c2e22a 100644 (file)
@@ -1151,6 +1151,16 @@ void ShowNPoints_Tools::Process()
         {
             bbGetInputWidgetShowNPoints()->OnSetPoint_();
         } // if Type
+        if (bbGetInputType()==35)
+        {
+            printf("EED ShowNPoints_Tools::Process 35  size %d", bbGetInputParamsStr().size() );
+            if (bbGetInputParamsStr().size()==1)
+            {
+               printf("EED ShowNPoints_Tools::Process 35  s:>%s<", bbGetInputParamsStr()[1].c_str() );
+               std::string label = bbGetInputParamsStr()[1];
+               bbGetInputWidgetShowNPoints()->OnRenamePoint_( label );
+            }
+        } // if Type
         if (bbGetInputType()==40)
         {
             bbGetInputWidgetShowNPoints()->OnErasePoint_();
index a52ce964b93314f0850bddd05728767980dee2f1..72c1c8c7023986112ce622a7edb67bf4add05af9 100644 (file)
@@ -73,9 +73,9 @@ 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,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   501:Save collection (ParamStr filenaname.xls)",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  35:Set Label to actual 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   501:Save 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, ParamsStr,"Optional params for the tools, required for 500:filename.xls", std::vector<std::string>,"");
+BBTK_INPUT(ShowNPoints_Tools, ParamsStr,"Optional params for the tools, required for 35:New Label  500:filename.xls", std::vector<std::string>,"");
 
   BBTK_OUTPUT(ShowNPoints_Tools, Out, "Output", std::vector<double>, "");
 //  BBTK_OUTPUT(ShowNPoints_Tools,Out,"First output",double,"");
index 40d7ec02adb4f719c6eb5252b32c99a8ec45df84..b326037984ac4f29c9f46861a4f00e839d091c8a 100644 (file)
@@ -1108,21 +1108,27 @@ void WidgetShowNPoints::StopTrackPoint( )
 }
 
 //------------------------------------------------------------------------
-       void WidgetShowNPoints::OnRenamePoint(wxCommandEvent& event)
-       {
-               int id = GetModelShowNPoints()->RenamePoint( (const char*) ( textCtrl->GetValue().mb_str() ) );
-               if (id>=0)
-               {
+    void WidgetShowNPoints::OnRenamePoint_(std::string label)
+    {
+        int id = GetModelShowNPoints()->RenamePoint( label );
+        if (id>=0)
+        {
             // EED 2022-05-19
-                       //lstActorsText[id]->SetInput(  (const char*) ( textCtrl->GetValue().mb_str() ) );
-                       //renderer->GetRenderWindow()->Render();
+            //lstActorsText[id]->SetInput(  (const char*) ( textCtrl->GetValue().mb_str() ) );
+            //renderer->GetRenderWindow()->Render();
             UndoRedo_SaveCollection(); //A
-            GetViewShowNPoints()->lstActorsText[id]->SetInput(  (const char*) ( textCtrl->GetValue().mb_str() ) );
+            GetViewShowNPoints()->lstActorsText[id]->SetInput(  label.c_str() );
             GetViewShowNPoints()->Render();
             SetOutputBox();
             UndoRedo_SaveCollection(); //B
-               } // if id
-       }
+        } // if id
+    }
+
+//------------------------------------------------------------------------
+    void WidgetShowNPoints::OnRenamePoint(wxCommandEvent& event)
+    {
+        OnRenamePoint_( (const char*) ( textCtrl->GetValue().mb_str() ) );
+    }
 
 //------------------------------------------------------------------------
        bool WidgetShowNPoints::ErasePoint(int id)
index 79c111a595890a5ee341594d86679358abb547fb..251130fff8baf14afc1495473baab52a30c23da1 100644 (file)
@@ -42,6 +42,7 @@ class WidgetShowNPoints : public wxPanel
       void StopTrackPoint();
       void DetectCollectionActive();
 
+      void OnRenamePoint_(std::string label);
          void OnRenamePoint(wxCommandEvent& event);
       void OnErasePoint_();
          void OnErasePoint(wxCommandEvent& event);