From: davila Date: Wed, 27 Aug 2014 07:34:04 +0000 (+0200) Subject: #2446 creaVtk Feature New Normal - Stream Tracer, Stream Line (interface, widget) X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7a66ae84aef4c670d7fb7ce855b39e5a9eb2b4a4;p=creaVtk.git #2446 creaVtk Feature New Normal - Stream Tracer, Stream Line (interface, widget) --- diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg index a607a2a..d46f5c1 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbg # ---------------------------------- APP_START @@ -13,7 +13,7 @@ PACKAGENAME:creaVtk COMPLEXOUTPUTS:8 COMPLEX_PORT boxChange --62.565379:-78.187196:-900.000000 +-105.187753:-83.433027:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT widget @@ -21,19 +21,19 @@ widget FIN_COMPLEX_PORT COMPLEX_PORT ActivePlane --35.207993:-79.393730:-900.000000 +-57.830638:-83.983832:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT ActiveStreamLine --6.787570:-80.384681:-900.000000 +-15.967774:-80.384681:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT TypeStreamLine -48.736401:-82.305574:-900.000000 +84.801487:-80.010523:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT Resolution -72.202351:-82.038197:-900.000000 +68.267978:-77.120231:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT Opacity @@ -56,8 +56,8 @@ FIN_BOX BOX wx:LayoutLine:Box01 ISEXEC:FALSE -10.121381:-40.100538:-900.000000 -67.681381:-50.100538:-900.000000 +-6.927569:-39.444809:-900.000000 +50.632431:-49.444809:-900.000000 PORT WinTitle:"StreamLine" FIN_BOX @@ -128,8 +128,8 @@ FIN_BOX BOX std:MultipleInputs:Box07 ISEXEC:FALSE --79.976543:-40.697310:-900.000000 --34.401543:-50.697310:-900.000000 +-117.680951:-39.057988:-900.000000 +-72.105951:-49.057988:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs index 0bd3445..829058c 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Interface.bbs # ---------------------------------- include std @@ -95,5 +95,6 @@ output boxChange Box07.BoxChange " " output Opacity Box08.Out " " output ScaleFactor Box10.Out " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg index 0d4cfd6..0d83e76 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbg # ---------------------------------- APP_START @@ -13,11 +13,11 @@ PACKAGENAME:creaVtk COMPLEXOUTPUTS:2 COMPLEX_PORT Widget --2.239362:-103.517011:-900.000000 +14.888453:-130.094656:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT boxchange --21.059819:-100.774311:-900.000000 +-16.630212:-130.600334:-900.000000 FIN_COMPLEX_PORT COMPLEXINPUTS:2 COMPLEX_PORT @@ -28,12 +28,12 @@ COMPLEX_PORT In 99.025068:96.869980:-900.000000 FIN_COMPLEX_PORT -BOXES:5 +BOXES:6 BOX creaVtk:StreamLineVisu:Box00 ISEXEC:FALSE --68.950102:-59.006785:-900.000000 --23.375102:-69.006785:-900.000000 +-68.064181:-82.926665:-900.000000 +-22.489181:-92.926665:-900.000000 PORT Active:"true" PORT @@ -42,8 +42,8 @@ FIN_BOX BOX creaVtk:PlaneWidget:Box01 ISEXEC:FALSE -15.270694:-28.357144:-900.000000 -60.845694:-38.357144:-900.000000 +15.861308:-23.632229:-900.000000 +61.436308:-33.632229:-900.000000 PORT Active:"true" PORT @@ -67,10 +67,15 @@ ISEXEC:FALSE 81.238099:47.686190:-900.000000 152.413099:37.686190:-900.000000 FIN_BOX -CONNECTIONS:17 -CONNECTION -Box01:Out:Box00:Source -NumberOfControlPoints:0 +BOX +creaVtk:StreamTracer:Box05 +ISEXEC:FALSE +10.778711:-57.880203:-900.000000 +56.353711:-67.880203:-900.000000 +PORT +Active:"true" +FIN_BOX +CONNECTIONS:19 CONNECTION Renderer:Renderer:Box02:In NumberOfControlPoints:0 @@ -108,9 +113,6 @@ CONNECTION In:In:Box04:In NumberOfControlPoints:0 CONNECTION -Box04:Out:Box00:In -NumberOfControlPoints:0 -CONNECTION Box03:boxChange:boxchange:boxchange NumberOfControlPoints:0 CONNECTION @@ -119,4 +121,16 @@ NumberOfControlPoints:0 CONNECTION Box03:ScaleFactor:Box00:ScaleFactor NumberOfControlPoints:0 +CONNECTION +Box01:Out:Box05:Source +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box00:PolyData +NumberOfControlPoints:0 +CONNECTION +Box03:boxChange:Box05:BoxExecute +NumberOfControlPoints:0 APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs index bfc8e5d..06ae9d8 100644 --- a/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs +++ b/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) -# - /home/davila/Creatis/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PlaneWidget_StreamLineVisu_Widget.bbs # ---------------------------------- include std @@ -30,8 +30,10 @@ new PlaneWidget_StreamLineVisu_Interface Box03 new vtkImageDataPointerRelay Box04 +new StreamTracer Box05 + set Box05.Active "true" + -connect Box01.Out Box00.Source connect Box02.Out Box00.Renderer connect Box02.Out Box01.Renderer connect Box03.ActivePlane Box01.Active @@ -41,9 +43,12 @@ connect Box03.Resolution Box01.Resolution connect Box03.boxChange Box01.BoxExecute connect Box03.boxChange Box00.BoxExecute connect Box04.Out Box01.In -connect Box04.Out Box00.In connect Box03.TypeStreamLine Box00.TypeForm connect Box03.ScaleFactor Box00.ScaleFactor +connect Box01.Out Box05.Source +connect Box04.Out Box05.In +connect Box05.Out Box00.PolyData +connect Box03.boxChange Box05.BoxExecute # Complex input ports input Renderer Box02.In " " @@ -53,5 +58,6 @@ input In Box04.In " " output Widget Box03.widget " " output boxchange Box03.boxChange " " +message endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbg b/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbg new file mode 100644 index 0000000..b6814ff --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbg @@ -0,0 +1,173 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:PointBySpacing +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +PointOut +141.443758:-66.114148:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:2 +COMPLEX_PORT +PointIn +102.118356:102.960033:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Spacing +241.552372:102.960033:-900.000000 +FIN_COMPLEX_PORT +BOXES:12 +BOX +std:GetVectorIntElement:Box17 +ISEXEC:FALSE +38.045732:41.891151:-900.000000 +109.220732:31.891151:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:Mul:Box18 +ISEXEC:FALSE +62.309811:6.496758:-900.000000 +95.084811:-3.503242:-900.000000 +FIN_BOX +BOX +std:GetVectorDoubleElement:Box21 +ISEXEC:FALSE +66.046829:25.255118:-900.000000 +137.221829:15.255118:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:ConcatStrings:Box22 +ISEXEC:FALSE +137.088107:-30.728878:-900.000000 +182.663107:-40.728878:-900.000000 +PORT +In2:" " +PORT +In4:" " +PORT +In5:"10" +FIN_BOX +BOX +std:GetVectorIntElement:Box23 +ISEXEC:FALSE +144.598773:36.917121:-900.000000 +215.773773:26.917121:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:Mul:Box24 +ISEXEC:FALSE +139.640155:2.357662:-900.000000 +172.415155:-7.642338:-900.000000 +FIN_BOX +BOX +std:GetVectorDoubleElement:Box25 +ISEXEC:FALSE +152.561450:23.203357:-900.000000 +223.736450:13.203357:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:GetVectorIntElement:Box26 +ISEXEC:FALSE +225.902988:38.194526:-900.000000 +297.077988:28.194526:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:Mul:Box27 +ISEXEC:FALSE +239.730391:-7.636545:-900.000000 +272.505391:-17.636545:-900.000000 +FIN_BOX +BOX +std:GetVectorDoubleElement:Box28 +ISEXEC:FALSE +251.816752:25.315697:-900.000000 +322.991752:15.315697:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:MagicBox:Box30 +ISEXEC:FALSE +93.351546:80.416809:-900.000000 +138.926546:70.416809:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box31 +ISEXEC:FALSE +237.377701:81.669210:-900.000000 +282.952701:71.669210:-900.000000 +FIN_BOX +CONNECTIONS:18 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box18:In2 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box24:In1 +NumberOfControlPoints:0 +CONNECTION +Box25:Out:Box24:In2 +NumberOfControlPoints:0 +CONNECTION +Box26:Out:Box27:In1 +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box27:In2 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box22:In3 +NumberOfControlPoints:0 +CONNECTION +Box27:Out:Box22:In5 +NumberOfControlPoints:0 +CONNECTION +Box22:Out:PointOut:PointOut +NumberOfControlPoints:0 +CONNECTION +PointIn:PointIn:Box30:In +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box17:In +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box23:In +NumberOfControlPoints:0 +CONNECTION +Box30:Out:Box26:In +NumberOfControlPoints:0 +CONNECTION +Spacing:Spacing:Box31:In +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box28:In +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box25:In +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box21:In +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbs b/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbs new file mode 100644 index 0000000..5bd18d3 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbs @@ -0,0 +1,76 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/PointBySpacing.bbs +# ---------------------------------- + +include std +include itkvtk +include std + +define PointBySpacing creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new GetVectorIntElement Box17 + set Box17.I "0" + +new Mul Box18 + +new GetVectorDoubleElement Box21 + set Box21.I "0" + +new ConcatStrings Box22 + set Box22.In2 " " + set Box22.In4 " " + set Box22.In5 "10" + +new GetVectorIntElement Box23 + set Box23.I "1" + +new Mul Box24 + +new GetVectorDoubleElement Box25 + set Box25.I "1" + +new GetVectorIntElement Box26 + set Box26.I "2" + +new Mul Box27 + +new GetVectorDoubleElement Box28 + set Box28.I "2" + +new MagicBox Box30 + +new MagicBox Box31 + + +connect Box17.Out Box18.In1 +connect Box21.Out Box18.In2 +connect Box18.Out Box22.In1 +connect Box23.Out Box24.In1 +connect Box25.Out Box24.In2 +connect Box26.Out Box27.In1 +connect Box28.Out Box27.In2 +connect Box24.Out Box22.In3 +connect Box27.Out Box22.In5 +connect Box30.Out Box17.In +connect Box30.Out Box23.In +connect Box30.Out Box26.In +connect Box31.Out Box28.In +connect Box31.Out Box25.In +connect Box31.Out Box21.In + +# Complex input ports +input PointIn Box30.In " " +input Spacing Box31.In " " + +# Complex output ports +output PointOut Box22.Out " " + +message Interpreter 0 + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbg b/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbg new file mode 100644 index 0000000..9f2807d --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbg @@ -0,0 +1,227 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:StreamLineVisu_Interface +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:6 +COMPLEX_PORT +boxChange +-151.416636:-79.170789:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +widget +-52.910690:-81.750377:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +ActivePlane +-99.469419:-81.033052:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +TypeStreamLine +25.946770:-77.571286:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Opacity +51.069337:-77.325576:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +ScaleFactor +120.779151:-78.998068:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:1 +COMPLEX_PORT +title +-40.055135:89.461664:-900.000000 +FIN_COMPLEX_PORT +BOXES:11 +BOX +wx:LayoutLine:Box01 +ISEXEC:FALSE +-74.929187:-22.244359:-900.000000 +-17.369187:-32.244359:-900.000000 +PORT +Orientation:"V" +FIN_BOX +BOX +wx:Slider:Box03 +ISEXEC:FALSE +46.074662:58.311372:-900.000000 +97.474662:48.311372:-900.000000 +PORT +In:"100" +PORT +Label:"true" +PORT +Max:"100" +PORT +Min:"0" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Opacity" +FIN_BOX +BOX +wx:RadioButton:Box04 +ISEXEC:FALSE +39.133296:87.337484:-900.000000 +102.853296:77.337484:-900.000000 +PORT +In:"2" +PORT +In0:"Tube" +PORT +In1:"Ribbon" +PORT +In2:"Line" +PORT +Title:"Form" +FIN_BOX +BOX +wx:CheckBox:Box06 +ISEXEC:FALSE +-102.563782:79.117358:-900.000000 +-56.988782:69.117358:-900.000000 +PORT +In:"false" +PORT +ReactiveOnKeystroke:"true" +PORT +Title:"Active" +FIN_BOX +BOX +std:MultipleInputs:Box07 +ISEXEC:FALSE +-151.450986:-36.762937:-900.000000 +-105.875986:-46.762937:-900.000000 +PORT +BoxProcessMode:"Reactive" +FIN_BOX +BOX +std:Div:Box08 +ISEXEC:FALSE +63.290934:-35.232995:-900.000000 +96.065934:-45.232995:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:Slider:Box09 +ISEXEC:FALSE +73.828180:37.041549:-900.000000 +125.228180:27.041549:-900.000000 +PORT +ChangeResolution:"true" +PORT +In:"40" +PORT +Label:"true" +PORT +Max:"500" +PORT +Min:"0" +PORT +ReactiveOnTrack:"true" +PORT +Title:"ScaleFactor" +FIN_BOX +BOX +std:Div:Box10 +ISEXEC:FALSE +110.082722:-38.817858:-900.000000 +142.857722:-48.817858:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box12 +ISEXEC:FALSE +-49.451026:-44.289828:-900.000000 +8.108974:-54.289828:-900.000000 +PORT +Orientation:"H" +PORT +WinTitle:"StreamLine" +FIN_BOX +BOX +wx:LayoutTab:Box16 +ISEXEC:FALSE +-60.941887:-62.362352:-900.000000 +-3.381887:-72.362352:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box14 +ISEXEC:FALSE +37.283684:5.910521:-900.000000 +94.843684:-4.089479:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:20 +CONNECTION +Box06:BoxChange:Box07:In2 +NumberOfControlPoints:0 +CONNECTION +Box06:Out:ActivePlane:ActivePlane +NumberOfControlPoints:0 +CONNECTION +Box04:Out:TypeStreamLine:TypeStreamLine +NumberOfControlPoints:0 +CONNECTION +Box04:BoxChange:Box07:In4 +NumberOfControlPoints:0 +CONNECTION +Box03:BoxChange:Box07:In6 +NumberOfControlPoints:0 +CONNECTION +Box07:BoxChange:boxChange:boxChange +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box08:In1 +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Opacity:Opacity +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box10:In1 +NumberOfControlPoints:0 +CONNECTION +Box09:BoxChange:Box07:In7 +NumberOfControlPoints:0 +CONNECTION +Box10:Out:ScaleFactor:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box12:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box06:Widget:Box01:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box12:Widget:Box16:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box16:Widget:widget:widget +NumberOfControlPoints:0 +CONNECTION +title:title:Box12:WinTitle +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box14:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box09:Widget:Box14:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box14:Widget:Box01:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box12:Widget2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbs b/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbs new file mode 100644 index 0000000..22c7878 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbs @@ -0,0 +1,96 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/StreamLineVisu_Interface.bbs +# ---------------------------------- + +include std +include itkvtk +include wx +include std + +define StreamLineVisu_Interface creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new LayoutLine Box01 + set Box01.Orientation "V" + +new Slider Box03 + set Box03.In "100" + set Box03.Label "true" + set Box03.Max "100" + set Box03.Min "0" + set Box03.ReactiveOnTrack "true" + set Box03.Title "Opacity" + +new RadioButton Box04 + set Box04.In "2" + set Box04.In0 "Tube" + set Box04.In1 "Ribbon" + set Box04.In2 "Line" + set Box04.Title "Form" + +new CheckBox Box06 + set Box06.In "false" + set Box06.ReactiveOnKeystroke "true" + set Box06.Title "Active" + +new MultipleInputs Box07 + set Box07.BoxProcessMode "Reactive" + +new Div Box08 + set Box08.In2 "100" + +new Slider Box09 + set Box09.ChangeResolution "true" + set Box09.In "40" + set Box09.Label "true" + set Box09.Max "500" + set Box09.Min "0" + set Box09.ReactiveOnTrack "true" + set Box09.Title "ScaleFactor" + +new Div Box10 + set Box10.In2 "100" + +new LayoutLine Box12 + set Box12.Orientation "H" + set Box12.WinTitle "StreamLine" + +new LayoutTab Box16 + +new LayoutLine Box14 + set Box14.Orientation "H" + + +connect Box06.BoxChange Box07.In2 +connect Box04.BoxChange Box07.In4 +connect Box03.BoxChange Box07.In6 +connect Box03.Out Box08.In1 +connect Box09.Out Box10.In1 +connect Box09.BoxChange Box07.In7 +connect Box01.Widget Box12.Widget1 +connect Box06.Widget Box01.Widget1 +connect Box12.Widget Box16.Widget1 +connect Box03.Widget Box14.Widget1 +connect Box09.Widget Box14.Widget2 +connect Box14.Widget Box01.Widget2 +connect Box04.Widget Box12.Widget2 + +# Complex input ports +input title Box12.WinTitle " " + +# Complex output ports +output ActivePlane Box06.Out " " +output TypeStreamLine Box04.Out " " +output boxChange Box07.BoxChange " " +output Opacity Box08.Out " " +output ScaleFactor Box10.Out " " +output widget Box16.Widget " " + +message + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbg new file mode 100644 index 0000000..526528b --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbg @@ -0,0 +1,113 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:StreamLine_Visu_Widget +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +Widget +-60.685622:-10.631058:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:4 +COMPLEX_PORT +polydata +5.758490:95.679520:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +renderer +19.933234:93.907677:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxExecute +-25.839377:94.202985:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Title +-105.746835:95.913932:-900.000000 +FIN_COMPLEX_PORT +BOXES:5 +BOX +creaVtk:StreamLineVisu:Box00 +ISEXEC:FALSE +-16.684854:10.631058:-900.000000 +28.890146:0.631058:-900.000000 +FIN_BOX +BOX +creaVtk:StreamLineVisu_Interface:Box01 +ISEXEC:FALSE +-106.753539:74.417404:-900.000000 +-35.578539:64.417404:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box02 +ISEXEC:FALSE +-34.107977:49.020989:-900.000000 +11.467023:39.020989:-900.000000 +PORT +BoxProcessMode:"Reactive" +FIN_BOX +BOX +vtk:UpdateRender:Box03 +ISEXEC:FALSE +51.235793:10.335751:-900.000000 +96.810793:0.335751:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +std:MagicBox:Box04 +ISEXEC:FALSE +44.739035:48.135067:-900.000000 +90.314035:38.135067:-900.000000 +FIN_BOX +CONNECTIONS:14 +CONNECTION +Box01:ActivePlane:Box00:Active +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box00:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box00:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:TypeStreamLine:Box00:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:widget:Widget:Widget +NumberOfControlPoints:0 +CONNECTION +polydata:polydata:Box00:PolyData +NumberOfControlPoints:0 +CONNECTION +boxExecute:boxExecute:Box02:In1 +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box02:In2 +NumberOfControlPoints:0 +CONNECTION +Box02:BoxChange:Box00:BoxExecute +NumberOfControlPoints:0 +CONNECTION +renderer:renderer:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box00:Renderer +NumberOfControlPoints:0 +CONNECTION +Box04:Out:Box03:Renderer +NumberOfControlPoints:0 +CONNECTION +Box02:BoxChange:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Title:Title:Box01:title +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbs new file mode 100644 index 0000000..03463e2 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbs @@ -0,0 +1,53 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/creaTools/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/StreamLine_Visu_Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaVtk +include std +include vtk + +define StreamLine_Visu_Widget creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new StreamLineVisu Box00 + +new StreamLineVisu_Interface Box01 + +new MultipleInputs Box02 + set Box02.BoxProcessMode "Reactive" + +new UpdateRender Box03 + set Box03.Active "true" + +new MagicBox Box04 + + +connect Box01.ActivePlane Box00.Active +connect Box01.Opacity Box00.Opacity +connect Box01.ScaleFactor Box00.ScaleFactor +connect Box01.TypeStreamLine Box00.TypeForm +connect Box01.boxChange Box02.In2 +connect Box02.BoxChange Box00.BoxExecute +connect Box04.Out Box00.Renderer +connect Box04.Out Box03.Renderer +connect Box02.BoxChange Box03.BoxExecute + +# Complex input ports +input polydata Box00.PolyData " " +input boxExecute Box02.In1 " " +input renderer Box04.In " " +input Title Box01.title " " + +# Complex output ports +output Widget Box01.widget " " + +message + +endefine diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.cxx index b0ff016..b8251b2 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.cxx @@ -26,17 +26,17 @@ void StreamLineVisu::Process() // * TYPE is the C++ type of the input/output // (the one provided in the attribute 'type' of the tag 'input') -printf("EED StreamLineVisu::Process Start\n"); - creavtkstreamline.SetActive( bbGetInputActive() ); creavtkstreamline.SetDataObject( bbGetInputIn() ); creavtkstreamline.SetSourcePoints( bbGetInputSource() ); // source - creavtkstreamline.SetOpacity( bbGetInputOpacity() ); - creavtkstreamline.SetRenderer( bbGetInputRenderer() ); - creavtkstreamline.SetScaleFactor( bbGetInputScaleFactor() ); - creavtkstreamline.SetTypeForm( bbGetInputTypeForm() ); + + creavtkstreamline.SetActive( bbGetInputActive() ); + creavtkstreamline.SetPolyData( bbGetInputPolyData() ); + creavtkstreamline.SetOpacity( bbGetInputOpacity() ); + creavtkstreamline.SetRenderer( bbGetInputRenderer() ); + creavtkstreamline.SetScaleFactor( bbGetInputScaleFactor() ); + creavtkstreamline.SetTypeForm( bbGetInputTypeForm() ); creavtkstreamline.Process(); bbSetOutputOut( creavtkstreamline.GetProp3D() ); -printf("EED StreamLineVisu::Process End\n"); } //===== @@ -49,6 +49,7 @@ void StreamLineVisu::bbUserSetDefaultValues() // Here we initialize the input 'In' to 0 bbSetInputActive(false); bbSetInputIn(NULL); + bbSetInputPolyData(NULL); bbSetInputRenderer(NULL); bbSetInputOpacity(1); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.h b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.h index 302c455..8743ca3 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStreamLineVisu.h @@ -9,12 +9,12 @@ #include "vtkDataObject.h" #include "vtkDataSet.h" + +#include "vtkPolyData.h" #include "vtkRenderer.h" #include "creaVtkStreamLine.h" - - namespace bbcreaVtk { @@ -26,9 +26,13 @@ class bbcreaVtk_EXPORT StreamLineVisu //===== // 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(Active,bool); + BBTK_DECLARE_INPUT(In,vtkDataObject*); BBTK_DECLARE_INPUT(Source,vtkDataSet*); + + + BBTK_DECLARE_INPUT(Active,bool); + BBTK_DECLARE_INPUT(PolyData,vtkPolyData*); BBTK_DECLARE_INPUT(Renderer,vtkRenderer*); BBTK_DECLARE_INPUT(Opacity,double); BBTK_DECLARE_INPUT(ScaleFactor,double); @@ -51,13 +55,15 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(StreamLineVisu,bbtk::AtomicBlackBox); BBTK_DESCRIPTION("vtk Stream Line"); BBTK_CATEGORY("empty"); - BBTK_INPUT(StreamLineVisu,Active,"Active (false default)",bool,""); BBTK_INPUT(StreamLineVisu,In,"(needed) vtkDataObject. (Example vtkDataObject<-vtkDataSet<-vtkPointSet<-vtkPolyData (parrent class) )",vtkDataObject*,""); BBTK_INPUT(StreamLineVisu,Source,"(needed) vtkDataSet. (Example vtkPointSource->GetOutput() )",vtkDataSet*,""); + + BBTK_INPUT(StreamLineVisu,Active,"Active (false default)",bool,""); + BBTK_INPUT(StreamLineVisu,PolyData,"(needed) vtkPolyData.",vtkPolyData*,""); BBTK_INPUT(StreamLineVisu,Opacity,"Opacity (1 default)",double,""); BBTK_INPUT(StreamLineVisu,Renderer,"vtkRenderer",vtkRenderer*,""); BBTK_INPUT(StreamLineVisu,ScaleFactor,"Scale factor",double,""); - BBTK_INPUT(StreamLineVisu,TypeForm,"Type of form : 0(default) Tube, 1 Ribbon",int,""); + BBTK_INPUT(StreamLineVisu,TypeForm,"Type of form : 0(default) Tubes, 1 Ribbons,2 Lines",int,""); BBTK_OUTPUT(StreamLineVisu,Out,"vtkProp3D of an vtkActor",vtkProp3D*,""); BBTK_END_DESCRIBE_BLACK_BOX(StreamLineVisu); diff --git a/lib/creaVtk/creaVtkStreamLine.cpp b/lib/creaVtk/creaVtkStreamLine.cpp index 5085b1d..31ea59b 100644 --- a/lib/creaVtk/creaVtkStreamLine.cpp +++ b/lib/creaVtk/creaVtkStreamLine.cpp @@ -30,16 +30,16 @@ #include "vtkPointData.h" #include "vtkRenderWindow.h" #include "vtkProperty.h" +#include "vtkPolyDataWriter.h" creaVtkStreamLine::creaVtkStreamLine() { - _source = vtkPointSource::New(); - _vPointWidget = vtkPointWidget::New(); - _streamMapper2 = vtkPolyDataMapper::New(); + _source = vtkPointSource::New(); + _vPointWidget = vtkPointWidget::New(); + _streamMapper2 = vtkPolyDataMapper::New(); _streamer = vtkStreamTracer::New(); - _tubefilter = vtkTubeFilter::New(); - _ribbonfilter = vtkRibbonFilter::New(); + _ribbonfilter = vtkRibbonFilter::New(); } @@ -54,15 +54,25 @@ void creaVtkStreamLine::SetSourcePoints( vtkDataSet* sourcepoints) _sourcePoints = sourcepoints; } +//--------------------------------------------- +void creaVtkStreamLine::SetPolyData( vtkPolyData* polydata) +{ + _polydata = polydata; +} + //--------------------------------------------- void creaVtkStreamLine::Process() { - -printf("creaVtkStreamLine::Process Start \n"); + printf("EED creaVtkStreamLine::Process Start \n"); + + if (_polydata!=NULL){ + if (_active==false) { //bbGetInputPlaneFieldShow _vPointWidget->Off(); } else { + +/* //---------------------------Stream Lines----------------------- _vPointWidget->SetInput( (vtkDataSet*) GetDataObject() ); if (_firsttime==true) @@ -76,56 +86,67 @@ printf("creaVtkStreamLine::Process Start \n"); } //EED1 _vPointWidget->On(); - double c[3]; _vPointWidget->GetPosition(c); _source->SetCenter( c ); _source->Update(); _streamer->SetInput( GetDataObject() ); - -//EED1 _streamer->SetSource( _source->GetOutput() ); +//EED1 _streamer->SetSource( _source->GetOutput() ); _streamer->SetSource( _sourcePoints ); - _streamer->SetIntegratorTypeToRungeKutta45(); - //EED _streamer->SetMaximumPropagation(500000); _streamer->SetMaximumPropagation(500); -//EED _streamer->SetMaximumPropagationUnitToTimeUnit(); - +//EED _streamer->SetMaximumPropagationUnitToTimeUnit(); _streamer->SetInitialIntegrationStep (0.001); //EED _streamer->SetInitialIntegrationStepUnitToCellLengthUnit(); - _streamer->SetIntegrationDirectionToBoth(); //EED streamer->ComputeVorticityOn (); _streamer->Update(); -printf("EED creaVtkStreamLine::Process StreamLine PrintSelf\n"); - _streamer->Print(std::cout); - -printf("EED creaVtkStreamLine::Process StreamLine->GetOutput() PrintSelf\n"); - _streamer->GetOutput()->Print(std::cout); +// _streamer->Print(std::cout); +// _streamer->GetOutput()->Print(std::cout); +//EED +//vtkPolyDataWriter *writer3 = vtkPolyDataWriter::New(); +//writer3->SetFileName( "/home/davila/Borrame/streamline-eed.vtk" ); +//writer3->SetInput( _streamer->GetOutput() ); +//writer3->Write(); //EED 3aout2011 - _tubefilter->SetInput(_streamer->GetOutput()); + _tubefilter->SetInput( _streamer->GetOutput() ); + _ribbonfilter->SetInput(_streamer->GetOutput()); +*/ + + _tubefilter->SetInput( _polydata ); + _ribbonfilter->SetInput( _polydata ); + + _tubefilter->SetRadius( GetScaleFactor() ); _tubefilter->SetNumberOfSides(12); _tubefilter->SetVaryRadiusToVaryRadiusOff(); - _ribbonfilter->SetInput(_streamer->GetOutput()); _ribbonfilter->SetWidth( GetScaleFactor() ); _ribbonfilter->SetWidthFactor( GetScaleFactor()*10 ); _ribbonfilter->GlobalWarningDisplayOff (); //EED this is to avoid the "BEVEL WARNING" + _polydata->Modified(); //BORRAME _streamer->GetOutput()->GetScalarRange( range ); - if (GetTypeForm()==0) { + if (GetTypeForm()==0) + { _streamMapper2->SetInput( _tubefilter->GetOutput() ); - } else { + } + if (GetTypeForm()==1) + { _streamMapper2->SetInput( _ribbonfilter->GetOutput() ); } + if (GetTypeForm()==2) + { + _streamMapper2->SetInput( _polydata ); + } //EED _streamMapper2->SetLookupTable(vGreenToRedLut); +/* vtkPolyData *pd = _streamer->GetOutput(); vtkPointData *pointdata = pd->GetPointData(); // vtkDataArray *da = pointdata->GetArray("Normals"); @@ -136,6 +157,8 @@ printf("EED creaVtkStreamLine::Process StreamLine->GetOutput() PrintSelf\n"); { printf("EED creaVtkStreamLine::Process-name %d, %s \n", i, pointdata->GetArrayName(i) ); } +*/ + // vtkDataArray *nda = vtkDoubleArray::New(); // nda->DeepCopy(da); @@ -162,19 +185,16 @@ printf("EED creaVtkStreamLine::Process StreamLine->GetOutput() PrintSelf\n"); _streamMapper2->SetLookupTable( _LutEED ); _streamMapper2->SelectColorArray( "velocity" ); - - //Config 3 Position // ??????? - _actor->SetMapper( _streamMapper2 ); - -printf("EED lib creaVTK creaVtkStreamLine::Process opacity %f\n", GetOpacity() ); _actor->GetProperty()->SetOpacity( GetOpacity() ); }// _active VisibilityActor(); - - + } // polydata } + + + diff --git a/lib/creaVtk/creaVtkStreamLine.h b/lib/creaVtk/creaVtkStreamLine.h index c8b40db..4f9c7fb 100644 --- a/lib/creaVtk/creaVtkStreamLine.h +++ b/lib/creaVtk/creaVtkStreamLine.h @@ -34,6 +34,8 @@ #include "vtkDataSet.h" #include "vtkPointSource.h" #include "vtkPointWidget.h" + +#include "vtkPolyData.h" #include "vtkPolyDataMapper.h" #include "vtkRibbonFilter.h" #include "vtkStreamTracer.h" @@ -55,8 +57,8 @@ public : ~creaVtkStreamLine(); void Process(); - - void SetSourcePoints( vtkDataSet* sourcepoints); + void SetSourcePoints( vtkDataSet* sourcepoints); + void SetPolyData( vtkPolyData* polydata); //--------------------------------------------- @@ -70,19 +72,16 @@ protected: //--------------------------------------------- private: - vtkPointWidget *_vPointWidget; - + vtkPointWidget *_vPointWidget; vtkDataSet *_sourcePoints; + vtkPointSource *_source; + vtkStreamTracer *_streamer; - vtkPointSource *_source; - vtkStreamTracer *_streamer; - - vtkTubeFilter *_tubefilter; - vtkRibbonFilter *_ribbonfilter; - - vtkPolyDataMapper *_streamMapper2; - + vtkPolyData *_polydata; + vtkTubeFilter *_tubefilter; + vtkRibbonFilter *_ribbonfilter; + vtkPolyDataMapper *_streamMapper2; }; diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp index 405d741..0e52ef3 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.cpp @@ -192,22 +192,15 @@ void vtkLookupTableDirectionVector::PrintSelf(ostream& os, vtkIndent indent) //---------------------------------- //---------------------------------- - - - - - - - vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() { - _firsttime = true; + _firsttime = true; _active = false; - _scalefactor = 1; - _opacity = 1; + _scalefactor= 1; + _opacity = 1; _dataobject = NULL; _renderer = NULL; - _typeForm = 0; + _typeForm = 0; _LutEED = vtkLookupTableDirectionVector::New(); // _LutEED->SetVectorMode(0); @@ -215,8 +208,6 @@ vtkVectorsTensorsVisuBase::vtkVectorsTensorsVisuBase() //_LutEED->SetVectorModeToComponent(); _LutEED->SetVectorModeToRGBColors(); - - _pdm = vtkPolyDataMapper::New(); _actor = vtkActor::New(); _actorAdded = false; diff --git a/lib/creaVtk/vtkVectorsTensorsVisuBase.h b/lib/creaVtk/vtkVectorsTensorsVisuBase.h index 0d86225..c889b5b 100644 --- a/lib/creaVtk/vtkVectorsTensorsVisuBase.h +++ b/lib/creaVtk/vtkVectorsTensorsVisuBase.h @@ -108,24 +108,23 @@ public : vtkVectorsTensorsVisuBase(); ~vtkVectorsTensorsVisuBase(); - void SetActive(bool); - void SetDataObject(vtkDataObject*); - void SetRenderer(vtkRenderer *); - void SetScaleFactor(double); - void SetOpacity(double); - void SetTypeForm(int); + void SetActive(bool); + void SetDataObject(vtkDataObject*); + void SetRenderer(vtkRenderer *); + void SetScaleFactor(double); + void SetOpacity(double); + void SetTypeForm(int); - bool GetActive(); - vtkDataObject* GetDataObject(); - vtkRenderer* GetRenderer(); - double GetScaleFactor(); - double GetOpacity(); - vtkProp3D* GetProp3D(); - int GetTypeForm(); + bool GetActive(); + vtkDataObject* GetDataObject(); + vtkRenderer* GetRenderer(); + double GetScaleFactor(); + double GetOpacity(); + vtkProp3D* GetProp3D(); + int GetTypeForm(); - virtual void Process(); -// void Refresh(); - void VisibilityActor(); + virtual void Process(); + void VisibilityActor(); @@ -141,20 +140,20 @@ protected: private: bool _actorAdded; - double _scalefactor; - double _opacity; - vtkDataObject *_dataobject; - vtkRenderer *_renderer; - int _typeForm; + double _scalefactor; + double _opacity; + vtkDataObject *_dataobject; + vtkRenderer *_renderer; + int _typeForm; protected: bool _firsttime; - bool _active; + bool _active; vtkSmartPointer _pdm; - vtkSmartPointer _actor; - vtkLookupTableDirectionVector *_LutEED; + vtkSmartPointer _actor; + vtkLookupTableDirectionVector *_LutEED; };