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