From 1830bf64f6ad13d04f4fd7589317f0515fae837c Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 20 Jul 2015 15:53:38 +0200 Subject: [PATCH] bugs wt xtk --- wt/bbtk_wt_PKG/bbs/appli/demo02.bbg | 185 +++++++++++++ wt/bbtk_wt_PKG/bbs/appli/demo02.bbs | 101 +++++++ .../bbs/appli/demoPresentacion1Boton.bbg | 18 +- .../bbs/appli/demoPresentacion1Boton.bbs | 6 +- .../bbs/appli/demoPresentacion1Boton02.bbg | 123 +++++++-- .../bbs/appli/demoPresentacion1Boton02.bbs | 50 +++- wt/bbtk_wt_PKG/src/bbwtAddMesh.cxx | 254 ++++++++++++++++++ wt/bbtk_wt_PKG/src/bbwtAddMesh.h | 50 ++++ wt/bbtk_wt_PKG/src/bbwtChart.cxx | 159 +++++++++++ wt/bbtk_wt_PKG/src/bbwtChart.h | 56 ++++ wt/bbtk_wt_PKG/src/bbwtInputText.cxx | 2 +- wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ | 2 +- wt/bbtk_wt_PKG/src/bbwtInputText.h | 18 +- wt/bbtk_wt_PKG/src/bbwtInputText.h~ | 22 +- wt/bbtk_wt_PKG/src/bbwtSlider.cxx | 25 +- wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ | 27 +- wt/bbtk_wt_PKG/src/bbwtSphereXTK.cxx | 116 ++++++++ wt/bbtk_wt_PKG/src/bbwtSphereXTK.h | 58 ++++ wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx | 12 +- wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h | 34 ++- wt/data/RunServers.sh | 5 + 21 files changed, 1214 insertions(+), 109 deletions(-) create mode 100644 wt/bbtk_wt_PKG/bbs/appli/demo02.bbg create mode 100644 wt/bbtk_wt_PKG/bbs/appli/demo02.bbs create mode 100644 wt/bbtk_wt_PKG/src/bbwtAddMesh.cxx create mode 100644 wt/bbtk_wt_PKG/src/bbwtAddMesh.h create mode 100644 wt/bbtk_wt_PKG/src/bbwtChart.cxx create mode 100644 wt/bbtk_wt_PKG/src/bbwtChart.h create mode 100644 wt/bbtk_wt_PKG/src/bbwtSphereXTK.cxx create mode 100644 wt/bbtk_wt_PKG/src/bbwtSphereXTK.h create mode 100644 wt/data/RunServers.sh diff --git a/wt/bbtk_wt_PKG/bbs/appli/demo02.bbg b/wt/bbtk_wt_PKG/bbs/appli/demo02.bbg new file mode 100644 index 0000000..fd88a2d --- /dev/null +++ b/wt/bbtk_wt_PKG/bbs/appli/demo02.bbg @@ -0,0 +1,185 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /tmpEED/creaWT/wt/bbtk_wt_PKG/bbs/appli/demo02.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:13 +BOX +vtk:PolyDataWriter:Box05 +ISEXEC:FALSE +7.488818:9.311016:-900.000000 +53.063818:-0.688984:-900.000000 +PORT +BoxProcessMode:"Reactive" +PORT +Filename:"/home/davila/tempWT/tt.vtk" +FIN_BOX +BOX +vtk:AppendPolyData:Box07 +ISEXEC:FALSE +29.295856:49.804779:-900.000000 +74.870856:39.804779:-900.000000 +FIN_BOX +BOX +vtk:SphereSource:Box08 +ISEXEC:FALSE +-46.582634:83.426000:-900.000000 +-1.007634:73.426000:-900.000000 +PORT +CenterX:"0" +PORT +CenterY:"0" +PORT +CenterZ:"0" +PORT +PhiResolution:"20" +PORT +Radius:"20" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +vtk:SphereSource:Box11 +ISEXEC:FALSE +3.163876:101.277744:-900.000000 +48.738876:91.277744:-900.000000 +PORT +CenterX:"30" +PORT +CenterY:"0" +PORT +CenterZ:"0" +PORT +PhiResolution:"20" +PORT +Radius:"20" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +vtk:SphereSource:Box12 +ISEXEC:FALSE +64.854854:109.240208:-900.000000 +110.429854:99.240208:-900.000000 +PORT +CenterX:"40" +PORT +CenterY:"0" +PORT +CenterZ:"0" +PORT +PhiResolution:"20" +PORT +Radius:"20" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +wt:configServerWT:Box14 +ISEXEC:TRUE +-101.167324:3.232206:-900.000000 +-55.592324:-6.767794:-900.000000 +PORT +DocRoot:"/home/davila/tempWT" +FIN_BOX +BOX +wt:ViewerNVWeb:Box16 +ISEXEC:FALSE +-63.667899:-21.252713:-900.000000 +-18.092899:-31.252713:-900.000000 +PORT +ImagePath:"hola.nii" +FIN_BOX +BOX +wt:AddObjectToViewerWeb:Box17 +ISEXEC:FALSE +5.743109:-48.457872:-900.000000 +76.918109:-58.457872:-900.000000 +PORT +Mesh:"tt.vtk" +FIN_BOX +BOX +wt:LayoutLine:Box18 +ISEXEC:FALSE +-84.402875:-63.825590:-900.000000 +-26.842875:-73.825590:-900.000000 +FIN_BOX +BOX +wt:CommandButton:Box19 +ISEXEC:FALSE +-103.533598:37.803869:-900.000000 +-57.958598:27.803869:-900.000000 +FIN_BOX +BOX +wt:LayoutSplit:Box20 +ISEXEC:TRUE +-67.417841:-89.192848:-900.000000 +-21.842841:-99.192848:-900.000000 +PORT +Orientation:"h" +FIN_BOX +BOX +vtk:SphereSource:Box22 +ISEXEC:FALSE +-57.665045:104.228127:-900.000000 +-12.090045:94.228127:-900.000000 +PORT +CenterX:"0" +PORT +CenterY:"0" +PORT +CenterZ:"0" +PORT +PhiResolution:"20" +PORT +Radius:"20" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +vtk:MarchingCubes:Box23 +ISEXEC:FALSE +-110.010772:73.598775:-900.000000 +-64.435772:63.598775:-900.000000 +FIN_BOX +CONNECTIONS:11 +CONNECTION +Box08:Out:Box07:In1 +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box07:In2 +NumberOfControlPoints:0 +CONNECTION +Box12:Out:Box07:In3 +NumberOfControlPoints:0 +CONNECTION +Box16:viewer1:Box17:Viewer3D +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box18:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box16:Widget:Box20:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box18:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box18:Widget:Box20:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box19:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box11:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box19:BoxChange:Box17:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/wt/bbtk_wt_PKG/bbs/appli/demo02.bbs b/wt/bbtk_wt_PKG/bbs/appli/demo02.bbs new file mode 100644 index 0000000..9346195 --- /dev/null +++ b/wt/bbtk_wt_PKG/bbs/appli/demo02.bbs @@ -0,0 +1,101 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /tmpEED/creaWT/wt/bbtk_wt_PKG/bbs/appli/demo02.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include wt + +author "Author ??" +description "Description ??" +category "" + +new PolyDataWriter Box05 + set Box05.BoxProcessMode "Reactive" + set Box05.Filename "/home/davila/tempWT/tt.vtk" + +new AppendPolyData Box07 + +new SphereSource Box08 + set Box08.CenterX "0" + set Box08.CenterY "0" + set Box08.CenterZ "0" + set Box08.PhiResolution "20" + set Box08.Radius "20" + set Box08.ThetaResolution "20" + +new SphereSource Box11 + set Box11.CenterX "30" + set Box11.CenterY "0" + set Box11.CenterZ "0" + set Box11.PhiResolution "20" + set Box11.Radius "20" + set Box11.ThetaResolution "20" + +new SphereSource Box12 + set Box12.CenterX "40" + set Box12.CenterY "0" + set Box12.CenterZ "0" + set Box12.PhiResolution "20" + set Box12.Radius "20" + set Box12.ThetaResolution "20" + +new configServerWT Box14 + set Box14.DocRoot "/home/davila/tempWT" + +new ViewerNVWeb Box16 + set Box16.ImagePath "hola.nii" + +new AddObjectToViewerWeb Box17 + set Box17.Mesh "tt.vtk" + +new LayoutLine Box18 + +new CommandButton Box19 + +new LayoutSplit Box20 + set Box20.Orientation "h" + +new SphereSource Box22 + set Box22.CenterX "0" + set Box22.CenterY "0" + set Box22.CenterZ "0" + set Box22.PhiResolution "20" + set Box22.Radius "20" + set Box22.ThetaResolution "20" + +new MarchingCubes Box23 + + +connect Box08.Out Box07.In1 + +connect Box11.Out Box07.In2 + +connect Box12.Out Box07.In3 + +connect Box16.viewer1 Box17.Viewer3D + +connect Box17.Widget Box18.Widget2 + +connect Box16.Widget Box20.Widget2 + +connect Box19.Widget Box18.Widget1 + +connect Box18.Widget Box20.Widget1 + +connect Box19.BoxChange Box05.BoxExecute + +connect Box11.Out Box05.In + +connect Box19.BoxChange Box17.BoxExecute + + + +# Complex input ports +exec Box14 +exec Box20 diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg index c61c458..5176318 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBG BlackBox Diagram file -# - /home/gonzalez/Documents/CREATOOLS/wt_library/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg +# - /tmpEED/creaWT/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbg # ---------------------------------- APP_START @@ -67,10 +67,10 @@ FIN_BOX BOX std:ConcatStrings:Box08 ISEXEC:FALSE --47.016798:38.862924:-900.000000 --1.441798:28.862924:-900.000000 +-46.751022:38.862924:-900.000000 +-1.176022:28.862924:-900.000000 PORT -In1:"/home/gonzalez/Documents/pruebaResources/" +In1:"/home/davila/tempWT/" FIN_BOX BOX std:ConcatStrings:Box10 @@ -102,7 +102,7 @@ BOX wt:Slider:Box15 ISEXEC:FALSE -147.478672:97.311303:-900.000000 --98.025084:87.311303:-900.000000 +-114.703672:87.311303:-900.000000 PORT In:"1250" PORT @@ -130,7 +130,7 @@ BOX wt:LayoutLine:Box17 ISEXEC:FALSE -42.045154:-30.545041:-900.000000 -3.529846:-40.545041:-900.000000 +15.514846:-40.545041:-900.000000 FIN_BOX BOX wt:CommandButton:Box21 @@ -149,10 +149,10 @@ FIN_BOX BOX wt:configServerWT:Box27 ISEXEC:TRUE --107.110360:-76.377506:-900.000000 --61.535360:-86.377506:-900.000000 +-106.313031:-76.377506:-900.000000 +-60.738031:-86.377506:-900.000000 PORT -DocRoot:"/home/gonzalez/Documents/pruebaResources/imagennii" +DocRoot:"/home/davila/tempWT" PORT Port:"8083" FIN_BOX diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs index 5478025..593bab4 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs @@ -1,6 +1,6 @@ # ---------------------------------- # - BBTKGEditor v 1.4 BBS BlackBox Script -# - /home/gonzalez/Documents/CREATOOLS/wt_library/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs +# - /tmpEED/creaWT/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton.bbs # ---------------------------------- # BBTK GEditor Script @@ -40,7 +40,7 @@ new SegmentationConnectivity Box09 set Box09.ThresholdMinMax "200 300" new ConcatStrings Box08 - set Box08.In1 "/home/gonzalez/Documents/pruebaResources/" + set Box08.In1 "/home/davila/tempWT/" new ConcatStrings Box10 set Box10.In1 "holaPP" @@ -72,7 +72,7 @@ new CommandButton Box21 new AddObjectToViewerWeb Box22 new configServerWT Box27 - set Box27.DocRoot "/home/gonzalez/Documents/pruebaResources/imagennii" + set Box27.DocRoot "/home/davila/tempWT" set Box27.Port "8083" new LayoutSplit Box28 diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbg b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbg index d9a1613..24ad6c7 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbg +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbg @@ -9,12 +9,12 @@ DESCRIPTION:Description ?? AUTHOR:Author ?? COMPLEXBOX:FALSE COMPLEXINPUTS:0 -BOXES:19 +BOXES:22 BOX vtk:LoadHola:Box00 ISEXEC:FALSE --72.570294:105.151943:-900.000000 --26.995294:95.151943:-900.000000 +-76.040094:136.647049:-900.000000 +-30.465094:126.647049:-900.000000 FIN_BOX BOX itk:BinaryThresholdImageFilter:Box02 @@ -33,8 +33,8 @@ FIN_BOX BOX vtk:MarchingCubes:Box05 ISEXEC:FALSE -6.692777:43.801065:-900.000000 -52.267777:33.801065:-900.000000 +22.246215:17.911021:-900.000000 +67.821215:7.911021:-900.000000 PORT ComputeNormalsOn:"true" PORT @@ -57,8 +57,8 @@ FIN_BOX BOX vtk:SegmentationConnectivity:Box09 ISEXEC:FALSE --8.391847:60.140101:-900.000000 -62.783153:50.140101:-900.000000 +-7.324216:56.937209:-900.000000 +63.850784:46.937209:-900.000000 PORT PositionXYZ:"73 101 93" PORT @@ -67,8 +67,8 @@ FIN_BOX BOX std:ConcatStrings:Box08 ISEXEC:FALSE --47.016798:38.862924:-900.000000 --1.441798:28.862924:-900.000000 +-41.088107:37.428114:-900.000000 +4.486893:27.428114:-900.000000 PORT In1:"/home/gonzalez/Documents/pruebaResources/" FIN_BOX @@ -82,7 +82,9 @@ In1:"/holaPP" PORT In3:"_" PORT -In5:".vtk" +In5:"_" +PORT +In7:".vtk" FIN_BOX BOX wt:ViewerNVWeb:Box12 @@ -95,34 +97,38 @@ FIN_BOX BOX vtk:PolyDataWriter:Box14 ISEXEC:FALSE -21.745332:14.303612:-900.000000 -67.320332:4.303612:-900.000000 +38.827423:-9.402642:-900.000000 +84.402423:-19.402642:-900.000000 FIN_BOX BOX wt:Slider:Box15 ISEXEC:FALSE --147.478672:97.311303:-900.000000 --99.158672:87.311303:-900.000000 +-154.151364:134.678377:-900.000000 +-105.831364:124.678377:-900.000000 PORT In:"1250" PORT -Max:"1449" +Max:"1500" +PORT +Min:"0" PORT -Min:"500" +ReactiveOnTrack:"true" PORT Title:"LowerThreshold" FIN_BOX BOX wt:Slider:Box16 ISEXEC:FALSE --11.084915:114.503664:-900.000000 -37.235085:104.503664:-900.000000 +-8.148931:139.059170:-900.000000 +24.626069:129.059170:-900.000000 PORT In:"1500" PORT -Max:"2500" +Max:"4000" +PORT +Min:"0" PORT -Min:"1450" +ReactiveOnTrack:"true" PORT Title:"UpperThresHold" FIN_BOX @@ -130,13 +136,13 @@ BOX wt:LayoutLine:Box17 ISEXEC:FALSE -16.520519:-78.953832:-900.000000 -41.039481:-88.953832:-900.000000 +29.054481:-88.953832:-900.000000 FIN_BOX BOX wt:CommandButton:Box21 ISEXEC:FALSE -66.944278:42.623376:-900.000000 -112.519278:32.623376:-900.000000 +106.713522:33.815423:-900.000000 +152.288522:23.815423:-900.000000 PORT Label:"Run" FIN_BOX @@ -153,6 +159,8 @@ ISEXEC:TRUE -76.620006:-132.911993:-900.000000 PORT DocRoot:"/tmpEED/tmpWt/wtInstall/share/Wt/resources" +PORT +Port:"8082" FIN_BOX BOX wt:LayoutSplit:Box25 @@ -184,7 +192,41 @@ ISEXEC:FALSE PORT In2:"/hola.nii" FIN_BOX -CONNECTIONS:27 +BOX +vtk:ImageGaussianSmooth:Box29 +ISEXEC:FALSE +32.866040:36.323708:-900.000000 +104.041040:26.323708:-900.000000 +PORT +StdDevX:"0" +PORT +StdDevY:"0" +PORT +StdDevZ:"0" +FIN_BOX +BOX +wt:Slider:Box31 +ISEXEC:FALSE +97.287847:129.717130:-900.000000 +130.062847:119.717130:-900.000000 +PORT +In:"1" +PORT +Max:"4" +PORT +Min:"0" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Smooth" +FIN_BOX +BOX +wt:OutputText:Box32 +ISEXEC:FALSE +-59.326297:-42.219941:-900.000000 +-13.751297:-52.219941:-900.000000 +FIN_BOX +CONNECTIONS:36 CONNECTION Box00:Out:Box02:In NumberOfControlPoints:0 @@ -195,9 +237,6 @@ CONNECTION Box06:Out:Box09:In NumberOfControlPoints:0 CONNECTION -Box09:Out:Box05:In -NumberOfControlPoints:0 -CONNECTION Box05:Out:Box14:In NumberOfControlPoints:0 CONNECTION @@ -266,4 +305,34 @@ NumberOfControlPoints:0 CONNECTION Box12:Widget:Box25:Widget2 NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box29:In +NumberOfControlPoints:0 +CONNECTION +Box31:Widget:Box17:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box32:Widget:Box17:Widget4 +NumberOfControlPoints:0 +CONNECTION +Box08:Out:Box32:In +NumberOfControlPoints:0 +CONNECTION +Box21:BoxChange:Box32:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box29:StdDevX +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box29:StdDevY +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box29:StdDevZ +NumberOfControlPoints:0 +CONNECTION +Box29:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box31:Out:Box10:In6 +NumberOfControlPoints:0 APP_END diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbs b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbs index 790974a..34acf86 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbs +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton02.bbs @@ -45,7 +45,8 @@ new ConcatStrings Box08 new ConcatStrings Box10 set Box10.In1 "/holaPP" set Box10.In3 "_" - set Box10.In5 ".vtk" + set Box10.In5 "_" + set Box10.In7 ".vtk" new ViewerNVWeb Box12 set Box12.ImagePath "hola.nii" @@ -54,14 +55,16 @@ new PolyDataWriter Box14 new Slider Box15 set Box15.In "1250" - set Box15.Max "1449" - set Box15.Min "500" + set Box15.Max "1500" + set Box15.Min "0" + set Box15.ReactiveOnTrack "true" set Box15.Title "LowerThreshold" new Slider Box16 set Box16.In "1500" - set Box16.Max "2500" - set Box16.Min "1450" + set Box16.Max "4000" + set Box16.Min "0" + set Box16.ReactiveOnTrack "true" set Box16.Title "UpperThresHold" new LayoutLine Box17 @@ -73,6 +76,7 @@ new AddObjectToViewerWeb Box22 new configServerWT Box24 set Box24.DocRoot "/tmpEED/tmpWt/wtInstall/share/Wt/resources" + set Box24.Port "8082" new LayoutSplit Box25 set Box25.Orientation "h" @@ -85,6 +89,20 @@ new ConcatStrings Box27 new ConcatStrings Box28 set Box28.In2 "/hola.nii" +new ImageGaussianSmooth Box29 + set Box29.StdDevX "0" + set Box29.StdDevY "0" + set Box29.StdDevZ "0" + +new Slider Box31 + set Box31.In "1" + set Box31.Max "4" + set Box31.Min "0" + set Box31.ReactiveOnTrack "true" + set Box31.Title "Smooth" + +new OutputText Box32 + connect Box00.Out Box02.In @@ -92,8 +110,6 @@ connect Box02.Out Box06.In connect Box06.Out Box09.In -connect Box09.Out Box05.In - connect Box05.Out Box14.In connect Box10.Out Box08.In2 @@ -140,6 +156,26 @@ connect Box17.Widget Box25.Widget1 connect Box12.Widget Box25.Widget2 +connect Box09.Out Box29.In + +connect Box31.Widget Box17.Widget1 + +connect Box32.Widget Box17.Widget4 + +connect Box08.Out Box32.In + +connect Box21.BoxChange Box32.BoxExecute + +connect Box31.Out Box29.StdDevX + +connect Box31.Out Box29.StdDevY + +connect Box31.Out Box29.StdDevZ + +connect Box29.Out Box05.In + +connect Box31.Out Box10.In6 + # Complex input ports diff --git a/wt/bbtk_wt_PKG/src/bbwtAddMesh.cxx b/wt/bbtk_wt_PKG/src/bbwtAddMesh.cxx new file mode 100644 index 0000000..ef7f69d --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtAddMesh.cxx @@ -0,0 +1,254 @@ +//===== +// 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 "bbwtAddMesh.h" +#include "bbwtPackage.h" + +#include + + +namespace bbwt +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,AddMesh) +BBTK_BLACK_BOX_IMPLEMENTATION(AddMesh,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 AddMesh::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 =====================================================AddMesh::Process() mesh %s\n", bbGetInputMesh().c_str() ); + + + + + Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetInputViewerWt(); + char strPointer[15]; + sprintf(strPointer,"%p",this); + std::string mMesh = w->jsRef() + ".mMesh"+strPointer; + std::string mCont = w->jsRef() + ".mCont"+strPointer; + std::string mRenderer = w->jsRef() + ".mRenderer"; + + printf("EED =====================================================AddMesh::Process() mMesh %s\n", mMesh.c_str() ); + + + std::string jsCom = "\ + try\ + {\ + " + mCont+" = true;\ + "+mMesh+".file = '"+bbGetInputMesh()+"';\ + "+mMesh+".modified(true);\ + "+mRenderer+".render();\ + }\ + catch(err)\ + {\ + var mMesh = new X.mesh();\ + " + mMesh+" = mMesh;\ + mMesh.file = '"+bbGetInputMesh()+"';\ + mMesh.color = [1,0.8,0];\ + mMesh.opacity=1;\ + " + mCont+" = false;\ + "+mRenderer+".onShowtime = function()\ + {\ + if(!" + mCont +")\ + {\ + }\ + };\ + " + mRenderer+".add( " + mMesh+");\ + " + mRenderer+".render();\ + " + mMesh+".transform.flipX();\ + " + mMesh+".transform.flipY();\ + " + mMesh+".transform.translateY(-10);\ + " + mRenderer+".render();\ + }"; + + std::cout<<"DEBUG ADD OBJECT ---- "<doJavaScript(jsCom); + Wt::WApplication::instance()->doJavaScript(jsCom); + + + + + + +/* + + std::string jsCom = "\ + try\ + {\ + " + mCont+" = true;\ + "+mMesh+".file = '"+bbGetInputMesh()+"';\ + "+mMesh+".modified(true);\ + "+w->jsRef()+".mRenderer.render();\ + }\ + catch(err)\ + {\ + var mMesh = new X.mesh();\ + " + mMesh+" = mMesh;\ + mMesh.file = '"+bbGetInputMesh()+"';\ + mMesh.color = [1,0.8,0];\ + mMesh.opacity=1;\ + " + mCont+" = false;\ + "+w->jsRef() +".mRenderer.onShowtime = function()\ + {\ + if(!" + mCont +")\ + {\ + }\ + };\ + " + mMesh+".transform.flipX();\ + " + mMesh+".transform.flipY();\ + " + mMesh+".transform.translateY(-10);\ + " + w->jsRef() +".mRenderer.add( " + mMesh+");\ + " + mMesh+".transform.flipX();\ + " + mMesh+".transform.flipY();\ + " + mMesh+".transform.translateY(-10);\ + " + mMesh+".visible = true;\ + "+mMesh+".modified(true);\ + " + w->jsRef() + ".mRenderer.render();\ + }"; + + std::cout<<"DEBUG ADD OBJECT ---- "<doJavaScript(jsCom); + Wt::WApplication::instance()->doJavaScript(jsCom); + + +*/ + + + + + +/* + std::string jsCom = "\ + try\ + {\ + " + mCont+" = true;\ + "+mMesh+".file = '"+bbGetInputMesh()+"';\ + "+mMesh+".modified(true);\ + "+w->jsRef()+".mRenderer.render();\ + }\ + catch(err)\ + {\ + var mMesh = new X.mesh();\ + mMesh.file = '"+bbGetInputMesh()+"';\ + mMesh.color = [1,0.8,0];\ + mMesh.opacity=1;\ + " + mMesh+" = mMesh;\ + " + mCont+" = false;\ + "+w->jsRef() +".mRenderer.onShowtime = function()\ + {\ + if(!" + mCont +")\ + {\ + " + mMesh+".transform.flipX();\ + " + mMesh+".transform.flipY();\ + " + mMesh+".transform.translateY(-10);\ + " + mMesh+".visible = true;\ + }\ + };\ + " + w->jsRef() +".mRenderer.add( " + mMesh+");\ + " + w->jsRef() + ".mRenderer.render();\ + }"; + + std::cout<<"DEBUG ADD OBJECT ---- "<doJavaScript(jsCom); + Wt::WApplication::instance()->doJavaScript(jsCom); +*/ + + + +/* + + Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetInputViewerWt(); + std::string jsCom = "\ + try{\ + " + w->jsRef() + ".cont = true;\ + " + w->jsRef() + ".mMesh.file = '"+bbGetInputMesh()+"';\ + "+w->jsRef() +".mRenderer.add( " + w->jsRef() + ".mMesh);\ + "+w->jsRef()+".mRenderer.render();\ + }\ + catch(err)\ + {\ + var mMesh = new X.mesh();\ + mMesh.file = '"+bbGetInputMesh()+"';\ + mMesh.color = [1,0.8,0];\ + mMesh.opacity=1;\ + " + w->jsRef() + ".mMesh = mMesh;\ + " + w->jsRef() + ".cont = false;\ + "+w->jsRef() +".mRenderer.onShowtime = function() {\ + if(!" + w->jsRef() + ".cont)\ + {\ + " + w->jsRef() + ".mMesh.transform.flipX();\ + " + w->jsRef() + ".mMesh.transform.flipY();\ + " + w->jsRef() + ".mMesh.transform.translateY(-10);\ + " + w->jsRef() + ".mMesh.visible = true;\ + }\ + };\ + " + w->jsRef() + ".mMesh.modified(true);\ + " + w->jsRef() + ".mRenderer.render();\ + }"; + + std::cout<<"DEBUG ADD OBJECT ---- "<doJavaScript(jsCom); + Wt::WApplication::instance()->doJavaScript(jsCom); + +*/ + + + + +} +//===== +// 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 AddMesh::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputMesh(""); + bbSetInputViewerWt(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 AddMesh::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 AddMesh::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbwt + + diff --git a/wt/bbtk_wt_PKG/src/bbwtAddMesh.h b/wt/bbtk_wt_PKG/src/bbwtAddMesh.h new file mode 100644 index 0000000..3ebde73 --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtAddMesh.h @@ -0,0 +1,50 @@ +//===== +// 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 __bbwtAddMesh_h_INCLUDED__ +#define __bbwtAddMesh_h_INCLUDED__ +#include "bbwt_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbwt +{ + +class bbwt_EXPORT AddMesh + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(AddMesh,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(ViewerWt,Wt::WContainerWidget*); + BBTK_DECLARE_INPUT(Mesh,std::string); +// BBTK_DECLARE_OUTPUT(Out,double); + 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(AddMesh,bbtk::AtomicBlackBox); + BBTK_NAME("AddMesh"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(AddMesh,ViewerWt,"Viewer 2D/3D Wt=>XTK " ,Wt::WContainerWidget*,""); + BBTK_INPUT(AddMesh,Mesh ,"Filename (from resourceDir-WT)" ,std::string ,""); + +BBTK_END_DESCRIBE_BLACK_BOX(AddMesh); +//===== +// 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 bbwt + +#endif // __bbwtAddMesh_h_INCLUDED__ + diff --git a/wt/bbtk_wt_PKG/src/bbwtChart.cxx b/wt/bbtk_wt_PKG/src/bbwtChart.cxx new file mode 100644 index 0000000..347aaeb --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtChart.cxx @@ -0,0 +1,159 @@ +//===== +// 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 "bbwtChart.h" +#include "bbwtPackage.h" + + +#include +#include +#include +#include + + +namespace bbwt +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,Chart) +BBTK_BLACK_BOX_IMPLEMENTATION(Chart,bbtk::WtBlackBox); +//===== +// 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 Chart::Process() +{ + +/* + int lstSize = bbGetInputlstX().size(); + Wt::WStandardItemModel *model = new Wt::WStandardItemModel(lstSize, 2, bbGetOutputWidget() ); + model->setHeaderData(0, Wt::WString("X")); + model->setHeaderData(1, Wt::WString("Y = cos(X)")); + + for (unsigned i = 0; i < lstSize; ++i) { +// double x = (static_cast(i) - 20) / 4; + + model->setData(i, 0, bbGetInputlstX()[i] ); + model->setData(i, 1, bbGetInputlstY()[i]); + } + + chart->setModel(model); + Wt::Chart::WDataSeries s(1, Wt::Chart::CurveSeries); + s.setShadow(Wt::WShadow(3, 3, Wt::WColor(0, 0, 0, 127), 3)); + chart->addSeries(s); +*/ + + + Wt::WStandardItemModel *model = new Wt::WStandardItemModel(40, 2, bbGetOutputWidget() ); + model->setHeaderData(0, Wt::WString("X")); + model->setHeaderData(1, Wt::WString("Y = cos(X)")); + + for (unsigned i = 0; i < 40; ++i) { + double x = (static_cast(i) - 20) / 4; + + model->setData(i, 0, x); + model->setData(i, 1, std::cos(x)); + } + + chart->setModel(model); + Wt::Chart::WDataSeries s(2, Wt::Chart::CurveSeries); + s.setShadow(Wt::WShadow(3, 3, Wt::WColor(0, 0, 255, 127), 3)); + chart->addSeries(s); + +} +//===== +// 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 Chart::CreateWidget(Wt::WContainerWidget* parent) +{ + + Wt::WContainerWidget *container = new Wt::WContainerWidget( parent ); + + + Wt::WStandardItemModel *model = new Wt::WStandardItemModel(40, 2, container); + model->setHeaderData(0, Wt::WString("X")); + model->setHeaderData(1, Wt::WString("Y = sin(X)")); + + for (unsigned i = 0; i < 40; ++i) { + double x = (static_cast(i) - 20) / 4; + + model->setData(i, 0, x); + model->setData(i, 1, std::sin(x)); + } + + /* + * Create the scatter plot. + */ + chart = new Wt::Chart::WCartesianChart(container); + chart->setModel(model); // Set the model. + chart->setXSeriesColumn(0); // Set the column that holds the X data. + chart->setLegendEnabled(true); // Enable the legend. + + chart->setType(Wt::Chart::ScatterPlot); // Set type to ScatterPlot. + + // Typically, for mathematical functions, you want the axes to cross + // at the 0 mark: + chart->axis(Wt::Chart::XAxis).setLocation(Wt::Chart::ZeroValue); + chart->axis(Wt::Chart::YAxis).setLocation(Wt::Chart::ZeroValue); + + // Provide space for the X and Y axis and title. + chart->setPlotAreaPadding(80, Wt::Left); + chart->setPlotAreaPadding(40, Wt::Top | Wt::Bottom); + + // Add the curves + Wt::Chart::WDataSeries s(1, Wt::Chart::CurveSeries); + s.setShadow(Wt::WShadow(3, 3, Wt::WColor(0, 0, 0, 127), 3)); + chart->addSeries(s); + + chart->resize(800, 300); // WPaintedWidget must be given explicit size. + + chart->setMargin(10, Wt::Top | Wt::Bottom); // Add margin vertically + chart->setMargin(Wt::WLength::Auto, Wt::Left | Wt::Right); // Center horizontally +/* + + Wt::WTimer *t = new Wt::WTimer(chart); + t->setInterval(25); + t->start(); + + double *phi = new double(0); + t->timeout().connect(std::bind([=] () { + *phi += 0.1; + + for (unsigned i = 0; i < 40; ++i) { + double x = (static_cast(i) - 20) / 4; + + model->setData(i, 0, x); + model->setData(i, 1, std::sin(x + *phi)); + } + })); +*/ + + bbSetOutputWidget( container ); + // 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) +//===== +void Chart::bbUserSetDefaultValues() +{ + +} +//===== +// 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 Chart::bbUserInitializeProcessing() +{ + +} +//===== +// 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 Chart::bbUserFinalizeProcessing() +{ + +} +} +// EO namespace bbwt + + diff --git a/wt/bbtk_wt_PKG/src/bbwtChart.h b/wt/bbtk_wt_PKG/src/bbwtChart.h new file mode 100644 index 0000000..4177343 --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtChart.h @@ -0,0 +1,56 @@ +//===== +// 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) +//===== +#ifdef _USE_WXWIDGETS_ +#ifndef __bbwtChart_h_INCLUDED__ +#define __bbwtChart_h_INCLUDED__ +#include "bbwt_EXPORT.h" +#include "bbtkWtBlackBox.h" + +#include + +namespace bbwt +{ + +class bbwt_EXPORT Chart + : + public bbtk::WtBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Chart,bbtk::WtBlackBox); +//===== +// 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(lstX,std::vector); + BBTK_DECLARE_INPUT(lstY,std::vector); + BBTK_PROCESS(Process); + void Process(); + BBTK_CREATE_WIDGET(CreateWidget); + void CreateWidget(Wt::WContainerWidget*); + + Wt::Chart::WCartesianChart *chart; + + +//===== +// 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(Chart,bbtk::WtBlackBox); + BBTK_NAME("Chart"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("__CategoryBlackBox__"); + + BBTK_INPUT(Chart,lstX,"LST Y",std::vector,""); + BBTK_INPUT(Chart,lstY,"LST Y",std::vector,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Chart); +//===== +// 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 bbwt + +#endif // __bbwtChart_h_INCLUDED__ +#endif // _USE_WXWIDGETS_ + diff --git a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx b/wt/bbtk_wt_PKG/src/bbwtInputText.cxx index 19b5d2c..ac66505 100644 --- a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtInputText.cxx @@ -155,7 +155,7 @@ void InputText::CreateWidget(Wt::WContainerWidget* parent) parent, bbtk::std2wt ( bbGetInputIn() ) , bbtk::std2wt ( bbGetInputTitle() ) ) ); - + 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) diff --git a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ b/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ index 31e7519..19b5d2c 100644 --- a/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ +++ b/wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ @@ -19,7 +19,7 @@ namespace bbwt std::string GetValue(); void SetValue(std::string value); - //void OnTextEnter(); + void OnTextEnter(); void OnTextUpdate(const Wt::WKeyEvent e); void SetTitle(Wt::WString); diff --git a/wt/bbtk_wt_PKG/src/bbwtInputText.h b/wt/bbtk_wt_PKG/src/bbwtInputText.h index d6333cf..3633b98 100644 --- a/wt/bbtk_wt_PKG/src/bbwtInputText.h +++ b/wt/bbtk_wt_PKG/src/bbwtInputText.h @@ -34,14 +34,16 @@ class bbwt_EXPORT InputText }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(InputText,bbtk::WtBlackBox); -BBTK_NAME("InputText"); -BBTK_AUTHOR("JohannGONZALEZ"); -BBTK_DESCRIPTION("gonzalez@creatis.insa-lyon.fr - InputText widget implemented with wt."); -BBTK_CATEGORY("__CategoryBlackBox__"); -BBTK_INPUT(InputText,Title,"Title prepended to the text",std::string,""); -BBTK_INPUT(InputText,In,"Text",std::string,""); -BBTK_INPUT(InputText,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,""); -BBTK_OUTPUT(InputText,Out,"Current text",std::string,""); + BBTK_NAME("InputText"); + BBTK_AUTHOR("JohannGONZALEZ"); + BBTK_DESCRIPTION("gonzalez@creatis.insa-lyon.fr - InputText widget implemented with wt."); + BBTK_CATEGORY("__CategoryBlackBox__"); + BBTK_INPUT(InputText,Title,"Title prepended to the text",std::string,""); + + BBTK_INPUT(InputText,In,"Text",std::string,""); + BBTK_INPUT(InputText,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,""); + + BBTK_OUTPUT(InputText,Out,"Current text",std::string,""); BBTK_END_DESCRIBE_BLACK_BOX(InputText); //===== // 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/wt/bbtk_wt_PKG/src/bbwtInputText.h~ b/wt/bbtk_wt_PKG/src/bbwtInputText.h~ index 41709bb..3633b98 100644 --- a/wt/bbtk_wt_PKG/src/bbwtInputText.h~ +++ b/wt/bbtk_wt_PKG/src/bbwtInputText.h~ @@ -30,18 +30,20 @@ class bbwt_EXPORT InputText // 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) //===== private: - bool firsttime; + bool firsttime; }; -BBTK_BEGIN_DESCRIBE_BLACK_BOX(InputText,bbtk::WxBlackBox); -BBTK_NAME("InputText"); -BBTK_AUTHOR("JohannGONZALEZ"); -BBTK_DESCRIPTION("gonzalez@creatis.insa-lyon.fr - InputText widget implemented with wt."); -BBTK_CATEGORY("__CategoryBlackBox__"); -BBTK_INPUT(InputText,Title,"Title prepended to the text",std::string,""); -BBTK_INPUT(InputText,In,"Text",std::string,""); -BBTK_INPUT(InputText,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,""); -BBTK_OUTPUT(InputText,Out,"Current text",std::string,""); +BBTK_BEGIN_DESCRIBE_BLACK_BOX(InputText,bbtk::WtBlackBox); + BBTK_NAME("InputText"); + BBTK_AUTHOR("JohannGONZALEZ"); + BBTK_DESCRIPTION("gonzalez@creatis.insa-lyon.fr - InputText widget implemented with wt."); + BBTK_CATEGORY("__CategoryBlackBox__"); + BBTK_INPUT(InputText,Title,"Title prepended to the text",std::string,""); + + BBTK_INPUT(InputText,In,"Text",std::string,""); + BBTK_INPUT(InputText,ReactiveOnKeystroke,"0 not event generated, 1 Enter event genereated, 2 All keys, (default '2') ", int,""); + + BBTK_OUTPUT(InputText,Out,"Current text",std::string,""); BBTK_END_DESCRIBE_BLACK_BOX(InputText); //===== // 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/wt/bbtk_wt_PKG/src/bbwtSlider.cxx b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx index 875d5b8..b66bdc7 100644 --- a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx @@ -197,15 +197,13 @@ namespace bbwt void SliderWidget::OnSliderTrack() { +printf("EED SliderWidget::OnSliderTrack value=%d\n", mwtSlider->value() ); + // When user releases the slider // we update the output of the box - if(reactiveOnTrack) - { - mBox->bbSetOutputOut( mwtSlider->value() ); - mBox->bbSetInputIn( mwtSlider->value() ); - } - // and signal that the output has changed - mBox->bbSignalOutputModification(std::string("Out")); + mBox->bbSetOutputOut( mwtSlider->value() ); + mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSignalOutputModification(std::string("Out")); textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -213,18 +211,17 @@ namespace bbwt //------------------------------------------------------------------------- void SliderWidget::OnSliderMove() { +printf("EED SliderWidget::OnSliderMove value=%d\n",mwtSlider->value() ); // When user releases the slider // we update the output of the box - if(!reactiveOnTrack) + if(reactiveOnTrack==true) { - mBox->bbSetOutputOut( mwtSlider->value() ); - mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSetOutputOut( mwtSlider->value() ); + mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSignalOutputModification(std::string("Out")); } - // and signal that the output has changed - mBox->bbSignalOutputModification(std::string("Out")); - textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); - + textTitle->setText(tTitle + bbtk::std2wt(" :: ") + mwtSlider->valueText()); } //------------------------------------------------------------------------- diff --git a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ index a73a877..e6c6514 100644 --- a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ +++ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ @@ -197,15 +197,13 @@ namespace bbwt void SliderWidget::OnSliderTrack() { +printf("EED SliderWidget::OnSliderTrack value=%d\n", mwtSlider->value() ); + // When user releases the slider // we update the output of the box - if(reactiveOnTrack) - { - mBox->bbSetOutputOut( mwtSlider->value() ); - mBox->bbSetInputIn( mwtSlider->value() ); - } - // and signal that the output has changed - mBox->bbSignalOutputModification(std::string("Out")); + mBox->bbSetOutputOut( mwtSlider->value() ); + mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSignalOutputModification(std::string("Out")); textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -213,18 +211,17 @@ namespace bbwt //------------------------------------------------------------------------- void SliderWidget::OnSliderMove() { +printf("EED SliderWidget::OnSliderMove value %d\n",mwtSlider->value() ); // When user releases the slider // we update the output of the box - if(!reactiveOnTrack) + if(reactiveOnTrack==true) { - mBox->bbSetOutputOut( mwtSlider->value() ); - mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSetOutputOut( mwtSlider->value() ); + mBox->bbSetInputIn( mwtSlider->value() ); + mBox->bbSignalOutputModification(std::string("Out")); } - // and signal that the output has changed - mBox->bbSignalOutputModification(std::string("Out")); - textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); - + textTitle->setText(tTitle + bbtk::std2wt(" :: ") + mwtSlider->valueText()); } //------------------------------------------------------------------------- @@ -301,7 +298,7 @@ namespace bbwt // std::cout << "w = "<SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); w->setMinimumSize(Wt::WLength::Auto, 120); - w->setMaximumSize(Wt::WLength::Auto, 200); + w->setMaximumSize(Wt::WLength::Auto, 180); bbSetOutputWidget( w ); } diff --git a/wt/bbtk_wt_PKG/src/bbwtSphereXTK.cxx b/wt/bbtk_wt_PKG/src/bbwtSphereXTK.cxx new file mode 100644 index 0000000..afba995 --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtSphereXTK.cxx @@ -0,0 +1,116 @@ +//===== +// 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 "bbwtSphereXTK.h" +#include "bbwtPackage.h" + +#include + + +namespace bbwt +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,SphereXTK) +BBTK_BLACK_BOX_IMPLEMENTATION(SphereXTK,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 SphereXTK::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') + + + Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetInputViewerWTxtk(); + std::string strRadio = boost::lexical_cast( bbGetInputRadio() ); + std::string jsCom ; + + + + if (firsttime==true) +{ + firsttime=false; + jsCom = "\ + alert('Creating sphere');\ + var sphere = new X.sphere(); \ + sphere.radius = "+strRadio+"; \ + sphere.center = [50, 50, 50]; \ + sphere.color = [0, 1, 0]; \ + sphere.caption = 'a sphere'; \ + "+ w->jsRef() + ".sphere = sphere ;\ + "+ w->jsRef() + ".mRenderer.add("+ w->jsRef() + ".sphere);\ + "+ w->jsRef() + ".mRenderer.render();\ + "; + } else { + jsCom = "\ + "+ w->jsRef() + ".sphere.radius = "+strRadio+"; \ + "+ w->jsRef() + ".mRenderer.add("+ w->jsRef() + ".sphere);\ + "+ w->jsRef() + ".mRenderer.render();\ + "; + +} + + + Wt::WApplication::instance()->doJavaScript(jsCom); + + +} +//===== +// 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 SphereXTK::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + std::vector center; + center.push_back(0); + center.push_back(0); + center.push_back(0); + + firsttime=true; + bbSetInputViewerWTxtk(NULL); + bbSetInputCenter(center); + bbSetInputRadio(10); + +} +//===== +// 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 SphereXTK::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 SphereXTK::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbwt + + diff --git a/wt/bbtk_wt_PKG/src/bbwtSphereXTK.h b/wt/bbtk_wt_PKG/src/bbwtSphereXTK.h new file mode 100644 index 0000000..4abf2be --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtSphereXTK.h @@ -0,0 +1,58 @@ +//===== +// 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 __bbwtSphereXTK_h_INCLUDED__ +#define __bbwtSphereXTK_h_INCLUDED__ +#include "bbwt_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbwt +{ + +class bbwt_EXPORT SphereXTK + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(SphereXTK,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(ViewerWTxtk,Wt::WContainerWidget*); + + BBTK_DECLARE_INPUT(Center,std::vector); + BBTK_DECLARE_INPUT(Radio,double); +// BBTK_DECLARE_OUTPUT(Out,double); + BBTK_PROCESS(Process); + void Process(); + + bool firsttime; +//===== +// 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(SphereXTK,bbtk::AtomicBlackBox); + BBTK_NAME("SphereXTK"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + + BBTK_INPUT(SphereXTK,ViewerWTxtk,"Viewer 2D/3D Wt=>XTK " ,Wt::WContainerWidget*,""); + BBTK_INPUT(SphereXTK,Center,"Center [x,y,z]",std::vector,""); + BBTK_INPUT(SphereXTK,Radio,"Radio",double,""); + +// BBTK_OUTPUT(SphereXTK,Out,"First output",double,""); + +BBTK_END_DESCRIBE_BLACK_BOX(SphereXTK); +//===== +// 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 bbwt + +#endif // __bbwtSphereXTK_h_INCLUDED__ + diff --git a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx index 4957d90..33dd441 100644 --- a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx @@ -399,7 +399,7 @@ void ViewerNVWeb::loadImage() " + wtWindow3->jsRef() + ".mRenderer.render();\ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow4->jsRef() + ".mRenderer.render();\ - },1500);"; + },3000);"; // jsCom = "\ var volume = new X.volume();\ @@ -541,7 +541,7 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent) wtWindow3 = new Viewer_NV(0,nType[2]); /* - l->addWidget(wtWindow2); + l->addWidget(wtWindow2);http://www.creatis.insa-lyon.fr/~davila/links/links_EED.html l->addWidget(wtWindow3); @@ -612,7 +612,7 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent) l2->addWidget(wtWindow1); l2->addWidget(aux1); - l2->setResizable(0,true,400); + l2->setResizable(0,true,600); w->setLayout(l2); @@ -631,6 +631,12 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent) bbSetOutputviewer3(wtWindow3->jsRef()); bbSetOutputviewer4(wtWindow4->jsRef()); + bbSetOutputViewer1(wtWindow1); + bbSetOutputViewer2(wtWindow2); + bbSetOutputViewer3(wtWindow3); + bbSetOutputViewer4(wtWindow4); + + } diff --git a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h index 2eed0f4..1fca1f8 100644 --- a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h +++ b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h @@ -38,6 +38,14 @@ class bbwt_EXPORT ViewerNVWeb BBTK_DECLARE_OUTPUT(viewer2,std::string); BBTK_DECLARE_OUTPUT(viewer3,std::string); BBTK_DECLARE_OUTPUT(viewer4,std::string); + + + BBTK_DECLARE_OUTPUT(Viewer1,Wt::WContainerWidget*); + BBTK_DECLARE_OUTPUT(Viewer2,Wt::WContainerWidget*); + BBTK_DECLARE_OUTPUT(Viewer3,Wt::WContainerWidget*); + BBTK_DECLARE_OUTPUT(Viewer4,Wt::WContainerWidget*); + + BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); @@ -61,18 +69,22 @@ class bbwt_EXPORT ViewerNVWeb }; BBTK_BEGIN_DESCRIBE_BLACK_BOX(ViewerNVWeb,bbtk::WtBlackBox); -BBTK_NAME("ViewerNVWeb"); -BBTK_AUTHOR("johann.gonzalez@creatis.insa-lyon.fr"); -BBTK_DESCRIPTION("No Description."); -BBTK_CATEGORY("empty"); -BBTK_INPUT(ViewerNVWeb,ImagePath,"Image path",std::string,""); -BBTK_INPUT(ViewerNVWeb,nTypeView,"Paramaters for the setting up of the renders",std::vector,""); - -BBTK_OUTPUT(ViewerNVWeb,viewer1,"Reference to viewer 1",std::string,""); -BBTK_OUTPUT(ViewerNVWeb,viewer2,"Reference to viewer 2",std::string,""); -BBTK_OUTPUT(ViewerNVWeb,viewer3,"Reference to viewer 3",std::string,""); -BBTK_OUTPUT(ViewerNVWeb,viewer4,"Reference to viewer 4",std::string,""); + BBTK_NAME("ViewerNVWeb"); + BBTK_AUTHOR("johann.gonzalez@creatis.insa-lyon.fr"); + BBTK_DESCRIPTION("No Description."); + BBTK_CATEGORY("empty"); + BBTK_INPUT(ViewerNVWeb,ImagePath,"Image path",std::string,""); + BBTK_INPUT(ViewerNVWeb,nTypeView,"Paramaters for the setting up of the renders",std::vector,""); + + BBTK_OUTPUT(ViewerNVWeb,viewer1,"Reference to viewer 1",std::string,""); + BBTK_OUTPUT(ViewerNVWeb,viewer2,"Reference to viewer 2",std::string,""); + BBTK_OUTPUT(ViewerNVWeb,viewer3,"Reference to viewer 3",std::string,""); + BBTK_OUTPUT(ViewerNVWeb,viewer4,"Reference to viewer 4",std::string,""); + BBTK_OUTPUT(ViewerNVWeb,Viewer1,"Viewer container wt",Wt::WContainerWidget*,""); + BBTK_OUTPUT(ViewerNVWeb,Viewer2,"Viewer container wt",Wt::WContainerWidget*,""); + BBTK_OUTPUT(ViewerNVWeb,Viewer3,"Viewer container wt",Wt::WContainerWidget*,""); + BBTK_OUTPUT(ViewerNVWeb,Viewer4,"Viewer container wt",Wt::WContainerWidget*,""); BBTK_END_DESCRIBE_BLACK_BOX(ViewerNVWeb); //===== // 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/wt/data/RunServers.sh b/wt/data/RunServers.sh new file mode 100644 index 0000000..e3ef418 --- /dev/null +++ b/wt/data/RunServers.sh @@ -0,0 +1,5 @@ +while true +do + bbi $1 +done + -- 2.44.0