]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs
3522 Mesh_tool_ApplyPatchSimple
[creaMaracasVisu.git] / bbtk / bbs / boxes / Mesh_tool_ApplyPatchSimple.bbs
1 # ----------------------------------
2 # - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
3 # - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.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_ApplyPatchSimple 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.OpenClose "false"
32   set Box06.OpenClose2 "false"
33
34 new wx:LayoutLine Box08
35
36 new vtk:UpdateRender Box11
37   set Box11.Active "true"
38
39 new creaMaracasVisu:DrawAxisTree3D Box30
40   set Box30.Colour "0 0 1"
41   set Box30.LineWidth "2"
42
43 new std:MultipleInputs Box31
44
45 new creaMaracasVisu:ManualContourModel_Box Box29
46   set Box29.NbPoints "40"
47   set Box29.OpenClose "false"
48   set Box29.OpenClose2 "false"
49
50 new creaMaracasVisu:wxPopupMenu Box57
51   set Box57.WithCtrlKey "true"
52
53 new std:AddStringToVector Box58
54   set Box58.In0 "+  Add point"
55   set Box58.In1 "(+)  Insert point"
56   set Box58.In2 "Track point"
57   set Box58.In3 "Set Nearest point"
58   set Box58.In4 "-  Erase point"
59   set Box58.In5 "--  Delete all points"
60   set Box58.In6 "----------------------"
61   set Box58.In7 "+>  Insert group after"
62   set Box58.In8 "-  Delete group"
63   set Box58.In9 "Tool - 3 or 4 points to surface"
64
65 new creaMaracasVisu:ShowNPoints_Tools Box60
66
67 new vtk:ImageVtkProperties Box68
68
69 new std:VectorFilterDouble Box70
70   set Box70.Type "11"
71
72 new wx:LayoutLine Box79
73   set Box79.Orientation "H"
74   set Box79.WinTitle "New Surface ( Magenta  =  Red+Yellow )"
75
76 new wx:CommandButton Box80
77   set Box80.Label "Run"
78
79 new std:MagicBox Box66
80
81 new std:MagicBox Box67
82
83 new creaMaracasVisu:PolyDataToActor_Widget Box48
84
85 new vtk:vtkImageDataPointerRelay Box35
86
87 new wx:Slider Box34
88   set Box34.In "50"
89   set Box34.Label "true"
90   set Box34.Max "100"
91   set Box34.Min "0"
92   set Box34.ReactiveOnTrack "true"
93   set Box34.Title "Splines Opacity"
94
95 new std:Div Box36
96   set Box36.In2 "100"
97
98 new creaMaracasVisu:PolyDataToActor_Widget Box37
99   set Box37.color "0 1 1"
100   set Box37.meshOpacity "100"
101
102 new wx:LayoutLine Box38
103   set Box38.Orientation "H"
104   set Box38.WinTitle "Interpolated Surface (Yellow)"
105
106 new wx:LayoutTab Box39
107
108 new wx:LayoutTab Box40
109
110 new wx:CommandButton Box42
111   set Box42.Label "Apply  (Magenta->To Red)"
112
113 new wx:CommandButton Box43
114   set Box43.Label "Reset Tool"
115
116 new wx:LayoutLine Box44
117   set Box44.Orientation "V"
118   set Box44.WinTitle "1.3   Mesh Action"
119
120 new creaVtk:MeshManager_tool Box45
121   set Box45.Tool "30"
122
123 new std:MagicBox Box46
124
125 new wx:ComboBox Box49
126   set Box49.In "25 50 100 150"
127   set Box49.Selection "0"
128   set Box49.Title "Number of Points"
129
130 new wx:LayoutLine Box50
131   set Box50.Orientation "V"
132   set Box50.WinTitle "Config"
133
134 new std:MultipleInputs Box51
135
136 new creaMaracasVisu:ShowNPoints_Tools Box52
137   set Box52.Type "120"
138
139 new std:MultipleInputs Box53
140
141 new std:MultipleInputs Box55
142
143 new creaMaracasVisu:MeshContours_Widget Box62
144   set Box62.colorMesh "1 1 0"
145
146 new std:MagicBox Box63
147
148 new std:MagicBox Box64
149
150 new std:MagicBox Box65
151
152 new std:MagicBox Box69
153
154 new std:MagicBox Box71
155
156 new creaMaracasVisu:MeshContours_Widget Box72
157   set Box72.colorMesh "0 1 1"
158
159 new wx:LayoutLine Box81
160   set Box81.WinTitle "Step 1.   Surface"
161
162 new wx:LayoutTab Box82
163
164 new wx:LayoutTab Box86
165
166 new wx:OutputText Box87
167
168 new wx:OutputText Box88
169
170 new creaVtk:MeshManager Box92
171
172 new creaVtk:MeshManager_tool Box93
173   set Box93.Tool "35"
174
175 new creaMaracasVisu:wxVtkBaseView_Info Box105
176
177 new std:AddStringToVector Box111
178   set Box111.In0 "Tool - Inverse Normals"
179
180 new std:VectorFilterString Box112
181   set Box112.In0 "0 1    2   3   4   5   6   7   8       9     10     11"
182   set Box112.In1 "1  5  10 20 30 40 50 0  100   110   200   210"
183   set Box112.Type "2"
184
185 new std:ConcatStrings Box114
186
187 new wx:LayoutLine Box117
188   set Box117.Orientation "H"
189
190 new std:AddStringToVector Box119
191   set Box119.In0 "Auto Add Points (Start/Stop)"
192
193 new creaMaracasVisu:ShowNPoints_Tools Box120
194   set Box120.BoxProcessMode "Manual"
195   set Box120.Type "220"
196
197 new wx:CommandButton Box121
198   set Box121.Label "+"
199
200 new wx:CommandButton Box127
201   set Box127.Label "-"
202
203 new creaMaracasVisu:ShowNPoints_Tools Box128
204   set Box128.BoxProcessMode "Manual"
205   set Box128.Type "220"
206
207 new std:ConcatStrings Box130
208   set Box130.In2 "  1"
209
210 new std:ConcatStrings Box131
211   set Box131.In2 "  -1"
212
213 new std:MultipleInputs Box126
214
215 new wx:LayoutLine Box129
216   set Box129.Orientation "H"
217   set Box129.WinTitle "1.2 Curvature"
218
219 new std:GetVectorDoubleSubVector Box132
220   set Box132.ErrorValue "0"
221   set Box132.I "3"
222   set Box132.Size "3"
223
224 new wx:LayoutLine Box134
225   set Box134.Orientation "V"
226   set Box134.WinTitle "1.4   Apply Changes"
227
228 new creaVtk:CleanMeshWithPatch Box135
229
230 new creaVtk:PolyDataToImageData Box139
231
232 new vtk:CreateImage Box140
233
234 new vtk:MarchingCubes Box141
235
236 new vtk:ImageGaussianSmooth Box142
237   set Box142.StdDevX "1"
238   set Box142.StdDevY "1"
239   set Box142.StdDevZ "1"
240
241 new creaVtk:MeshReduction_DecimatePro Box143
242   set Box143.BoxProcessMode "Manual"
243   set Box143.TargetReduction "0.8"
244
245 new wx:LayoutLine Box145
246   set Box145.Orientation "H"
247
248 new wx:LayoutTab Box146
249
250 new wx:LayoutLine Box147
251   set Box147.Orientation "H"
252   set Box147.WinTitle "New Surface ( Magenta  =  Red+Yellow )"
253
254 new wx:LayoutTab Box148
255
256 new std:MagicBox Box150
257
258 new creaVtk:ImageGaussianSmooth2 Box151
259   set Box151.StdDevX "1"
260   set Box151.StdDevY "1"
261   set Box151.StdDevZ "1"
262
263 new creaVtk:MarchingCubes2 Box152
264   set Box152.Value "128"
265
266 new std:MultipleInputs Box154
267
268
269 connect Box06.LstContourPointsX Box04.LstX
270 connect showNpoints.lstIndexs Box06.LstIndexsIn
271 connect Box06.LstContourPointsY Box04.LstY
272 connect Box06.LstContourPointsZ Box04.LstZ
273 connect Box06.LstIndexsOut Box04.LstIndexs
274 connect Box30.BoxChange Box31.In4
275 connect showNpoints.lstIndexs Box29.LstIndexsIn
276 connect Box29.LstContourPointsX Box30.lstPointX
277 connect Box29.LstContourPointsY Box30.lstPointY
278 connect Box29.LstContourPointsZ Box30.lstPointZ
279 connect Box29.LstIndexsOut Box30.lstIndexs
280 connect Box31.BoxChange Box11.BoxExecute
281 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
282 connect Box57.BoxChange Box60.BoxExecute
283 connect Box68.Spacing Box60.Spacing
284 connect showNpoints.lstPointsX Box70.In0
285 connect showNpoints.lstPointsY Box70.In1
286 connect showNpoints.lstPointsZ Box70.In2
287 connect Box70.Out0 Box06.LstControlPointsX
288 connect Box70.Out1 Box06.LstControlPointsY
289 connect Box70.Out2 Box06.LstControlPointsZ
290 connect Box70.Out0 Box29.LstControlPointsX
291 connect Box70.Out1 Box29.LstControlPointsY
292 connect Box70.Out2 Box29.LstControlPointsZ
293 connect Box66.Out Box11.Renderer
294 connect Box66.Out Box30.Renderer
295 connect Box66.Out showNpoints.Renderer
296 connect Box04.Out Box48.polydata
297 connect Box66.Out Box48.render
298 connect Box48.boxchange Box31.In1
299 connect Box35.Out Box68.In
300 connect Box68.Spacing Box70.k1
301 connect Box35.Out showNpoints.Image
302 connect Box34.Out Box36.In1
303 connect Box36.Out Box30.Opacity
304 connect Box34.BoxChange Box31.In2
305 connect Box66.Out Box37.render
306 connect Box38.Widget Box39.Widget2
307 connect Box79.Widget Box40.Widget2
308 connect Box46.Out Box45.MeshManagerModel
309 connect Box49.OutString Box06.NbPoints
310 connect Box45.BoxChange Box51.In2
311 connect Box52.BoxChange Box51.In4
312 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
313 connect Box80.BoxChange Box53.In2
314 connect Box43.BoxChange Box55.BoxExecute
315 connect Box52.BoxChange Box55.In2
316 connect Box43.BoxChange Box53.In6
317 connect Box63.BoxChange showNpoints.BoxExecute
318 connect Box63.BoxChange Box62._execute
319 connect Box64.Out Box57.wxVtkBaseView2
320 connect Box64.Out Box62._wxvtkbaseview2D1
321 connect Box65.Out Box57.wxVtkBaseView3
322 connect Box65.Out Box62._wxvtkbaseview2D2
323 connect Box69.Out Box57.wxVtkBaseView4
324 connect Box69.Out Box62._wxvtkbaseview2D3
325 connect Box71.Out Box57.wxVtkBaseView
326 connect Box71.Out Box62._wxvtkbaseview3D1
327 connect Box71.Out Box72._wxvtkbaseview3D1
328 connect Box64.Out Box72._wxvtkbaseview2D1
329 connect Box65.Out Box72._wxvtkbaseview2D2
330 connect Box69.Out Box72._wxvtkbaseview2D3
331 connect Box39.Widget Box81.Widget2
332 connect Box44.Widget Box82.Widget2
333 connect Box82.Widget Box79.Widget2
334 connect Box86.Widget Box38.Widget2
335 connect Box50.Widget Box86.Widget4
336 connect showNpoints.Widget Box86.Widget2
337 connect Box87.Widget Box50.Widget8
338 connect Box88.Widget Box50.Widget9
339 connect Box49.Widget Box50.Widget2
340 connect Box34.Widget Box50.Widget4
341 connect Box57.BoxChange Box08.BoxExecute
342 connect Box92.MeshManagerModel Box93.MeshManagerModel
343 connect Box92.MeshBase Box72._polydata
344 connect Box92.MeshBase Box37.polydata
345 connect Box37.boxchange Box72._execute
346 connect Box81.Widget Box08.Widget2
347 connect Box71.Out Box105.wxVtkBaseView
348 connect Box105.vtkRenderer Box66.In
349 connect Box40.Widget Box81.Widget6
350 connect Box04.Out Box62._polydata
351 connect Box67.Out Box60.Mesh
352 connect Box58.Out Box111.StringVector
353 connect Box111.Out Box57.In
354 connect Box57.Out Box112.sk1
355 connect Box112.Out1 Box114.In1
356 connect Box114.Out Box60.Type
357 connect Box43.Widget Box44.Widget1
358 connect Box80.Widget Box117.Widget4
359 connect Box117.Widget Box44.Widget3
360 connect Box119.Out Box58.StringVector
361 connect Box68.Spacing Box120.Spacing
362 connect showNpoints.WidgetShowNPoints Box120.WidgetShowNPoints
363 connect Box121.BoxChange Box120.BoxExecute
364 connect Box127.BoxChange Box128.BoxExecute
365 connect Box68.Spacing Box128.Spacing
366 connect showNpoints.WidgetShowNPoints Box128.WidgetShowNPoints
367 connect Box130.Out Box120.Params
368 connect Box131.Out Box128.Params
369 connect Box120.BoxChange Box31.In3
370 connect Box128.BoxChange Box31.In5
371 connect showNpoints.BoxChange Box126.In4
372 connect Box128.BoxChange Box126.In2
373 connect Box120.BoxChange Box126.In1
374 connect Box126.BoxChange Box31.BoxExecute
375 connect Box127.Widget Box129.Widget4
376 connect Box121.Widget Box129.Widget6
377 connect Box60.Out Box132.In
378 connect Box132.Out Box131.In1
379 connect Box132.Out Box130.In1
380 connect Box42.Widget Box134.Widget3
381 connect Box67.Out Box135.Mesh
382 connect Box04.Out Box135.Patch
383 connect showNpoints.lstPointsX Box135.LstX
384 connect showNpoints.lstPointsY Box135.LstY
385 connect showNpoints.lstPointsZ Box135.LstZ
386 connect showNpoints.lstIndexs Box135.LstIndexs
387 connect Box68.Spacing Box135.Spacing
388 connect Box135.Out Box139.InPolyData
389 connect Box68.Spacing Box140.Spacing
390 connect Box68.Size Box140.Dimensions
391 connect Box68.TypeName Box140.OutputFormat
392 connect Box140.Out Box139.InImage
393 connect Box139.Out Box142.In
394 connect Box62._widget Box145.Widget2
395 connect Box48.widget Box145.Widget4
396 connect Box145.Widget Box38.Widget8
397 connect Box129.Widget Box146.Widget2
398 connect Box146.Widget Box38.Widget4
399 connect Box42.BoxChange Box51.BoxExecute
400 connect Box72._widget Box147.Widget2
401 connect Box37.widget Box147.Widget4
402 connect Box147.Widget Box79.Widget6
403 connect Box134.Widget Box148.Widget3
404 connect Box148.Widget Box79.Widget4
405 connect Box143.Out Box45.Mesh
406 connect Box143.Out Box93.Mesh
407 connect Box53.BoxChange Box143.BoxExecute
408 connect Box53.BoxChange Box150.BoxExecute
409 connect Box139.Out Box151.In
410 connect Box151.Out Box141.In
411 connect Box151.Out Box152.In
412 connect Box152.Out Box143.In
413 connect Box42.BoxChange Box53.In3
414 connect Box150.BoxChange Box37.boxexecute
415 connect Box150.BoxChange Box154.In1
416 connect Box143.BoxChange Box154.In3
417 connect Box154.BoxChange Box93.BoxExecute
418
419 # Complex input ports
420 input point showNpoints.In " "
421 input mesh Box67.In " "
422 input image Box35.In " "
423 input title Box08.WinTitle " "
424 input meshmanagermodel Box46.In " "
425 input boxChange Box63.In " "
426 input wxvtkbaseview2 Box64.In " "
427 input wxvtkbaseview3 Box65.In " "
428 input wxvtkbaseview4 Box69.In " "
429 input wxvtkbaseview1 Box71.In " "
430
431 # Complex output ports
432 output widget Box08.Widget " "
433 output interactorStyleMaracas Box57.InteractorStyleMaracas " "
434 output interactorStyleMaracas2 Box57.InteractorStyleMaracas2 " "
435 output interactorStyleMaracas3 Box57.InteractorStyleMaracas3 " "
436 output interactorStyleMaracas4 Box57.InteractorStyleMaracas4 " "
437
438
439 endefine