From 0aca619f319ce0cf836ff7735740704b1db4de93 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 25 Aug 2015 18:08:39 +0200 Subject: [PATCH] #2691 creaWT Feature New Normal - Implementation temp files --- .../bbs/appli/demoPresentacion1Boton03.bbg | 158 ++++----- .../bbs/appli/demoPresentacion1Boton03.bbs | 62 ++-- wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbg | 23 +- wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbs | 5 +- wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbg | 20 +- wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbs | 4 +- wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.cxx | 77 +++++ wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.h | 47 +++ wt/bbtk_wt_PKG/src/bbwtInputText.cxx | 2 +- wt/bbtk_wt_PKG/src/bbwtInputText.cxx~ | 2 +- wt/bbtk_wt_PKG/src/bbwtOutputText.cxx | 2 +- wt/bbtk_wt_PKG/src/bbwtOutputText.cxx~ | 11 +- wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx | 302 +++--------------- wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h | 3 +- 14 files changed, 274 insertions(+), 444 deletions(-) create mode 100644 wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.cxx create mode 100644 wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.h diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbg b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbg index 1997381..b93e6c2 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbg +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbg @@ -9,18 +9,18 @@ DESCRIPTION:Description ?? AUTHOR:Author ?? COMPLEXBOX:FALSE COMPLEXINPUTS:0 -BOXES:20 +BOXES:17 BOX vtk:LoadHola:Box00 ISEXEC:FALSE -19.706028:4.218308:-900.000000 -65.281028:-5.781692:-900.000000 +60.324137:-36.902724:-900.000000 +105.899137:-46.902724:-900.000000 FIN_BOX BOX itk:BinaryThresholdImageFilter:Box02 ISEXEC:FALSE -110.969172:-113.546435:-900.000000 -182.144172:-123.546435:-900.000000 +57.945666:-128.858036:-900.000000 +129.120666:-138.858036:-900.000000 PORT InsideValue:"255" PORT @@ -33,8 +33,8 @@ FIN_BOX BOX vtk:MarchingCubes:Box05 ISEXEC:FALSE -98.769445:-206.135374:-900.000000 -144.344445:-216.135374:-900.000000 +42.059812:-205.568278:-900.000000 +87.634812:-215.568278:-900.000000 PORT ComputeNormalsOn:"true" PORT @@ -44,9 +44,9 @@ Value:"128" FIN_BOX BOX vtk:ImageContinuousErode3D:Box06 -ISEXEC:FALSE -112.040179:-136.271704:-900.000000 -183.215179:-146.271704:-900.000000 +ISEXEC:TRUE +55.330546:-148.747823:-900.000000 +126.505546:-158.747823:-900.000000 PORT KernelSizeX:"3" PORT @@ -57,8 +57,8 @@ FIN_BOX BOX vtk:SegmentationConnectivity:Box09 ISEXEC:FALSE -112.425062:-157.933155:-900.000000 -183.600062:-167.933155:-900.000000 +54.014140:-166.439600:-900.000000 +125.189140:-176.439600:-900.000000 PORT PositionXYZ:"73 101 93" PORT @@ -67,16 +67,16 @@ FIN_BOX BOX wt:ViewerNVWeb:Box12 ISEXEC:FALSE --79.966168:-202.388734:-900.000000 --34.391168:-212.388734:-900.000000 +-101.034885:-197.398691:-900.000000 +-55.459885:-207.398691:-900.000000 PORT -ImagePath:"xx" +ImagePath:"imagesTMP/hola.nii" FIN_BOX BOX wt:Slider:Box15 ISEXEC:FALSE --135.346214:-66.177168:-900.000000 --87.026214:-76.177168:-900.000000 +-121.482446:-62.619179:-900.000000 +-73.162446:-72.619179:-900.000000 PORT In:"1250" PORT @@ -91,8 +91,8 @@ FIN_BOX BOX wt:Slider:Box16 ISEXEC:FALSE --153.534026:-38.309300:-900.000000 --105.214026:-48.309300:-900.000000 +-163.108601:-79.545339:-900.000000 +-114.788601:-89.545339:-900.000000 PORT In:"1500" PORT @@ -107,56 +107,22 @@ FIN_BOX BOX wt:LayoutLine:Box17 ISEXEC:FALSE --184.557478:-126.277482:-900.000000 --126.997478:-136.277482:-900.000000 +-170.375687:-198.734780:-900.000000 +-112.815687:-208.734780:-900.000000 FIN_BOX BOX wt:CommandButton:Box21 ISEXEC:FALSE --126.882350:-88.359946:-900.000000 --81.307350:-98.359946:-900.000000 -PORT -Label:"Run...Q" -FIN_BOX -BOX -wt:configServerWT:Box24 -ISEXEC:TRUE -4.308157:-272.491944:-900.000000 -49.883157:-282.491944:-900.000000 +-189.489664:-97.152664:-900.000000 +-143.914664:-107.152664:-900.000000 PORT -DocRoot:"/var/www/testwtdbg/docroot/appli1/" -PORT -Port:"8082" -FIN_BOX -BOX -itk:ImageWriter:Box26 -ISEXEC:FALSE --2.355526:-180.973757:-900.000000 -43.219474:-190.973757:-900.000000 -FIN_BOX -BOX -std:ConcatStrings:Box27 -ISEXEC:FALSE --40.193736:-128.049015:-900.000000 -5.381264:-138.049015:-900.000000 -PORT -In1:"/var/www/testwtdbg/docroot/appli1/" -FIN_BOX -BOX -std:ConcatStrings:Box28 -ISEXEC:FALSE --27.981750:-150.063096:-900.000000 -17.593250:-160.063096:-900.000000 -PORT -In2:"/imagesTMP/" -PORT -In3:"hola.nii" +Label:"Segmentation" FIN_BOX BOX vtk:ImageGaussianSmooth:Box29 ISEXEC:FALSE -106.977757:-186.112622:-900.000000 -178.152757:-196.112622:-900.000000 +51.402317:-187.813911:-900.000000 +122.577317:-197.813911:-900.000000 PORT StdDevX:"0" PORT @@ -167,8 +133,8 @@ FIN_BOX BOX wt:Slider:Box31 ISEXEC:FALSE --169.916356:-14.173068:-900.000000 --121.596356:-24.173068:-900.000000 +-78.667210:-47.626578:-900.000000 +-30.347210:-57.626578:-900.000000 PORT In:"1" PORT @@ -183,30 +149,42 @@ FIN_BOX BOX wt:AddMeshB:Box37 ISEXEC:FALSE -13.203509:-245.183527:-900.000000 -58.778509:-255.183527:-900.000000 +38.683815:-225.123788:-900.000000 +84.258815:-235.123788:-900.000000 FIN_BOX BOX -wt:ImageWriteB:Box33 +wt:configServerWT:Box38 ISEXEC:TRUE --76.199317:-160.688358:-900.000000 --30.624317:-170.688358:-900.000000 +86.797340:-60.838054:-900.000000 +132.372340:-70.838054:-900.000000 +PORT +DocRoot:"/var/www/testwtdbg/docroot/appli1/" +PORT +Port:"8082" FIN_BOX BOX -wt:OutputText:Box35 -ISEXEC:FALSE --129.329787:-182.455051:-900.000000 --83.754787:-192.455051:-900.000000 +wt:ImageWriteB:Box39 +ISEXEC:TRUE +16.790413:-59.780862:-900.000000 +62.365413:-69.780862:-900.000000 FIN_BOX BOX -wt:LayoutSplit:Box36 +wt:LayoutSplit:Box40 ISEXEC:TRUE --117.324457:-252.223720:-900.000000 --71.749457:-262.223720:-900.000000 +-143.571980:-228.411427:-900.000000 +-97.996980:-238.411427:-900.000000 PORT Orientation:"h" FIN_BOX -CONNECTIONS:28 +BOX +wt:OutputText:Box25 +ISEXEC:FALSE +-194.819427:-148.967664:-900.000000 +-149.244427:-158.967664:-900.000000 +PORT +In:"ALT-left to refresh screen" +FIN_BOX +CONNECTIONS:22 CONNECTION Box00:Out:Box02:In NumberOfControlPoints:0 @@ -232,15 +210,6 @@ CONNECTION Box21:Widget:Box17:Widget5 NumberOfControlPoints:0 CONNECTION -Box00:Out:Box26:In -NumberOfControlPoints:0 -CONNECTION -Box27:Out:Box28:In1 -NumberOfControlPoints:0 -CONNECTION -Box28:Out:Box26:Filename -NumberOfControlPoints:0 -CONNECTION Box09:Out:Box29:In NumberOfControlPoints:0 CONNECTION @@ -265,30 +234,21 @@ CONNECTION Box12:Viewer1:Box37:viewerwt NumberOfControlPoints:0 CONNECTION -Box21:BoxChange:Box37:boxExecute -NumberOfControlPoints:0 -CONNECTION -Box00:Out:Box33:Image +Box00:Out:Box39:Image NumberOfControlPoints:0 CONNECTION -Box35:Widget:Box17:Widget4 +Box17:Widget:Box40:Widget1 NumberOfControlPoints:0 CONNECTION -Box33:FileName:Box35:In +Box12:Widget:Box40:Widget2 NumberOfControlPoints:0 CONNECTION -Box21:BoxChange:Box35:BoxExecute -NumberOfControlPoints:0 -CONNECTION -Box17:Widget:Box36:Widget1 -NumberOfControlPoints:0 -CONNECTION -Box12:Widget:Box36:Widget2 +Box21:BoxChange:Box37:boxExecute NumberOfControlPoints:0 CONNECTION -Box33:FileName:Box12:ImagePath +Box39:FileName:Box12:ImagePath NumberOfControlPoints:0 CONNECTION -Box33:out:Box24:BoxExecute +Box25:Widget:Box17:Widget6 NumberOfControlPoints:0 APP_END diff --git a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbs b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbs index ba60fdf..eeab1cd 100644 --- a/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbs +++ b/wt/bbtk_wt_PKG/bbs/appli/demoPresentacion1Boton03.bbs @@ -11,7 +11,6 @@ include itkvtk include vtk include itk include wt -include std author "Author ??" description "Description ??" @@ -40,7 +39,7 @@ new vtk:SegmentationConnectivity Box09 set Box09.ThresholdMinMax "200 300" new wt:ViewerNVWeb Box12 - set Box12.ImagePath "xx" + set Box12.ImagePath "imagesTMP/hola.nii" new wt:Slider Box15 set Box15.In "1250" @@ -59,20 +58,7 @@ new wt:Slider Box16 new wt:LayoutLine Box17 new wt:CommandButton Box21 - set Box21.Label "Run...Q" - -new wt:configServerWT Box24 - set Box24.DocRoot "/var/www/testwtdbg/docroot/appli1/" - set Box24.Port "8082" - -new itk:ImageWriter Box26 - -new std:ConcatStrings Box27 - set Box27.In1 "/var/www/testwtdbg/docroot/appli1/" - -new std:ConcatStrings Box28 - set Box28.In2 "/imagesTMP/" - set Box28.In3 "hola.nii" + set Box21.Label "Segmentation" new vtk:ImageGaussianSmooth Box29 set Box29.StdDevX "0" @@ -88,12 +74,17 @@ new wt:Slider Box31 new wt:AddMeshB Box37 -new wt:ImageWriteB Box33 +new wt:configServerWT Box38 + set Box38.DocRoot "/var/www/testwtdbg/docroot/appli1/" + set Box38.Port "8082" + +new wt:ImageWriteB Box39 -new wt:OutputText Box35 +new wt:LayoutSplit Box40 + set Box40.Orientation "h" -new wt:LayoutSplit Box36 - set Box36.Orientation "h" +new wt:OutputText Box25 + set Box25.In "ALT-left to refresh screen" connect Box00.Out Box02.In @@ -112,12 +103,6 @@ connect Box16.Widget Box17.Widget3 connect Box21.Widget Box17.Widget5 -connect Box00.Out Box26.In - -connect Box27.Out Box28.In1 - -connect Box28.Out Box26.Filename - connect Box09.Out Box29.In connect Box31.Widget Box17.Widget1 @@ -134,27 +119,22 @@ connect Box05.Out Box37.vtkPolyData connect Box12.Viewer1 Box37.viewerwt -connect Box21.BoxChange Box37.boxExecute - -connect Box00.Out Box33.Image +connect Box00.Out Box39.Image -connect Box35.Widget Box17.Widget4 +connect Box17.Widget Box40.Widget1 -connect Box33.FileName Box35.In +connect Box12.Widget Box40.Widget2 -connect Box21.BoxChange Box35.BoxExecute - -connect Box17.Widget Box36.Widget1 - -connect Box12.Widget Box36.Widget2 +connect Box21.BoxChange Box37.boxExecute -connect Box33.FileName Box12.ImagePath +connect Box39.FileName Box12.ImagePath -connect Box33.out Box24.BoxExecute +connect Box25.Widget Box17.Widget6 # Complex input ports -exec Box24 -exec Box33 -exec Box36 +exec Box06 +exec Box38 +exec Box39 +exec Box40 diff --git a/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbg b/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbg index 49f4370..21b6358 100644 --- a/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbg +++ b/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbg @@ -10,11 +10,7 @@ AUTHOR:Author ?? COMPLEXBOX:TRUE COMPLEXBOXNAME:AddMeshB PACKAGENAME:wt -COMPLEXOUTPUTS:1 -COMPLEX_PORT -out --63.140570:-83.461272:-900.000000 -FIN_COMPLEX_PORT +COMPLEXOUTPUTS:0 COMPLEXINPUTS:3 COMPLEX_PORT boxExecute @@ -32,8 +28,8 @@ BOXES:8 BOX std:RandomString:Box04 ISEXEC:FALSE -72.734827:21.182375:-900.000000 -118.309827:11.182375:-900.000000 +-6.661884:3.538662:-900.000000 +38.913116:-6.461338:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX @@ -76,8 +72,8 @@ FIN_BOX BOX std:MultipleInputs:Box11 ISEXEC:FALSE --64.412233:45.152810:-900.000000 --18.837233:35.152810:-900.000000 +-64.763199:49.407780:-900.000000 +-19.188199:39.407780:-900.000000 PORT BoxProcessMode:"Reactive" FIN_BOX @@ -87,7 +83,7 @@ ISEXEC:FALSE 116.484416:-14.508239:-900.000000 162.059416:-24.508239:-900.000000 FIN_BOX -CONNECTIONS:13 +CONNECTIONS:12 CONNECTION Box04:Out:Box05:In2 NumberOfControlPoints:0 @@ -113,7 +109,7 @@ CONNECTION boxExecute:boxExecute:Box11:BoxExecute NumberOfControlPoints:0 CONNECTION -Box11:BoxChange:Box09:BoxExecute +Box12:DocRoot:Box07:In1 NumberOfControlPoints:0 CONNECTION Box11:BoxChange:Box10:BoxExecute @@ -122,9 +118,6 @@ CONNECTION Box11:BoxChange:Box04:BoxExecute NumberOfControlPoints:0 CONNECTION -Box11:BoxChange:out:out -NumberOfControlPoints:0 -CONNECTION -Box12:DocRoot:Box07:In1 +Box11:BoxChange:Box09:BoxExecute NumberOfControlPoints:0 APP_END diff --git a/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbs b/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbs index f621110..fef3938 100644 --- a/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbs +++ b/wt/bbtk_wt_PKG/bbs/boxes/AddMeshB.bbs @@ -43,10 +43,10 @@ connect Box05.Out Box06.In2 connect Box06.Out Box07.In2 connect Box07.Out Box09.Filename connect Box06.Out Box10.Mesh -connect Box11.BoxChange Box09.BoxExecute +connect Box12.DocRoot Box07.In1 connect Box11.BoxChange Box10.BoxExecute connect Box11.BoxChange Box04.BoxExecute -connect Box12.DocRoot Box07.In1 +connect Box11.BoxChange Box09.BoxExecute # Complex input ports input vtkPolyData Box09.In " " @@ -54,7 +54,6 @@ input viewerwt Box10.ViewerWt " " input boxExecute Box11.BoxExecute " " # Complex output ports -output out Box11.BoxChange " " message diff --git a/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbg b/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbg index 279174d..e789ba8 100644 --- a/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbg +++ b/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbg @@ -31,7 +31,7 @@ ISEXEC:FALSE -31.511542:19.529497:-900.000000 14.063458:9.529497:-900.000000 PORT -In1:"Image_" +In1:"hola" PORT In3:".nii" FIN_BOX @@ -44,20 +44,20 @@ FIN_BOX BOX wt:GetConfigServerWt:Box02 ISEXEC:FALSE --111.255962:3.228152:-900.000000 --65.680962:-6.771848:-900.000000 +-98.729444:17.178138:-900.000000 +-53.154444:7.178138:-900.000000 FIN_BOX BOX std:RandomString:Box03 ISEXEC:FALSE --22.477657:39.017820:-900.000000 -23.097343:29.017820:-900.000000 +-30.164384:67.060138:-900.000000 +15.410616:57.060138:-900.000000 FIN_BOX BOX std:ConcatStrings:Box04 ISEXEC:FALSE --40.928359:0.461165:-900.000000 -4.646641:-9.538835:-900.000000 +-40.928359:0.318818:-900.000000 +4.646641:-9.681182:-900.000000 PORT In1:"imagesTMP/" FIN_BOX @@ -74,9 +74,6 @@ CONNECTION Image:Image:Box01:In NumberOfControlPoints:0 CONNECTION -Box03:Out:Box00:In2 -NumberOfControlPoints:0 -CONNECTION Box00:Out:Box04:In2 NumberOfControlPoints:0 CONNECTION @@ -94,4 +91,7 @@ NumberOfControlPoints:0 CONNECTION Box01:BoxChange:out:out NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box00:In2 +NumberOfControlPoints:0 APP_END diff --git a/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbs b/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbs index e18eed5..c4a64a7 100644 --- a/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbs +++ b/wt/bbtk_wt_PKG/bbs/boxes/ImageWriteB.bbs @@ -17,7 +17,7 @@ description "Description ??" category "" new ConcatStrings Box00 - set Box00.In1 "Image_" + set Box00.In1 "hola" set Box00.In3 ".nii" new ImageWriter Box01 @@ -33,11 +33,11 @@ new ConcatStrings Box05 set Box05.In2 "/" -connect Box03.Out Box00.In2 connect Box00.Out Box04.In2 connect Box02.DocRoot Box05.In1 connect Box04.Out Box05.In3 connect Box05.Out Box01.Filename +connect Box03.Out Box00.In2 # Complex input ports input Image Box01.In " " diff --git a/wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.cxx b/wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.cxx new file mode 100644 index 0000000..ba03be3 --- /dev/null +++ b/wt/bbtk_wt_PKG/src/bbwtGetConfigServerWt.cxx @@ -0,0 +1,77 @@ +//===== +// 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 "bbwtGetConfigServerWt.h" +#include "bbwtPackage.h" +#include "bbtkWtBlackBox.h" + +namespace bbwt +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,GetConfigServerWt) +BBTK_BLACK_BOX_IMPLEMENTATION(GetConfigServerWt,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 GetConfigServerWt::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') + +// bbSetOutputOut( bbGetInputIn() ); +// std::cout << "Output value = " <setText(newText); +//EED mText->setText(newText); } Wt::WString OutputTextWidget::getTextValue() @@ -80,17 +80,10 @@ void OutputText::CreateWidget(Wt::WContainerWidget* parent) { bbSetOutputWidget( new OutputTextWidget(parent,bbtk::std2wt(bbGetInputIn()))) ; - Process(); +//EED Process(); } //===== - - -void updatePath (std::string sPath) -{ - bbSetOutputOutPath(sPath); -} - // 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 OutputText::bbUserSetDefaultValues() diff --git a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx index 33dd441..8fa80e4 100644 --- a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx @@ -82,260 +82,19 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNVWeb,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 ViewerNVWeb::Process() -{ - - //------------- This part works perfectly, uncomment it for use it safe - /*Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); - - cont++; - std::string jsCom; - - - //jsCom = "\ - " + wtWindow1->jsRef() + ".mRenderer.add(" +bbGetInputImagePath() + ".mObject);\ - " + wtWindow1->jsRef() + ".mRenderer.render();"; - - std::cout<jsRef() + ".mRenderer.add(volume);\ - " + wtWindow1->jsRef() + ".mRenderer.render();"; - - - jsCom = "\ - var volume = new X.volume();\ - volume.file = '" + bbGetInputImagePath() + "';\ - " + w->jsRef() +".mVolume = volume;\ - " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow1->jsRef() + ".mRenderer.render();"; - - - if(nType.size() >1) - { - jsCom = jsCom + "\ - " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow2->jsRef() + ".mRenderer.render();"; - } - if(nType.size() >2 ) - { - jsCom = jsCom + "\ - " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow3->jsRef() + ".mRenderer.render();"; - } - if(nType.size() > 3) - { - jsCom = jsCom + "\ - " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow4->jsRef() + ".mRenderer.render();"; - } - - - - - std::cout<<"PROCESSSSS>>>>"<doJavaScript(jsCom); - */ - - /* Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); - - cont++; - std::string jsCom; - - std::cout<<"Process ----"<jsRef() +".mVolume = volume;\ - " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow1->jsRef() + ".mRenderer.render();"; - - // jsCom = jsCom + "\ - var gui = new dat.GUI();\ - var volumegui = gui.addFolder('Volume');\ - var vrController = volumegui.add(volume, 'volumeRendering');\ - var opacityController = volumegui.add(volume, 'opacity', 0, 1).listen();\ - var lowerThresholdController = volumegui.add(volume, 'lowerThreshold',volume.min, volume.max);\ - var upperThresholdController = volumegui.add(volume, 'upperThreshold',volume.min, volume.max);\ - volumegui.open();"; - - //jsCom = jsCom + "\ - var gui = new dat.GUI();\ - var volumegui = gui.addFolder('Volume');\ - var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\ - var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1).listen();\ - var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', " + w->jsRef() +".mVolume.min," + w->jsRef() +".mVolume.max);\ - var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', " + w->jsRef() +".mVolume.min," + w->jsRef() +".mVolume.max);\ - volumegui.open();"; - - - - - - - - - if(nType.size() >1) - { - jsCom = jsCom + "\ - setTimeout(function(){\ - " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow2->jsRef() + ".mRenderer.render();"; - } - - if(nType.size() >2 ) - { - jsCom = jsCom + "\ - " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow3->jsRef() + ".mRenderer.render();"; - } - - if(nType.size() > 3) - { - jsCom = jsCom + "\ - " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow4->jsRef() + ".mRenderer.render();\ - " + w->jsRef() +".mVolume.upperTheshold =0;\ - " + w->jsRef() +".mVolume.windowLow =0;\ - " + w->jsRef() +".mVolume.windowHigh =1900;"; - - - jsCom = jsCom + "\ - var gui = new dat.GUI();\ - var volumegui = gui.addFolder('Volume');\ - var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\ - var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1).listen();\ - var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\ - var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\ - volumegui.open();\ - var lowerThresholdController = volumegui.add(" + w->jsRef() +".mVolume, 'lowerThreshold'," + w->jsRef() +".mVolume.min, " + w->jsRef() +".mVolume.max);\ - var upperThresholdController = volumegui.add(" + w->jsRef() +".mVolume, 'upperThreshold'," + w->jsRef() +".mVolume.min, " + w->jsRef() +".mVolume.max);"; - } - - - if(nType.size() >1) - { - jsCom = jsCom + "\ - },2000);"; - } - - - - - std::cout<<"PROCESSSSS>>>>"<doJavaScript(jsCom); - - Wt::WApplication::instance()->refresh(); - - - -}*/ - -void ViewerNVWeb::Process() -{ - - - Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); - - cont++; - std::string jsCom; - - std::cout<<"Process ----"<jsRef() +".mVolume = volume;\ - " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow1->jsRef() + ".onShowTime = function(){"; - - - if(nType.size() >1) - { - jsCom = jsCom + "\ - " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow2->jsRef() + ".mRenderer.render();"; - } - - if(nType.size() >2 ) - { - jsCom = jsCom + "\ - " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow3->jsRef() + ".mRenderer.render();"; - } - - if(nType.size() > 3) - { - jsCom = jsCom + "\ - " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow4->jsRef() + ".mRenderer.render();\ - " + w->jsRef() +".mVolume.upperTheshold =0;\ - " + w->jsRef() +".mVolume.windowLow =0;\ - " + w->jsRef() +".mVolume.windowHigh =1900;"; - - - jsCom = jsCom + "\ - var gui = new dat.GUI();\ - var volumegui = gui.addFolder('Volume');\ - var vrController = volumegui.add(" + w->jsRef() +".mVolume, 'volumeRendering');\ - var opacityController = volumegui.add(" + w->jsRef() +".mVolume, 'opacity', 0, 1).listen();\ - var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\ - var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\ - volumegui.open();\ - var lowerThresholdController = volumegui.add(" + w->jsRef() +".mVolume, 'lowerThreshold'," + w->jsRef() +".mVolume.min, " + w->jsRef() +".mVolume.max);\ - var upperThresholdController = volumegui.add(" + w->jsRef() +".mVolume, 'upperThreshold'," + w->jsRef() +".mVolume.min, " + w->jsRef() +".mVolume.max);"; - } - - - jsCom = jsCom + "\ - };\ - " + wtWindow1->jsRef() + ".mRenderer.render();"; - - - - std::cout<<"PROCESSSSS>>>>"<doJavaScript(jsCom); - - Wt::WApplication::instance()->refresh(); - - - -} //-------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------- - - - -void ViewerNVWeb::loadImage() +void ViewerNVWeb::Process() { + printf("EED ViewerNVWeb::Process start\n "); - - Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); + Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); std::string jsCom; - std::cout<<"Process ----"<jsRef() + ".mRenderer.render();\ },500"; - jsCom = "\ + + if (firstTime==false) + { + firstTime=false; + jsCom = "\ var volume = new X.volume();\ volume.spacing = [0.7,0.7,0.7 ];\ volume.file = '" + bbGetInputImagePath() + "';\ " +w->jsRef() + ".mVolume = volume;\ - var center = [0,0,0\ - ];\ + var center = [0,0,0];\ + " +w->jsRef() + ".mVolume.center = center;\ + volume.center = [0,0,0];\ + setTimeout(function(){\ + " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ + " + wtWindow1->jsRef() + ".mRenderer.render();\ + },300);\ + "; + w->doJavaScript(jsCom); + } + + if (firstTime==true) + { + firstTime=false; + jsCom = "\ + var volume = new X.volume();\ + volume.spacing = [0.7,0.7,0.7 ];\ + volume.file = '" + bbGetInputImagePath() + "';\ + " +w->jsRef() + ".mVolume = volume;\ + var center = [0,0,0];\ " +w->jsRef() + ".mVolume.center = center;\ volume.center = [0,0,0];\ setTimeout(function(){\ @@ -399,7 +180,8 @@ void ViewerNVWeb::loadImage() " + wtWindow3->jsRef() + ".mRenderer.render();\ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow4->jsRef() + ".mRenderer.render();\ - },3000);"; + },3000);\ + "; // jsCom = "\ var volume = new X.volume();\ @@ -434,12 +216,9 @@ void ViewerNVWeb::loadImage() };\ " + wtWindow1->jsRef() + ".mRenderer.render();"; - - - - - std::cout<<"LOADzzzzzzzzzzzzzzzzzzzzzzzzzzzz"<doJavaScript(jsCom); + std::cout<<"LOADzzzzzzzzzzzzzzzzzzzzzzzzzzzz"<doJavaScript(jsCom); + } //Wt::WApplication::instance()->refresh(); @@ -451,6 +230,7 @@ void ViewerNVWeb::loadImage() Wt::WApplication::instance()->refresh(); + printf("EED ViewerNVWeb::Process END\n "); } @@ -463,10 +243,11 @@ void ViewerNVWeb::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 - bbSetInputImagePath(""); - int n[] = {3,2,1,0}; - std::vector nn (n,n+sizeof(n)/sizeof(int)); - bbSetInputnTypeView(nn); + firstTime=true; + bbSetInputImagePath(""); + int n[] = {3,2,1,0}; + std::vector nn (n,n+sizeof(n)/sizeof(int)); + bbSetInputnTypeView(nn); bbSetOutputviewer1(""); bbSetOutputviewer2(""); bbSetOutputviewer3(""); @@ -642,8 +423,7 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent) bbSetOutputWidget(w); - loadImage(); - //Process(); +//EED loadImage(); } diff --git a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h index 1fca1f8..a8c126d 100644 --- a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h +++ b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.h @@ -50,8 +50,9 @@ class bbwt_EXPORT ViewerNVWeb void Process(); BBTK_CREATE_WIDGET(CreateWidget); void CreateWidget(Wt::WContainerWidget* parent); - void loadImage(); std::vector nType; + bool firstTime; + /* Wt::WContainerWidget* wtWindow1; Wt::WContainerWidget* wtWindow2; Wt::WContainerWidget* wtWindow3; -- 2.47.1