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