]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
46fa7a1edb8fd708db6fe088898db90b3559549b
[creaMaracasVisu.git] / bbtk / bbs / boxes / Mesh_tool_ApplySurface.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_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
25 new creaVtk:CreateMeshFromPoints Box04
26
27 new creaMaracasVisu:ManualContourModel_Box Box06
28   set Box06.DoubleContour "1"
29   set Box06.NbPoints "100"
30
31 new wx:LayoutLine Box08
32
33 new vtk:UpdateRender Box11
34   set Box11.Active "true"
35
36 new creaMaracasVisu:DrawAxisTree3D Box30
37   set Box30.Colour "0 0 1"
38   set Box30.LineWidth "2"
39
40 new std:MultipleInputs Box31
41
42 new creaMaracasVisu:ManualContourModel_Box Box29
43   set Box29.NbPoints "40"
44
45 new creaMaracasVisu:wxPopupMenu Box57
46   set Box57.WithCtrlKey "true"
47
48 new std:AddStringToVector Box58
49   set Box58.In0 "+  Add point"
50   set Box58.In1 "(+)  Insert point"
51   set Box58.In2 "Track point"
52   set Box58.In3 "Set Nearest point"
53   set Box58.In4 "-  Erase point"
54   set Box58.In5 "--  Delete all points"
55   set Box58.In6 "----------------------"
56   set Box58.In7 "+>  Insert group after"
57   set Box58.In8 "- Delete group"
58   set Box58.In9 "Tool - Create Volume Surface from 3 or 4 points (use Close Spline 2 - Close Surface Off)"
59
60 new creaMaracasVisu:ShowNPoints_Tools Box60
61
62 new vtk:ImageVtkProperties Box68
63
64 new std:VectorFilterDouble Box70
65   set Box70.Type "11"
66
67 new creaVtk:BooleanOperationPolyDataFilter Box77
68   set Box77.BoxProcessMode "Manual"
69   set Box77.ReorientDifferenceCells "false"
70
71 new wx:ComboBox Box78
72   set Box78.In "Union Intersection Difference"
73
74 new wx:LayoutLine Box79
75   set Box79.Orientation "H"
76   set Box79.WinTitle "New Surface ( Magenta  =  Red+Yellow )"
77
78 new wx:CommandButton Box80
79   set Box80.Label "Run"
80
81 new std:MagicBox Box66
82
83 new std:MagicBox Box67
84
85 new creaMaracasVisu:PolyDataToActor_Widget Box48
86
87 new vtk:vtkImageDataPointerRelay Box35
88
89 new wx:Slider Box34
90   set Box34.In "50"
91   set Box34.Label "true"
92   set Box34.Max "100"
93   set Box34.Min "0"
94   set Box34.ReactiveOnTrack "true"
95   set Box34.Title "Splines Opacity"
96
97 new std:Div Box36
98   set Box36.In2 "100"
99
100 new creaMaracasVisu:PolyDataToActor_Widget Box37
101   set Box37.color "0 1 1"
102   set Box37.meshOpacity "100"
103
104 new wx:LayoutLine Box38
105   set Box38.Orientation "H"
106   set Box38.WinTitle "Interpolated Surface (Yellow)"
107
108 new wx:LayoutTab Box39
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 "1"
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 creaMaracasVisu:MeshContours_Widget Box62
146   set Box62.colorMesh "1 1 0"
147
148 new std:MagicBox Box63
149
150 new std:MagicBox Box64
151
152 new std:MagicBox Box65
153
154 new std:MagicBox Box69
155
156 new std:MagicBox Box71
157
158 new creaMaracasVisu:MeshContours_Widget Box72
159   set Box72.colorMesh "0 1 1"
160
161 new wx:LayoutLine Box81
162   set Box81.WinTitle "Step 1.   Surface"
163
164 new wx:LayoutTab Box82
165
166 new wx:OutputText Box84
167
168 new wx:LayoutTab Box86
169
170 new creaVtk:MeshManager Box92
171
172 new creaVtk:MeshManager_tool Box93
173   set Box93.BoxProcessMode "Manual"
174   set Box93.Tool "35"
175
176 new creaMaracasVisu:wxVtkBaseView_Info Box96
177
178 new creaVtk:PolyDataNormals Box97
179
180 new wx:LayoutLine Box98
181   set Box98.Orientation "H"
182
183 new std:AddStringToVector Box99
184   set Box99.In0 "Auto Add Points (Start/Stop)"
185
186 new std:VectorFilterString Box100
187   set Box100.In0 "0  1  2   3   4   5   6   7   8      9       10   11   12   13"
188   set Box100.In1 "1  5 10 20 30 40 50 0  100   110   205  210  240  400"
189   set Box100.Type "2"
190
191 new std:ConcatStrings Box101
192
193 new wx:CheckBox Box103
194   set Box103.In "false"
195   set Box103.ReactiveOnKeystroke "true"
196   set Box103.Title "Show Normals"
197
198 new creaVtk:GlyphPolyDataNormals Box104
199   set Box104.MaskRatio "2"
200   set Box104.Opacity "1"
201   set Box104.Size "5"
202
203 new creaVtk:PolyDataNormals Box105
204
205 new wx:CheckBox Box106
206   set Box106.In "true"
207   set Box106.ReactiveOnKeystroke "true"
208   set Box106.Title "CloseSurface"
209
210 new wx:ComboBox Box108
211
212 new std:AddStringToVector Box109
213   set Box109.In0 "Close Spline 1"
214   set Box109.In1 "Close Spline 2"
215   set Box109.StringVector "Patch"
216
217 new std:StringSelect Box110
218   set Box110.In0 "false false"
219   set Box110.In1 "true false"
220   set Box110.In2 "false true"
221
222 new std:GetVectorStringElement Box111
223   set Box111.I "0"
224
225 new std:GetVectorStringElement Box112
226   set Box112.I "1"
227
228 new creaVtk:CleanPolyData Box113
229
230 new wx:LayoutLine Box114
231   set Box114.Orientation "V"
232   set Box114.WinTitle "1.3   Apply Changes"
233
234 new std:AddStringToVector Box115
235   set Box115.In0 "Tool - Inverse Normals"
236   set Box115.In1 "Tool - Join start and end points to current spline"
237   set Box115.In2 "Tool - Separate and order contours around axis"
238
239 new wx:LayoutLine Box121
240   set Box121.Orientation "V"
241   set Box121.WinTitle "1.1   Splines"
242
243 new wx:LayoutLine Box127
244   set Box127.Orientation "H"
245
246 new wx:OutputText Box131
247
248 new creaMaracasVisu:ShowNPoints_Tools Box132
249   set Box132.BoxProcessMode "Manual"
250   set Box132.Type "250"
251
252 new std:ConcatStrings Box120
253
254 new wx:LayoutTab Box122
255
256 new wx:LayoutLine Box123
257   set Box123.Orientation "V"
258   set Box123.WinTitle "Visu"
259
260 new wx:LayoutTab Box124
261
262 new wx:LayoutLine Box125
263   set Box125.Orientation "V"
264   set Box125.WinTitle "Visu"
265
266 new wx:LayoutLine Box126
267   set Box126.Orientation "V"
268   set Box126.WinTitle "config"
269
270 new wx:LayoutTab Box128
271
272 new wx:OutputText Box129
273
274 new wx:OutputText Box134
275
276 new wx:LayoutLine Box135
277   set Box135.Orientation "V"
278   set Box135.WinTitle "config"
279
280 new wx:LayoutTab Box136
281
282 new wx:OutputText Box137
283
284 new wx:OutputText Box139
285
286 new std:VectorFilterDouble Box140
287   set Box140.Type "14"
288
289 new std:MagicBox Box141
290
291 new std:MagicBox Box142
292
293 new std:ConcatStrings Box143
294   set Box143.In2 "  "
295   set Box143.In4 "  "
296   set Box143.In6 "  "
297
298 new creaVtk:TransformVector Box144
299   set Box144.InX "0"
300   set Box144.InY "1"
301   set Box144.InZ "0"
302
303 new std:MagicBox Box145
304
305 new std:ConcatStrings Box146
306
307 new std:ConcatStrings_tool Box147
308
309 new std:StringSelect Box148
310   set Box148.In0 "0"
311   set Box148.In1 "2"
312
313 new std:ConcatStrings Box149
314
315 new creaMaracasVisu:InteractorStyleMaracas_Model Box150
316
317
318 connect Box06.LstContourPointsX Box04.LstX
319 connect showNpoints.lstIndexs Box06.LstIndexsIn
320 connect Box06.LstContourPointsY Box04.LstY
321 connect Box06.LstContourPointsZ Box04.LstZ
322 connect Box06.LstIndexsOut Box04.LstIndexs
323 connect Box30.BoxChange Box31.In4
324 connect Box29.LstContourPointsX Box30.lstPointX
325 connect Box29.LstContourPointsY Box30.lstPointY
326 connect Box29.LstContourPointsZ Box30.lstPointZ
327 connect Box29.LstIndexsOut Box30.lstIndexs
328 connect Box31.BoxChange Box11.BoxExecute
329 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
330 connect Box57.BoxChange Box60.BoxExecute
331 connect Box68.Spacing Box60.Spacing
332 connect showNpoints.lstPointsX Box70.In0
333 connect showNpoints.lstPointsY Box70.In1
334 connect showNpoints.lstPointsZ Box70.In2
335 connect Box70.Out0 Box06.LstControlPointsX
336 connect Box70.Out1 Box06.LstControlPointsY
337 connect Box70.Out2 Box06.LstControlPointsZ
338 connect Box78.Out Box77.Operation
339 connect Box66.Out Box11.Renderer
340 connect Box66.Out Box30.Renderer
341 connect Box66.Out showNpoints.Renderer
342 connect Box67.Out Box77.In1
343 connect Box66.Out Box48.render
344 connect showNpoints.BoxChange Box31.BoxExecute
345 connect Box48.boxchange Box31.In1
346 connect Box35.Out Box68.In
347 connect Box68.Spacing Box70.k1
348 connect Box35.Out showNpoints.Image
349 connect Box34.Out Box36.In1
350 connect Box36.Out Box30.Opacity
351 connect Box34.BoxChange Box31.In2
352 connect Box66.Out Box37.render
353 connect Box38.Widget Box39.Widget2
354 connect Box79.Widget Box40.Widget2
355 connect Box46.Out Box45.MeshManagerModel
356 connect Box49.OutString Box06.NbPoints
357 connect Box42.BoxChange Box51.BoxExecute
358 connect Box45.BoxChange Box51.In2
359 connect Box52.BoxChange Box51.In4
360 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
361 connect Box80.BoxChange Box53.In2
362 connect Box53.BoxChange Box77.BoxExecute
363 connect Box42.BoxChange Box53.In3
364 connect Box43.BoxChange Box55.BoxExecute
365 connect Box52.BoxChange Box55.In2
366 connect Box43.BoxChange Box53.In6
367 connect Box64.Out Box57.wxVtkBaseView2
368 connect Box64.Out Box62._wxvtkbaseview2D1
369 connect Box65.Out Box57.wxVtkBaseView3
370 connect Box65.Out Box62._wxvtkbaseview2D2
371 connect Box69.Out Box57.wxVtkBaseView4
372 connect Box69.Out Box62._wxvtkbaseview2D3
373 connect Box71.Out Box57.wxVtkBaseView
374 connect Box71.Out Box62._wxvtkbaseview3D1
375 connect Box04.Out Box62._polydata
376 connect Box71.Out Box72._wxvtkbaseview3D1
377 connect Box64.Out Box72._wxvtkbaseview2D1
378 connect Box65.Out Box72._wxvtkbaseview2D2
379 connect Box69.Out Box72._wxvtkbaseview2D3
380 connect Box39.Widget Box81.Widget2
381 connect Box40.Widget Box81.Widget4
382 connect Box44.Widget Box82.Widget2
383 connect Box82.Widget Box79.Widget2
384 connect Box84.Widget Box44.Widget9
385 connect Box86.Widget Box38.Widget2
386 connect Box49.Widget Box50.Widget2
387 connect Box34.Widget Box50.Widget4
388 connect Box57.BoxChange Box08.BoxExecute
389 connect Box92.MeshManagerModel Box93.MeshManagerModel
390 connect Box92.MeshBase Box72._polydata
391 connect Box92.MeshBase Box37.polydata
392 connect Box37.boxchange Box72._execute
393 connect Box81.Widget Box08.Widget2
394 connect Box71.Out Box96.wxVtkBaseView
395 connect Box96.vtkRenderer Box66.In
396 connect Box97.Out Box45.Mesh
397 connect Box97.Out Box93.Mesh
398 connect Box43.Widget Box44.Widget1
399 connect Box78.Widget Box98.Widget2
400 connect Box80.Widget Box98.Widget4
401 connect Box98.Widget Box44.Widget3
402 connect Box99.Out Box58.StringVector
403 connect Box100.Out1 Box101.In1
404 connect Box101.Out Box60.Type
405 connect Box57.Out Box100.sk1
406 connect Box103.Out Box104.Active
407 connect Box66.Out Box104.Renderer
408 connect Box103.BoxChange Box104.BoxExecute
409 connect Box104.BoxChange Box31.In6
410 connect Box04.Out Box105.In
411 connect Box105.Out Box104.In
412 connect Box106.Out Box04.CloseSurface
413 connect Box106.BoxChange Box31.In7
414 connect Box109.Out Box108.In
415 connect Box108.Out Box110.In
416 connect Box110.Out Box111.In
417 connect Box110.Out Box112.In
418 connect Box111.Out Box06.OpenClose
419 connect Box112.Out Box06.OpenClose2
420 connect Box112.Out Box29.OpenClose2
421 connect Box111.Out Box29.OpenClose
422 connect Box77.Out Box113.In
423 connect Box113.Out Box97.In
424 connect Box04.Out Box77.In2
425 connect Box42.Widget Box114.Widget2
426 connect Box105.Out Box48.polydata
427 connect Box58.Out Box115.StringVector
428 connect Box115.Out Box57.In
429 connect Box67.Out Box60.Mesh
430 connect Box49.OutString Box29.NbPoints
431 connect showNpoints.Widget Box121.Widget1
432 connect Box121.Widget Box86.Widget2
433 connect Box108.Widget Box127.Widget2
434 connect Box127.Widget Box50.Widget6
435 connect Box106.Widget Box127.Widget5
436 connect Box103.Widget Box50.Widget7
437 connect Box131.Widget Box50.Widget9
438 connect showNpoints.WidgetShowNPoints Box132.WidgetShowNPoints
439 connect Box68.Spacing Box132.Spacing
440 connect Box105.Out Box132.Mesh
441 connect Box105.BoxChange Box132.BoxExecute
442 connect Box108.Out Box120.In1
443 connect Box120.Out Box132.Params
444 connect Box114.Widget Box122.Widget2
445 connect Box122.Widget Box79.Widget4
446 connect Box50.Widget Box124.Widget3
447 connect Box124.Widget Box38.Widget4
448 connect Box72._widgetB Box126.Widget2
449 connect Box37.widgetB Box126.Widget4
450 connect Box72._widgetA Box123.Widget2
451 connect Box37.widgetA Box123.Widget4
452 connect Box123.Widget Box128.Widget1
453 connect Box128.Widget Box79.Widget7
454 connect Box126.Widget Box128.Widget3
455 connect Box136.Widget Box38.Widget7
456 connect Box125.Widget Box136.Widget2
457 connect Box135.Widget Box136.Widget4
458 connect Box62._widgetA Box125.Widget2
459 connect Box48.widgetA Box125.Widget4
460 connect Box62._widgetB Box135.Widget3
461 connect Box48.widgetB Box135.Widget5
462 connect Box139.Widget Box125.Widget9
463 connect Box137.Widget Box135.Widget9
464 connect Box129.Widget Box126.Widget9
465 connect Box134.Widget Box123.Widget9
466 connect Box70.Out0 Box140.In0
467 connect Box70.Out1 Box140.In1
468 connect Box70.Out2 Box140.In2
469 connect showNpoints.lstIndexs Box140.In3
470 connect showNpoints.lstSelectedIndexs Box140.k1
471 connect Box140.Out0 Box29.LstControlPointsX
472 connect Box140.Out1 Box29.LstControlPointsY
473 connect Box140.Out2 Box29.LstControlPointsZ
474 connect Box140.Out3 Box29.LstIndexsIn
475 connect Box142.Out Box143.In1
476 connect Box141.Out Box144.Transform
477 connect Box144.OutX Box143.In3
478 connect Box144.OutY Box143.In5
479 connect Box144.OutZ Box143.In7
480 connect Box143.Out Box60.Params
481 connect Box77.BoxChange Box37.boxexecute
482 connect Box77.BoxChange Box93.BoxExecute
483 connect Box48.boxchange Box62._execute
484 connect Box145.Out Box147.In1
485 connect Box146.Box_ConcatStrings Box147.Box_ConcatString
486 connect Box146.Out showNpoints.In
487 connect Box63.BoxChange Box147.BoxExecute
488 connect Box148.Out Box147.Type
489 connect Box149.Out Box148.In
490 connect Box149.Out Box150.Active
491 connect Box57.InteractorStyleMaracas Box150.InteractorStyleMaracas
492 connect Box57.InteractorStyleMaracas2 Box150.InteractorStyleMaracas2
493 connect Box57.InteractorStyleMaracas3 Box150.InteractorStyleMaracas3
494 connect Box149.BoxChange Box150.BoxExecute
495 connect Box57.InteractorStyleMaracas4 Box150.InteractorStyleMaracas4
496
497 # Complex input ports
498 input mesh Box67.In " "
499 input image Box35.In " "
500 input title Box08.WinTitle " "
501 input meshmanagermodel Box46.In " "
502 input boxChange Box63.In " "
503 input wxvtkbaseview2 Box64.In " "
504 input wxvtkbaseview3 Box65.In " "
505 input wxvtkbaseview4 Box69.In " "
506 input wxvtkbaseview1 Box71.In " "
507 input freeplane_transform Box141.In " "
508 input freeplane_point Box142.In " "
509 input point Box145.In " "
510
511 # Complex output ports
512 output widget Box08.Widget " "
513 output Active_ConcatString_box Box149.Box_ConcatStrings " "
514
515
516 endefine