]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplyPatchSimple.bbs
3543 Clean Mesh Contours in Mesh Application
[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 "6"
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
105 new wx:LayoutTab Box40
106
107 new wx:CommandButton Box42
108   set Box42.Label "Apply  (Magenta->To Red)"
109
110 new wx:CommandButton Box43
111   set Box43.Label "Reset Tool"
112
113 new wx:LayoutLine Box44
114   set Box44.Orientation "V"
115   set Box44.WinTitle "1.3   Mesh Action"
116
117 new creaVtk:MeshManager_tool Box45
118   set Box45.Tool "30"
119
120 new std:MagicBox Box46
121
122 new wx:ComboBox Box49
123   set Box49.In "25 50 100 150"
124   set Box49.Selection "0"
125   set Box49.Title "Number of Points"
126
127 new wx:LayoutLine Box50
128   set Box50.Orientation "V"
129   set Box50.WinTitle "Config"
130
131 new std:MultipleInputs Box51
132
133 new creaMaracasVisu:ShowNPoints_Tools Box52
134   set Box52.Type "120"
135
136 new std:MultipleInputs Box53
137
138 new std:MultipleInputs Box55
139
140 new creaMaracasVisu:MeshContours_Widget Box62
141   set Box62.colorMesh "1 1 0"
142
143 new std:MagicBox Box63
144
145 new std:MagicBox Box64
146
147 new std:MagicBox Box65
148
149 new std:MagicBox Box69
150
151 new std:MagicBox Box71
152
153 new creaMaracasVisu:MeshContours_Widget Box72
154   set Box72.colorMesh "0 1 1"
155
156 new wx:LayoutLine Box81
157   set Box81.WinTitle "Step 1.   Surface"
158
159 new wx:LayoutTab Box82
160
161 new wx:LayoutTab Box86
162
163 new wx:OutputText Box87
164
165 new wx:OutputText Box88
166
167 new creaVtk:MeshManager Box92
168
169 new creaVtk:MeshManager_tool Box93
170   set Box93.Tool "35"
171
172 new creaMaracasVisu:wxVtkBaseView_Info Box105
173
174 new std:AddStringToVector Box111
175   set Box111.In0 "Tool - Inverse Normals"
176
177 new std:VectorFilterString Box112
178   set Box112.In0 "0 1    2   3   4   5   6   7   8       9     10     11"
179   set Box112.In1 "1  5  10 20 30 40 50 0  100   110   200   210"
180   set Box112.Type "2"
181
182 new std:ConcatStrings Box114
183
184 new wx:LayoutLine Box117
185   set Box117.Orientation "H"
186
187 new std:AddStringToVector Box119
188   set Box119.In0 "Auto Add Points (Start/Stop)"
189
190 new creaMaracasVisu:ShowNPoints_Tools Box120
191   set Box120.BoxProcessMode "Manual"
192   set Box120.Params "1"
193   set Box120.Type "220"
194
195 new wx:CommandButton Box121
196   set Box121.Label "+"
197
198 new wx:CommandButton Box127
199   set Box127.Label "-"
200
201 new creaMaracasVisu:ShowNPoints_Tools Box128
202   set Box128.BoxProcessMode "Manual"
203   set Box128.Params "-1"
204   set Box128.Type "220"
205
206 new std:MultipleInputs Box126
207
208 new wx:LayoutLine Box129
209   set Box129.Orientation "H"
210   set Box129.WinTitle "1.2 Curvature"
211
212 new wx:LayoutLine Box134
213   set Box134.Orientation "V"
214   set Box134.WinTitle "1.4   Apply Changes"
215
216 new creaVtk:CleanMeshWithPatch Box135
217
218 new creaVtk:PolyDataToImageData Box139
219
220 new vtk:CreateImage Box140
221
222 new creaVtk:MeshReduction_DecimatePro Box143
223   set Box143.BoxProcessMode "Manual"
224   set Box143.TargetReduction "0.8"
225
226 new wx:LayoutLine Box145
227   set Box145.Orientation "V"
228   set Box145.WinTitle "Visu"
229
230 new wx:LayoutTab Box146
231
232 new wx:LayoutLine Box147
233   set Box147.Orientation "V"
234   set Box147.WinTitle "Visu"
235
236 new wx:LayoutTab Box148
237
238 new std:MagicBox Box150
239
240 new creaVtk:ImageGaussianSmooth2 Box151
241   set Box151.StdDevX "1"
242   set Box151.StdDevY "1"
243   set Box151.StdDevZ "1"
244
245 new creaVtk:MarchingCubes2 Box152
246   set Box152.Value "128"
247
248 new std:MultipleInputs Box154
249
250 new wx:LayoutLine Box136
251   set Box136.Orientation "V"
252   set Box136.WinTitle "conf"
253
254 new wx:LayoutTab Box137
255
256 new wx:LayoutLine Box138
257   set Box138.Orientation "V"
258   set Box138.WinTitle "conf"
259
260 new wx:LayoutTab Box144
261
262 new wx:OutputText Box149
263
264 new wx:OutputText Box153
265
266 new wx:OutputText Box155
267
268 new wx:OutputText Box156
269
270 new std:MagicBox Box157
271
272 new creaMaracasVisu:ShowNPoints_Tools Box158
273   set Box158.Params "0"
274   set Box158.Type "250"
275
276 new creaVtk:PolyDataNormals Box159
277
278 new std:VectorFilterDouble Box160
279   set Box160.Type "14"
280
281 new std:MagicBox Box161
282
283 new std:ConcatStrings Box162
284
285 new std:ConcatStrings Box163
286
287 new std:ConcatStrings_tool Box164
288
289 new std:StringSelect Box165
290   set Box165.In0 "0"
291   set Box165.In1 "2"
292
293 new creaMaracasVisu:InteractorStyleMaracas_Model Box166
294
295 new std:MagicBox Box167
296
297 new std:MagicBox Box168
298
299 new std:MagicBox Box169
300
301
302 connect Box06.LstContourPointsX Box04.LstX
303 connect showNpoints.lstIndexs Box06.LstIndexsIn
304 connect Box06.LstContourPointsY Box04.LstY
305 connect Box06.LstContourPointsZ Box04.LstZ
306 connect Box06.LstIndexsOut Box04.LstIndexs
307 connect Box30.BoxChange Box31.In4
308 connect Box29.LstContourPointsX Box30.lstPointX
309 connect Box29.LstContourPointsY Box30.lstPointY
310 connect Box29.LstContourPointsZ Box30.lstPointZ
311 connect Box29.LstIndexsOut Box30.lstIndexs
312 connect Box31.BoxChange Box11.BoxExecute
313 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
314 connect Box57.BoxChange Box60.BoxExecute
315 connect Box68.Spacing Box60.Spacing
316 connect showNpoints.lstPointsX Box70.In0
317 connect showNpoints.lstPointsY Box70.In1
318 connect showNpoints.lstPointsZ Box70.In2
319 connect Box70.Out0 Box06.LstControlPointsX
320 connect Box70.Out1 Box06.LstControlPointsY
321 connect Box70.Out2 Box06.LstControlPointsZ
322 connect Box66.Out Box11.Renderer
323 connect Box66.Out Box30.Renderer
324 connect Box66.Out showNpoints.Renderer
325 connect Box04.Out Box48.polydata
326 connect Box66.Out Box48.render
327 connect Box48.boxchange Box31.In1
328 connect Box35.Out Box68.In
329 connect Box68.Spacing Box70.k1
330 connect Box35.Out showNpoints.Image
331 connect Box34.Out Box36.In1
332 connect Box36.Out Box30.Opacity
333 connect Box34.BoxChange Box31.In2
334 connect Box66.Out Box37.render
335 connect Box79.Widget Box40.Widget2
336 connect Box46.Out Box45.MeshManagerModel
337 connect Box49.OutString Box06.NbPoints
338 connect Box45.BoxChange Box51.In2
339 connect Box52.BoxChange Box51.In4
340 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
341 connect Box80.BoxChange Box53.In2
342 connect Box43.BoxChange Box55.BoxExecute
343 connect Box52.BoxChange Box55.In2
344 connect Box43.BoxChange Box53.In6
345 connect Box64.Out Box57.wxVtkBaseView2
346 connect Box64.Out Box62._wxvtkbaseview2D1
347 connect Box65.Out Box57.wxVtkBaseView3
348 connect Box65.Out Box62._wxvtkbaseview2D2
349 connect Box69.Out Box57.wxVtkBaseView4
350 connect Box69.Out Box62._wxvtkbaseview2D3
351 connect Box71.Out Box57.wxVtkBaseView
352 connect Box71.Out Box62._wxvtkbaseview3D1
353 connect Box71.Out Box72._wxvtkbaseview3D1
354 connect Box64.Out Box72._wxvtkbaseview2D1
355 connect Box65.Out Box72._wxvtkbaseview2D2
356 connect Box69.Out Box72._wxvtkbaseview2D3
357 connect Box44.Widget Box82.Widget2
358 connect Box82.Widget Box79.Widget2
359 connect Box86.Widget Box38.Widget2
360 connect Box50.Widget Box86.Widget4
361 connect showNpoints.Widget Box86.Widget2
362 connect Box87.Widget Box50.Widget8
363 connect Box88.Widget Box50.Widget9
364 connect Box49.Widget Box50.Widget2
365 connect Box34.Widget Box50.Widget4
366 connect Box57.BoxChange Box08.BoxExecute
367 connect Box92.MeshManagerModel Box93.MeshManagerModel
368 connect Box92.MeshBase Box72._polydata
369 connect Box92.MeshBase Box37.polydata
370 connect Box81.Widget Box08.Widget2
371 connect Box71.Out Box105.wxVtkBaseView
372 connect Box105.vtkRenderer Box66.In
373 connect Box40.Widget Box81.Widget6
374 connect Box04.Out Box62._polydata
375 connect Box67.Out Box60.Mesh
376 connect Box58.Out Box111.StringVector
377 connect Box111.Out Box57.In
378 connect Box57.Out Box112.sk1
379 connect Box112.Out1 Box114.In1
380 connect Box114.Out Box60.Type
381 connect Box43.Widget Box44.Widget1
382 connect Box80.Widget Box117.Widget4
383 connect Box117.Widget Box44.Widget3
384 connect Box119.Out Box58.StringVector
385 connect Box68.Spacing Box120.Spacing
386 connect showNpoints.WidgetShowNPoints Box120.WidgetShowNPoints
387 connect Box121.BoxChange Box120.BoxExecute
388 connect Box127.BoxChange Box128.BoxExecute
389 connect Box68.Spacing Box128.Spacing
390 connect showNpoints.WidgetShowNPoints Box128.WidgetShowNPoints
391 connect Box120.BoxChange Box31.In3
392 connect Box128.BoxChange Box31.In5
393 connect showNpoints.BoxChange Box126.In4
394 connect Box128.BoxChange Box126.In2
395 connect Box120.BoxChange Box126.In1
396 connect Box126.BoxChange Box31.BoxExecute
397 connect Box127.Widget Box129.Widget4
398 connect Box121.Widget Box129.Widget6
399 connect Box42.Widget Box134.Widget3
400 connect Box67.Out Box135.Mesh
401 connect Box04.Out Box135.Patch
402 connect showNpoints.lstPointsX Box135.LstX
403 connect showNpoints.lstPointsY Box135.LstY
404 connect showNpoints.lstPointsZ Box135.LstZ
405 connect showNpoints.lstIndexs Box135.LstIndexs
406 connect Box68.Spacing Box135.Spacing
407 connect Box135.Out Box139.InPolyData
408 connect Box68.Spacing Box140.Spacing
409 connect Box68.Size Box140.Dimensions
410 connect Box68.TypeName Box140.OutputFormat
411 connect Box140.Out Box139.InImage
412 connect Box129.Widget Box146.Widget2
413 connect Box146.Widget Box38.Widget4
414 connect Box42.BoxChange Box51.BoxExecute
415 connect Box134.Widget Box148.Widget3
416 connect Box148.Widget Box79.Widget4
417 connect Box53.BoxChange Box143.BoxExecute
418 connect Box53.BoxChange Box150.BoxExecute
419 connect Box139.Out Box151.In
420 connect Box151.Out Box152.In
421 connect Box152.Out Box143.In
422 connect Box42.BoxChange Box53.In3
423 connect Box150.BoxChange Box37.boxexecute
424 connect Box150.BoxChange Box154.In1
425 connect Box143.BoxChange Box154.In3
426 connect Box154.BoxChange Box93.BoxExecute
427 connect Box38.Widget Box81.Widget2
428 connect Box62._widgetB Box136.Widget2
429 connect Box48.widgetB Box136.Widget4
430 connect Box62._widgetA Box145.Widget2
431 connect Box48.widgetA Box145.Widget4
432 connect Box145.Widget Box137.Widget2
433 connect Box137.Widget Box38.Widget6
434 connect Box136.Widget Box137.Widget4
435 connect Box72._widgetA Box147.Widget2
436 connect Box37.widgetA Box147.Widget4
437 connect Box72._widgetB Box138.Widget2
438 connect Box37.widgetB Box138.Widget4
439 connect Box147.Widget Box144.Widget2
440 connect Box138.Widget Box144.Widget4
441 connect Box144.Widget Box79.Widget6
442 connect Box149.Widget Box145.Widget9
443 connect Box153.Widget Box136.Widget9
444 connect Box155.Widget Box147.Widget9
445 connect Box156.Widget Box138.Widget9
446 connect Box157.Out Box45.Mesh
447 connect Box157.Out Box93.Mesh
448 connect showNpoints.WidgetShowNPoints Box158.WidgetShowNPoints
449 connect Box04.BoxChange Box158.BoxExecute
450 connect Box68.Spacing Box158.Spacing
451 connect Box04.Out Box159.In
452 connect Box159.Out Box158.Mesh
453 connect Box143.Out Box157.In
454 connect showNpoints.lstSelectedIndexs Box160.k1
455 connect Box70.Out0 Box160.In0
456 connect Box70.Out1 Box160.In1
457 connect Box70.Out2 Box160.In2
458 connect Box160.Out0 Box29.LstControlPointsX
459 connect Box160.Out1 Box29.LstControlPointsY
460 connect Box160.Out2 Box29.LstControlPointsZ
461 connect Box160.Out3 Box29.LstIndexsIn
462 connect showNpoints.lstIndexs Box160.In3
463 connect Box163.Box_ConcatStrings Box164.Box_ConcatString
464 connect Box161.Out Box164.In1
465 connect Box163.Out showNpoints.In
466 connect Box162.Out Box165.In
467 connect Box165.Out Box164.Type
468 connect Box63.BoxChange Box164.BoxExecute
469 connect Box48.boxchange Box62._execute
470 connect Box63.BoxChange Box72._execute
471 connect Box57.InteractorStyleMaracas Box166.InteractorStyleMaracas
472 connect Box57.InteractorStyleMaracas2 Box166.InteractorStyleMaracas2
473 connect Box57.InteractorStyleMaracas3 Box166.InteractorStyleMaracas3
474 connect Box57.InteractorStyleMaracas4 Box166.InteractorStyleMaracas4
475 connect Box162.Out Box166.Active
476 connect Box162.BoxChange Box166.BoxExecute
477 connect Box167.BoxChange Box62.Freeplane_boxexecute
478 connect Box168.Out Box62.Freeplane_point
479 connect Box169.Out Box62.Freeplane_transform
480 connect Box167.BoxChange Box72.Freeplane_boxexecute
481 connect Box168.Out Box72.Freeplane_point
482 connect Box169.Out Box72.Freeplane_transform
483 connect Box162.Out Box62.active_widget
484 connect Box162.Out Box72.active_widget
485
486 # Complex input ports
487 input mesh Box67.In " "
488 input image Box35.In " "
489 input title Box08.WinTitle " "
490 input meshmanagermodel Box46.In " "
491 input boxChange Box63.In " "
492 input wxvtkbaseview2 Box64.In " "
493 input wxvtkbaseview3 Box65.In " "
494 input wxvtkbaseview4 Box69.In " "
495 input wxvtkbaseview1 Box71.In " "
496 input point Box161.In " "
497 input freeplane_executebox Box167.In " "
498 input freeplane_point Box168.In " "
499 input freeplane_transform Box169.In " "
500
501 # Complex output ports
502 output widget Box08.Widget " "
503 output Active_ConcatString_box Box162.Box_ConcatStrings " "
504
505
506 endefine