From 388e8bb0c5843e3a2cf0d8ed9e74fc6c350a21c6 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 27 Jun 2023 12:48:32 +0200 Subject: [PATCH] #3520 CleanMeshWithPatch --- bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg | 79 ++++++++++++++++++- bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs | 28 ++++++- .../wxWindows/widgets/WidgetShowNPoints.cxx | 15 +--- 3 files changed, 107 insertions(+), 15 deletions(-) diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg index 4d1eea2..58d5a4b 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.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_ApplyPatch.bbg +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg # ---------------------------------- APP_START @@ -72,7 +72,7 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:86 +BOXES:90 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE @@ -783,7 +783,41 @@ Orientation:"V" PORT WinTitle:"1.3 Apply Changes" FIN_BOX -CONNECTIONS:175 +BOX +creaVtk:CleanMeshWithPatch:Box135 +ISEXEC:FALSE +10.527341:-109.019479:-900.000000 +33.327341:-111.519479:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:PolyDataToActor_Widget:Box136 +ISEXEC:FALSE +2.128805:-136.236464:-900.000000 +25.258805:-138.736464:-900.000000 +PORT +active:"true" +PORT +color:"1 1 1" +PORT +meshOpacity:"100" +FIN_BOX +BOX +wx:LayoutLine:Box137 +ISEXEC:FALSE +1.468734:-145.464302:-900.000000 +34.788734:-147.964302:-900.000000 +PORT +WinTitle:"Beta" +FIN_BOX +BOX +wx:CommandButton:Box138 +ISEXEC:FALSE +52.385246:-124.247932:-900.000000 +74.770246:-126.747932:-900.000000 +PORT +Label:"Run" +FIN_BOX +CONNECTIONS:188 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -1309,4 +1343,43 @@ NumberOfControlPoints:0 CONNECTION Box42:Widget:Box134:Widget3 NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box135:Mesh +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box135:Patch +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstPointsX:Box135:LstX +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstPointsY:Box135:LstY +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstPointsZ:Box135:LstZ +NumberOfControlPoints:0 +CONNECTION +showNpoints:lstIndexs:Box135:LstIndexs +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box136:polydata +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box136:render +NumberOfControlPoints:0 +CONNECTION +Box136:widget:Box137:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box137:Widget:Box106:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box138:Widget:Box137:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box138:BoxChange:Box136:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box68:Spacing:Box135:Spacing +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs index ad70a78..376c093 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.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_ApplyPatch.bbs +# - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs # ---------------------------------- include std @@ -287,6 +287,19 @@ new wx:LayoutLine Box134 set Box134.Orientation "V" set Box134.WinTitle "1.3 Apply Changes" +new creaVtk:CleanMeshWithPatch Box135 + +new creaMaracasVisu:PolyDataToActor_Widget Box136 + set Box136.active "true" + set Box136.color "1 1 1" + set Box136.meshOpacity "100" + +new wx:LayoutLine Box137 + set Box137.WinTitle "Beta" + +new wx:CommandButton Box138 + set Box138.Label "Run" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -448,6 +461,19 @@ connect Box77.Out Box133.In connect Box133.Out Box115.In connect Box134.Widget Box82.Widget4 connect Box42.Widget Box134.Widget3 +connect Box67.Out Box135.Mesh +connect Box04.Out Box135.Patch +connect showNpoints.lstPointsX Box135.LstX +connect showNpoints.lstPointsY Box135.LstY +connect showNpoints.lstPointsZ Box135.LstZ +connect showNpoints.lstIndexs Box135.LstIndexs +connect Box135.Out Box136.polydata +connect Box66.Out Box136.render +connect Box136.widget Box137.Widget2 +connect Box137.Widget Box106.Widget4 +connect Box138.Widget Box137.Widget4 +connect Box138.BoxChange Box136.boxexecute +connect Box68.Spacing Box135.Spacing # Complex input ports input point showNpoints.In " " diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 12d4589..1029417 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -849,7 +849,7 @@ void WidgetShowNPoints::OnSetPoint(wxCommandEvent& event) //------------------------------------------------------------------------ void WidgetShowNPoints::MovePoint_(double step) { - step=step*2; + step=step; StopAutoAddPoints(); StopTrackPoint(); @@ -1460,7 +1460,6 @@ void WidgetShowNPoints::CreatePointsIntoNewCollection() } // for delete m; // ----------------- Add new Points -------------------- - vtkPoints *points; vtkStaticPointLocator *pointLocator; if (aux_mesh!=NULL) @@ -1469,10 +1468,6 @@ void WidgetShowNPoints::CreatePointsIntoNewCollection() pointLocator = vtkStaticPointLocator::New(); pointLocator->SetDataSet( aux_mesh ); pointLocator->BuildLocator(); - vtkPoints *points = aux_mesh->GetPoints(); - vtkStaticPointLocator *pointLocator = vtkStaticPointLocator::New(); - pointLocator->SetDataSet( aux_mesh ); - pointLocator->BuildLocator(); } // if aux_mesh double p[3], pM[3]; @@ -1483,18 +1478,16 @@ void WidgetShowNPoints::CreatePointsIntoNewCollection() x = (c1LstXX[i]+c2LstXX[i])/2; y = (c1LstYY[i]+c2LstYY[i])/2; z = (c1LstZZ[i]+c2LstZZ[i])/2; - if (aux_mesh!=NULL) { p[0] = x * aux_mesh_spc[0]; p[1] = y * aux_mesh_spc[1]; p[2] = z * aux_mesh_spc[2]; points->GetPoint( pointLocator->FindClosestPoint(p) , pM ); -// x = pM[0] / aux_mesh_spc[0]; -// y = pM[1] / aux_mesh_spc[1]; -// z = pM[2] / aux_mesh_spc[2]; + x = pM[0] / aux_mesh_spc[0]; + y = pM[1] / aux_mesh_spc[1]; + z = pM[2] / aux_mesh_spc[2]; } // aux_mesh - AddPoint(x,y,z,""); } pointLocator->Delete(); -- 2.47.1