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 # ----------------------------------
8 include creaMaracasVisu
14 define Mesh_tool_ApplySurface creaMaracasVisu
16 author "info-dev@creatis.insa-lyon.fr"
17 description "Show N Points"
21 new creaMaracasVisu:ShowNPoints showNpoints
22 set showNpoints.Radio "2"
23 set showNpoints.Type "4"
25 new creaVtk:CreateMeshFromPoints Box04
27 new creaMaracasVisu:ManualContourModel_Box Box06
28 set Box06.DoubleContour "1"
29 set Box06.NbPoints "100"
31 new wx:LayoutLine Box08
33 new vtk:UpdateRender Box11
34 set Box11.Active "true"
36 new creaMaracasVisu:DrawAxisTree3D Box30
37 set Box30.Colour "0 0 1"
38 set Box30.LineWidth "2"
40 new std:MultipleInputs Box31
42 new creaMaracasVisu:ManualContourModel_Box Box29
43 set Box29.NbPoints "40"
45 new creaMaracasVisu:wxPopupMenu Box57
46 set Box57.WithCtrlKey "true"
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)"
60 new creaMaracasVisu:ShowNPoints_Tools Box60
61 set Box60.Params "156 276 97"
63 new vtk:ImageVtkProperties Box68
65 new std:VectorFilterDouble Box70
68 new creaVtk:BooleanOperationPolyDataFilter Box77
69 set Box77.BoxProcessMode "Manual"
70 set Box77.ReorientDifferenceCells "false"
73 set Box78.In "Union Intersection Difference"
75 new wx:LayoutLine Box79
76 set Box79.Orientation "H"
77 set Box79.WinTitle "New Surface ( Magenta = Red+Yellow )"
79 new wx:CommandButton Box80
82 new std:MagicBox Box66
84 new std:MagicBox Box67
86 new creaMaracasVisu:PolyDataToActor_Widget Box48
88 new vtk:vtkImageDataPointerRelay Box35
92 set Box34.Label "true"
95 set Box34.ReactiveOnTrack "true"
96 set Box34.Title "Splines Opacity"
101 new creaMaracasVisu:PolyDataToActor_Widget Box37
102 set Box37.color "0 1 1"
103 set Box37.meshOpacity "100"
105 new wx:LayoutLine Box38
106 set Box38.Orientation "H"
107 set Box38.WinTitle "Interpolated Surface (Yellow)"
109 new wx:LayoutTab Box39
111 new wx:LayoutTab Box40
113 new wx:CommandButton Box42
114 set Box42.Label "Apply (Magenta->To Red)"
116 new wx:CommandButton Box43
117 set Box43.Label "Reset Tool"
119 new wx:LayoutLine Box44
120 set Box44.Orientation "V"
121 set Box44.WinTitle "1.2 Mesh Action"
123 new creaVtk:MeshManager_tool Box45
126 new std:MagicBox Box46
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"
133 new wx:LayoutLine Box50
134 set Box50.Orientation "V"
135 set Box50.WinTitle "Config"
137 new std:MultipleInputs Box51
139 new creaMaracasVisu:ShowNPoints_Tools Box52
142 new std:MultipleInputs Box53
144 new std:MultipleInputs Box55
146 new creaMaracasVisu:MeshContours_Widget Box62
147 set Box62.colorMesh "1 1 0"
149 new std:MagicBox Box63
151 new std:MagicBox Box64
153 new std:MagicBox Box65
155 new std:MagicBox Box69
157 new std:MagicBox Box71
159 new creaMaracasVisu:MeshContours_Widget Box72
160 set Box72.colorMesh "0 1 1"
162 new wx:LayoutLine Box81
163 set Box81.WinTitle "Step 1. Surface"
165 new wx:LayoutTab Box82
167 new wx:OutputText Box84
169 new wx:LayoutTab Box86
171 new creaVtk:MeshManager Box92
173 new creaVtk:MeshManager_tool Box93
176 new std:MagicBox Box94
178 new creaMaracasVisu:wxVtkBaseView_Info Box96
180 new creaVtk:PolyDataNormals Box97
182 new wx:LayoutLine Box98
183 set Box98.Orientation "H"
185 new std:AddStringToVector Box99
186 set Box99.In0 "Auto Add Points (Start/Stop)"
188 new std:VectorFilterString Box100
189 set Box100.In0 "0 1 2 3 4 5 6 7 8 9 10 11 12 13"
190 set Box100.In1 "1 5 10 20 30 40 50 0 100 110 205 210 240 400"
193 new std:ConcatStrings Box101
195 new wx:CheckBox Box103
196 set Box103.In "false"
197 set Box103.ReactiveOnKeystroke "true"
198 set Box103.Title "Show Normals"
200 new creaVtk:GlyphPolyDataNormals Box104
201 set Box104.MaskRatio "2"
202 set Box104.Opacity "1"
205 new creaVtk:PolyDataNormals Box105
207 new wx:CheckBox Box106
209 set Box106.ReactiveOnKeystroke "true"
210 set Box106.Title "CloseSurface"
212 new wx:ComboBox Box108
214 new std:AddStringToVector Box109
215 set Box109.In0 "Close Spline 1"
216 set Box109.In1 "Close Spline 2"
217 set Box109.StringVector "Patch"
219 new std:StringSelect Box110
220 set Box110.In0 "false false"
221 set Box110.In1 "true false"
222 set Box110.In2 "false true"
224 new std:GetVectorStringElement Box111
227 new std:GetVectorStringElement Box112
230 new creaVtk:CleanPolyData Box113
232 new wx:LayoutLine Box114
233 set Box114.Orientation "V"
234 set Box114.WinTitle "1.3 Apply Changes"
236 new std:AddStringToVector Box115
237 set Box115.In0 "Tool - Inverse Normals"
238 set Box115.In1 "Tool - Join start and end points to current spline"
239 set Box115.In2 "Tool - Separate and order contours around axis"
241 new wx:LayoutLine Box121
242 set Box121.Orientation "V"
243 set Box121.WinTitle "1.1 Splines"
245 new wx:LayoutLine Box127
246 set Box127.Orientation "H"
248 new wx:OutputText Box131
250 new creaMaracasVisu:ShowNPoints_Tools Box132
251 set Box132.BoxProcessMode "Manual"
252 set Box132.Type "250"
254 new std:ConcatStrings Box120
256 new wx:LayoutTab Box122
258 new wx:LayoutLine Box123
259 set Box123.Orientation "V"
260 set Box123.WinTitle "Visu"
262 new wx:LayoutTab Box124
264 new wx:LayoutLine Box125
265 set Box125.Orientation "V"
266 set Box125.WinTitle "Visu"
268 new wx:LayoutLine Box126
269 set Box126.Orientation "V"
270 set Box126.WinTitle "config"
272 new wx:LayoutTab Box128
274 new wx:OutputText Box129
276 new wx:OutputText Box134
278 new wx:LayoutLine Box135
279 set Box135.Orientation "V"
280 set Box135.WinTitle "config"
282 new wx:LayoutTab Box136
284 new wx:OutputText Box137
286 new wx:OutputText Box139
288 new std:VectorFilterDouble Box140
292 connect Box06.LstContourPointsX Box04.LstX
293 connect showNpoints.lstIndexs Box06.LstIndexsIn
294 connect Box06.LstContourPointsY Box04.LstY
295 connect Box06.LstContourPointsZ Box04.LstZ
296 connect Box06.LstIndexsOut Box04.LstIndexs
297 connect Box30.BoxChange Box31.In4
298 connect Box29.LstContourPointsX Box30.lstPointX
299 connect Box29.LstContourPointsY Box30.lstPointY
300 connect Box29.LstContourPointsZ Box30.lstPointZ
301 connect Box29.LstIndexsOut Box30.lstIndexs
302 connect Box31.BoxChange Box11.BoxExecute
303 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
304 connect Box57.BoxChange Box60.BoxExecute
305 connect Box68.Spacing Box60.Spacing
306 connect showNpoints.lstPointsX Box70.In0
307 connect showNpoints.lstPointsY Box70.In1
308 connect showNpoints.lstPointsZ Box70.In2
309 connect Box70.Out0 Box06.LstControlPointsX
310 connect Box70.Out1 Box06.LstControlPointsY
311 connect Box70.Out2 Box06.LstControlPointsZ
312 connect Box78.Out Box77.Operation
313 connect Box66.Out Box11.Renderer
314 connect Box66.Out Box30.Renderer
315 connect Box66.Out showNpoints.Renderer
316 connect Box67.Out Box77.In1
317 connect Box66.Out Box48.render
318 connect showNpoints.BoxChange Box31.BoxExecute
319 connect Box48.boxchange Box31.In1
320 connect Box35.Out Box68.In
321 connect Box68.Spacing Box70.k1
322 connect Box35.Out showNpoints.Image
323 connect Box34.Out Box36.In1
324 connect Box36.Out Box30.Opacity
325 connect Box34.BoxChange Box31.In2
326 connect Box66.Out Box37.render
327 connect Box38.Widget Box39.Widget2
328 connect Box79.Widget Box40.Widget2
329 connect Box46.Out Box45.MeshManagerModel
330 connect Box49.OutString Box06.NbPoints
331 connect Box42.BoxChange Box51.BoxExecute
332 connect Box45.BoxChange Box51.In2
333 connect Box52.BoxChange Box51.In4
334 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
335 connect Box80.BoxChange Box53.In2
336 connect Box53.BoxChange Box77.BoxExecute
337 connect Box42.BoxChange Box53.In3
338 connect Box43.BoxChange Box55.BoxExecute
339 connect Box52.BoxChange Box55.In2
340 connect Box43.BoxChange Box53.In6
341 connect Box63.BoxChange showNpoints.BoxExecute
342 connect Box63.BoxChange Box62._execute
343 connect Box64.Out Box57.wxVtkBaseView2
344 connect Box64.Out Box62._wxvtkbaseview2D1
345 connect Box65.Out Box57.wxVtkBaseView3
346 connect Box65.Out Box62._wxvtkbaseview2D2
347 connect Box69.Out Box57.wxVtkBaseView4
348 connect Box69.Out Box62._wxvtkbaseview2D3
349 connect Box71.Out Box57.wxVtkBaseView
350 connect Box71.Out Box62._wxvtkbaseview3D1
351 connect Box04.Out Box62._polydata
352 connect Box71.Out Box72._wxvtkbaseview3D1
353 connect Box64.Out Box72._wxvtkbaseview2D1
354 connect Box65.Out Box72._wxvtkbaseview2D2
355 connect Box69.Out Box72._wxvtkbaseview2D3
356 connect Box39.Widget Box81.Widget2
357 connect Box40.Widget Box81.Widget4
358 connect Box44.Widget Box82.Widget2
359 connect Box82.Widget Box79.Widget2
360 connect Box84.Widget Box44.Widget9
361 connect Box86.Widget Box38.Widget2
362 connect Box49.Widget Box50.Widget2
363 connect Box34.Widget Box50.Widget4
364 connect Box57.BoxChange Box08.BoxExecute
365 connect Box92.MeshManagerModel Box93.MeshManagerModel
366 connect Box77.BoxChange Box93.BoxExecute
367 connect Box92.MeshBase Box72._polydata
368 connect Box92.MeshBase Box37.polydata
369 connect Box37.boxchange Box72._execute
370 connect Box81.Widget Box08.Widget2
371 connect Box94.BoxChange Box37.boxexecute
372 connect Box77.BoxChange Box94.BoxExecute
373 connect Box71.Out Box96.wxVtkBaseView
374 connect Box96.vtkRenderer Box66.In
375 connect Box97.Out Box45.Mesh
376 connect Box97.Out Box93.Mesh
377 connect Box43.Widget Box44.Widget1
378 connect Box78.Widget Box98.Widget2
379 connect Box80.Widget Box98.Widget4
380 connect Box98.Widget Box44.Widget3
381 connect Box99.Out Box58.StringVector
382 connect Box100.Out1 Box101.In1
383 connect Box101.Out Box60.Type
384 connect Box57.Out Box100.sk1
385 connect Box103.Out Box104.Active
386 connect Box66.Out Box104.Renderer
387 connect Box103.BoxChange Box104.BoxExecute
388 connect Box104.BoxChange Box31.In6
389 connect Box04.Out Box105.In
390 connect Box105.Out Box104.In
391 connect Box106.Out Box04.CloseSurface
392 connect Box106.BoxChange Box31.In7
393 connect Box109.Out Box108.In
394 connect Box108.Out Box110.In
395 connect Box110.Out Box111.In
396 connect Box110.Out Box112.In
397 connect Box111.Out Box06.OpenClose
398 connect Box112.Out Box06.OpenClose2
399 connect Box112.Out Box29.OpenClose2
400 connect Box111.Out Box29.OpenClose
401 connect Box77.Out Box113.In
402 connect Box113.Out Box97.In
403 connect Box04.Out Box77.In2
404 connect Box42.Widget Box114.Widget2
405 connect Box105.Out Box48.polydata
406 connect Box58.Out Box115.StringVector
407 connect Box115.Out Box57.In
408 connect Box67.Out Box60.Mesh
409 connect Box49.OutString Box29.NbPoints
410 connect showNpoints.Widget Box121.Widget1
411 connect Box121.Widget Box86.Widget2
412 connect Box108.Widget Box127.Widget2
413 connect Box127.Widget Box50.Widget6
414 connect Box106.Widget Box127.Widget5
415 connect Box103.Widget Box50.Widget7
416 connect Box131.Widget Box50.Widget9
417 connect showNpoints.WidgetShowNPoints Box132.WidgetShowNPoints
418 connect Box68.Spacing Box132.Spacing
419 connect Box105.Out Box132.Mesh
420 connect Box105.BoxChange Box132.BoxExecute
421 connect Box108.Out Box120.In1
422 connect Box120.Out Box132.Params
423 connect Box114.Widget Box122.Widget2
424 connect Box122.Widget Box79.Widget4
425 connect Box50.Widget Box124.Widget3
426 connect Box124.Widget Box38.Widget4
427 connect Box72._widgetB Box126.Widget2
428 connect Box37.widgetB Box126.Widget4
429 connect Box72._widgetA Box123.Widget2
430 connect Box37.widgetA Box123.Widget4
431 connect Box123.Widget Box128.Widget1
432 connect Box128.Widget Box79.Widget7
433 connect Box126.Widget Box128.Widget3
434 connect Box136.Widget Box38.Widget7
435 connect Box125.Widget Box136.Widget2
436 connect Box135.Widget Box136.Widget4
437 connect Box62._widgetA Box125.Widget2
438 connect Box48.widgetA Box125.Widget4
439 connect Box62._widgetB Box135.Widget3
440 connect Box48.widgetB Box135.Widget5
441 connect Box139.Widget Box125.Widget9
442 connect Box137.Widget Box135.Widget9
443 connect Box129.Widget Box126.Widget9
444 connect Box134.Widget Box123.Widget9
445 connect Box70.Out0 Box140.In0
446 connect Box70.Out1 Box140.In1
447 connect Box70.Out2 Box140.In2
448 connect showNpoints.lstIndexs Box140.In3
449 connect showNpoints.lstSelectedIndexs Box140.k1
450 connect Box140.Out0 Box29.LstControlPointsX
451 connect Box140.Out1 Box29.LstControlPointsY
452 connect Box140.Out2 Box29.LstControlPointsZ
453 connect Box140.Out3 Box29.LstIndexsIn
455 # Complex input ports
456 input point showNpoints.In " "
457 input mesh Box67.In " "
458 input image Box35.In " "
459 input title Box08.WinTitle " "
460 input meshmanagermodel Box46.In " "
461 input boxChange Box63.In " "
462 input wxvtkbaseview2 Box64.In " "
463 input wxvtkbaseview3 Box65.In " "
464 input wxvtkbaseview4 Box69.In " "
465 input wxvtkbaseview1 Box71.In " "
467 # Complex output ports
468 output widget Box08.Widget " "
469 output interactorStyleMaracas Box57.InteractorStyleMaracas " "
470 output interactorStyleMaracas2 Box57.InteractorStyleMaracas2 " "
471 output interactorStyleMaracas3 Box57.InteractorStyleMaracas3 " "
472 output interactorStyleMaracas4 Box57.InteractorStyleMaracas4 " "