]> Creatis software - creaMaracasVisu.git/commitdiff
3502 Modify middle point in patch
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 31 Mar 2023 06:34:46 +0000 (08:34 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 31 Mar 2023 06:34:46 +0000 (08:34 +0200)
bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg
bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs
bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx

index 112a484df9019c362f6e6e1dad750af644513615..ddc0a77572c5c30ea56120782518b8dc4cded78d 100644 (file)
@@ -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,12 +72,12 @@ COMPLEX_PORT
 meshmanagermodel
 -150.374274:130.740991:-900.000000
 FIN_COMPLEX_PORT
-BOXES:81
+BOXES:83
 BOX
 creaMaracasVisu:ShowNPoints:showNpoints
 ISEXEC:FALSE
-24.787568:83.025910:-900.000000
-61.627568:80.525910:-900.000000
+-20.157943:99.596730:-900.000000
+16.682057:97.096730:-900.000000
 PORT
 Radio:"2"
 PORT
@@ -132,8 +132,8 @@ FIN_BOX
 BOX
 std:MultipleInputs:Box31
 ISEXEC:FALSE
-18.992085:-64.219001:-900.000000
-40.962085:-66.719001:-900.000000
+-257.036910:-81.243816:-900.000000
+-235.066910:-83.743816:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:ManualContourModel_Box:Box29
@@ -184,8 +184,8 @@ FIN_BOX
 BOX
 creaMaracasVisu:ShowNPoints_Tools:Box60
 ISEXEC:FALSE
--271.997629:60.063100:-900.000000
--249.562629:57.563100:-900.000000
+-273.132617:53.934167:-900.000000
+-250.697617:51.434167:-900.000000
 FIN_BOX
 BOX
 vtk:ImageVtkProperties:Box68
@@ -554,8 +554,8 @@ FIN_BOX
 BOX
 wx:LayoutLine:Box101
 ISEXEC:FALSE
-75.262796:-54.319784:-900.000000
-108.582796:-56.819784:-900.000000
+78.195133:-42.092223:-900.000000
+111.515133:-44.592223:-900.000000
 PORT
 Orientation:"V"
 FIN_BOX
@@ -704,16 +704,16 @@ FIN_BOX
 BOX
 wx:CommandButton:Box121
 ISEXEC:FALSE
--390.668472:-8.967632:-900.000000
--368.283472:-11.467632:-900.000000
+-390.668472:4.266324:-900.000000
+-368.283472:1.766324:-900.000000
 PORT
 Label:"+"
 FIN_BOX
 BOX
 wx:CommandButton:Box127
 ISEXEC:FALSE
--322.149651:-11.922729:-900.000000
--299.764651:-14.422729:-900.000000
+-324.646624:4.307594:-900.000000
+-302.261624:1.807594:-900.000000
 PORT
 Label:"-"
 FIN_BOX
@@ -743,7 +743,21 @@ ISEXEC:FALSE
 PORT
 In2:"  -1"
 FIN_BOX
-CONNECTIONS:168
+BOX
+std:MultipleInputs:Box126
+ISEXEC:FALSE
+-262.331700:-55.177234:-900.000000
+-240.251700:-57.677234:-900.000000
+FIN_BOX
+BOX
+wx:LayoutLine:Box129
+ISEXEC:FALSE
+-363.353902:-10.160808:-900.000000
+-330.033902:-12.660808:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+CONNECTIONS:172
 CONNECTION
 Box06:LstContourPointsX:Box04:LstX
 NumberOfControlPoints:0
@@ -847,9 +861,6 @@ CONNECTION
 Box66:Out:Box48:render
 NumberOfControlPoints:0
 CONNECTION
-showNpoints:BoxChange:Box31:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
 Box48:boxchange:Box31:In1
 NumberOfControlPoints:0
 CONNECTION
@@ -1216,15 +1227,9 @@ CONNECTION
 Box121:BoxChange:Box120:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box121:Widget:Box101:Widget5
-NumberOfControlPoints:0
-CONNECTION
 Box127:BoxChange:Box128:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box127:Widget:Box101:Widget6
-NumberOfControlPoints:0
-CONNECTION
 Box68:Spacing:Box128:Spacing
 NumberOfControlPoints:0
 CONNECTION
@@ -1248,4 +1253,25 @@ NumberOfControlPoints:0
 CONNECTION
 Box128:BoxChange:Box31:In5
 NumberOfControlPoints:0
+CONNECTION
+showNpoints:BoxChange:Box126:In4
+NumberOfControlPoints:0
+CONNECTION
+Box128:BoxChange:Box126:In2
+NumberOfControlPoints:0
+CONNECTION
+Box120:BoxChange:Box126:In1
+NumberOfControlPoints:0
+CONNECTION
+Box126:BoxChange:Box31:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box127:Widget:Box129:Widget4
+NumberOfControlPoints:0
+CONNECTION
+Box129:Widget:Box101:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box121:Widget:Box129:Widget6
+NumberOfControlPoints:0
 APP_END
index 031783008c20f4ffbf552c186fdae66fab68c371..482b97cdbbe1f7e4bed3a2b8f0f87d9426ddee23 100644 (file)
@@ -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
@@ -272,6 +272,11 @@ new std:ConcatStrings Box130
 new std:ConcatStrings Box131
   set Box131.In2 "  -1"
 
+new std:MultipleInputs Box126
+
+new wx:LayoutLine Box129
+  set Box129.Orientation "H"
+
 
 connect Box06.LstContourPointsX Box04.LstX
 connect showNpoints.lstIndexs Box06.LstIndexsIn
@@ -304,7 +309,6 @@ connect Box66.Out showNpoints.Renderer
 connect Box67.Out Box77.In1
 connect Box04.Out Box48.polydata
 connect Box66.Out Box48.render
-connect showNpoints.BoxChange Box31.BoxExecute
 connect Box48.boxchange Box31.In1
 connect Box35.Out Box68.In
 connect Box68.Spacing Box70.k1
@@ -415,9 +419,7 @@ connect Box119.Out Box58.StringVector
 connect Box68.Spacing Box120.Spacing
 connect showNpoints.WidgetShowNPoints Box120.WidgetShowNPoints
 connect Box121.BoxChange Box120.BoxExecute
-connect Box121.Widget Box101.Widget5
 connect Box127.BoxChange Box128.BoxExecute
-connect Box127.Widget Box101.Widget6
 connect Box68.Spacing Box128.Spacing
 connect showNpoints.WidgetShowNPoints Box128.WidgetShowNPoints
 connect Box60.Out Box130.In1
@@ -426,6 +428,13 @@ connect Box130.Out Box120.Params
 connect Box131.Out Box128.Params
 connect Box120.BoxChange Box31.In3
 connect Box128.BoxChange Box31.In5
+connect showNpoints.BoxChange Box126.In4
+connect Box128.BoxChange Box126.In2
+connect Box120.BoxChange Box126.In1
+connect Box126.BoxChange Box31.BoxExecute
+connect Box127.Widget Box129.Widget4
+connect Box129.Widget Box101.Widget7
+connect Box121.Widget Box129.Widget6
 
 # Complex input ports
 input point showNpoints.In " "
index 275a66d2e753a4a9892a3a7d1c276256185943ec..84435b2ab3567d5a051c55fe4173ebf72e38652e 100644 (file)
@@ -338,16 +338,20 @@ void ShowNPoints_Tools::MovePatchCenter()
                normal.push_back(params[1]);
                normal.push_back(params[2]);
 
-               int direction = -params[3];
+               int direction = -3 * params[3];
                
                WidgetShowNPoints* wsp = bbGetInputWidgetShowNPoints();
                wsp->GetCollectionPoint(1,1, centerPoint);
-               modPoint.push_back(centerPoint[0] + direction*normal[0]);
-               modPoint.push_back(centerPoint[1] + direction*normal[1]);
-               modPoint.push_back(centerPoint[2] + direction*normal[2]);
+               modPoint.push_back(centerPoint[0] + direction * normal[0]);
+               modPoint.push_back(centerPoint[1] + direction * normal[1]);
+               modPoint.push_back(centerPoint[2] + direction * normal[2]);
 
                wsp->SetCollectionPoint(1, 1, modPoint);
                wsp->GetViewShowNPoints()->RefreshPoints();
+        
+        // --- Finish ---
+        wsp->SetOutputBox();
+        wsp->UndoRedo_SaveCollection();
        }else{
                printf("PG ShowNPoints_Tools::MovePatchCenter()  Warning params are wrong. Need 4: normal x y z and direction of movement (1 or -1)\n");
        }