From: eduardo.davila@creatis.insa-lyon.fr Date: Tue, 23 Jul 2024 08:28:13 +0000 (+0200) Subject: #3561 ShowNPoints_Tools::SaveCollection X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=510e270a480ce9d475d431a945e0581d1f0ff351;p=creaMaracasVisu.git #3561 ShowNPoints_Tools::SaveCollection --- diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index f0eb286..fcca0ce 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -1096,6 +1096,16 @@ void ShowNPoints_Tools::LoadCollection() } } +void ShowNPoints_Tools::SaveCollection() +{ + WidgetShowNPoints* wsp = bbGetInputWidgetShowNPoints(); + if ((wsp!=NULL) && (bbGetInputParamsStr().size()==1)) + { + std::string filename = bbGetInputParamsStr()[0]; + wsp->OnSaveCollections_( 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) @@ -1221,6 +1231,10 @@ void ShowNPoints_Tools::Process() { LoadCollection(); } // if Type + if(bbGetInputType()==501) + { + SaveCollection(); + } // if Type } // if bbGetInputWidgetShowNPoints } //===== diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h index 580f6cc..a52ce96 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.h @@ -55,6 +55,7 @@ class bbcreaMaracasVisu_EXPORT ShowNPoints_Tools void SetMesh(); void SeparateSplines(); void LoadCollection(); + void SaveCollection(); std::vector GetProjectionPointOnAxis(double pointToProject[3], double originAxis[3], double axisDir[3]); std::vector>> GetOrderedPointsAroundPlane(std::vector planeOrigin, std::vector planeNormal, std::vector rotAxis, std::vector pX, std::vector pY, std::vector pZ); std::vector GetPlaneNormalFromPointsRefPoint(std::vector pointsX, std::vector pointsY, std::vector pointsZ, std::vector refPoint); @@ -72,7 +73,7 @@ BBTK_CATEGORY("empty"); BBTK_INPUT(ShowNPoints_Tools,WidgetShowNPoints,"WidgetShowNPoints",WidgetShowNPoints*,""); BBTK_INPUT(ShowNPoints_Tools,Spacing,"(default [1,1,1] )Spacing",std::vector,""); 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)",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 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,""); BBTK_INPUT(ShowNPoints_Tools, ParamsStr,"Optional params for the tools, required for 500:filename.xls", std::vector,""); diff --git a/bbtk/src/bbmaracasvisuShowNPoints.h b/bbtk/src/bbmaracasvisuShowNPoints.h index 96068ea..69a424b 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.h +++ b/bbtk/src/bbmaracasvisuShowNPoints.h @@ -56,9 +56,6 @@ private: ShowNPoints *mbbShowNPoints; }; - - - class /*BBTK_EXPORT*/ ShowNPoints : public bbtk::WxBlackBox