]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
#3497 Mesh_tool_ApplyThresholdConnectivity
[creaMaracasVisu.git] / bbtk / bbs / boxes / Mesh_tool_ApplySurface.bbs
1 # ----------------------------------
2 # - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
3 # - /home/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
4 # ----------------------------------
5
6 include std
7 include itkvtk
8 include creaMaracasVisu
9 include creaVtk
10 include wx
11 include vtk
12 include std
13
14 define Mesh_tool_ApplySurface creaMaracasVisu
15
16 author "info-dev@creatis.insa-lyon.fr"
17 description "Show N Points"
18
19 category "demo"
20
21 new creaMaracasVisu:ShowNPoints showNpoints
22   set showNpoints.Radio "2"
23   set showNpoints.Type "4"
24   set showNpoints.WinTitle "1.1   Splines"
25
26 new creaVtk:CreateMeshFromPoints Box04
27
28 new creaMaracasVisu:ManualContourModel_Box Box06
29   set Box06.DoubleContour "1"
30   set Box06.NbPoints "100"
31   set Box06.OpenClose2 "false"
32
33 new wx:LayoutLine Box08
34
35 new vtk:UpdateRender Box11
36   set Box11.Active "true"
37
38 new creaMaracasVisu:DrawAxisTree3D Box30
39   set Box30.Colour "0 0 1"
40   set Box30.LineWidth "2"
41
42 new std:MultipleInputs Box31
43
44 new creaMaracasVisu:ManualContourModel_Box Box29
45   set Box29.NbPoints "40"
46   set Box29.OpenClose2 "false"
47
48 new creaMaracasVisu:wxPopupMenu Box57
49   set Box57.WithCtrlKey "true"
50
51 new std:AddStringToVector Box58
52   set Box58.In0 "+  Add point"
53   set Box58.In1 "(+)  Insert point"
54   set Box58.In2 "Track point"
55   set Box58.In3 "Set Nearest point"
56   set Box58.In4 "-  Erase point"
57   set Box58.In5 "--  Delete all points"
58   set Box58.In6 "----------------------"
59   set Box58.In7 "+>  Insert group after"
60   set Box58.In8 "- Delete group"
61   set Box58.In9 "Tool - Inverse Normals"
62
63 new creaMaracasVisu:ShowNPoints_Tools Box60
64
65 new vtk:ImageVtkProperties Box68
66
67 new std:VectorFilterDouble Box70
68   set Box70.Type "11"
69
70 new creaVtk:BooleanOperationPolyDataFilter Box77
71   set Box77.BoxProcessMode "Manual"
72   set Box77.ReorientDifferenceCells "false"
73
74 new wx:ComboBox Box78
75   set Box78.In "Union Intersection Difference"
76
77 new wx:LayoutLine Box79
78   set Box79.Orientation "H"
79   set Box79.WinTitle "New Surface ( Magenta  =  Red+Yellow )"
80
81 new wx:CommandButton Box80
82   set Box80.Label "Refresh"
83
84 new std:MagicBox Box66
85
86 new std:MagicBox Box67
87
88 new creaMaracasVisu:PolyDataToActor_Widget Box48
89
90 new vtk:vtkImageDataPointerRelay Box35
91
92 new wx:Slider Box34
93   set Box34.In "50"
94   set Box34.Label "true"
95   set Box34.Max "100"
96   set Box34.Min "0"
97   set Box34.ReactiveOnTrack "true"
98   set Box34.Title "Splines Opacity"
99
100 new std:Div Box36
101   set Box36.In2 "100"
102
103 new creaMaracasVisu:PolyDataToActor_Widget Box37
104   set Box37.color "0 1 1"
105   set Box37.meshOpacity "100"
106
107 new wx:LayoutLine Box38
108   set Box38.Orientation "H"
109   set Box38.WinTitle "Interpolated Surface (Yellow)"
110
111 new wx:LayoutTab Box39
112
113 new wx:LayoutTab Box40
114
115 new wx:CommandButton Box42
116   set Box42.Label "Apply  (Magenta->To Red)"
117
118 new wx:CommandButton Box43
119   set Box43.Label "Reset Tool"
120
121 new wx:LayoutLine Box44
122   set Box44.Orientation "V"
123   set Box44.WinTitle "1.2   Mesh Action"
124
125 new creaVtk:MeshManager_tool Box45
126   set Box45.Tool "30"
127
128 new std:MagicBox Box46
129
130 new wx:ComboBox Box49
131   set Box49.In "25 50 100 150"
132   set Box49.Selection "1"
133   set Box49.Title "Number of Points"
134
135 new wx:LayoutLine Box50
136   set Box50.Orientation "V"
137   set Box50.WinTitle "Config"
138
139 new std:MultipleInputs Box51
140
141 new creaMaracasVisu:ShowNPoints_Tools Box52
142   set Box52.Type "120"
143
144 new std:MultipleInputs Box53
145
146 new std:MultipleInputs Box55
147
148 new creaMaracasVisu:MeshContours_Widget Box62
149   set Box62.colorMesh "1 1 0"
150
151 new std:MagicBox Box63
152
153 new std:MagicBox Box64
154
155 new std:MagicBox Box65
156
157 new std:MagicBox Box69
158
159 new std:MagicBox Box71
160
161 new creaMaracasVisu:MeshContours_Widget Box72
162   set Box72.colorMesh "0 1 1"
163
164 new wx:LayoutLine Box81
165   set Box81.WinTitle "Step 1.   Surface"
166
167 new wx:LayoutTab Box82
168
169 new wx:OutputText Box84
170
171 new wx:LayoutTab Box86
172
173 new wx:OutputText Box88
174
175 new creaVtk:MeshManager Box92
176
177 new creaVtk:MeshManager_tool Box93
178   set Box93.Tool "35"
179
180 new std:MagicBox Box94
181
182 new creaMaracasVisu:wxVtkBaseView_Info Box96
183
184 new creaVtk:PolyDataNormals Box97
185
186 new wx:LayoutLine Box98
187   set Box98.Orientation "H"
188
189 new std:AddStringToVector Box99
190   set Box99.In0 "Auto Add Points (Start/Stop)"
191
192 new std:VectorFilterString Box100
193   set Box100.In0 "0  1  2   3   4   5   6   7   8      9       10 "
194   set Box100.In1 "1  5 10 20 30 40 50 0  100   110   210"
195   set Box100.Type "2"
196
197 new std:ConcatStrings Box101
198
199 new wx:CheckBox Box102
200   set Box102.In "true"
201   set Box102.ReactiveOnKeystroke "true"
202   set Box102.Title "Close "
203
204 new wx:CheckBox Box103
205   set Box103.In "false"
206   set Box103.ReactiveOnKeystroke "true"
207   set Box103.Title "Show Normals"
208
209 new creaVtk:GlyphPolyDataNormals Box104
210   set Box104.MaskRatio "2"
211   set Box104.Opacity "1"
212   set Box104.Size "5"
213
214 new creaVtk:PolyDataNormals Box105
215
216 new wx:CheckBox Box106
217   set Box106.In "true"
218   set Box106.ReactiveOnKeystroke "true"
219   set Box106.Title "CloseSurface"
220
221
222 connect Box06.LstContourPointsX Box04.LstX
223 connect showNpoints.lstIndexs Box06.LstIndexsIn
224 connect Box06.LstContourPointsY Box04.LstY
225 connect Box06.LstContourPointsZ Box04.LstZ
226 connect Box06.LstIndexsOut Box04.LstIndexs
227 connect Box30.BoxChange Box31.In4
228 connect showNpoints.lstIndexs Box29.LstIndexsIn
229 connect Box29.LstContourPointsX Box30.lstPointX
230 connect Box29.LstContourPointsY Box30.lstPointY
231 connect Box29.LstContourPointsZ Box30.lstPointZ
232 connect Box29.LstIndexsOut Box30.lstIndexs
233 connect Box31.BoxChange Box11.BoxExecute
234 connect Box58.Out Box57.In
235 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
236 connect Box57.BoxChange Box60.BoxExecute
237 connect Box68.Spacing Box60.Spacing
238 connect showNpoints.lstPointsX Box70.In0
239 connect showNpoints.lstPointsY Box70.In1
240 connect showNpoints.lstPointsZ Box70.In2
241 connect Box70.Out0 Box06.LstControlPointsX
242 connect Box70.Out1 Box06.LstControlPointsY
243 connect Box70.Out2 Box06.LstControlPointsZ
244 connect Box70.Out0 Box29.LstControlPointsX
245 connect Box70.Out1 Box29.LstControlPointsY
246 connect Box70.Out2 Box29.LstControlPointsZ
247 connect Box78.Out Box77.Operation
248 connect Box66.Out Box11.Renderer
249 connect Box66.Out Box30.Renderer
250 connect Box66.Out showNpoints.Renderer
251 connect Box67.Out Box77.In1
252 connect Box04.Out Box48.polydata
253 connect Box66.Out Box48.render
254 connect showNpoints.BoxChange Box31.BoxExecute
255 connect Box48.boxchange Box31.In1
256 connect Box35.Out Box68.In
257 connect Box68.Spacing Box70.k1
258 connect Box35.Out showNpoints.Image
259 connect Box34.Out Box36.In1
260 connect Box36.Out Box30.Opacity
261 connect Box34.BoxChange Box31.In2
262 connect Box04.Out Box77.In2
263 connect Box66.Out Box37.render
264 connect Box38.Widget Box39.Widget2
265 connect Box79.Widget Box40.Widget2
266 connect Box46.Out Box45.MeshManagerModel
267 connect Box49.OutString Box06.NbPoints
268 connect Box42.BoxChange Box51.BoxExecute
269 connect Box45.BoxChange Box51.In2
270 connect Box52.BoxChange Box51.In4
271 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
272 connect Box80.BoxChange Box53.In2
273 connect Box53.BoxChange Box77.BoxExecute
274 connect Box42.BoxChange Box53.In3
275 connect Box43.BoxChange Box55.BoxExecute
276 connect Box52.BoxChange Box55.In2
277 connect Box43.BoxChange Box53.In6
278 connect Box63.BoxChange showNpoints.BoxExecute
279 connect Box63.BoxChange Box62._execute
280 connect Box64.Out Box57.wxVtkBaseView2
281 connect Box64.Out Box62._wxvtkbaseview2D1
282 connect Box65.Out Box57.wxVtkBaseView3
283 connect Box65.Out Box62._wxvtkbaseview2D2
284 connect Box69.Out Box57.wxVtkBaseView4
285 connect Box69.Out Box62._wxvtkbaseview2D3
286 connect Box71.Out Box57.wxVtkBaseView
287 connect Box71.Out Box62._wxvtkbaseview3D1
288 connect Box04.Out Box62._polydata
289 connect Box71.Out Box72._wxvtkbaseview3D1
290 connect Box64.Out Box72._wxvtkbaseview2D1
291 connect Box65.Out Box72._wxvtkbaseview2D2
292 connect Box69.Out Box72._wxvtkbaseview2D3
293 connect Box72._widget Box79.Widget6
294 connect Box62._widget Box38.Widget7
295 connect Box39.Widget Box81.Widget2
296 connect Box40.Widget Box81.Widget4
297 connect Box44.Widget Box82.Widget2
298 connect Box82.Widget Box79.Widget2
299 connect Box84.Widget Box44.Widget9
300 connect Box86.Widget Box38.Widget2
301 connect Box50.Widget Box86.Widget4
302 connect showNpoints.Widget Box86.Widget2
303 connect Box88.Widget Box50.Widget9
304 connect Box49.Widget Box50.Widget2
305 connect Box34.Widget Box50.Widget4
306 connect Box57.BoxChange Box08.BoxExecute
307 connect Box92.MeshManagerModel Box93.MeshManagerModel
308 connect Box77.BoxChange Box93.BoxExecute
309 connect Box92.MeshBase Box72._polydata
310 connect Box92.MeshBase Box37.polydata
311 connect Box37.boxchange Box72._execute
312 connect Box81.Widget Box08.Widget2
313 connect Box42.Widget Box44.Widget6
314 connect Box94.BoxChange Box37.boxexecute
315 connect Box77.BoxChange Box94.BoxExecute
316 connect Box71.Out Box96.wxVtkBaseView
317 connect Box96.vtkRenderer Box66.In
318 connect Box37.widget Box79.Widget7
319 connect Box48.widget Box38.Widget8
320 connect Box77.Out Box97.In
321 connect Box97.Out Box45.Mesh
322 connect Box97.Out Box93.Mesh
323 connect Box43.Widget Box44.Widget1
324 connect Box78.Widget Box98.Widget2
325 connect Box80.Widget Box98.Widget4
326 connect Box98.Widget Box44.Widget3
327 connect Box99.Out Box58.StringVector
328 connect Box100.Out1 Box101.In1
329 connect Box101.Out Box60.Type
330 connect Box57.Out Box100.sk1
331 connect Box102.Widget Box50.Widget5
332 connect Box102.Out Box06.OpenClose
333 connect Box102.Out Box29.OpenClose
334 connect Box103.Out Box104.Active
335 connect Box66.Out Box104.Renderer
336 connect Box103.Widget Box50.Widget6
337 connect Box103.BoxChange Box104.BoxExecute
338 connect Box104.BoxChange Box31.In6
339 connect Box04.Out Box105.In
340 connect Box105.Out Box104.In
341 connect Box106.Widget Box50.Widget7
342 connect Box106.Out Box04.CloseSurface
343 connect Box106.BoxChange Box31.In7
344
345 # Complex input ports
346 input point showNpoints.In " "
347 input mesh Box67.In " "
348 input image Box35.In " "
349 input title Box08.WinTitle " "
350 input meshmanagermodel Box46.In " "
351 input boxChange Box63.In " "
352 input wxvtkbaseview2 Box64.In " "
353 input wxvtkbaseview3 Box65.In " "
354 input wxvtkbaseview4 Box69.In " "
355 input wxvtkbaseview1 Box71.In " "
356
357 # Complex output ports
358 output widget Box08.Widget " "
359 output interactorStyleMaracas Box57.InteractorStyleMaracas " "
360 output interactorStyleMaracas2 Box57.InteractorStyleMaracas2 " "
361 output interactorStyleMaracas3 Box57.InteractorStyleMaracas3 " "
362 output interactorStyleMaracas4 Box57.InteractorStyleMaracas4 " "
363
364
365 endefine