From 562222204bce7de0a24fac67cb4e5acc05b20f5d Mon Sep 17 00:00:00 2001 From: davila Date: Wed, 15 Oct 2014 16:28:13 +0200 Subject: [PATCH] #2446 creaVtk Feature New Normal - Stream Tracer, Stream Line (interface, widget) --- .../bbs/boxes/PlaneTensorVisu_Widget.bbg | 11 +- .../bbs/boxes/PlaneTensorVisu_Widget.bbs | 6 +- .../bbs/boxes/PlaneVectorVisu_Interface.bbg | 147 +++++++++++++----- .../bbs/boxes/PlaneVectorVisu_Interface.bbs | 40 +++-- .../bbs/boxes/PlaneVectorVisu_Widget.bbg | 9 +- .../bbs/boxes/PlaneVectorVisu_Widget.bbs | 5 +- .../boxes/StreamlineExploration_Wideget.bbg | 55 ++++--- .../boxes/StreamlineExploration_Wideget.bbs | 5 +- .../bbs/boxes/TensorsExploration_Wideget.bbg | 7 +- .../bbs/boxes/TensorsExploration_Wideget.bbs | 2 +- .../bbs/boxes/TensorsVisu_Wideget.bbg | 2 +- .../bbs/boxes/TensorsVisu_Wideget.bbs | 3 +- .../bbs/boxes/VectorsExploration_Wideget.bbg | 45 +++--- .../bbs/boxes/VectorsExploration_Wideget.bbs | 1 + bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.cxx | 105 +++++++++++++ bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.h | 51 ++++++ .../src/bbcreaVtkPointRotation.cxx | 105 +++++++++++++ bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.h | 49 ++++++ bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx | 2 + bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.h | 2 + bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx | 3 +- bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h | 2 + lib/creaVtk/vtkImageDataStrucPoints.cpp | 5 +- lib/creaVtk/vtkTensorsVisu.cpp | 29 ++-- lib/creaVtk/vtkTensorsVisu.h | 10 +- lib/creaVtk/vtkVectorsTensorsVisuBase.cpp | 6 +- lib/creaVtk/vtkVectorsTensorsVisuBase.h | 12 +- lib/creaVtk/vtkVectorsVisu.cpp | 11 +- lib/creaVtk/vtkVectorsVisu.h | 4 +- 29 files changed, 587 insertions(+), 147 deletions(-) create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.h create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.h diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg index 8fcb0a6..bb9fd4b 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbg # ---------------------------------- APP_START @@ -40,8 +40,6 @@ std:MultipleInputs:Box02 ISEXEC:FALSE -67.511455:-19.324707:-900.000000 -21.936455:-29.324707:-900.000000 -PORT -BoxProcessMode:"Reactive" FIN_BOX BOX vtk:ProbeFilter:Box03 @@ -66,6 +64,8 @@ creaVtk:PlaneVectorViso_Interface:Box06 ISEXEC:FALSE 54.274543:36.839315:-900.000000 125.449543:26.839315:-900.000000 +PORT +typeFormsStr:"Cube Sphere Superquadric" FIN_BOX BOX creaVtk:TensorsVisu:Box07 @@ -73,7 +73,7 @@ ISEXEC:FALSE 6.511770:-45.519777:-900.000000 52.086770:-55.519777:-900.000000 FIN_BOX -CONNECTIONS:19 +CONNECTIONS:20 CONNECTION Box01:BoxChange:Box02:In1 NumberOfControlPoints:0 @@ -131,4 +131,7 @@ NumberOfControlPoints:0 CONNECTION Box06:ScaleFactor:Box07:ScaleFactor NumberOfControlPoints:0 +CONNECTION +Box06:typeForm:Box07:TypeForm +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs index cd9f301..f42f024 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneTensorVisu_Widget.bbs # ---------------------------------- include std @@ -19,7 +19,6 @@ category "" new PlaneWidget Box01 new MultipleInputs Box02 - set Box02.BoxProcessMode "Reactive" new ProbeFilter Box03 @@ -28,6 +27,7 @@ new vtkImageDataPointerRelay Box04 new MagicBox Box05 new PlaneVectorViso_Interface Box06 + set Box06.typeFormsStr "Cube Sphere Superquadric" new TensorsVisu Box07 @@ -47,6 +47,7 @@ connect Box02.BoxChange Box07.BoxExecute connect Box03.Out Box07.In connect Box06.Opacity Box07.Opacity connect Box06.ScaleFactor Box07.ScaleFactor +connect Box06.typeForm Box07.TypeForm # Complex input ports input vtkImageData Box04.In " " @@ -56,5 +57,6 @@ input renderer Box05.In " " output Widget Box06.widget " " output boxchange Box02.BoxChange " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg index cfd7c64..bec1430 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbg # ---------------------------------- APP_START @@ -10,7 +10,7 @@ AUTHOR:Author ?? COMPLEXBOX:TRUE COMPLEXBOXNAME:PlaneVectorViso_Interface PACKAGENAME:creaVtk -COMPLEXOUTPUTS:7 +COMPLEXOUTPUTS:8 COMPLEX_PORT boxChange -55.620936:-52.838253:-900.000000 @@ -39,13 +39,21 @@ COMPLEX_PORT Ratio -91.228359:-50.583288:-900.000000 FIN_COMPLEX_PORT -COMPLEXINPUTS:0 -BOXES:10 +COMPLEX_PORT +typeForm +102.276330:-54.205701:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:1 +COMPLEX_PORT +typeFormsStr +107.913964:117.907952:-900.000000 +FIN_COMPLEX_PORT +BOXES:14 BOX wx:Slider:Box00 ISEXEC:FALSE --50.906743:62.037478:-900.000000 -0.493257:52.037478:-900.000000 +31.999641:48.109206:-900.000000 +83.399641:38.109206:-900.000000 PORT In:"30" PORT @@ -55,15 +63,15 @@ Max:"100" PORT Min:"1" PORT -ReactiveOnTrack:"true" +ReactiveOnTrack:"True" PORT Title:"Plane Resolution" FIN_BOX BOX wx:CheckBox:Box01 ISEXEC:FALSE -6.711178:62.037478:-900.000000 -52.286178:52.037478:-900.000000 +-29.436005:97.853036:-900.000000 +16.138995:87.853036:-900.000000 PORT In:"false" PORT @@ -74,30 +82,28 @@ FIN_BOX BOX std:MultipleInputs:Box02 ISEXEC:FALSE --57.320437:18.206815:-900.000000 --11.745437:8.206815:-900.000000 -PORT -BoxProcessMode:"Reactive" +-69.982503:10.428689:-900.000000 +-24.407503:0.428689:-900.000000 FIN_BOX BOX wx:LayoutLine:Box03 ISEXEC:FALSE -21.964932:17.280930:-900.000000 -79.524932:7.280930:-900.000000 +10.915772:-15.519850:-900.000000 +68.475772:-25.519850:-900.000000 PORT WinTitle:"Plane flield" FIN_BOX BOX wx:LayoutTab:Box04 ISEXEC:FALSE -1.964247:-8.020677:-900.000000 -59.524247:-18.020677:-900.000000 +1.361291:-37.866975:-900.000000 +58.921291:-47.866975:-900.000000 FIN_BOX BOX wx:CheckBox:Box05 ISEXEC:FALSE -76.189077:62.984731:-900.000000 -121.764077:52.984731:-900.000000 +27.771749:97.805412:-900.000000 +73.346749:87.805412:-900.000000 PORT ReactiveOnKeystroke:"true" PORT @@ -106,8 +112,8 @@ FIN_BOX BOX wx:Slider:Box06 ISEXEC:FALSE -133.231853:60.872036:-900.000000 -184.631853:50.872036:-900.000000 +96.421419:49.928393:-900.000000 +147.821419:39.928393:-900.000000 PORT In:"100" PORT @@ -117,15 +123,15 @@ Max:"100" PORT Min:"0" PORT -ReactiveOnTrack:"true" +ReactiveOnTrack:"True" PORT Title:"Opacity" FIN_BOX BOX std:Div:Box07 ISEXEC:FALSE -117.650724:22.843519:-900.000000 -150.425724:12.843519:-900.000000 +124.614860:-26.900311:-900.000000 +157.389860:-36.900311:-900.000000 PORT In2:"100.0" FIN_BOX @@ -145,19 +151,53 @@ Max:"500000" PORT Min:"1" PORT -ReactiveOnTrack:"true" +ReactiveOnTrack:"True" PORT Title:"Scale Factor" FIN_BOX BOX std:Div:Box09 ISEXEC:FALSE -173.149288:17.893679:-900.000000 -205.924288:7.893679:-900.000000 +170.827909:-26.212517:-900.000000 +203.602909:-36.212517:-900.000000 PORT In2:"100.0" FIN_BOX -CONNECTIONS:20 +BOX +wx:LayoutLine:Box10 +ISEXEC:FALSE +8.365236:62.514618:-900.000000 +65.925236:52.514618:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:LayoutLine:Box11 +ISEXEC:FALSE +25.048980:15.194635:-900.000000 +82.608980:5.194635:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +wx:ComboBox:Box12 +ISEXEC:FALSE +113.883224:81.760768:-900.000000 +159.458224:71.760768:-900.000000 +PORT +In:"A B C" +PORT +Title:"Form" +FIN_BOX +BOX +wx:LayoutLine:Box13 +ISEXEC:FALSE +94.792811:8.332966:-900.000000 +152.352811:-1.667034:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:27 CONNECTION Box00:BoxChange:Box02:In1 NumberOfControlPoints:0 @@ -165,12 +205,6 @@ CONNECTION Box01:BoxChange:Box02:In2 NumberOfControlPoints:0 CONNECTION -Box01:Widget:Box03:Widget1 -NumberOfControlPoints:0 -CONNECTION -Box00:Widget:Box03:Widget2 -NumberOfControlPoints:0 -CONNECTION Box02:BoxChange:boxChange:boxChange NumberOfControlPoints:0 CONNECTION @@ -180,15 +214,9 @@ CONNECTION Box04:Widget:widget:widget NumberOfControlPoints:0 CONNECTION -Box05:Widget:Box03:Widget3 -NumberOfControlPoints:0 -CONNECTION Box05:BoxChange:Box02:In3 NumberOfControlPoints:0 CONNECTION -Box06:Widget:Box03:Widget4 -NumberOfControlPoints:0 -CONNECTION Box06:Out:Box07:In1 NumberOfControlPoints:0 CONNECTION @@ -201,9 +229,6 @@ CONNECTION Box08:BoxChange:Box02:In5 NumberOfControlPoints:0 CONNECTION -Box08:Widget:Box03:Widget5 -NumberOfControlPoints:0 -CONNECTION Box01:Out:ActivePlaneControl:ActivePlaneControl NumberOfControlPoints:0 CONNECTION @@ -218,4 +243,40 @@ NumberOfControlPoints:0 CONNECTION Box00:Out:Ratio:Ratio NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box10:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box10:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box00:Widget:Box11:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box11:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box10:Widget:Box03:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box11:Widget:Box03:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box08:Widget:Box13:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box12:Widget:Box13:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box13:Widget:Box03:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box12:Out:typeForm:typeForm +NumberOfControlPoints:0 +CONNECTION +typeFormsStr:typeFormsStr:Box12:In +NumberOfControlPoints:0 +CONNECTION +Box12:BoxChange:Box02:In6 +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs index 935067b..2a016ac 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Interface.bbs # ---------------------------------- include std @@ -20,7 +20,7 @@ new Slider Box00 set Box00.Label "true" set Box00.Max "100" set Box00.Min "1" - set Box00.ReactiveOnTrack "true" + set Box00.ReactiveOnTrack "True" set Box00.Title "Plane Resolution" new CheckBox Box01 @@ -29,7 +29,6 @@ new CheckBox Box01 set Box01.Title "Plane control" new MultipleInputs Box02 - set Box02.BoxProcessMode "Reactive" new LayoutLine Box03 set Box03.WinTitle "Plane flield" @@ -45,7 +44,7 @@ new Slider Box06 set Box06.Label "true" set Box06.Max "100" set Box06.Min "0" - set Box06.ReactiveOnTrack "true" + set Box06.ReactiveOnTrack "True" set Box06.Title "Opacity" new Div Box07 @@ -57,28 +56,47 @@ new Slider Box08 set Box08.Label "true" set Box08.Max "500000" set Box08.Min "1" - set Box08.ReactiveOnTrack "true" + set Box08.ReactiveOnTrack "True" set Box08.Title "Scale Factor" new Div Box09 set Box09.In2 "100.0" +new LayoutLine Box10 + set Box10.Orientation "H" + +new LayoutLine Box11 + set Box11.Orientation "H" + +new ComboBox Box12 + set Box12.In "A B C" + set Box12.Title "Form" + +new LayoutLine Box13 + set Box13.Orientation "H" + connect Box00.BoxChange Box02.In1 connect Box01.BoxChange Box02.In2 -connect Box01.Widget Box03.Widget1 -connect Box00.Widget Box03.Widget2 connect Box03.Widget Box04.Widget1 -connect Box05.Widget Box03.Widget3 connect Box05.BoxChange Box02.In3 -connect Box06.Widget Box03.Widget4 connect Box06.Out Box07.In1 connect Box08.Out Box09.In1 connect Box06.BoxChange Box02.In4 connect Box08.BoxChange Box02.In5 -connect Box08.Widget Box03.Widget5 +connect Box01.Widget Box10.Widget1 +connect Box05.Widget Box10.Widget2 +connect Box00.Widget Box11.Widget1 +connect Box06.Widget Box11.Widget2 +connect Box10.Widget Box03.Widget1 +connect Box11.Widget Box03.Widget2 +connect Box08.Widget Box13.Widget1 +connect Box12.Widget Box13.Widget2 +connect Box13.Widget Box03.Widget3 +connect Box12.BoxChange Box02.In6 # Complex input ports +input typeFormsStr Box12.In " " # Complex output ports output boxChange Box02.BoxChange " " @@ -88,6 +106,8 @@ output AcitiveVector Box05.Out " " output Opacity Box07.Out " " output ScaleFactor Box09.Out " " output Ratio Box00.Out " " +output typeForm Box12.Out " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg index 7c038a0..1cdd5fc 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbg # ---------------------------------- APP_START @@ -72,8 +72,10 @@ creaVtk:PlaneVectorViso_Interface:Box06 ISEXEC:FALSE 54.274543:36.839315:-900.000000 125.449543:26.839315:-900.000000 +PORT +typeFormsStr:"Line Arrow" FIN_BOX -CONNECTIONS:19 +CONNECTIONS:20 CONNECTION Box01:BoxChange:Box02:In1 NumberOfControlPoints:0 @@ -131,4 +133,7 @@ NumberOfControlPoints:0 CONNECTION Box06:boxChange:Box01:BoxExecute NumberOfControlPoints:0 +CONNECTION +Box06:typeForm:Box00:TypeForm +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs index efc73d1..bbeaa56 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneVectorVisu_Widget.bbs # ---------------------------------- include std @@ -30,6 +30,7 @@ new vtkImageDataPointerRelay Box04 new MagicBox Box05 new PlaneVectorViso_Interface Box06 + set Box06.typeFormsStr "Line Arrow" connect Box01.BoxChange Box02.In1 @@ -47,6 +48,7 @@ connect Box06.ScaleFactor Box00.ScaleFactor connect Box06.boxChange Box02.In2 connect Box06.Ratio Box01.Resolution connect Box06.boxChange Box01.BoxExecute +connect Box06.typeForm Box00.TypeForm # Complex input ports input vtkImageData Box04.In " " @@ -56,5 +58,6 @@ input renderer Box05.In " " output Widget Box06.widget " " output boxchange Box02.BoxChange " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbg index ad2d054..b9f6695 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbg @@ -13,69 +13,75 @@ PACKAGENAME:creaVtk COMPLEXOUTPUTS:1 COMPLEX_PORT widget --87.086702:-131.675720:-900.000000 +-93.495737:-25.392558:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:3 COMPLEX_PORT vtkImageData_vectors --202.201495:171.786415:-900.000000 +-162.145027:117.309618:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT vtkRenderer -128.828216:174.474869:-900.000000 +24.147313:122.668504:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT Title --83.966322:173.231649:-900.000000 +-49.784803:117.152594:-900.000000 FIN_COMPLEX_PORT -BOXES:7 +BOXES:8 BOX vtk:UpdateRender:Box22 ISEXEC:FALSE -168.162416:-18.581651:-900.000000 -213.737416:-28.581651:-900.000000 +6.334285:28.952024:-900.000000 +51.909285:18.952024:-900.000000 PORT Active:"true" FIN_BOX BOX wx:LayoutTab:Box17 ISEXEC:FALSE --89.942511:-71.713124:-900.000000 --32.382511:-81.713124:-900.000000 +-107.033271:7.331640:-900.000000 +-49.473271:-2.668360:-900.000000 FIN_BOX BOX std:MultipleInputs:Box23 ISEXEC:FALSE -76.506639:18.351379:-900.000000 -122.081639:8.351379:-900.000000 +-34.049213:48.794295:-900.000000 +11.525787:38.794295:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX BOX creaVtk:PlaneWidget_StreamLineVisu_Widget:Box30 ISEXEC:FALSE --128.471084:73.231403:-900.000000 --57.296084:63.231403:-900.000000 +-123.664308:72.163231:-900.000000 +-52.489308:62.163231:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box26 ISEXEC:FALSE --208.540015:141.393307:-900.000000 --137.365015:131.393307:-900.000000 +-172.222151:92.257373:-900.000000 +-101.047151:82.257373:-900.000000 FIN_BOX BOX std:MagicBox:Box28 ISEXEC:FALSE -123.517825:137.982960:-900.000000 -169.092825:127.982960:-900.000000 +6.018852:102.199182:-900.000000 +51.593852:92.199182:-900.000000 FIN_BOX BOX wx:LayoutLine:Box14 ISEXEC:FALSE --114.309291:-7.256705:-900.000000 --56.749291:-17.256705:-900.000000 +-122.299506:43.713393:-900.000000 +-64.739506:33.713393:-900.000000 FIN_BOX -CONNECTIONS:11 +BOX +std:MagicBox:Box07 +ISEXEC:FALSE +-64.010236:96.562792:-900.000000 +-18.435236:86.562792:-900.000000 +FIN_BOX +CONNECTIONS:12 CONNECTION Box23:BoxChange:Box22:BoxExecute NumberOfControlPoints:0 @@ -101,12 +107,15 @@ CONNECTION Box28:Out:Box30:Renderer NumberOfControlPoints:0 CONNECTION -Title:Title:Box14:WinTitle -NumberOfControlPoints:0 -CONNECTION Box30:Widget:Box14:Widget1 NumberOfControlPoints:0 CONNECTION Box14:Widget:Box17:Widget1 NumberOfControlPoints:0 +CONNECTION +Title:Title:Box07:In +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box14:WinTitle +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbs index 7759d21..0bfb099 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamlineExploration_Wideget.bbs @@ -33,6 +33,8 @@ new MagicBox Box28 new LayoutLine Box14 +new MagicBox Box07 + connect Box23.BoxChange Box22.BoxExecute connect Box30.boxchange Box23.In5 @@ -41,11 +43,12 @@ connect Box28.Out Box22.Renderer connect Box28.Out Box30.Renderer connect Box30.Widget Box14.Widget1 connect Box14.Widget Box17.Widget1 +connect Box07.Out Box14.WinTitle # Complex input ports input vtkImageData_vectors Box26.In " " input vtkRenderer Box28.In " " -input Title Box14.WinTitle " " +input Title Box07.In " " # Complex output ports output widget Box17.Widget " " diff --git a/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbg index 1f823c2..31a6dab 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbg @@ -50,8 +50,6 @@ std:MultipleInputs:Box23 ISEXEC:FALSE 3.709669:55.066372:-900.000000 49.284669:45.066372:-900.000000 -PORT -BoxProcessMode:"Reactive" FIN_BOX BOX wx:LayoutLine:Box16 @@ -85,7 +83,7 @@ ISEXEC:FALSE 21.602067:137.982960:-900.000000 67.177067:127.982960:-900.000000 FIN_BOX -CONNECTIONS:15 +CONNECTIONS:16 CONNECTION Box23:BoxChange:Box22:BoxExecute NumberOfControlPoints:0 @@ -131,4 +129,7 @@ NumberOfControlPoints:0 CONNECTION Title:Title:Box17:WinTitle NumberOfControlPoints:0 +CONNECTION +Box23:BoxChange:Box17:BoxExecute +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbs index 6d962b5..319a70a 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/TensorsExploration_Wideget.bbs @@ -24,7 +24,6 @@ new LayoutTab Box17 set Box17.WinTitle "VectorsTensors Analysis" new MultipleInputs Box23 - set Box23.BoxProcessMode "Reactive" new LayoutLine Box16 set Box16.WinTitle "Tensors" @@ -49,6 +48,7 @@ connect Box28.Out Box22.Renderer connect Box28.Out Box21.renderer connect Box28.Out Box19.renderer connect Box16.Widget Box17.Widget1 +connect Box23.BoxChange Box17.BoxExecute # Complex input ports input vtkImageData_tensors Box27.In " " diff --git a/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg index 50bde04..9c781d7 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbg # ---------------------------------- APP_START diff --git a/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs index 85f9780..1c1ad05 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/TensorsVisu_Wideget.bbs # ---------------------------------- include std @@ -38,5 +38,6 @@ input renderer Box04.Renderer " " output Widget Box05.widget " " output BoxChange Box04.BoxChange " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbg index 1efcce9..bb9a835 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbg @@ -13,79 +13,79 @@ PACKAGENAME:creaVtk COMPLEXOUTPUTS:1 COMPLEX_PORT widget --153.237662:-116.543147:-900.000000 +-179.941974:-67.018786:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:3 COMPLEX_PORT vtkImageData_vectors --202.201495:171.786415:-900.000000 +-219.680681:113.036929:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT vtkRenderer --59.902043:169.419594:-900.000000 +-81.265493:115.039904:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT Title --96.827992:172.211702:-900.000000 +-130.329765:114.918814:-900.000000 FIN_COMPLEX_PORT BOXES:8 BOX vtk:UpdateRender:Box22 ISEXEC:FALSE --20.567843:-23.636926:-900.000000 -25.007157:-33.636926:-900.000000 +-109.905905:-14.897333:-900.000000 +-64.330905:-24.897333:-900.000000 PORT Active:"true" FIN_BOX BOX wx:LayoutTab:Box17 ISEXEC:FALSE --180.737946:-42.745057:-900.000000 --123.177946:-52.745057:-900.000000 +-184.622210:-20.410541:-900.000000 +-127.062210:-30.410541:-900.000000 PORT WinTitle:"VectorsTensors Analysis" FIN_BOX BOX std:MultipleInputs:Box23 ISEXEC:FALSE --112.223620:13.296104:-900.000000 --66.648620:3.296104:-900.000000 +-151.066256:11.353972:-900.000000 +-105.491256:1.353972:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX BOX creaVtk:PlaneVectorVisu_Widget:Box41 ISEXEC:FALSE --290.289955:71.849699:-900.000000 --219.114955:61.849699:-900.000000 +-268.440972:51.457315:-900.000000 +-197.265972:41.457315:-900.000000 FIN_BOX BOX wx:LayoutLine:Box14 ISEXEC:FALSE --221.145840:-2.517243:-900.000000 --163.585840:-12.517243:-900.000000 +-232.798631:5.736817:-900.000000 +-175.238631:-4.263183:-900.000000 PORT WinTitle:"Field" FIN_BOX BOX creaVtk:VolumeVectorVisu_Widget:Box18 ISEXEC:FALSE --214.258652:71.383715:-900.000000 --143.083652:61.383715:-900.000000 +-187.068807:50.505798:-900.000000 +-115.893807:40.505798:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box26 ISEXEC:FALSE --208.540015:141.393307:-900.000000 --137.365015:131.393307:-900.000000 +-226.504734:87.499150:-900.000000 +-155.329734:77.499150:-900.000000 FIN_BOX BOX std:MagicBox:Box28 ISEXEC:FALSE --65.212434:132.927685:-900.000000 --19.637434:122.927685:-900.000000 +-94.829944:83.888857:-900.000000 +-49.254944:73.888857:-900.000000 FIN_BOX -CONNECTIONS:15 +CONNECTIONS:16 CONNECTION Box23:BoxChange:Box22:BoxExecute NumberOfControlPoints:0 @@ -131,4 +131,7 @@ NumberOfControlPoints:0 CONNECTION Title:Title:Box14:WinTitle NumberOfControlPoints:0 +CONNECTION +Box23:BoxChange:Box17:BoxExecute +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbs index bec8a33..b713d5e 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorsExploration_Wideget.bbs @@ -49,6 +49,7 @@ connect Box28.Out Box41.renderer connect Box28.Out Box18.renderer connect Box26.Out Box41.vtkImageData connect Box14.Widget Box17.Widget1 +connect Box23.BoxChange Box17.BoxExecute # Complex input ports input vtkImageData_vectors Box26.In " " diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.cxx new file mode 100644 index 0000000..b35cfba --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.cxx @@ -0,0 +1,105 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkLineProfile.h" +#include "bbcreaVtkPackage.h" +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LineProfile) +BBTK_BLACK_BOX_IMPLEMENTATION(LineProfile,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LineProfile::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + +printf("EED LineProfile::Process Start\n"); + + std::vector profileLst; + if ( (bbGetInputPoint1().size()==3) && (bbGetInputPoint2().size()==3) && (bbGetInputIn()!=NULL) ) + { + double x1 = bbGetInputPoint1()[0]; + double y1 = bbGetInputPoint1()[1]; + double z1 = bbGetInputPoint1()[2]; + double x2 = bbGetInputPoint2()[0]; + double y2 = bbGetInputPoint2()[1]; + double z2 = bbGetInputPoint2()[2]; + double dx = x1-x2; + double dy = y1-y2; + double dz = z1-z2; + double dist = (int) sqrt( dx*dx + dy*dy + dz*dz ); + +printf("EED LineProfile::Process point %f %f %f - %f %f %f\n", x1,y1,z1, x2,y2,z2); + + + int i; + double ii,nx,ny,nz; + for (i=0; iGetScalarComponentAsDouble(nx,ny,nz,0) ); +printf("%f ", bbGetInputIn()->GetScalarComponentAsDouble(nx,ny,nz,0) ); + } // for i + } // if + bbSetOutputOut( profileLst ); +printf("\n"); +printf("EED LineProfile::Process End\n"); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LineProfile::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LineProfile::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void LineProfile::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.h b/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.h new file mode 100644 index 0000000..e0a6ac4 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLineProfile.h @@ -0,0 +1,51 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkLineProfile_h_INCLUDED__ +#define __bbcreaVtkLineProfile_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkImageData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT LineProfile + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(LineProfile,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,vtkImageData*); + BBTK_DECLARE_INPUT(Point1,std::vector); + BBTK_DECLARE_INPUT(Point2,std::vector); + BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(LineProfile,bbtk::AtomicBlackBox); + BBTK_NAME("LineProfile"); + BBTK_AUTHOR("Info-Dev Creatis"); + BBTK_DESCRIPTION("Line Profile"); + BBTK_CATEGORY("filter"); + BBTK_INPUT(LineProfile,In,"Input image",vtkImageData*,""); + BBTK_INPUT(LineProfile,Point1,"Vector [x y z]",std::vector,""); + BBTK_INPUT(LineProfile,Point2,"Vector [x y z]",std::vector,""); + BBTK_OUTPUT(LineProfile,Out,"Profile in gray level of the points of the segment",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(LineProfile); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkLineProfile_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx new file mode 100644 index 0000000..0ca30a2 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.cxx @@ -0,0 +1,105 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbcreaVtkPointRotation.h" +#include "bbcreaVtkPackage.h" + +#include + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PointRotation) +BBTK_BLACK_BOX_IMPLEMENTATION(PointRotation,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PointRotation::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + +printf("EED PointRotation::Process Start\n"); + + if (bbGetInputCenter().size()==3) + { + std::vector newpoint; + double nx,cx = bbGetInputCenter()[0]; + double ny,cy = bbGetInputCenter()[1]; + double nz,cz = bbGetInputCenter()[2]; + double angRad = bbGetInputAngle()*M_PI/180; + nx = bbGetInputSize() * cos( angRad ) + cx; + ny = bbGetInputSize() * sin( angRad ) + cy; + nz = cz; + newpoint.push_back(nx); + newpoint.push_back(ny); + newpoint.push_back(nz); + bbSetOutputOut( newpoint ); + } // if +printf("EED PointRotation::Process End\n"); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PointRotation::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + std::vector point; + point.push_back(1); + point.push_back(0); + point.push_back(0); + + std::vector center; + center.push_back(0); + center.push_back(0); + center.push_back(0); + + bbSetInputSize(1); + bbSetInputCenter(center); + bbSetInputAngle(0); + bbSetOutputOut(point); +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PointRotation::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PointRotation::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.h new file mode 100644 index 0000000..ca7c046 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPointRotation.h @@ -0,0 +1,49 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#ifndef __bbcreaVtkPointRotation_h_INCLUDED__ +#define __bbcreaVtkPointRotation_h_INCLUDED__ +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT PointRotation + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PointRotation,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(Center,std::vector); + BBTK_DECLARE_INPUT(Size,double); + BBTK_DECLARE_INPUT(Angle,double); + BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(PointRotation,bbtk::AtomicBlackBox); + BBTK_NAME("PointRotation"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("Point Rotation with a center reference"); + BBTK_CATEGORY("empty"); + BBTK_INPUT(PointRotation,Center,"Center of rotation [x y z]",std::vector,""); + BBTK_INPUT(PointRotation,Size,"Size of the segment (default 1)",double,""); + BBTK_INPUT(PointRotation,Angle,"Angle in degrees (default 0)",double,""); + BBTK_OUTPUT(PointRotation,Out,"End point of the rotated segment",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(PointRotation); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbcreaVtk + +#endif // __bbcreaVtkPointRotation_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx index 40202e2..3f61eca 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.cxx @@ -31,6 +31,7 @@ void TensorsVisu::Process() tensorsvisu.SetScaleFactor( bbGetInputScaleFactor() ); tensorsvisu.SetOpacity( bbGetInputOpacity() ); tensorsvisu.SetRenderer( bbGetInputRenderer() ); + tensorsvisu.SetTypeForm( bbGetInputTypeForm() ); tensorsvisu.Process(); bbSetOutputOut( tensorsvisu.GetProp3D() ); } @@ -47,6 +48,7 @@ void TensorsVisu::bbUserSetDefaultValues() bbSetInputRenderer(NULL); bbSetInputScaleFactor(500); bbSetInputOpacity(1); + bbSetInputTypeForm(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.h b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.h index 903f50f..81d1b20 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTensorsVisu.h @@ -27,6 +27,7 @@ class bbcreaVtk_EXPORT TensorsVisu BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); BBTK_DECLARE_INPUT(ScaleFactor,double); BBTK_DECLARE_INPUT(Opacity,double); + BBTK_DECLARE_INPUT(TypeForm,int); BBTK_DECLARE_OUTPUT(Out,vtkProp3D*); BBTK_PROCESS(Process); void Process(); @@ -49,6 +50,7 @@ BBTK_CATEGORY("empty"); BBTK_INPUT(TensorsVisu,ScaleFactor,"Scale factor (500 default)",double,""); BBTK_INPUT(TensorsVisu,Opacity,"Opacity (1 default)",double,""); BBTK_INPUT(TensorsVisu,Renderer,"vtkRenderer",vtkRenderer*,""); + BBTK_INPUT(TensorsVisu,TypeForm,"0 Cube, 1 Sphere, 2 Superquadric (default 0)",int,""); BBTK_OUTPUT(TensorsVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,""); BBTK_END_DESCRIBE_BLACK_BOX(TensorsVisu); //===== diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx index 6fd718c..080382f 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.cxx @@ -45,6 +45,7 @@ if ( bbGetInputActive()==true) vectorsvisu.SetScaleFactor( bbGetInputScaleFactor() ); vectorsvisu.SetOpacity( bbGetInputOpacity() ); vectorsvisu.SetRenderer( bbGetInputRenderer() ); + vectorsvisu.SetTypeForm( bbGetInputTypeForm() ); vectorsvisu.Process(); bbSetOutputOut( vectorsvisu.GetProp3D() ); printf("EED VectorsVisu::Process End\n"); @@ -64,7 +65,7 @@ void VectorsVisu::bbUserSetDefaultValues() bbSetInputRenderer(NULL); bbSetInputScaleFactor(500); bbSetInputOpacity(1); - + bbSetInputTypeForm(0); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h index 89beba9..27ad79c 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h @@ -28,6 +28,7 @@ class bbcreaVtk_EXPORT VectorsVisu BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); BBTK_DECLARE_INPUT(ScaleFactor,double); BBTK_DECLARE_INPUT(Opacity,double); + BBTK_DECLARE_INPUT(TypeForm,int); BBTK_DECLARE_OUTPUT(Out,vtkProp3D*); BBTK_PROCESS(Process); void Process(); @@ -50,6 +51,7 @@ BBTK_CATEGORY("empty"); BBTK_INPUT(VectorsVisu,ScaleFactor,"Scale factor (500 default)",double,""); BBTK_INPUT(VectorsVisu,Opacity,"Opacity (1 default)",double,""); BBTK_INPUT(VectorsVisu,Renderer,"vtkRenderer",vtkRenderer*,""); + BBTK_INPUT(VectorsVisu,TypeForm,"0 Line, 1 Arrow (default 0)",int,""); BBTK_OUTPUT(VectorsVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,""); BBTK_END_DESCRIBE_BLACK_BOX(VectorsVisu); //===== diff --git a/lib/creaVtk/vtkImageDataStrucPoints.cpp b/lib/creaVtk/vtkImageDataStrucPoints.cpp index 3678f7f..44c33a3 100644 --- a/lib/creaVtk/vtkImageDataStrucPoints.cpp +++ b/lib/creaVtk/vtkImageDataStrucPoints.cpp @@ -92,9 +92,10 @@ printf("EED vtkImageDataStrucPoints::joinComponents sizeimage%d\n", sizeimage _structuredPoints->Modified(); _structuredPoints->Update(); +/* _structuredPoints->Print(cout); - vtkStructuredPointsWriter *writer2 = vtkStructuredPointsWriter::New(); + vtkStructuredPointsWriter *writer2 = vtkStructuredPointsWriter::New(); writer2->SetFileName("/home/davila/tmp/VectorfromCal_EED_ups.vtk"); //writer->SetFileTypeToBinary(); writer2->SetFileTypeToASCII(); @@ -103,7 +104,7 @@ printf("EED vtkImageDataStrucPoints::joinComponents sizeimage%d\n", sizeimage writer2->SetScalarsName("Scalar"); writer2->SetInput(_structuredPoints); writer2->Write(); - +*/ diff --git a/lib/creaVtk/vtkTensorsVisu.cpp b/lib/creaVtk/vtkTensorsVisu.cpp index c834ada..046b0a5 100644 --- a/lib/creaVtk/vtkTensorsVisu.cpp +++ b/lib/creaVtk/vtkTensorsVisu.cpp @@ -32,13 +32,13 @@ //------------------------------------------------------------------------ vtkTensorsVisu::vtkTensorsVisu() : vtkVectorsTensorsVisuBase() { - ss = vtkSphereSource::New(); + ss = vtkSphereSource::New(); superquadratic = vtkSuperquadricSource::New(); - cs = vtkCubeSource::New(); - tg = vtkTensorGlyph::New(); - pdn = vtkPolyDataNormals::New(); - pd = vtkPolyData::New(); - pod = vtkPointData::New(); + cs = vtkCubeSource::New(); + tg = vtkTensorGlyph::New(); + pdn = vtkPolyDataNormals::New(); + pd = vtkPolyData::New(); + pod = vtkPointData::New(); } //------------------------------------------------------------------------ @@ -53,19 +53,18 @@ void vtkTensorsVisu::Process() printf("EED vtkTensorsVisu::Process Start\n"); - if (_active==true){ -// std::string source="sphere"; - std::string source="superquadratic"; - if(source=="sphere") + if (_active==true) + { + + if(GetTypeForm()==2) // source superquadratic { - tg->SetSource(ss->GetOutput()); - } else if(source=="cube") { - tg->SetSource(cs->GetOutput()); - }else if(source=="superquadratic") { superquadratic->SetThetaResolution(20); superquadratic->SetPhiResolution(20); tg->SetSource(superquadratic->GetOutput()); - } else { + } else if(GetTypeForm()==1) { // source sphere + tg->SetSource(ss->GetOutput()); + } else { // source cube + tg->SetSource(cs->GetOutput()); } diff --git a/lib/creaVtk/vtkTensorsVisu.h b/lib/creaVtk/vtkTensorsVisu.h index cdfdb93..8f1f135 100644 --- a/lib/creaVtk/vtkTensorsVisu.h +++ b/lib/creaVtk/vtkTensorsVisu.h @@ -69,13 +69,13 @@ protected: //--------------------------------------------- private: - vtkSmartPointer ss; + vtkSmartPointer ss; vtkSmartPointer superquadratic; - vtkSmartPointer cs; - vtkSmartPointer tg; + vtkSmartPointer cs; + vtkSmartPointer tg; vtkSmartPointer pdn; - vtkSmartPointer pd; - vtkSmartPointer pod; + vtkSmartPointer pd; + vtkSmartPointer pod; }; //-end of _VTKTENSORSVISU_H_------------------------------------------------------ diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp index 4c28724..962eeec 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp @@ -210,9 +210,9 @@ vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() //_LutEED->SetVectorModeToComponent(); _LutEED->SetVectorModeToRGBColors(); - _pdm = vtkPolyDataMapper::New(); - _actor = vtkActor::New(); - _actorAdded = false; + _pdm = vtkPolyDataMapper::New(); + _actor = vtkActor::New(); + _actorAdded = false; } vtkVectorsTensorsVisuBase::~vtkVectorsTensorsVisuBase() diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.h b/lib/creaVtk/vtkVectorsTensorsVisuBase.h index 2ca0d49..c1e7b75 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.h +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.h @@ -140,13 +140,13 @@ protected: //Methods and attributes only visible by this class //--------------------------------------------- private: - bool _actorAdded; + bool _actorAdded; - double _scalefactor; - double _opacity; - vtkDataObject *_dataobject; - vtkRenderer *_renderer; - int _typeForm; + double _scalefactor; + double _opacity; + vtkDataObject *_dataobject; + vtkRenderer *_renderer; + int _typeForm; protected: diff --git a/lib/creaVtk/vtkVectorsVisu.cpp b/lib/creaVtk/vtkVectorsVisu.cpp index c8045e5..ef8e116 100644 --- a/lib/creaVtk/vtkVectorsVisu.cpp +++ b/lib/creaVtk/vtkVectorsVisu.cpp @@ -38,6 +38,7 @@ vtkVectorsVisu::vtkVectorsVisu() :vtkVectorsTensorsVisuBase() { _vtkarrowsource = vtkArrowSource::New(); + _vtklinesource = vtkLineSource::New(); _vtkglyph = vtkGlyph3D::New(); } @@ -54,7 +55,15 @@ printf("EED vtkVectorsVisu::Process() start\n"); if(_active==true) { _vtkglyph->SetInput( GetDataObject() ); - _vtkglyph->SetSource( _vtkarrowsource->GetOutput() ); + + if(GetTypeForm()==1) // source Arrow + { + _vtkglyph->SetSource( _vtkarrowsource->GetOutput() ); + } else { // source Line + _vtkglyph->SetSource( _vtklinesource->GetOutput() ); + } + + _vtkglyph->SetScaleModeToScaleByVector(); _vtkglyph->SetColorModeToColorByVector(); _vtkglyph->SetScaleFactor( GetScaleFactor() ); diff --git a/lib/creaVtk/vtkVectorsVisu.h b/lib/creaVtk/vtkVectorsVisu.h index 56b41c4..55981f0 100644 --- a/lib/creaVtk/vtkVectorsVisu.h +++ b/lib/creaVtk/vtkVectorsVisu.h @@ -32,6 +32,7 @@ #include "vtkArrowSource.h" +#include "vtkLineSource.h" #include "vtkGlyph3D.h" @@ -69,7 +70,8 @@ protected: //--------------------------------------------- private: vtkArrowSource *_vtkarrowsource; - vtkGlyph3D *_vtkglyph; + vtkLineSource *_vtklinesource; + vtkGlyph3D *_vtkglyph; }; //-end of _vtkVectorsVISU_H_------------------------------------------------------ -- 2.45.0