From b3c17c05db93ad4cd96934f4adfc0eb80dccaae6 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 23 Mar 2023 11:47:58 +0100 Subject: [PATCH] Clean code --- bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg | 221 +++++++++++++++------- bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs | 41 +++- 2 files changed, 188 insertions(+), 74 deletions(-) diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg index aa0c1c2..0935238 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg @@ -72,12 +72,12 @@ COMPLEX_PORT meshmanagermodel -150.374274:130.740991:-900.000000 FIN_COMPLEX_PORT -BOXES:60 +BOXES:64 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:"2" PORT @@ -88,21 +88,19 @@ FIN_BOX BOX creaVtk:CreateMeshFromPoints:Box04 ISEXEC:FALSE -31.252553:-1.141010:-900.000000 -54.107553:-3.641010:-900.000000 +29.752185:-0.390826:-900.000000 +52.607185:-2.890826:-900.000000 FIN_BOX 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 NbPoints:"100" PORT -OpenClose:"true" -PORT OpenClose2:"false" FIN_BOX BOX @@ -114,8 +112,8 @@ FIN_BOX BOX vtk:UpdateRender:Box11 ISEXEC:FALSE -50.398091:-54.711454:-900.000000 -72.423091:-57.211454:-900.000000 +8.762877:-56.586914:-900.000000 +30.787877:-59.086914:-900.000000 PORT Active:"true" FIN_BOX @@ -123,7 +121,7 @@ BOX creaMaracasVisu:DrawAxisTree3D:Box30 ISEXEC:FALSE 66.011927:-0.645212:-900.000000 -88.191927:-3.145212:-900.000000 +94.051927:-3.145212:-900.000000 PORT Colour:"0 0 1" PORT @@ -132,26 +130,24 @@ FIN_BOX BOX std:MultipleInputs:Box31 ISEXEC:FALSE -5.423388:-28.995680:-900.000000 -27.393388:-31.495680:-900.000000 +14.774837:-45.768661:-900.000000 +36.744837:-48.268661:-900.000000 FIN_BOX 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 -OpenClose:"true" -PORT OpenClose2:"false" FIN_BOX 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 +155,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 @@ -191,13 +187,13 @@ BOX vtk:ImageVtkProperties:Box68 ISEXEC:FALSE -111.766259:110.196821:-900.000000 -16.720000:107.696821:-900.000000 +-89.231259:107.696821:-900.000000 FIN_BOX 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 @@ -205,7 +201,7 @@ BOX creaVtk:BooleanOperationPolyDataFilter:Box77 ISEXEC:FALSE -85.849843:-22.221970:-900.000000 -12.200000:-24.721970:-900.000000 +-62.119843:-24.721970:-900.000000 PORT BoxProcessMode:"Manual" PORT @@ -215,7 +211,7 @@ BOX wx:ComboBox:Box78 ISEXEC:FALSE -153.877713:-5.775167:-900.000000 -26.280000:-8.275167:-900.000000 +-127.597713:-8.275167:-900.000000 PORT In:"Union Intersection Difference" FIN_BOX @@ -223,7 +219,7 @@ BOX wx:LayoutLine:Box79 ISEXEC:FALSE -144.841026:-82.628158:-900.000000 -33.320000:-85.128158:-900.000000 +-111.521026:-85.128158:-900.000000 PORT Orientation:"H" PORT @@ -241,31 +237,31 @@ BOX std:MagicBox:Box66 ISEXEC:FALSE -148.055989:80.219744:-900.000000 -8.680000:77.719744:-900.000000 +-126.455989:77.719744:-900.000000 FIN_BOX BOX std:MagicBox:Box67 ISEXEC:FALSE -67.526006:124.007723:-900.000000 -8.680000:121.507723:-900.000000 +-45.926006:121.507723:-900.000000 FIN_BOX BOX creaMaracasVisu:PolyDataToActor_Widget:Box48 ISEXEC:FALSE -13.436541:-16.292093:-900.000000 -36.456541:-18.792093:-900.000000 +2.746015:-16.179561:-900.000000 +25.766015:-18.679561:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box35 ISEXEC:FALSE -107.091396:123.633118:-900.000000 -6.920000:121.133118:-900.000000 +-83.881396:121.133118:-900.000000 FIN_BOX BOX wx:Slider:Box34 ISEXEC:FALSE -198.941120:-3.426364:-900.000000 -29.800000:-5.926364:-900.000000 +-169.141120:-5.926364:-900.000000 PORT In:"50" PORT @@ -283,7 +279,7 @@ BOX std:Div:Box36 ISEXEC:FALSE -190.788172:-9.261990:-900.000000 -8.680000:-11.761990:-900.000000 +-169.863172:-11.761990:-900.000000 PORT In2:"100" FIN_BOX @@ -291,7 +287,7 @@ BOX creaMaracasVisu:PolyDataToActor_Widget:Box37 ISEXEC:FALSE -67.388857:-39.476785:-900.000000 -13.960000:-41.976785:-900.000000 +-44.368857:-41.976785:-900.000000 PORT color:"0 1 1" PORT @@ -301,7 +297,7 @@ BOX wx:LayoutLine:Box38 ISEXEC:FALSE -190.854929:-82.522396:-900.000000 -33.320000:-85.022396:-900.000000 +-157.534929:-85.022396:-900.000000 PORT Orientation:"H" PORT @@ -311,19 +307,19 @@ BOX wx:LayoutTab:Box39 ISEXEC:FALSE -195.888488:-89.508403:-900.000000 -33.320000:-92.008403:-900.000000 +-162.568488:-92.008403:-900.000000 FIN_BOX BOX wx:LayoutTab:Box40 ISEXEC:FALSE -148.825313:-89.038628:-900.000000 -33.320000:-91.538628:-900.000000 +-115.505313:-91.538628:-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 @@ -331,7 +327,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 @@ -339,7 +335,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 @@ -349,7 +345,7 @@ BOX creaVtk:MeshManager_tool:Box45 ISEXEC:FALSE -90.848443:-133.408000:-900.000000 -10.440000:-135.908000:-900.000000 +-68.348443:-135.908000:-900.000000 PORT Tool:"30" FIN_BOX @@ -357,13 +353,13 @@ BOX std:MagicBox:Box46 ISEXEC:FALSE -137.131256:113.921532:-900.000000 -8.680000:111.421532:-900.000000 +-115.531256:111.421532:-900.000000 FIN_BOX BOX wx:ComboBox:Box49 ISEXEC:FALSE -182.639251:-13.479145:-900.000000 -26.280000:-15.979145:-900.000000 +-156.359251:-15.979145:-900.000000 PORT In:"25 50 100 150" PORT @@ -375,7 +371,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 @@ -391,7 +387,7 @@ 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 @@ -399,7 +395,7 @@ 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 @@ -425,31 +421,31 @@ BOX std:MagicBox:Box64 ISEXEC:FALSE -243.113826:124.330340:-900.000000 -8.680000:121.830340:-900.000000 +-221.513826:121.830340:-900.000000 FIN_BOX BOX std:MagicBox:Box65 ISEXEC:FALSE -220.296210:124.504415:-900.000000 -8.680000:122.004415:-900.000000 +-198.696210:122.004415:-900.000000 FIN_BOX BOX std:MagicBox:Box69 ISEXEC:FALSE -197.793508:124.678490:-900.000000 -8.680000:122.178490:-900.000000 +-176.193508:122.178490:-900.000000 FIN_BOX BOX std:MagicBox:Box71 ISEXEC:FALSE -273.359367:124.504415:-900.000000 -8.680000:122.004415:-900.000000 +-251.759367:122.004415:-900.000000 FIN_BOX BOX creaMaracasVisu:MeshContours_Widget:Box72 ISEXEC:FALSE -180.819147:-56.018495:-900.000000 -13.960000:-58.518495:-900.000000 +-158.024147:-58.518495:-900.000000 PORT colorMesh:"0 1 1" FIN_BOX @@ -457,7 +453,7 @@ BOX wx:LayoutLine:Box81 ISEXEC:FALSE -184.734921:-96.564525:-900.000000 -33.320000:-99.064525:-900.000000 +-151.414921:-99.064525:-900.000000 PORT WinTitle:"Step 1. Surface" FIN_BOX @@ -465,13 +461,13 @@ BOX wx:LayoutTab:Box82 ISEXEC:FALSE -142.286608:-51.350487:-900.000000 -33.320000:-53.850487:-900.000000 +-108.966608:-53.850487:-900.000000 FIN_BOX BOX wx:OutputText:Box84 ISEXEC:FALSE -127.611417:-38.148449:-900.000000 -19.240000:-40.648449:-900.000000 +-105.941417:-40.648449:-900.000000 FIN_BOX BOX wx:LayoutTab:Box86 @@ -480,28 +476,22 @@ ISEXEC:FALSE -23.693911:-64.786670:-900.000000 FIN_BOX BOX -wx:OutputText:Box87 -ISEXEC:FALSE --35.032220:-44.152050:-900.000000 -19.240000:-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 -56.608588:-81.789032:-900.000000 -9.680000:-84.289032:-900.000000 +-34.578588:-84.289032:-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 @@ -509,13 +499,13 @@ BOX std:MagicBox:Box94 ISEXEC:FALSE -70.989776:-33.864327:-900.000000 -8.680000:-36.364327:-900.000000 +-49.389776:-36.364327:-900.000000 FIN_BOX BOX creaMaracasVisu:wxVtkBaseView_Info:Box96 ISEXEC:FALSE -157.021318:90.558496:-900.000000 -27.280000:88.058496:-900.000000 +-129.741318:88.058496:-900.000000 FIN_BOX BOX creaVtk:PolyDataNormals:Box97 @@ -527,7 +517,7 @@ BOX wx:LayoutLine:Box98 ISEXEC:FALSE -143.911108:-17.437953:-900.000000 -33.320000:-19.937953:-900.000000 +-110.591108:-19.937953:-900.000000 PORT Orientation:"H" FIN_BOX @@ -535,7 +525,7 @@ BOX std:AddStringToVector:Box99 ISEXEC:FALSE -309.024176:108.151656:-900.000000 -24.520000:105.651656:-900.000000 +-284.504176:105.651656:-900.000000 PORT In0:"Auto Add Points (Start/Stop)" FIN_BOX @@ -543,7 +533,7 @@ BOX std:VectorFilterString:Box100 ISEXEC:FALSE -265.790737:67.872984:-900.000000 -28.040000:65.372984:-900.000000 +-237.750737:65.372984:-900.000000 PORT In0:"0 1 2 3 4 5 6 7 8 9 10 " PORT @@ -555,9 +545,63 @@ BOX std:ConcatStrings:Box101 ISEXEC:FALSE -265.899318:61.380437:-900.000000 -22.760000:58.880437:-900.000000 +-243.139318:58.880437:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box102 +ISEXEC:FALSE +-40.533540:29.017711:-900.000000 +-18.793540:26.517711:-900.000000 +PORT +In:"true" +PORT +ReactiveOnKeystroke:"true" +PORT +Title:"Close " +FIN_BOX +BOX +wx:CheckBox:Box103 +ISEXEC:FALSE +-32.928859:47.395747:-900.000000 +-11.188859:44.895747:-900.000000 +PORT +In:"false" +PORT +ReactiveOnKeystroke:"true" +PORT +Title:"Show Normals" +FIN_BOX +BOX +creaVtk:GlyphPolyDataNormals:Box104 +ISEXEC:FALSE +38.820748:-34.725366:-900.000000 +61.810748:-37.225366:-900.000000 +PORT +MaskRatio:"2" +PORT +Opacity:"1" +PORT +Size:"5" +FIN_BOX +BOX +creaVtk:PolyDataNormals:Box105 +ISEXEC:FALSE +51.998032:-20.482004:-900.000000 +74.403032:-22.982004:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box106 +ISEXEC:FALSE +-17.803540:53.620811:-900.000000 +3.936460:51.120811:-900.000000 +PORT +In:"true" +PORT +ReactiveOnKeystroke:"true" +PORT +Title:"CloseSurface" FIN_BOX -CONNECTIONS:125 +CONNECTIONS:138 CONNECTION Box06:LstContourPointsX:Box04:LstX NumberOfControlPoints:0 @@ -835,9 +879,6 @@ CONNECTION showNpoints:Widget:Box86:Widget2 NumberOfControlPoints:0 CONNECTION -Box87:Widget:Box50:Widget8 -NumberOfControlPoints:0 -CONNECTION Box88:Widget:Box50:Widget9 NumberOfControlPoints:0 CONNECTION @@ -933,4 +974,46 @@ NumberOfControlPoints:0 CONNECTION Box57:Out:Box100:sk1 NumberOfControlPoints:0 +CONNECTION +Box102:Widget:Box50:Widget5 +NumberOfControlPoints:0 +CONNECTION +Box102:Out:Box04:OpenClose +NumberOfControlPoints:0 +CONNECTION +Box102:Out:Box06:OpenClose +NumberOfControlPoints:0 +CONNECTION +Box102:Out:Box29:OpenClose +NumberOfControlPoints:0 +CONNECTION +Box103:Out:Box104:Active +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box104:Renderer +NumberOfControlPoints:0 +CONNECTION +Box103:Widget:Box50:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box103:BoxChange:Box104:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box104:BoxChange:Box31:In6 +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box105:In +NumberOfControlPoints:0 +CONNECTION +Box105:Out:Box104:In +NumberOfControlPoints:0 +CONNECTION +Box106:Widget:Box50:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box106:Out:Box04:CloseSurface +NumberOfControlPoints:0 +CONNECTION +Box106:BoxChange:Box31:In7 +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs index 6cf1094..72cff1e 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs @@ -28,7 +28,6 @@ new creaVtk:CreateMeshFromPoints Box04 new creaMaracasVisu:ManualContourModel_Box Box06 set Box06.DoubleContour "1" set Box06.NbPoints "100" - set Box06.OpenClose "true" set Box06.OpenClose2 "false" new wx:LayoutLine Box08 @@ -44,7 +43,6 @@ new std:MultipleInputs Box31 new creaMaracasVisu:ManualContourModel_Box Box29 set Box29.NbPoints "40" - set Box29.OpenClose "true" set Box29.OpenClose2 "false" new creaMaracasVisu:wxPopupMenu Box57 @@ -172,8 +170,6 @@ new wx:OutputText Box84 new wx:LayoutTab Box86 -new wx:OutputText Box87 - new wx:OutputText Box88 new creaVtk:MeshManager Box92 @@ -200,6 +196,28 @@ new std:VectorFilterString Box100 new std:ConcatStrings Box101 +new wx:CheckBox Box102 + set Box102.In "true" + set Box102.ReactiveOnKeystroke "true" + set Box102.Title "Close " + +new wx:CheckBox Box103 + set Box103.In "false" + set Box103.ReactiveOnKeystroke "true" + set Box103.Title "Show Normals" + +new creaVtk:GlyphPolyDataNormals Box104 + set Box104.MaskRatio "2" + set Box104.Opacity "1" + set Box104.Size "5" + +new creaVtk:PolyDataNormals Box105 + +new wx:CheckBox Box106 + set Box106.In "true" + set Box106.ReactiveOnKeystroke "true" + set Box106.Title "CloseSurface" + connect Box06.LstContourPointsX Box04.LstX connect showNpoints.lstIndexs Box06.LstIndexsIn @@ -282,7 +300,6 @@ connect Box84.Widget Box44.Widget9 connect Box86.Widget Box38.Widget2 connect Box50.Widget Box86.Widget4 connect showNpoints.Widget Box86.Widget2 -connect Box87.Widget Box50.Widget8 connect Box88.Widget Box50.Widget9 connect Box49.Widget Box50.Widget2 connect Box34.Widget Box50.Widget4 @@ -311,6 +328,20 @@ connect Box99.Out Box58.StringVector connect Box100.Out1 Box101.In1 connect Box101.Out Box60.Type connect Box57.Out Box100.sk1 +connect Box102.Widget Box50.Widget5 +connect Box102.Out Box04.OpenClose +connect Box102.Out Box06.OpenClose +connect Box102.Out Box29.OpenClose +connect Box103.Out Box104.Active +connect Box66.Out Box104.Renderer +connect Box103.Widget Box50.Widget6 +connect Box103.BoxChange Box104.BoxExecute +connect Box104.BoxChange Box31.In6 +connect Box04.Out Box105.In +connect Box105.Out Box104.In +connect Box106.Widget Box50.Widget7 +connect Box106.Out Box04.CloseSurface +connect Box106.BoxChange Box31.In7 # Complex input ports input point showNpoints.In " " -- 2.47.1