From 454355ad3087e8ece3bec1080ccd108f9979d1ef Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 26 Jul 2023 08:32:21 +0200 Subject: [PATCH] #3525 ShowNPoints Actual Visu collection option --- bbtk/bbs/boxes/Mesh_Application.bbg | 2 +- bbtk/bbs/boxes/Mesh_Application.bbs | 2 +- bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg | 138 +++++++++--------- bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs | 22 +-- .../src/bbcreaMaracasVisuTransformWidget2.cxx | 66 ++++----- bbtk/src/bbmaracasvisuShowNPoints.cxx | 13 +- bbtk/src/bbmaracasvisuShowNPoints.h | 55 +++---- .../wxWindows/widgets/WidgetShowNPoints.cxx | 50 +++---- .../wxWindows/widgets/WidgetShowNPoints.h | 30 ++-- 9 files changed, 190 insertions(+), 188 deletions(-) diff --git a/bbtk/bbs/boxes/Mesh_Application.bbg b/bbtk/bbs/boxes/Mesh_Application.bbg index 8c28d3e..3ffc1f5 100644 --- a/bbtk/bbs/boxes/Mesh_Application.bbg +++ b/bbtk/bbs/boxes/Mesh_Application.bbg @@ -103,7 +103,7 @@ ISEXEC:FALSE -96.149542:-151.649281:-900.000000 -73.389542:-154.149281:-900.000000 PORT -Proportion:"2" +Proportion:"20" FIN_BOX BOX wx:LayoutTab:Box12 diff --git a/bbtk/bbs/boxes/Mesh_Application.bbs b/bbtk/bbs/boxes/Mesh_Application.bbs index 59519ca..e4946d2 100644 --- a/bbtk/bbs/boxes/Mesh_Application.bbs +++ b/bbtk/bbs/boxes/Mesh_Application.bbs @@ -31,7 +31,7 @@ new creaMaracasVisu:Mesh_tool_ApplySurface Box10 set Box10.title "Surface" new wx:LayoutSplit Box11 - set Box11.Proportion "2" + set Box11.Proportion "20" new wx:LayoutTab Box12 diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg index 7079b3a..ea62e01 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.5 BBG BlackBox Diagram file -# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg # ---------------------------------- APP_START @@ -17,7 +17,7 @@ widget FIN_COMPLEX_PORT COMPLEX_PORT ExportIsActive_concatstring_tool --550.600502:-76.318417:-900.000000 +-490.632709:-167.862172:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:9 COMPLEX_PORT @@ -56,7 +56,7 @@ COMPLEX_PORT meshmanagermodel -131.800179:136.578564:-900.000000 FIN_COMPLEX_PORT -BOXES:98 +BOXES:97 BOX wx:LayoutLine:Box08 ISEXEC:FALSE @@ -228,8 +228,8 @@ FIN_BOX BOX creaVtk:MeshDeformation:Box39 ISEXEC:FALSE --409.619944:-79.385524:-900.000000 --387.274944:-81.885524:-900.000000 +-409.372374:-78.395244:-900.000000 +-387.027374:-80.895244:-900.000000 PORT TypeIn:"1" FIN_BOX @@ -262,8 +262,8 @@ FIN_BOX BOX creaVtk:PlaneWidget:Box58 ISEXEC:FALSE --297.212617:-23.918602:-900.000000 --275.367617:-26.418602:-900.000000 +-298.092499:-17.627995:-900.000000 +-276.247499:-20.127995:-900.000000 PORT ReactiveType:"1" PORT @@ -274,8 +274,8 @@ FIN_BOX BOX std:MultipleInputs:Box59 ISEXEC:FALSE --310.679685:15.680840:-900.000000 --288.709685:13.180840:-900.000000 +-301.160040:-7.351237:-900.000000 +-279.190040:-9.851237:-900.000000 FIN_BOX BOX wx:CommandButton:Box53 @@ -304,8 +304,8 @@ FIN_BOX BOX creaVtk:PlaneWidget_Base:Box57 ISEXEC:FALSE --363.831600:-51.704534:-900.000000 --341.421600:-54.204534:-900.000000 +-361.309840:-52.334974:-900.000000 +-338.899840:-54.834974:-900.000000 PORT Param:"-1" PORT @@ -314,8 +314,8 @@ FIN_BOX BOX creaVtk:PlaneWidget_Base:Box60 ISEXEC:FALSE --335.517560:-51.686120:-900.000000 --313.107560:-54.186120:-900.000000 +-334.046533:-52.736853:-900.000000 +-311.636533:-55.236853:-900.000000 PORT Param:"1" PORT @@ -324,8 +324,8 @@ FIN_BOX BOX std:MultipleInputs:Box61 ISEXEC:FALSE --388.881212:-40.132206:-900.000000 --366.911212:-42.632206:-900.000000 +-385.749451:-39.723715:-900.000000 +-363.779451:-42.223715:-900.000000 FIN_BOX BOX creaVtk:MeshManager:Box62 @@ -400,8 +400,8 @@ FIN_BOX BOX creaMaracasVisu:SetPosition:Box89 ISEXEC:FALSE --280.871840:-68.898121:-900.000000 --259.211840:-71.398121:-900.000000 +-283.590345:-73.428963:-900.000000 +-261.930345:-75.928963:-900.000000 PORT Active:"false" FIN_BOX @@ -432,44 +432,44 @@ FIN_BOX BOX std:ConcatStrings_tool:Box94 ISEXEC:FALSE --216.694761:-7.885064:-900.000000 --194.254761:-10.385064:-900.000000 +-216.818546:-8.875344:-900.000000 +-194.378546:-11.375344:-900.000000 PORT Type:"1" FIN_BOX BOX std:ConcatStrings:Box95 ISEXEC:FALSE --206.264131:11.029955:-900.000000 --183.504131:8.529955:-900.000000 +-214.864715:12.373023:-900.000000 +-192.104715:9.873023:-900.000000 FIN_BOX BOX std:ConcatStrings_tool:Box97 ISEXEC:FALSE --191.577457:-29.432312:-900.000000 --169.137457:-31.932312:-900.000000 +-194.573055:-24.190016:-900.000000 +-172.133055:-26.690016:-900.000000 PORT Type:"1" FIN_BOX BOX std:ConcatStrings:Box98 ISEXEC:FALSE --176.876738:24.951051:-900.000000 --154.116738:22.451051:-900.000000 +-190.493092:14.305538:-900.000000 +-167.733092:11.805538:-900.000000 FIN_BOX BOX std:ConcatStrings_tool:Box99 ISEXEC:FALSE --213.431372:-20.340330:-900.000000 --190.991372:-22.840330:-900.000000 +-219.797636:-14.392459:-900.000000 +-197.357636:-16.892459:-900.000000 PORT Type:"1" FIN_BOX BOX std:ConcatStrings_tool:Box100 ISEXEC:FALSE --183.825982:-13.921355:-900.000000 --161.275982:-16.421355:-900.000000 +-183.676202:-13.771575:-900.000000 +-161.126202:-16.271575:-900.000000 PORT Type:"1" FIN_BOX @@ -596,8 +596,8 @@ FIN_BOX BOX std:ConcatStrings_tool:Box116 ISEXEC:FALSE --202.680134:-3.848758:-900.000000 --180.130134:-6.348758:-900.000000 +-208.439852:-1.979604:-900.000000 +-185.889852:-4.479604:-900.000000 PORT Type:"1" FIN_BOX @@ -636,8 +636,8 @@ FIN_BOX BOX itkvtk:GeodesicMeshDeformation:Box122 ISEXEC:FALSE --424.104555:-56.428783:-900.000000 --400.689555:-58.928783:-900.000000 +-422.007694:-58.443600:-900.000000 +-398.592694:-60.943600:-900.000000 PORT TypeIn:"1" FIN_BOX @@ -740,8 +740,8 @@ FIN_BOX BOX creaVtk:MeshManager_tool:Box137 ISEXEC:FALSE --483.739977:-50.316487:-900.000000 --461.129977:-52.816487:-900.000000 +-482.873482:-50.564057:-900.000000 +-460.263482:-53.064057:-900.000000 PORT BoxProcessMode:"Manual" PORT @@ -760,28 +760,28 @@ FIN_BOX BOX creaMaracasVisu:SetPosition:Box142 ISEXEC:FALSE --486.165273:-86.007669:-900.000000 --464.395273:-88.507669:-900.000000 +-467.892126:-121.805063:-900.000000 +-446.122126:-124.305063:-900.000000 FIN_BOX BOX creaMaracasVisu:SetPosition:Box143 ISEXEC:FALSE --458.925237:-86.103993:-900.000000 --437.155237:-88.603993:-900.000000 +-424.237483:-120.561026:-900.000000 +-402.467483:-123.061026:-900.000000 FIN_BOX BOX std:MathOperationVector:Box144 ISEXEC:FALSE --453.769576:-74.337147:-900.000000 --429.249576:-76.837147:-900.000000 +-443.371633:-73.718222:-900.000000 +-418.851633:-76.218222:-900.000000 PORT Type:"3" FIN_BOX BOX std:MathOperationVector:Box145 ISEXEC:FALSE --482.408042:-69.518814:-900.000000 --457.888042:-72.018814:-900.000000 +-475.847435:-73.727505:-900.000000 +-451.327435:-76.227505:-900.000000 PORT Type:"3" FIN_BOX @@ -794,26 +794,20 @@ FIN_BOX BOX creaVtk:PlaneWidget_Base:Box154 ISEXEC:FALSE --534.858110:-91.209728:-900.000000 --512.338110:-93.709728:-900.000000 +-460.584699:-132.025714:-900.000000 +-438.064699:-134.525714:-900.000000 PORT -Type:"2" -FIN_BOX -BOX -std:MultipleInputs:Box150 -ISEXEC:FALSE --513.551344:-104.677172:-900.000000 --491.471344:-107.177172:-900.000000 +Type:"3" FIN_BOX BOX creaVtk:PlaneWidget_Base:Box151 ISEXEC:FALSE --512.258536:-92.741365:-900.000000 --489.738536:-95.241365:-900.000000 +-431.925229:-141.181205:-900.000000 +-409.405229:-143.681205:-900.000000 PORT Type:"3" FIN_BOX -CONNECTIONS:185 +CONNECTIONS:187 CONNECTION Box08:Widget:widget:widget NumberOfControlPoints:0 @@ -1328,12 +1322,6 @@ CONNECTION Box122:Out:Box134:DoubleParams NumberOfControlPoints:0 CONNECTION -Box138:BoxChange:Box143:BoxExecute -NumberOfControlPoints:0 -CONNECTION -Box96:wxVtkBaseView:Box143:wxVtkBaseView -NumberOfControlPoints:0 -CONNECTION Box96:wxVtkBaseView:Box142:wxVtkBaseView NumberOfControlPoints:0 CONNECTION @@ -1343,9 +1331,6 @@ CONNECTION Box83:Spacing:Box144:In1 NumberOfControlPoints:0 CONNECTION -Box144:Out:Box143:Point -NumberOfControlPoints:0 -CONNECTION Box137:Out:Box145:In0 NumberOfControlPoints:0 CONNECTION @@ -1355,18 +1340,33 @@ CONNECTION Box145:Out:Box142:Point NumberOfControlPoints:0 CONNECTION -Box154:BoxChange:Box150:In1 +Box96:wxVtkBaseView:Box143:wxVtkBaseView NumberOfControlPoints:0 CONNECTION -Box148:Normal:Box154:ParamVector +Box137:BoxChange:Box142:BoxExecute NumberOfControlPoints:0 CONNECTION -Box151:BoxChange:Box150:In3 +Box138:BoxChange:Box143:BoxExecute NumberOfControlPoints:0 CONNECTION -Box148:PointOut:Box151:ParamVector +Box58:Base:Box151:In NumberOfControlPoints:0 CONNECTION -Box137:BoxChange:Box142:BoxExecute +Box58:Base:Box154:In +NumberOfControlPoints:0 +CONNECTION +Box142:BoxChange:Box154:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box143:BoxChange:Box151:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box144:Out:Box143:Point +NumberOfControlPoints:0 +CONNECTION +Box137:Out:Box154:ParamVector +NumberOfControlPoints:0 +CONNECTION +Box138:Out:Box151:ParamVector NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs index da33e19..0dab6aa 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box) -# - /home/garzon/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs # ---------------------------------- include std @@ -292,9 +292,7 @@ new std:MathOperationVector Box145 new creaVtk:PointPickerNearest Box148 new creaVtk:PlaneWidget_Base Box154 - set Box154.Type "2" - -new std:MultipleInputs Box150 + set Box154.Type "3" new creaVtk:PlaneWidget_Base Box151 set Box151.Type "3" @@ -460,20 +458,22 @@ connect Box95.Out Box58.Origin connect Box58.BoxChange Box61.In2 connect Box58.BoxChange Box89.BoxExecute connect Box122.Out Box134.DoubleParams -connect Box138.BoxChange Box143.BoxExecute -connect Box96.wxVtkBaseView Box143.wxVtkBaseView connect Box96.wxVtkBaseView Box142.wxVtkBaseView connect Box138.Out Box144.In0 connect Box83.Spacing Box144.In1 -connect Box144.Out Box143.Point connect Box137.Out Box145.In0 connect Box83.Spacing Box145.In1 connect Box145.Out Box142.Point -connect Box154.BoxChange Box150.In1 -connect Box148.Normal Box154.ParamVector -connect Box151.BoxChange Box150.In3 -connect Box148.PointOut Box151.ParamVector +connect Box96.wxVtkBaseView Box143.wxVtkBaseView connect Box137.BoxChange Box142.BoxExecute +connect Box138.BoxChange Box143.BoxExecute +connect Box58.Base Box151.In +connect Box58.Base Box154.In +connect Box142.BoxChange Box154.BoxExecute +connect Box143.BoxChange Box151.BoxExecute +connect Box144.Out Box143.Point +connect Box137.Out Box154.ParamVector +connect Box138.Out Box151.ParamVector # Complex input ports input mesh Box67.In " " diff --git a/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx b/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx index 9b7262c..aed6670 100644 --- a/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx +++ b/bbtk/src/bbcreaMaracasVisuTransformWidget2.cxx @@ -89,20 +89,20 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare { sizeSliderWidget.Set(25,25); sizeButton.Set( 45 , -1 ); - mSliderRotationX = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); - mSliderRotationY = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); - mSliderRotationZ = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); - wxButton *mBtnSetPoint = new wxButton( this, -1, _T("Set Point") , wxDefaultPosition, sizeButton ); - Connect(mBtnSetPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSetPoint ); - Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseX ); - Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackX ); - Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackX ); - Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseY ); - Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackY ); - Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackY ); - Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseZ ); - Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackZ ); - Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackZ ); + mSliderRotationX = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); + mSliderRotationY = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); + mSliderRotationZ = new wxSlider( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget, wxSL_HORIZONTAL, wxDefaultValidator ); + wxButton *mBtnSetPoint = new wxButton( this, -1, _T("Set Point") , wxDefaultPosition, sizeButton ); + Connect(mBtnSetPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSetPoint ); + Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseX); + Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackX ); + Connect( mSliderRotationX->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackX ); + Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseY); + Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackY ); + Connect( mSliderRotationY->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackY ); + Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderReleaseZ); + Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackZ ); + Connect( mSliderRotationZ->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderTrackZ ); wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add( mSliderRotationX , 1 ); sizer->Add( mSliderRotationY , 1 ); @@ -115,26 +115,26 @@ TransformWidgetPanel::TransformWidgetPanel(TransformWidget2* box, wxWindow *pare { sizeSliderWidget.Set(250,-1 ); sizeButton.Set( 45 , -1 ); - wxRadioButton *rBtnX = new wxRadioButton( this, -1, _T("ri") , wxDefaultPosition, wxDefaultSize, wxRB_GROUP); - wxRadioButton *rBtnY = new wxRadioButton( this, -1, _T("rj") , wxDefaultPosition, wxDefaultSize, 0); - wxRadioButton *rBtnZ = new wxRadioButton( this, -1, _T("rk") , wxDefaultPosition, wxDefaultSize, 0); - wxRadioButton *rBtnC = new wxRadioButton( this, -1, _T("Center") , wxDefaultPosition, wxDefaultSize, 0); + wxRadioButton *rBtnX = new wxRadioButton( this, -1, _T("ri") , wxDefaultPosition , wxDefaultSize , wxRB_GROUP); + wxRadioButton *rBtnY = new wxRadioButton( this, -1, _T("rj") , wxDefaultPosition , wxDefaultSize , 0); + wxRadioButton *rBtnZ = new wxRadioButton( this, -1, _T("rk") , wxDefaultPosition , wxDefaultSize , 0); + wxRadioButton *rBtnC = new wxRadioButton( this, -1, _T("Cen") , wxDefaultPosition , wxDefaultSize , 0); rBtnC->SetValue(true); mTool = 3; - mSliderGeneral = new wxSlider ( this, -1, 0 , -180, 180, wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator ); - cbLocalReference = new wxCheckBox ( this,-1, _T("Loc Ref"), wxDefaultPosition,wxDefaultSize ,wxCHK_2STATE | wxALIGN_RIGHT ); - wxButton *mBtnMoveDown = new wxButton ( this, -1, _T("-") , wxDefaultPosition, sizeButton ); - wxButton *mBtnMoveUp = new wxButton ( this, -1, _T("+") , wxDefaultPosition, sizeButton ); - wxButton *mBtnReset = new wxButton ( this, -1, _T("Reset") , wxDefaultPosition, sizeButton ); - Connect( rBtnX->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX ); - Connect( rBtnY->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY ); - Connect( rBtnZ->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ ); - Connect( rBtnC->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN ); - Connect(mBtnReset->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset ); - Connect(mBtnMoveDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown ); - Connect(mBtnMoveUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); - Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); + mSliderGeneral = new wxSlider ( this, -1, 0 , -180, 180 , wxDefaultPosition,sizeSliderWidget ,wxSL_HORIZONTAL, wxDefaultValidator ); + cbLocalReference = new wxCheckBox ( this,-1, _T("Loc Ref") , wxDefaultPosition,wxDefaultSize ,wxCHK_2STATE | wxALIGN_RIGHT ); + wxButton *mBtnMoveDown = new wxButton ( this, -1, _T("-") , wxDefaultPosition, sizeButton ); + wxButton *mBtnMoveUp = new wxButton ( this, -1, _T("+") , wxDefaultPosition, sizeButton ); + wxButton *mBtnReset = new wxButton ( this, -1, _T("Reset") , wxDefaultPosition, sizeButton ); + Connect( rBtnX->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonX ); + Connect( rBtnY->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonY ); + Connect( rBtnZ->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonZ ); + Connect( rBtnC->GetId() , wxEVT_COMMAND_RADIOBUTTON_SELECTED , (wxObjectEventFunction)(void (wxPanel::*)(wxEvent&)) &TransformWidgetPanel::OnRadioButtonN ); + Connect(mBtnReset->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnReset ); + Connect(mBtnMoveDown->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveDown ); + Connect(mBtnMoveUp->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnMoveUp ); + Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBRELEASE , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralRelease ); + Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_THUMBTRACK , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); + Connect( mSliderGeneral->GetId(), wxEVT_SCROLL_CHANGED , (wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &TransformWidgetPanel::OnSliderGeneralTrack ); wxBoxSizer *sizerA = new wxBoxSizer(wxHORIZONTAL); sizerA->Add( rBtnC , 1 ); diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index b9a032a..4d879e6 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -79,6 +79,7 @@ void WidgetShowNPointsBox::SetOutputBox() mbbShowNPoints->bbSetOutputlstPointsZ( GetLstPointsZ() ); mbbShowNPoints->bbSetOutputlstLabels( GetLstLabels() ); mbbShowNPoints->bbSetOutputlstIndexs( GetLstIndexs() ); + mbbShowNPoints->bbSetOutputlstSelectedIndexs( GetLstSelectedIndexs() ); // mbbShowNPoints->bbSetOutputlstPointsX( GetModelShowNPoints()->GetLstPointsX() ); // mbbShowNPoints->bbSetOutputlstPointsY( GetModelShowNPoints()->GetLstPointsY() ); // mbbShowNPoints->bbSetOutputlstPointsZ( GetModelShowNPoints()->GetLstPointsZ() ); @@ -110,7 +111,6 @@ void ShowNPoints::Process() mwxwidget->SetColour( bbGetInputColour() ); // mwxwidget->SetOpacity( bbGetInputOpacity() ); mwxwidget->SetRadio( bbGetInputRadio() ); - if ( backOpacity!=bbGetInputOpacity() ) { backOpacity = bbGetInputOpacity(); @@ -133,11 +133,12 @@ void ShowNPoints::Process() mwxwidget->AutoAddPoints(); mwxwidget->TrackingPoint(); - bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() ); - bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() ); - bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() ); - bbSetOutputlstLabels( mwxwidget->GetLstLabels() ); - bbSetOutputlstIndexs( mwxwidget->GetLstIndexs() ); + bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() ); + bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() ); + bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() ); + bbSetOutputlstLabels( mwxwidget->GetLstLabels() ); + bbSetOutputlstIndexs( mwxwidget->GetLstIndexs() ); + bbSetOutputlstSelectedIndexs( mwxwidget->GetLstSelectedIndexs() ); // bbSetOutputlstPointsX( mwxwidget->GetModelShowNPoints()->GetLstPointsX() ); // bbSetOutputlstPointsY( mwxwidget->GetModelShowNPoints()->GetLstPointsY() ); // bbSetOutputlstPointsZ( mwxwidget->GetModelShowNPoints()->GetLstPointsZ() ); diff --git a/bbtk/src/bbmaracasvisuShowNPoints.h b/bbtk/src/bbmaracasvisuShowNPoints.h index 71eb59a..96068ea 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.h +++ b/bbtk/src/bbmaracasvisuShowNPoints.h @@ -64,35 +64,35 @@ class /*BBTK_EXPORT*/ ShowNPoints public bbtk::WxBlackBox { BBTK_BLACK_BOX_INTERFACE(ShowNPoints,bbtk::WxBlackBox); - BBTK_DECLARE_INPUT(In, std::vector ); - BBTK_DECLARE_INPUT(Renderer, vtkRenderer* ); - BBTK_DECLARE_INPUT(Image, vtkImageData* ); - BBTK_DECLARE_INPUT(Colour, std::vector ); - BBTK_DECLARE_INPUT(Opacity, double ); - BBTK_DECLARE_INPUT(Radio, double ); - BBTK_DECLARE_INPUT(InitLstPointsX , std::vector ); - BBTK_DECLARE_INPUT(InitLstPointsY , std::vector ); - BBTK_DECLARE_INPUT(InitLstPointsZ , std::vector ); - BBTK_DECLARE_INPUT(InitLstLabels , std::vector ); - BBTK_DECLARE_INPUT(InitLstIndexs , std::vector ); + BBTK_DECLARE_INPUT(In , std::vector ); + BBTK_DECLARE_INPUT(Renderer , vtkRenderer* ); + BBTK_DECLARE_INPUT(Image , vtkImageData* ); + BBTK_DECLARE_INPUT(Colour , std::vector ); + BBTK_DECLARE_INPUT(Opacity , double ); + BBTK_DECLARE_INPUT(Radio , double ); + BBTK_DECLARE_INPUT(InitLstPointsX , std::vector ); + BBTK_DECLARE_INPUT(InitLstPointsY , std::vector ); + BBTK_DECLARE_INPUT(InitLstPointsZ , std::vector ); + BBTK_DECLARE_INPUT(InitLstLabels , std::vector ); + BBTK_DECLARE_INPUT(InitLstIndexs , std::vector ); BBTK_DECLARE_INPUT(Type, int ); - BBTK_DECLARE_OUTPUT( lstPointsX , std::vector ); - BBTK_DECLARE_OUTPUT( lstPointsY , std::vector ); - BBTK_DECLARE_OUTPUT( lstPointsZ , std::vector ); - BBTK_DECLARE_OUTPUT( lstLabels , std::vector ); - BBTK_DECLARE_OUTPUT( WidgetShowNPoints, WidgetShowNPoints*); - BBTK_DECLARE_OUTPUT( lstIndexs , std::vector ); + BBTK_DECLARE_OUTPUT( lstPointsX , std::vector ); + BBTK_DECLARE_OUTPUT( lstPointsY , std::vector ); + BBTK_DECLARE_OUTPUT( lstPointsZ , std::vector ); + BBTK_DECLARE_OUTPUT( lstLabels , std::vector ); + BBTK_DECLARE_OUTPUT( lstIndexs , std::vector ); + BBTK_DECLARE_OUTPUT( lstSelectedIndexs, std::vector ); + BBTK_DECLARE_OUTPUT( WidgetShowNPoints, WidgetShowNPoints* ); BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); void CreateWidget(wxWindow*); - - double backOpacity; + double backOpacity; private: - bool firsttime; - WidgetShowNPointsBox *mwxwidget; + bool firsttime; + WidgetShowNPointsBox *mwxwidget; }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox); @@ -114,12 +114,13 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox); BBTK_INPUT(ShowNPoints,InitLstIndexs,"Initial lst of indexs sizes",std::vector,""); BBTK_INPUT(ShowNPoints,Type,"Type of the widget. 0(default): N-points, 1:Just one point, 2:Add/DeleteAll points, 3:As 0 with out save/load option, 4 Multiple NPoints",int,""); - BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X ", std::vector ,""); - BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y ", std::vector ,""); - BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z ", std::vector ,""); - BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels ", std::vector ,""); - BBTK_OUTPUT(ShowNPoints , lstIndexs , " list of index sizes ", std::vector ,""); - BBTK_OUTPUT(ShowNPoints , WidgetShowNPoints , " WidgetShowNPoints ", WidgetShowNPoints* ,""); + BBTK_OUTPUT(ShowNPoints , lstPointsX , " list of points X " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , lstPointsY , " list of points Y " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , lstPointsZ , " list of points Z " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , lstLabels , " list of labels " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , lstIndexs , " list of index sizes " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , lstSelectedIndexs , " list of points Z " , std::vector ,"" ); + BBTK_OUTPUT(ShowNPoints , WidgetShowNPoints , " WidgetShowNPoints " , WidgetShowNPoints* ,"" ); BBTK_END_DESCRIBE_BLACK_BOX(ShowNPoints); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index f42c078..c5b0808 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -217,21 +217,16 @@ cbAutoAddPoints = new wxCheckBox(panel,-1, _T("Auto") , wxDefaultPosition, sizeButton ); wxButton *btnMovePointUp = new wxButton( panel, -1, _T("<-") , wxDefaultPosition, sizeButton ); wxButton *btnMovePointDown = new wxButton( panel, -1, _T("->") , wxDefaultPosition, sizeButton ); - wxButton *btnSetPositionPoint = new wxButton( panel, -1, _T("Set") , wxDefaultPosition, sizeButton ); cbTrackPoint = new wxCheckBox(panel,-1, _T("Tra.") , wxDefaultPosition, sizeButton ); wxButton *btnRenamePoint = new wxButton( panel, -1, _T("Ren.") , wxDefaultPosition, sizeButton ); wxButton *btnErasePoint = new wxButton( panel, -1, _T("-") , wxDefaultPosition, sizeButton ); // wxButton *btnEraseLastPoint = new wxButton( panel, -1, _T("- lst") , wxDefaultPosition, sizeButton ); wxButton *btnDeleteAllPoints = new wxButton( panel, -1, _T("--") , wxDefaultPosition, sizeButton ); - wxButton *btnUndo = NULL; wxButton *btnRedo = NULL; - wxButton *btnSavePoints = NULL; wxButton *btnLoadPoints = NULL; - - btnBackPoint -> SetToolTip( _T("Select befor point") ); btnNextPoint -> SetToolTip( _T("Select next point") ); cbAutoAddPoints -> SetToolTip( _T("Auto Add point") ); @@ -241,12 +236,9 @@ btnMovePointDown -> SetToolTip( _T("Move point Down in the normal direction") ); btnRenamePoint -> SetToolTip( _T("Rename label for each point") ); textCtrl -> SetToolTip( _T("Point label") ); - - btnErasePoint -> SetToolTip( _T("- Erase point") ); // btnEraseLastPoint -> SetToolTip( _T("- lst Erase last point") ); btnDeleteAllPoints -> SetToolTip( _T("-- Erase all points") ); - if ( mtype==0 ) { btnUndo = new wxButton( panel, -1, _T("Undo") , wxDefaultPosition, sizeButton ); @@ -259,7 +251,6 @@ Connect(btnRedo->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnRedo ); } // if mtype txtNrPoints = new wxStaticText(panel,-1, _T(" -/-")); - wxStaticText* txOpacity; wxStaticText* txRadio; if ( (mtype==0) || (mtype==3) ) @@ -324,7 +315,6 @@ sizer7->Add( btnMovePointDown ); sizer8->Add( cbAutoAddPoints ); sizer8->Add( txtNrPoints ); - // sizer0->Add(askPointLabel); // JPR sizer0->Add(sizer8); sizer0->Add(sizer6); @@ -341,13 +331,9 @@ // sizer5->Add(sdrRadio,1,wxGROW ); // sizer5->Add(txOpacity); // sizer5->Add(sdrOpacity,1,wxGROW ); - sizer5->Add( sCtrlRadio ); sizer5->Add( sCtrlOpacity ); - - sizer0->Add(sizer5); - } // if mtype 0 3 if ( mtype==0 ) { @@ -385,10 +371,7 @@ sCtrlOpacity->SetValue( 10 ); Connect( sCtrlRadio->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints); Connect( sCtrlOpacity->GetId() ,wxEVT_COMMAND_SPINCTRL_UPDATED,(wxObjectEventFunction)(void (wxPanel::*)(wxScrollEvent&)) &WidgetShowNPoints::UpdatePoints); - - Connect(btnSetPositionPoint->GetId() , wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WidgetShowNPoints::OnSetPoint); - wxFlexGridSizer *sizer1 = new wxFlexGridSizer(1); sizer1->Add(btnSetPositionPoint); sizer1->Add(txtNrPoints); @@ -699,7 +682,6 @@ void WidgetShowNPoints::OnInsertPoint_() } RefreshCollectionText(); RefreshColourCollection(); - UndoRedo_SaveCollection(); } @@ -1045,11 +1027,15 @@ void WidgetShowNPoints::TrackingPoint( ) { if ( cbTrackPoint->GetValue() == true ) { - int id = GetModelShowNPoints()->IdInsidePoint(); - if (id>=0) - { - idTrack=id; - } +// int id = GetModelShowNPoints()->IdInsidePoint(); +// if (id>=0) +// { +// idTrack=id; +// } + +// int idTrack = GetModelShowNPoints()->GetIdCurrentPoint(); + int idTrack = GetModelShowNPoints()->GetNearestPoint(); + if (idTrack>=0) { @@ -1077,12 +1063,12 @@ void WidgetShowNPoints::OnTrackPoint_() { StopAutoAddPoints(); - idTrack = -1; +// idTrack = -1; if ( cbTrackPoint->GetValue() == true ) { // EED 2023-06-23 // idTrack = GetModelShowNPoints()->IdInsidePoint(); - idTrack = GetModelShowNPoints()->GetIdCurrentPoint(); +// idTrack = GetModelShowNPoints()->GetIdCurrentPoint(); } // if trackPointFlag } @@ -1096,7 +1082,7 @@ void WidgetShowNPoints::OnTrackPoint(wxCommandEvent& event) void WidgetShowNPoints::StopTrackPoint( ) { cbTrackPoint->SetValue(false); - idTrack=-1; +// idTrack=-1; } //------------------------------------------------------------------------ @@ -2007,6 +1993,18 @@ std::vector WidgetShowNPoints::GetLstIndexs() } return lstIndexs; } + +//------------------------------------------------------------------------ +std::vector WidgetShowNPoints::GetLstSelectedIndexs() +{ + std::vector lstSelectedIndexs; + if ( (cbVisuActualCollection!=NULL) && (cbVisuActualCollection->GetValue()==true) ) + { + lstSelectedIndexs.push_back( mActualCollection ); + } + return lstSelectedIndexs; +} + //------------------------------------------------------------------------ int WidgetShowNPoints::GetLstModelShowNPointsSize() { diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h index 3f444fa..5ed2ea1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h @@ -116,20 +116,22 @@ class WidgetShowNPoints : public wxPanel ViewShowNPoints* GetViewShowNPoints(); void SetInitLstPoints( std::vector initLstPointsX, std::vector initLstPointsY, std::vector initLstPointsZ, std::vector initLstLabels, std::vector initLstIndexs ); - void SetType(int type); - int GetType(); - double GetRadio(); - double GetOpacity(); - virtual void SetOutputBox(); - bool ErasePoint(int id); - - void SetAuxMesh(vtkPolyData* , std::vector spc, std::vector params); + void SetType(int type); + int GetType(); + double GetRadio(); + double GetOpacity(); + virtual void SetOutputBox(); + bool ErasePoint(int id); + + void SetAuxMesh(vtkPolyData* , std::vector spc, std::vector params); - std::vector GetLstPointsX(); - std::vector GetLstPointsY(); - std::vector GetLstPointsZ(); - std::vector GetLstLabels(); - std::vector GetLstIndexs(); + std::vector GetLstPointsX(); + std::vector GetLstPointsY(); + std::vector GetLstPointsZ(); + std::vector GetLstLabels(); + std::vector GetLstIndexs(); + std::vector GetLstSelectedIndexs(); + protected: private: @@ -152,7 +154,7 @@ class WidgetShowNPoints : public wxPanel std::vector lstModelShowNPoints; int mtype; int mActualCollection; - int idTrack; +// int idTrack; int idUndoRedo; int maxUndoRedo; std::string UndoRedoDir; -- 2.47.1