From fbcff81d5224e6a2a4bf3887cdb1ebb3d8f07256 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 8 Sep 2022 17:15:52 +0200 Subject: [PATCH] MeshManager --- bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg | 42 +- bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs | 4 +- bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg | 594 ++++++++++++++++++ bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs | 218 +++++++ bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg | 175 +++--- bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs | 25 +- bbtk/bbs/boxes/PolyDataToActor_Widget.bbg | 19 +- bbtk/bbs/boxes/PolyDataToActor_Widget.bbs | 1 + bbtk/bbs/boxes/SetPositionPointPicker.bbg | 59 +- bbtk/bbs/boxes/SetPositionPointPicker.bbs | 5 + .../bbcreaMaracasVisuShowNPoints_Tools.cxx | 10 +- .../wxWindows/widgets/ModelShowNPoints.cxx | 17 + .../wxWindows/widgets/ModelShowNPoints.h | 3 +- .../wxWindows/widgets/WidgetShowNPoints.cxx | 11 + .../wxWindows/widgets/WidgetShowNPoints.h | 2 +- 15 files changed, 1059 insertions(+), 126 deletions(-) create mode 100644 bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg create mode 100644 bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg index 9b35a0b..b020d67 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg @@ -57,7 +57,7 @@ BOX wx:LayoutLine:Box08 ISEXEC:FALSE -191.490538:-129.735971:-900.000000 --158.170538:-132.235971:-900.000000 +33.320000:-132.235971:-900.000000 FIN_BOX BOX vtk:UpdateRender:Box11 @@ -81,7 +81,7 @@ ISEXEC:FALSE PORT Orientation:"H" PORT -WinTitle:"New Surface ( Magenta = Red+Yellow )" +WinTitle:"New Surface ( Magenta )" FIN_BOX BOX wx:CommandButton:Box80 @@ -101,19 +101,19 @@ BOX std:MagicBox:Box67 ISEXEC:FALSE -67.526006:124.007723:-900.000000 --45.926006:121.507723:-900.000000 +8.680000:121.507723:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box35 ISEXEC:FALSE -107.091396:123.633118:-900.000000 --83.881396:121.133118:-900.000000 +6.920000:121.133118:-900.000000 FIN_BOX BOX creaMaracasVisu:PolyDataToActor_Widget:Box37 ISEXEC:FALSE -36.296182:-79.717323:-900.000000 --13.276182:-82.217323:-900.000000 +10.440000:-82.217323:-900.000000 PORT color:"0 1 1" FIN_BOX @@ -127,7 +127,7 @@ BOX wx:CommandButton:Box42 ISEXEC:FALSE -91.903796:13.441695:-900.000000 --69.628796:10.941695:-900.000000 +21.000000:10.941695:-900.000000 PORT Label:"Apply (Magenta->To Red)" FIN_BOX @@ -135,7 +135,7 @@ BOX wx:CommandButton:Box43 ISEXEC:FALSE -80.312782:7.645253:-900.000000 --58.037782:5.145253:-900.000000 +21.000000:5.145253:-900.000000 PORT Label:"Reset Tool" FIN_BOX @@ -147,13 +147,13 @@ ISEXEC:FALSE PORT Orientation:"V" PORT -WinTitle:"1.2 Mesh Action" +WinTitle:"Mesh Action" FIN_BOX BOX creaVtk:MeshManager_tool:Box45 ISEXEC:FALSE -88.859950:-132.940417:-900.000000 --66.359950:-135.440417:-900.000000 +10.440000:-135.440417:-900.000000 PORT Tool:"30" FIN_BOX @@ -161,13 +161,13 @@ BOX std:MagicBox:Box46 ISEXEC:FALSE -139.784698:124.004612:-900.000000 --118.184698:121.504612:-900.000000 +8.680000:121.504612:-900.000000 FIN_BOX BOX std:MultipleInputs:Box51 ISEXEC:FALSE -92.949669:-148.627142:-900.000000 --70.979669:-151.127142:-900.000000 +21.000000:-151.127142:-900.000000 FIN_BOX BOX std:MagicBox:Box63 @@ -179,31 +179,31 @@ BOX std:MagicBox:Box64 ISEXEC:FALSE -243.113826:124.330340:-900.000000 --221.513826:121.830340:-900.000000 +8.680000:121.830340:-900.000000 FIN_BOX BOX std:MagicBox:Box65 ISEXEC:FALSE -220.296210:124.504415:-900.000000 --198.696210:122.004415:-900.000000 +8.680000:122.004415:-900.000000 FIN_BOX BOX std:MagicBox:Box69 ISEXEC:FALSE -197.793508:124.678490:-900.000000 --176.193508:122.178490:-900.000000 +8.680000:122.178490:-900.000000 FIN_BOX BOX std:MagicBox:Box71 ISEXEC:FALSE -273.359367:124.504415:-900.000000 --251.759367:122.004415:-900.000000 +8.680000:122.004415:-900.000000 FIN_BOX BOX creaMaracasVisu:MeshContours_Widget:Box72 ISEXEC:FALSE -109.985892:-79.925596:-900.000000 --87.190892:-82.425596:-900.000000 +13.960000:-82.425596:-900.000000 PORT colorMesh:"0 1 1" FIN_BOX @@ -211,7 +211,7 @@ BOX wx:LayoutLine:Box81 ISEXEC:FALSE -186.050677:-117.835921:-900.000000 --152.730677:-120.335921:-900.000000 +33.320000:-120.335921:-900.000000 PORT WinTitle:"Step 1. Surface" FIN_BOX @@ -225,7 +225,7 @@ BOX wx:OutputText:Box84 ISEXEC:FALSE -90.166444:-34.853291:-900.000000 --68.496444:-37.353291:-900.000000 +19.240000:-37.353291:-900.000000 FIN_BOX BOX creaVtk:MeshManager:Box92 @@ -245,7 +245,7 @@ BOX creaMaracasVisu:wxVtkBaseView_Info:Box96 ISEXEC:FALSE -6.504018:23.833007:-900.000000 -16.110982:21.333007:-900.000000 +18.480000:21.333007:-900.000000 FIN_BOX BOX creaVtk:PolyDataToImageData:Box97 @@ -295,7 +295,7 @@ BOX creaVtk:MeshManager_tool:Box47 ISEXEC:FALSE -60.096172:-132.552191:-900.000000 --37.596172:-135.052191:-900.000000 +10.440000:-135.052191:-900.000000 PORT Tool:"35" FIN_BOX @@ -303,7 +303,7 @@ BOX creaVtk:MeshManager_tool:Box48 ISEXEC:FALSE -31.571613:-131.892967:-900.000000 --9.071613:-134.392967:-900.000000 +10.440000:-134.392967:-900.000000 PORT Tool:"35" FIN_BOX diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs index 3d561a7..6c49452 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs @@ -27,7 +27,7 @@ new vtk:ImageVtkProperties Box68 new wx:LayoutLine Box79 set Box79.Orientation "H" - set Box79.WinTitle "New Surface ( Magenta = Red+Yellow )" + set Box79.WinTitle "New Surface ( Magenta )" new wx:CommandButton Box80 set Box80.Label "Run" @@ -51,7 +51,7 @@ new wx:CommandButton Box43 new wx:LayoutLine Box44 set Box44.Orientation "V" - set Box44.WinTitle "1.2 Mesh Action" + set Box44.WinTitle "Mesh Action" new creaVtk:MeshManager_tool Box45 set Box45.Tool "30" diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg new file mode 100644 index 0000000..3a19d3e --- /dev/null +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg @@ -0,0 +1,594 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBG BlackBox Diagram file +# - /Users/davila/Creatis/C22/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbg +# ---------------------------------- + +APP_START +CATEGORY:demo +DESCRIPTION:Show N Points +AUTHOR:info-dev@creatis.insa-lyon.fr +COMPLEXBOX:TRUE +COMPLEXBOXNAME:Mesh_tool_ApplyDeformation +PACKAGENAME:creaMaracasVisu +COMPLEXOUTPUTS:1 +COMPLEX_PORT +widget +-190.515959:-183.832070:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:9 +COMPLEX_PORT +boxChange +14.583096:139.152887:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview1 +-268.019084:133.379456:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +mesh +-59.814076:140.655693:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +image +-101.103689:138.087401:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview2 +-231.668448:132.854505:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview3 +-216.690458:133.262996:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview4 +-193.414893:132.224675:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +title +-167.581636:131.715380:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +meshmanagermodel +-131.800179:136.578564:-900.000000 +FIN_COMPLEX_PORT +BOXES:42 +BOX +wx:LayoutLine:Box08 +ISEXEC:FALSE +-191.490538:-129.735971:-900.000000 +-158.170538:-132.235971:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box11 +ISEXEC:FALSE +-7.745536:-95.586489:-900.000000 +14.279464:-98.086489:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +wx:LayoutLine:Box79 +ISEXEC:FALSE +-142.444548:-98.205267:-900.000000 +-109.124548:-100.705267:-900.000000 +PORT +Orientation:"H" +PORT +WinTitle:"New Surface ( Magenta )" +FIN_BOX +BOX +wx:CommandButton:Box80 +ISEXEC:FALSE +-101.602098:27.184371:-900.000000 +-79.327098:24.684371:-900.000000 +PORT +Label:"Run" +FIN_BOX +BOX +std:MagicBox:Box66 +ISEXEC:FALSE +-8.767256:-65.552297:-900.000000 +12.832744:-68.052297:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box67 +ISEXEC:FALSE +-67.526006:124.007723:-900.000000 +-45.926006:121.507723:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box35 +ISEXEC:FALSE +-107.091396:123.633118:-900.000000 +-83.881396:121.133118:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:PolyDataToActor_Widget:Box37 +ISEXEC:FALSE +-36.296182:-79.717323:-900.000000 +-13.276182:-82.217323:-900.000000 +PORT +color:"0 1 1" +FIN_BOX +BOX +wx:LayoutTab:Box40 +ISEXEC:FALSE +-182.535138:-107.612723:-900.000000 +-149.215138:-110.112723:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box42 +ISEXEC:FALSE +-91.903796:13.441695:-900.000000 +-69.628796:10.941695:-900.000000 +PORT +Label:"Apply (Magenta->To Red)" +FIN_BOX +BOX +wx:CommandButton:Box43 +ISEXEC:FALSE +-80.312782:7.645253:-900.000000 +-58.037782:5.145253:-900.000000 +PORT +Label:"Reset Tool" +FIN_BOX +BOX +wx:LayoutLine:Box44 +ISEXEC:FALSE +-122.128535:-44.031647:-900.000000 +-88.808535:-46.531647:-900.000000 +PORT +Orientation:"V" +PORT +WinTitle:"Mesh Action" +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box45 +ISEXEC:FALSE +-88.859950:-132.940417:-900.000000 +-66.359950:-135.440417:-900.000000 +PORT +Tool:"30" +FIN_BOX +BOX +std:MagicBox:Box46 +ISEXEC:FALSE +-139.784698:124.004612:-900.000000 +-118.184698:121.504612:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box51 +ISEXEC:FALSE +-92.949669:-148.627142:-900.000000 +-70.979669:-151.127142:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box63 +ISEXEC:FALSE +11.031862:123.390537:-900.000000 +32.631862:120.890537:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box64 +ISEXEC:FALSE +-243.113826:124.330340:-900.000000 +-221.513826:121.830340:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box65 +ISEXEC:FALSE +-220.296210:124.504415:-900.000000 +-198.696210:122.004415:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box69 +ISEXEC:FALSE +-197.793508:124.678490:-900.000000 +-176.193508:122.178490:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box71 +ISEXEC:FALSE +-273.359367:124.504415:-900.000000 +-251.759367:122.004415:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:MeshContours_Widget:Box72 +ISEXEC:FALSE +-110.583963:-80.124953:-900.000000 +-87.788963:-82.624953:-900.000000 +PORT +colorMesh:"0 1 1" +FIN_BOX +BOX +wx:LayoutLine:Box81 +ISEXEC:FALSE +-186.050677:-117.835921:-900.000000 +-152.730677:-120.335921:-900.000000 +PORT +WinTitle:"Step 1. Surface" +FIN_BOX +BOX +wx:LayoutTab:Box82 +ISEXEC:FALSE +-123.564121:-52.398946:-900.000000 +-90.244121:-54.898946:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box84 +ISEXEC:FALSE +-90.166444:-34.853291:-900.000000 +-68.496444:-37.353291:-900.000000 +FIN_BOX +BOX +creaVtk:MeshManager:Box92 +ISEXEC:FALSE +-180.315243:-41.937258:-900.000000 +-158.285243:-44.437258:-900.000000 +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box93 +ISEXEC:FALSE +-256.027180:-70.934538:-900.000000 +-233.527180:-73.434538:-900.000000 +PORT +Tool:"35" +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box96 +ISEXEC:FALSE +-313.048795:83.525380:-900.000000 +-290.433795:81.025380:-900.000000 +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box47 +ISEXEC:FALSE +-60.096172:-132.552191:-900.000000 +-37.596172:-135.052191:-900.000000 +PORT +Tool:"35" +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box48 +ISEXEC:FALSE +-31.571613:-131.892967:-900.000000 +-9.071613:-134.392967:-900.000000 +PORT +Tool:"35" +FIN_BOX +BOX +creaVtk:MeshDeformation:Box39 +ISEXEC:FALSE +-397.716820:-32.055618:-900.000000 +-375.371820:-34.555618:-900.000000 +PORT +TypeIn:"1" +FIN_BOX +BOX +wx:Slider:Box49 +ISEXEC:FALSE +-352.383503:38.044822:-900.000000 +-322.583503:35.544822:-900.000000 +PORT +In:"40" +PORT +Label:"true" +PORT +Max:"40" +PORT +Min:"1" +PORT +ReactiveOnTrack:"false" +PORT +Title:"Size Deformation" +FIN_BOX +BOX +wx:CheckBox:Box50 +ISEXEC:FALSE +-412.119236:43.623139:-900.000000 +-390.489236:41.123139:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box52 +ISEXEC:FALSE +-352.234286:18.772505:-900.000000 +-318.914286:16.272505:-900.000000 +PORT +Orientation:"V" +FIN_BOX +BOX +creaMaracasVisu:SetPositionPointPicker:Box55 +ISEXEC:FALSE +-310.791850:19.311250:-900.000000 +-288.061850:16.811250:-900.000000 +FIN_BOX +BOX +creaVtk:PlaneWidget:Box58 +ISEXEC:FALSE +-352.778408:-17.000645:-900.000000 +-330.933408:-19.500645:-900.000000 +PORT +ReactiveType:"1" +PORT +Representation:"1" +PORT +Resolution:"5" +FIN_BOX +BOX +std:MultipleInputs:Box59 +ISEXEC:FALSE +-347.131093:-0.309984:-900.000000 +-325.161093:-2.809984:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box53 +ISEXEC:FALSE +-390.585705:58.769311:-900.000000 +-368.310705:56.269311:-900.000000 +PORT +Label:"-" +FIN_BOX +BOX +wx:CommandButton:Box54 +ISEXEC:FALSE +-357.413878:62.971953:-900.000000 +-335.138878:60.471953:-900.000000 +PORT +Label:"+" +FIN_BOX +BOX +wx:LayoutLine:Box56 +ISEXEC:FALSE +-385.265172:52.931125:-900.000000 +-351.945172:50.431125:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +creaVtk:PlaneWidget_Base:Box57 +ISEXEC:FALSE +-366.426208:-31.952370:-900.000000 +-344.016208:-34.452370:-900.000000 +PORT +Param:"-1" +PORT +Type:"1" +FIN_BOX +BOX +creaVtk:PlaneWidget_Base:Box60 +ISEXEC:FALSE +-336.100200:-31.943566:-900.000000 +-313.690200:-34.443566:-900.000000 +PORT +Param:"1" +PORT +Type:"1" +FIN_BOX +BOX +std:MultipleInputs:Box61 +ISEXEC:FALSE +-418.624501:6.091723:-900.000000 +-396.654501:3.591723:-900.000000 +FIN_BOX +CONNECTIONS:73 +CONNECTION +Box08:Widget:widget:widget +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +mesh:mesh:Box67:In +NumberOfControlPoints:0 +CONNECTION +image:image:Box35:In +NumberOfControlPoints:0 +CONNECTION +title:title:Box08:WinTitle +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box37:render +NumberOfControlPoints:0 +CONNECTION +Box79:Widget:Box40:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box80:Widget:Box44:Widget5 +NumberOfControlPoints:0 +CONNECTION +meshmanagermodel:meshmanagermodel:Box46:In +NumberOfControlPoints:0 +CONNECTION +Box46:Out:Box45:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box42:BoxChange:Box51:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box45:BoxChange:Box51:In2 +NumberOfControlPoints:0 +CONNECTION +boxChange:boxChange:Box63:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview2:wxvtkbaseview2:Box64:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview3:wxvtkbaseview3:Box65:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview4:wxvtkbaseview4:Box69:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview1:wxvtkbaseview1:Box71:In +NumberOfControlPoints:0 +CONNECTION +Box71:Out:Box72:_wxvtkbaseview3D1 +NumberOfControlPoints:0 +CONNECTION +Box64:Out:Box72:_wxvtkbaseview2D1 +NumberOfControlPoints:0 +CONNECTION +Box65:Out:Box72:_wxvtkbaseview2D2 +NumberOfControlPoints:0 +CONNECTION +Box69:Out:Box72:_wxvtkbaseview2D3 +NumberOfControlPoints:0 +CONNECTION +Box72:_widget:Box79:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box44:Widget:Box82:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box82:Widget:Box79:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box84:Widget:Box44:Widget9 +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box93:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box72:_polydata +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box37:polydata +NumberOfControlPoints:0 +CONNECTION +Box81:Widget:Box08:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box42:Widget:Box44:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box43:Widget:Box44:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box71:Out:Box96:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box96:vtkRenderer:Box66:In +NumberOfControlPoints:0 +CONNECTION +Box37:widget:Box79:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box40:Widget:Box81:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box47:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box48:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box48:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box63:BoxChange:Box72:_execute +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box45:Mesh +NumberOfControlPoints:0 +CONNECTION +Box47:BoxChange:Box51:In5 +NumberOfControlPoints:0 +CONNECTION +Box37:boxchange:Box11:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box49:Out:Box39:S +NumberOfControlPoints:0 +CONNECTION +Box50:Widget:Box52:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box49:Widget:Box52:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box52:Widget:Box44:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box55:image +NumberOfControlPoints:0 +CONNECTION +Box96:vtkRenderer:Box55:render +NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box93:Mesh +NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box39:In +NumberOfControlPoints:0 +CONNECTION +Box71:Out:Box55:wxvtkbaseview +NumberOfControlPoints:0 +CONNECTION +Box50:Out:Box58:Active +NumberOfControlPoints:0 +CONNECTION +Box50:BoxChange:Box59:In2 +NumberOfControlPoints:0 +CONNECTION +Box55:boxchange:Box59:In4 +NumberOfControlPoints:0 +CONNECTION +Box59:BoxChange:Box58:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box55:PositionWorld:Box58:Origin +NumberOfControlPoints:0 +CONNECTION +Box55:normal:Box58:NormalIn +NumberOfControlPoints:0 +CONNECTION +Box96:vtkRenderer:Box58:Renderer +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box58:In +NumberOfControlPoints:0 +CONNECTION +Box80:BoxChange:Box93:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box53:Widget:Box56:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box54:Widget:Box56:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box56:Widget:Box52:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box58:Base:Box57:In +NumberOfControlPoints:0 +CONNECTION +Box58:Base:Box60:In +NumberOfControlPoints:0 +CONNECTION +Box53:BoxChange:Box57:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box54:BoxChange:Box60:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box55:pointid:Box39:EdgeId +NumberOfControlPoints:0 +CONNECTION +Box58:Center:Box39:Center +NumberOfControlPoints:0 +CONNECTION +Box49:BoxChange:Box61:In1 +NumberOfControlPoints:0 +CONNECTION +Box58:BoxChange:Box61:In2 +NumberOfControlPoints:0 +CONNECTION +Box61:BoxChange:Box39:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box50:Out:Box39:Active +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs new file mode 100644 index 0000000..8b6180b --- /dev/null +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs @@ -0,0 +1,218 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box) +# - /Users/davila/Creatis/C22/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyDeformation.bbs +# ---------------------------------- + +include std +include itkvtk +include wx +include vtk +include std +include creaMaracasVisu +include creaVtk + +define Mesh_tool_ApplyDeformation creaMaracasVisu + +author "info-dev@creatis.insa-lyon.fr" +description "Show N Points" + +category "demo" + +new wx:LayoutLine Box08 + +new vtk:UpdateRender Box11 + set Box11.Active "true" + +new wx:LayoutLine Box79 + set Box79.Orientation "H" + set Box79.WinTitle "New Surface ( Magenta )" + +new wx:CommandButton Box80 + set Box80.Label "Run" + +new std:MagicBox Box66 + +new std:MagicBox Box67 + +new vtk:vtkImageDataPointerRelay Box35 + +new creaMaracasVisu:PolyDataToActor_Widget Box37 + set Box37.color "0 1 1" + +new wx:LayoutTab Box40 + +new wx:CommandButton Box42 + set Box42.Label "Apply (Magenta->To Red)" + +new wx:CommandButton Box43 + set Box43.Label "Reset Tool" + +new wx:LayoutLine Box44 + set Box44.Orientation "V" + set Box44.WinTitle "Mesh Action" + +new creaVtk:MeshManager_tool Box45 + set Box45.Tool "30" + +new std:MagicBox Box46 + +new std:MultipleInputs Box51 + +new std:MagicBox Box63 + +new std:MagicBox Box64 + +new std:MagicBox Box65 + +new std:MagicBox Box69 + +new std:MagicBox Box71 + +new creaMaracasVisu:MeshContours_Widget Box72 + set Box72.colorMesh "0 1 1" + +new wx:LayoutLine Box81 + set Box81.WinTitle "Step 1. Surface" + +new wx:LayoutTab Box82 + +new wx:OutputText Box84 + +new creaVtk:MeshManager Box92 + +new creaVtk:MeshManager_tool Box93 + set Box93.Tool "35" + +new creaMaracasVisu:wxVtkBaseView_Info Box96 + +new creaVtk:MeshManager_tool Box47 + set Box47.Tool "35" + +new creaVtk:MeshManager_tool Box48 + set Box48.Tool "35" + +new creaVtk:MeshDeformation Box39 + set Box39.TypeIn "1" + +new wx:Slider Box49 + set Box49.In "40" + set Box49.Label "true" + set Box49.Max "40" + set Box49.Min "1" + set Box49.ReactiveOnTrack "false" + set Box49.Title "Size Deformation" + +new wx:CheckBox Box50 + +new wx:LayoutLine Box52 + set Box52.Orientation "V" + +new creaMaracasVisu:SetPositionPointPicker Box55 + +new creaVtk:PlaneWidget Box58 + set Box58.ReactiveType "1" + set Box58.Representation "1" + set Box58.Resolution "5" + +new std:MultipleInputs Box59 + +new wx:CommandButton Box53 + set Box53.Label "-" + +new wx:CommandButton Box54 + set Box54.Label "+" + +new wx:LayoutLine Box56 + set Box56.Orientation "H" + +new creaVtk:PlaneWidget_Base Box57 + set Box57.Param "-1" + set Box57.Type "1" + +new creaVtk:PlaneWidget_Base Box60 + set Box60.Param "1" + set Box60.Type "1" + +new std:MultipleInputs Box61 + + +connect Box66.Out Box11.Renderer +connect Box66.Out Box37.render +connect Box79.Widget Box40.Widget2 +connect Box80.Widget Box44.Widget5 +connect Box46.Out Box45.MeshManagerModel +connect Box42.BoxChange Box51.BoxExecute +connect Box45.BoxChange Box51.In2 +connect Box71.Out Box72._wxvtkbaseview3D1 +connect Box64.Out Box72._wxvtkbaseview2D1 +connect Box65.Out Box72._wxvtkbaseview2D2 +connect Box69.Out Box72._wxvtkbaseview2D3 +connect Box72._widget Box79.Widget6 +connect Box44.Widget Box82.Widget2 +connect Box82.Widget Box79.Widget2 +connect Box84.Widget Box44.Widget9 +connect Box92.MeshManagerModel Box93.MeshManagerModel +connect Box92.MeshBase Box72._polydata +connect Box92.MeshBase Box37.polydata +connect Box81.Widget Box08.Widget2 +connect Box42.Widget Box44.Widget6 +connect Box43.Widget Box44.Widget7 +connect Box71.Out Box96.wxVtkBaseView +connect Box96.vtkRenderer Box66.In +connect Box37.widget Box79.Widget7 +connect Box40.Widget Box81.Widget2 +connect Box92.MeshManagerModel Box47.MeshManagerModel +connect Box43.BoxChange Box48.BoxExecute +connect Box92.MeshManagerModel Box48.MeshManagerModel +connect Box63.BoxChange Box72._execute +connect Box92.MeshBase Box45.Mesh +connect Box47.BoxChange Box51.In5 +connect Box37.boxchange Box11.BoxExecute +connect Box49.Out Box39.S +connect Box50.Widget Box52.Widget2 +connect Box49.Widget Box52.Widget4 +connect Box52.Widget Box44.Widget3 +connect Box35.Out Box55.image +connect Box96.vtkRenderer Box55.render +connect Box67.Out Box93.Mesh +connect Box67.Out Box39.In +connect Box71.Out Box55.wxvtkbaseview +connect Box50.Out Box58.Active +connect Box50.BoxChange Box59.In2 +connect Box55.boxchange Box59.In4 +connect Box59.BoxChange Box58.BoxExecute +connect Box55.PositionWorld Box58.Origin +connect Box55.normal Box58.NormalIn +connect Box96.vtkRenderer Box58.Renderer +connect Box35.Out Box58.In +connect Box80.BoxChange Box93.BoxExecute +connect Box53.Widget Box56.Widget2 +connect Box54.Widget Box56.Widget4 +connect Box56.Widget Box52.Widget6 +connect Box58.Base Box57.In +connect Box58.Base Box60.In +connect Box53.BoxChange Box57.BoxExecute +connect Box54.BoxChange Box60.BoxExecute +connect Box55.pointid Box39.EdgeId +connect Box58.Center Box39.Center +connect Box49.BoxChange Box61.In1 +connect Box58.BoxChange Box61.In2 +connect Box61.BoxChange Box39.BoxExecute +connect Box50.Out Box39.Active + +# Complex input ports +input mesh Box67.In " " +input image Box35.In " " +input title Box08.WinTitle " " +input meshmanagermodel Box46.In " " +input boxChange Box63.In " " +input wxvtkbaseview2 Box64.In " " +input wxvtkbaseview3 Box65.In " " +input wxvtkbaseview4 Box69.In " " +input wxvtkbaseview1 Box71.In " " + +# Complex output ports +output widget Box08.Widget " " + + +endefine diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg index 9c504d1..0efada9 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbg @@ -72,12 +72,12 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:69 +BOXES:72 BOX creaMaracasVisu:ShowNPoints:showNpoints ISEXEC:FALSE 24.787568:83.025910:-900.000000 -46.637568:80.525910:-900.000000 +61.627568:80.525910:-900.000000 PORT Radio:"1" PORT @@ -95,7 +95,7 @@ BOX creaMaracasVisu:ManualContourModel_Box:Box06 ISEXEC:FALSE 29.075845:30.364799:-900.000000 -52.285845:27.864799:-900.000000 +53.595845:27.864799:-900.000000 PORT DoubleContour:"1" PORT @@ -109,7 +109,7 @@ BOX wx:LayoutLine:Box08 ISEXEC:FALSE -182.125107:-147.642582:-900.000000 -33.320000:-150.142582:-900.000000 +-148.805107:-150.142582:-900.000000 FIN_BOX BOX vtk:UpdateRender:Box11 @@ -123,7 +123,7 @@ BOX creaMaracasVisu:DrawAxisTree3D:Box30 ISEXEC:FALSE 53.253812:0.984257:-900.000000 -75.433812:-1.515743:-900.000000 +81.293812:-1.515743:-900.000000 PORT Colour:"0 0 1" PORT @@ -139,7 +139,7 @@ BOX creaMaracasVisu:ManualContourModel_Box:Box29 ISEXEC:FALSE 76.240145:29.637449:-900.000000 -99.450145:27.137449:-900.000000 +100.760145:27.137449:-900.000000 PORT NbPoints:"40" PORT @@ -151,7 +151,7 @@ BOX creaMaracasVisu:wxPopupMenu:Box57 ISEXEC:FALSE -291.724262:77.620511:-900.000000 -17.480000:75.120511:-900.000000 +-269.659262:75.120511:-900.000000 PORT WithCtrlKey:"true" FIN_BOX @@ -159,7 +159,7 @@ BOX std:AddStringToVector:Box58 ISEXEC:FALSE -304.297403:100.641432:-900.000000 -24.520000:98.141432:-900.000000 +-279.777403:98.141432:-900.000000 PORT In0:"+ Add point" PORT @@ -179,19 +179,19 @@ In7:"+> Insert group after" PORT In8:"- Delete group" PORT -In9:"Tool 4 points" +In9:"Tool - 4 points to surface" FIN_BOX BOX creaMaracasVisu:ShowNPoints_Tools:Box60 ISEXEC:FALSE -271.997629:60.063100:-900.000000 -12.200000:57.563100:-900.000000 +-249.562629:57.563100:-900.000000 FIN_BOX BOX std:StringSelect:Box61 ISEXEC:FALSE --269.928610:68.362614:-900.000000 -24.520000:65.862614:-900.000000 +-331.944913:69.352894:-900.000000 +-307.424913:66.852894:-900.000000 PORT In0:"5" PORT @@ -223,7 +223,7 @@ BOX std:VectorFilterDouble:Box70 ISEXEC:FALSE 49.750242:60.953814:-900.000000 -72.180242:58.453814:-900.000000 +76.030242:58.453814:-900.000000 PORT Type:"11" FIN_BOX @@ -231,7 +231,7 @@ BOX creaVtk:BooleanOperationPolyDataFilter:Box77 ISEXEC:FALSE -85.337097:-56.984129:-900.000000 -12.200000:-59.484129:-900.000000 +-61.607097:-59.484129:-900.000000 PORT BoxProcessMode:"Manual" PORT @@ -240,8 +240,8 @@ FIN_BOX BOX wx:ComboBox:Box78 ISEXEC:FALSE --153.877713:-5.775167:-900.000000 -26.280000:-8.275167:-900.000000 +-153.505707:-32.466606:-900.000000 +-127.225707:-34.966606:-900.000000 PORT In:"Union Intersection Difference" FIN_BOX @@ -249,7 +249,7 @@ BOX wx:LayoutLine:Box79 ISEXEC:FALSE -144.033821:-109.706143:-900.000000 -33.320000:-112.206143:-900.000000 +-110.713821:-112.206143:-900.000000 PORT Orientation:"H" PORT @@ -258,8 +258,8 @@ FIN_BOX BOX wx:CommandButton:Box80 ISEXEC:FALSE --107.184095:21.801731:-900.000000 -21.000000:19.301731:-900.000000 +-107.307880:18.830890:-900.000000 +-85.032880:16.330890:-900.000000 PORT Label:"Run" FIN_BOX @@ -267,7 +267,7 @@ BOX std:MagicBox:Box66 ISEXEC:FALSE -56.713712:80.848585:-900.000000 -8.680000:78.348585:-900.000000 +-35.113712:78.348585:-900.000000 FIN_BOX BOX std:MagicBox:Box67 @@ -290,8 +290,8 @@ FIN_BOX BOX wx:Slider:Box34 ISEXEC:FALSE --198.941120:-3.426364:-900.000000 -29.800000:-5.926364:-900.000000 +-191.390233:59.951574:-900.000000 +-161.590233:57.451574:-900.000000 PORT In:"50" PORT @@ -308,8 +308,8 @@ FIN_BOX BOX std:Div:Box36 ISEXEC:FALSE --190.788172:-9.261990:-900.000000 -8.680000:-11.761990:-900.000000 +-183.237285:54.115948:-900.000000 +-162.312285:51.615948:-900.000000 PORT In2:"100" FIN_BOX @@ -317,7 +317,7 @@ BOX creaMaracasVisu:PolyDataToActor_Widget:Box37 ISEXEC:FALSE -62.803645:-79.746907:-900.000000 -10.440000:-82.246907:-900.000000 +-39.783645:-82.246907:-900.000000 PORT color:"0 1 1" FIN_BOX @@ -325,7 +325,7 @@ BOX wx:LayoutLine:Box38 ISEXEC:FALSE -186.054864:-109.780662:-900.000000 -33.320000:-112.280662:-900.000000 +-152.734864:-112.280662:-900.000000 PORT Orientation:"H" PORT @@ -335,19 +335,19 @@ BOX wx:LayoutTab:Box39 ISEXEC:FALSE -195.489774:-120.807458:-900.000000 -33.320000:-123.307458:-900.000000 +-162.169774:-123.307458:-900.000000 FIN_BOX BOX wx:LayoutTab:Box40 ISEXEC:FALSE -148.426599:-120.337683:-900.000000 -33.320000:-122.837683:-900.000000 +-115.106599:-122.837683:-900.000000 FIN_BOX BOX wx:CommandButton:Box42 ISEXEC:FALSE -91.903796:13.441695:-900.000000 -21.000000:10.941695:-900.000000 +-69.628796:10.941695:-900.000000 PORT Label:"Apply (Magenta->To Red)" FIN_BOX @@ -355,7 +355,7 @@ BOX wx:CommandButton:Box43 ISEXEC:FALSE -85.356515:8.083838:-900.000000 -21.000000:5.583838:-900.000000 +-63.081515:5.583838:-900.000000 PORT Label:"Reset Tool" FIN_BOX @@ -363,7 +363,7 @@ BOX wx:LayoutLine:Box44 ISEXEC:FALSE -154.036190:-43.432527:-900.000000 -33.320000:-45.932527:-900.000000 +-120.716190:-45.932527:-900.000000 PORT Orientation:"V" PORT @@ -373,7 +373,7 @@ BOX creaVtk:MeshManager_tool:Box45 ISEXEC:FALSE -85.991381:-134.296045:-900.000000 -10.440000:-136.796045:-900.000000 +-63.491381:-136.796045:-900.000000 PORT Tool:"30" FIN_BOX @@ -386,12 +386,12 @@ FIN_BOX BOX wx:ComboBox:Box49 ISEXEC:FALSE --182.639251:-13.479145:-900.000000 -26.280000:-15.979145:-900.000000 +-175.088364:49.898793:-900.000000 +-148.808364:47.398793:-900.000000 PORT In:"25 50 100 150" PORT -Selection:"1" +Selection:"0" PORT Title:"Number of Points" FIN_BOX @@ -399,7 +399,7 @@ BOX wx:LayoutLine:Box50 ISEXEC:FALSE -57.295971:-56.374591:-900.000000 -33.320000:-58.874591:-900.000000 +-23.975971:-58.874591:-900.000000 PORT Orientation:"V" PORT @@ -409,13 +409,13 @@ BOX std:MultipleInputs:Box51 ISEXEC:FALSE -92.949669:-148.627142:-900.000000 -21.000000:-151.127142:-900.000000 +-70.979669:-151.127142:-900.000000 FIN_BOX BOX creaMaracasVisu:ShowNPoints_Tools:Box52 ISEXEC:FALSE -48.321002:-133.648902:-900.000000 -12.200000:-136.148902:-900.000000 +-25.886002:-136.148902:-900.000000 PORT Type:"120" FIN_BOX @@ -423,13 +423,13 @@ BOX std:MultipleInputs:Box53 ISEXEC:FALSE -96.292390:-13.293248:-900.000000 -21.000000:-15.793248:-900.000000 +-74.322390:-15.793248:-900.000000 FIN_BOX BOX std:MultipleInputs:Box55 ISEXEC:FALSE -56.758371:-149.042885:-900.000000 -21.000000:-151.542885:-900.000000 +-34.788371:-151.542885:-900.000000 FIN_BOX BOX creaMaracasVisu:MeshContours_Widget:Box62 @@ -473,7 +473,7 @@ BOX creaMaracasVisu:MeshContours_Widget:Box72 ISEXEC:FALSE -191.950694:-87.321377:-900.000000 -13.960000:-89.821377:-900.000000 +-169.155694:-89.821377:-900.000000 PORT colorMesh:"0 1 1" FIN_BOX @@ -481,7 +481,7 @@ BOX wx:LayoutLine:Box81 ISEXEC:FALSE -180.022846:-140.278086:-900.000000 -33.320000:-142.778086:-900.000000 +-146.702846:-142.778086:-900.000000 PORT WinTitle:"Step 1. Surface" FIN_BOX @@ -489,37 +489,37 @@ BOX wx:LayoutTab:Box82 ISEXEC:FALSE -153.588182:-50.941996:-900.000000 -33.320000:-53.441996:-900.000000 +-120.268182:-53.441996:-900.000000 FIN_BOX BOX wx:LayoutTab:Box86 ISEXEC:FALSE -54.290640:-69.094847:-900.000000 -33.320000:-71.594847:-900.000000 +-20.970640:-71.594847:-900.000000 FIN_BOX BOX wx:OutputText:Box87 ISEXEC:FALSE -35.032220:-44.152050:-900.000000 -19.240000:-46.652050:-900.000000 +-13.362220:-46.652050:-900.000000 FIN_BOX BOX wx:OutputText:Box88 ISEXEC:FALSE -31.367033:-49.235762:-900.000000 -19.240000:-51.735762:-900.000000 +-9.697033:-51.735762:-900.000000 FIN_BOX BOX creaVtk:MeshManager:Box92 ISEXEC:FALSE -48.235592:-73.814750:-900.000000 -9.680000:-76.314750:-900.000000 +-26.205592:-76.314750:-900.000000 FIN_BOX BOX creaVtk:MeshManager_tool:Box93 ISEXEC:FALSE -61.627153:-92.643884:-900.000000 -10.440000:-95.143884:-900.000000 +-39.127153:-95.143884:-900.000000 PORT Tool:"35" FIN_BOX @@ -527,7 +527,7 @@ BOX std:MagicBox:Box94 ISEXEC:FALSE -67.076676:-63.786058:-900.000000 -8.680000:-66.286058:-900.000000 +-45.476676:-66.286058:-900.000000 FIN_BOX BOX creaVtk:PolyDataNormals:Box95 @@ -547,7 +547,7 @@ BOX wx:SpinCtrl:Box97 ISEXEC:FALSE 61.957510:-28.253822:-900.000000 -83.317510:-30.753822:-900.000000 +86.477510:-30.753822:-900.000000 PORT Max:"50" PORT @@ -567,7 +567,7 @@ BOX wx:Slider:Box99 ISEXEC:FALSE 70.913562:-8.032501:-900.000000 -92.068562:-10.532501:-900.000000 +100.713562:-10.532501:-900.000000 PORT In:"100" PORT @@ -593,7 +593,7 @@ BOX wx:LayoutLine:Box101 ISEXEC:FALSE 75.262796:-54.319784:-900.000000 -97.032796:-56.819784:-900.000000 +108.582796:-56.819784:-900.000000 PORT Orientation:"V" FIN_BOX @@ -601,7 +601,7 @@ BOX wx:LayoutLine:Box102 ISEXEC:FALSE 82.113479:-63.996790:-900.000000 -103.883479:-66.496790:-900.000000 +115.433479:-66.496790:-900.000000 PORT Orientation:"H" PORT @@ -617,13 +617,13 @@ BOX creaMaracasVisu:wxVtkBaseView_Info:Box105 ISEXEC:FALSE -238.523609:87.781768:-900.000000 -18.480000:85.281768:-900.000000 +-215.798609:85.281768:-900.000000 FIN_BOX BOX wx:LayoutTab:Box106 ISEXEC:FALSE 75.970731:-73.857697:-900.000000 -97.695731:-76.357697:-900.000000 +109.290731:-76.357697:-900.000000 FIN_BOX BOX creaMaracasVisu:MeshContours_Widget:Box107 @@ -636,8 +636,8 @@ FIN_BOX BOX creaVtk:MeshReduction_DecimatePro:Box108 ISEXEC:FALSE -124.328231:-37.982124:-900.000000 -147.933231:-40.482124:-900.000000 +140.776435:-37.674681:-900.000000 +164.381435:-40.174681:-900.000000 PORT TargetReduction:"0.8" FIN_BOX @@ -650,12 +650,38 @@ FIN_BOX BOX creaVtk:MeshReduction_QuadricDecimation:Box110 ISEXEC:FALSE -159.883842:-36.905093:-900.000000 -184.148842:-39.405093:-900.000000 +172.642730:-37.135675:-900.000000 +196.907730:-39.635675:-900.000000 PORT TargetReduction:"0.5" FIN_BOX -CONNECTIONS:149 +BOX +std:AddStringToVector:Box111 +ISEXEC:FALSE +-292.044479:93.098246:-900.000000 +-267.524479:90.598246:-900.000000 +PORT +In0:"Tool - Inverse Normals" +FIN_BOX +BOX +std:VectorFilterString:Box112 +ISEXEC:FALSE +-275.952424:71.064509:-900.000000 +-247.912424:68.564509:-900.000000 +PORT +In0:"0 1 2 3 4 5 6 7 8 9 10 " +PORT +In1:"5 10 20 30 40 50 0 100 110 200 210" +PORT +Type:"2" +FIN_BOX +BOX +std:ConcatStrings:Box114 +ISEXEC:FALSE +-270.706221:65.761298:-900.000000 +-247.946221:63.261298:-900.000000 +FIN_BOX +CONNECTIONS:150 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -693,15 +719,6 @@ CONNECTION Box31:BoxChange:Box11:BoxExecute NumberOfControlPoints:0 CONNECTION -Box58:Out:Box57:In -NumberOfControlPoints:0 -CONNECTION -Box57:Out:Box61:In -NumberOfControlPoints:0 -CONNECTION -Box61:Out:Box60:Type -NumberOfControlPoints:0 -CONNECTION showNpoints:WidgetShowNPoints:Box60:WidgetShowNPoints NumberOfControlPoints:0 CONNECTION @@ -1077,9 +1094,6 @@ CONNECTION Box67:Out:Box60:Mesh NumberOfControlPoints:0 CONNECTION -Box96:Out:Box108:In -NumberOfControlPoints:0 -CONNECTION Box109:Out:Box98:polydata NumberOfControlPoints:0 CONNECTION @@ -1101,6 +1115,21 @@ CONNECTION Box48:widget:Box38:Widget8 NumberOfControlPoints:0 CONNECTION -Box108:Out:Box109:In +Box96:Out:Box109:In +NumberOfControlPoints:0 +CONNECTION +Box58:Out:Box111:StringVector +NumberOfControlPoints:0 +CONNECTION +Box111:Out:Box57:In +NumberOfControlPoints:0 +CONNECTION +Box57:Out:Box112:sk1 +NumberOfControlPoints:0 +CONNECTION +Box112:Out1:Box114:In1 +NumberOfControlPoints:0 +CONNECTION +Box114:Out:Box60:Type NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs index 5c850f6..62ff7d3 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyPatch.bbs @@ -60,7 +60,7 @@ new std:AddStringToVector Box58 set Box58.In6 "----------------------" set Box58.In7 "+> Insert group after" set Box58.In8 "- Delete group" - set Box58.In9 "Tool 4 points" + set Box58.In9 "Tool - 4 points to surface" new creaMaracasVisu:ShowNPoints_Tools Box60 @@ -142,7 +142,7 @@ new std:MagicBox Box46 new wx:ComboBox Box49 set Box49.In "25 50 100 150" - set Box49.Selection "1" + set Box49.Selection "0" set Box49.Title "Number of Points" new wx:LayoutLine Box50 @@ -240,6 +240,16 @@ new std:MagicBox Box109 new creaVtk:MeshReduction_QuadricDecimation Box110 set Box110.TargetReduction "0.5" +new std:AddStringToVector Box111 + set Box111.In0 "Tool - Inverse Normals" + +new std:VectorFilterString Box112 + set Box112.In0 "0 1 2 3 4 5 6 7 8 9 10 " + set Box112.In1 "5 10 20 30 40 50 0 100 110 200 210" + set Box112.Type "2" + +new std:ConcatStrings Box114 + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -253,9 +263,6 @@ connect Box29.LstContourPointsY Box30.lstPointY connect Box29.LstContourPointsZ Box30.lstPointZ connect Box29.LstIndexsOut Box30.lstIndexs connect Box31.BoxChange Box11.BoxExecute -connect Box58.Out Box57.In -connect Box57.Out Box61.In -connect Box61.Out Box60.Type connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints connect Box57.BoxChange Box60.BoxExecute connect Box68.Spacing Box60.Spacing @@ -366,7 +373,6 @@ connect Box107._widget Box102.Widget6 connect Box103.BoxChange Box107._execute connect Box63.BoxChange Box103.In1 connect Box67.Out Box60.Mesh -connect Box96.Out Box108.In connect Box109.Out Box98.polydata connect Box109.Out Box107._polydata connect Box109.Out Box77.In2 @@ -374,7 +380,12 @@ connect Box96.Out Box110.In connect Box72._widget Box79.Widget3 connect Box98.widget Box102.Widget8 connect Box48.widget Box38.Widget8 -connect Box108.Out Box109.In +connect Box96.Out Box109.In +connect Box58.Out Box111.StringVector +connect Box111.Out Box57.In +connect Box57.Out Box112.sk1 +connect Box112.Out1 Box114.In1 +connect Box114.Out Box60.Type # Complex input ports input point showNpoints.In " " diff --git a/bbtk/bbs/boxes/PolyDataToActor_Widget.bbg b/bbtk/bbs/boxes/PolyDataToActor_Widget.bbg index 7cc889c..cce1603 100644 --- a/bbtk/bbs/boxes/PolyDataToActor_Widget.bbg +++ b/bbtk/bbs/boxes/PolyDataToActor_Widget.bbg @@ -10,7 +10,7 @@ AUTHOR:Author ?? COMPLEXBOX:TRUE COMPLEXBOXNAME:PolyDataToActor_Widget PACKAGENAME:creaMaracasVisu -COMPLEXOUTPUTS:2 +COMPLEXOUTPUTS:3 COMPLEX_PORT widget -2.037812:-82.749770:-900.000000 @@ -19,6 +19,10 @@ COMPLEX_PORT boxchange 48.028303:-85.261950:-900.000000 FIN_COMPLEX_PORT +COMPLEX_PORT +vtkprop3D +60.073531:-84.713710:-900.000000 +FIN_COMPLEX_PORT COMPLEXINPUTS:5 COMPLEX_PORT render @@ -53,7 +57,7 @@ BOX vtk:PolyDataToActor:Box09 ISEXEC:FALSE 45.132224:-46.323772:-900.000000 -67.372224:-48.823772:-900.000000 +71.412224:-48.823772:-900.000000 FIN_BOX BOX std:MagicBox:Box10 @@ -73,7 +77,7 @@ BOX wx:Slider:Box13 ISEXEC:FALSE -13.704404:-6.213707:-900.000000 -29.800000:-8.713707:-900.000000 +16.095596:-8.713707:-900.000000 PORT In:"50" PORT @@ -99,7 +103,7 @@ BOX wx:ComboBox:Box15 ISEXEC:FALSE 22.112635:-19.005024:-900.000000 -43.827635:-21.505024:-900.000000 +48.392635:-21.505024:-900.000000 PORT In:"Points WireFrame Surface" PORT @@ -111,9 +115,9 @@ BOX std:MultipleInputs:Box08 ISEXEC:FALSE -27.821638:-25.674906:-900.000000 -21.000000:-28.174906:-900.000000 +-5.851638:-28.174906:-900.000000 FIN_BOX -CONNECTIONS:17 +CONNECTIONS:18 CONNECTION Box10:Out:Box11:Renderer NumberOfControlPoints:0 @@ -165,4 +169,7 @@ NumberOfControlPoints:0 CONNECTION scalarvisibility:scalarvisibility:Box09:ScalarVisibility NumberOfControlPoints:0 +CONNECTION +Box09:Out:vtkprop3D:vtkprop3D +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/PolyDataToActor_Widget.bbs b/bbtk/bbs/boxes/PolyDataToActor_Widget.bbs index 3c66262..1a2cac3 100644 --- a/bbtk/bbs/boxes/PolyDataToActor_Widget.bbs +++ b/bbtk/bbs/boxes/PolyDataToActor_Widget.bbs @@ -66,6 +66,7 @@ input scalarvisibility Box09.ScalarVisibility " " # Complex output ports output widget Box04.Widget " " output boxchange Box09.BoxChange " " +output vtkprop3D Box09.Out " " endefine diff --git a/bbtk/bbs/boxes/SetPositionPointPicker.bbg b/bbtk/bbs/boxes/SetPositionPointPicker.bbg index d4ea8ab..585bc08 100644 --- a/bbtk/bbs/boxes/SetPositionPointPicker.bbg +++ b/bbtk/bbs/boxes/SetPositionPointPicker.bbg @@ -10,12 +10,28 @@ AUTHOR:info-dev@creatis.insa-lyon.fr COMPLEXBOX:TRUE COMPLEXBOXNAME:SetPositionPointPicker PACKAGENAME:creaMaracasVisu -COMPLEXOUTPUTS:1 +COMPLEXOUTPUTS:5 COMPLEX_PORT boxchange --9.213239:14.240089:-900.000000 +-9.290100:10.166468:-900.000000 FIN_COMPLEX_PORT -COMPLEXINPUTS:3 +COMPLEX_PORT +pointid +31.820358:11.298533:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +normal +12.220862:10.376204:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +PositionWorld +22.366484:12.682027:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +PositionImage +43.733777:12.144001:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:4 COMPLEX_PORT render 69.901565:137.945660:-900.000000 @@ -28,6 +44,10 @@ COMPLEX_PORT wxvtkbaseview 90.962875:134.060564:-900.000000 FIN_COMPLEX_PORT +COMPLEX_PORT +vtkprop3D +55.493475:137.580775:-900.000000 +FIN_COMPLEX_PORT BOXES:7 BOX vtk:ImageVtkProperties:Box24 @@ -46,32 +66,32 @@ FIN_BOX BOX std:MathOperationVector:Box48 ISEXEC:FALSE -22.756536:71.258420:-900.000000 -47.276536:68.758420:-900.000000 +37.283221:70.797255:-900.000000 +61.803221:68.297255:-900.000000 PORT Type:"3" FIN_BOX BOX std:MathOperationVector:Box49 ISEXEC:FALSE -26.833970:63.962803:-900.000000 -51.353970:61.462803:-900.000000 +58.961771:62.886752:-900.000000 +83.481771:60.386752:-900.000000 PORT Type:"23" FIN_BOX BOX creaMaracasVisu:SetPosition:Box50 ISEXEC:FALSE -16.273915:54.364595:-900.000000 -37.933915:51.864595:-900.000000 +33.337006:53.134823:-900.000000 +54.997006:50.634823:-900.000000 PORT FixAxis2D:"true" FIN_BOX BOX creaMaracasVisu:SetPosition:Box32 ISEXEC:FALSE -22.025494:44.019147:-900.000000 -43.685494:41.519147:-900.000000 +47.466408:38.024007:-900.000000 +69.126408:35.524007:-900.000000 PORT FixAxis2D:"false" FIN_BOX @@ -81,7 +101,7 @@ ISEXEC:FALSE 48.710471:81.272436:-900.000000 70.420471:78.772436:-900.000000 FIN_BOX -CONNECTIONS:13 +CONNECTIONS:18 CONNECTION Box47:Point:Box48:In0 NumberOfControlPoints:0 @@ -121,4 +141,19 @@ NumberOfControlPoints:0 CONNECTION Box47:BoxChange:boxchange:boxchange NumberOfControlPoints:0 +CONNECTION +vtkprop3D:vtkprop3D:Box47:Prop3D +NumberOfControlPoints:0 +CONNECTION +Box47:PointId:pointid:pointid +NumberOfControlPoints:0 +CONNECTION +Box47:Normal:normal:normal +NumberOfControlPoints:0 +CONNECTION +Box47:Point:PositionWorld:PositionWorld +NumberOfControlPoints:0 +CONNECTION +Box49:Out:PositionImage:PositionImage +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/SetPositionPointPicker.bbs b/bbtk/bbs/boxes/SetPositionPointPicker.bbs index 77db91d..695c461 100644 --- a/bbtk/bbs/boxes/SetPositionPointPicker.bbs +++ b/bbtk/bbs/boxes/SetPositionPointPicker.bbs @@ -51,9 +51,14 @@ connect Box100.Out Box32.wxVtkBaseView input render Box47.Renderer " " input image Box24.In " " input wxvtkbaseview Box100.In " " +input vtkprop3D Box47.Prop3D " " # Complex output ports output boxchange Box47.BoxChange " " +output pointid Box47.PointId " " +output normal Box47.Normal " " +output PositionWorld Box47.Point " " +output PositionImage Box49.Out " " endefine diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index ec39f26..7161020 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -16,9 +16,9 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints_Tools,bbtk::AtomicBlackBox); void ShowNPoints_Tools::NearestPointToMesh( vtkPoints *points,vtkStaticPointLocator *pointLocator,double *spc,double *p,double *pM) { - p[0] = p[0] * spc[0]; - p[1] = p[1] * spc[1]; - p[2] = p[2] * spc[2]; + p[0] = p[0] * spc[0]; + p[1] = p[1] * spc[1]; + p[2] = p[2] * spc[2]; points->GetPoint( pointLocator->FindClosestPoint(p) , pM ); pM[0] = pM[0] / spc[0]; pM[1] = pM[1] / spc[1]; @@ -179,6 +179,10 @@ void ShowNPoints_Tools::Process() { CreatePatch01(); } // if Type + if (bbGetInputType()==210) + { + bbGetInputWidgetShowNPoints()->InvertLstPoints(); + } // if Type } // if bbGetInputWidgetShowNPoints } //===== diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx index bb59af5..1fedfc2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx @@ -400,4 +400,21 @@ bool ModelShowNPoints::GetFirstTime() return firsttime; } +//---------------------------------------------------------------------- +void ModelShowNPoints::InversLstPoints() +{ + int i,size = lstPointsX.size(); + int i2,size2 = size/2; + double dTmp; + std::string sTmp; + for (i=0 ; i lstPointsX; std::vector lstPointsY; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 9c73b00..22c98a7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -1332,3 +1332,14 @@ int WidgetShowNPoints::GetLstModelShowNPointsSize() { return lstModelShowNPoints.size(); } + +//------------------------------------------------------------------------ +void WidgetShowNPoints::InvertLstPoints() +{ + int i,size=lstModelShowNPoints.size(); + for (i=0 ; i < size ; i++) + { + lstModelShowNPoints[i]->InversLstPoints(); + } // for iM + SetOutputBox(); +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h index 8fed9e7..76f25de 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.h @@ -57,7 +57,7 @@ class WidgetShowNPoints : public wxPanel void RefreshCollectionText(); void RefreshColourCollection(); - + void InvertLstPoints(); // EED 2022-05-19 //void RefreshPoint(int id); -- 2.47.1