From e19fa7d7d6d8da78d560d0dbc06efb4bb85e41e5 Mon Sep 17 00:00:00 2001 From: Felipe Gonzalez Date: Wed, 8 Jul 2015 14:53:31 +0200 Subject: [PATCH] #2498 creaWt Feature New Normal wt-version kernel --- wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx | 19 ++- wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx~ | 19 ++- wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx | 2 +- wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx~ | 6 +- wt/bbtk_wt_PKG/src/bbwtLayoutTab.h | 2 +- wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~ | 36 ++-- wt/bbtk_wt_PKG/src/bbwtSlider.cxx | 13 +- wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ | 13 +- wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx | 210 +++++++++++++----------- 9 files changed, 180 insertions(+), 140 deletions(-) diff --git a/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx b/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx index de0e755..1e06e09 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx @@ -23,12 +23,14 @@ void LayoutSplit::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 LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) +void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) { Wt::WContainerWidget* w = new Wt::WContainerWidget(parent); Wt::WBoxLayout *l; if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { l = new Wt::WHBoxLayout(); } if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { l = new Wt::WVBoxLayout(); } + + Wt::WContainerWidget* w1 = bbCreateWidgetOfInput("Widget1",w); Wt::WContainerWidget* w2 = bbCreateWidgetOfInput("Widget2",w); @@ -39,17 +41,18 @@ void LayoutSplit::Process() l->addWidget(w1); l->addWidget(w2); - + l->setResizable(0,true,400); w->setLayout(l); bbSetOutputWidget( w ); -}*/ +} +/* void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) { Wt::WContainerWidget* w = new Wt::WContainerWidget(parent); - Wt::Ext::Splitter *l = new Wt::Ext::Splitter(w); + Wt::Ext::Splitter *l = new Wt::Ext::Splitter(); // if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { l = new Wt::WHBoxLayout(); } // if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { l = new Wt::WVBoxLayout(); } @@ -59,18 +62,18 @@ void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) if (w1==NULL) { w1=new Wt::WContainerWidget(); } if (w2==NULL) { w2=new Wt::WContainerWidget(); } - w1->resize(Wt::WLength::Auto,Wt::WLength::Auto) ; - w2->resize(Wt::WLength::Auto,Wt::WLength::Auto) ; + w1->resize(200,200) ; + w2->resize(200,200) ; l->addWidget(w1); l->addWidget(w2); - + w->addWidget(l); //w->setLayout(l); bbSetOutputWidget( w ); -} +}*/ //===== // 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/bbwtLayoutSplit.cxx~ b/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx~ index e4cc865..4769aaa 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx~ +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx~ @@ -23,12 +23,14 @@ void LayoutSplit::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 LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) +void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) { Wt::WContainerWidget* w = new Wt::WContainerWidget(parent); Wt::WBoxLayout *l; if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { l = new Wt::WHBoxLayout(); } if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { l = new Wt::WVBoxLayout(); } + + Wt::WContainerWidget* w1 = bbCreateWidgetOfInput("Widget1",w); Wt::WContainerWidget* w2 = bbCreateWidgetOfInput("Widget2",w); @@ -39,17 +41,18 @@ void LayoutSplit::Process() l->addWidget(w1); l->addWidget(w2); - + l->setResizable(0,true,Wt::WLength::Auto); w->setLayout(l); bbSetOutputWidget( w ); -}*/ +} +/* void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) { Wt::WContainerWidget* w = new Wt::WContainerWidget(parent); - Wt::Ext::Splitter *l = new Wt::Ext::Splitter(w); + Wt::Ext::Splitter *l = new Wt::Ext::Splitter(); // if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { l = new Wt::WHBoxLayout(); } // if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { l = new Wt::WVBoxLayout(); } @@ -58,17 +61,19 @@ void LayoutSplit::CreateWidget(Wt::WContainerWidget* parent) if (w1==NULL) { w1=new Wt::WContainerWidget(); } if (w2==NULL) { w2=new Wt::WContainerWidget(); } - + + w1->resize(200,200) ; + w2->resize(200,200) ; l->addWidget(w1); l->addWidget(w2); - + w->addWidget(l); //w->setLayout(l); bbSetOutputWidget( w ); -} +}*/ //===== // 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/bbwtLayoutTab.cxx b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx index 00ed3f8..e0d5947 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx @@ -45,7 +45,7 @@ void LayoutTab::CreateWidget(Wt::WContainerWidget* parent) bbSetOutputWidget( w ); -} +} //===== // 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/bbwtLayoutTab.cxx~ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx~ index e0d5947..a043716 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx~ +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx~ @@ -28,10 +28,10 @@ void LayoutTab::CreateWidget(Wt::WContainerWidget* parent) Wt::WContainerWidget *w = new Wt::WContainerWidget(parent); - Wt::WTabWidget* layout = new Wt::WTabWidget(w); + Wt::WTabWidget* layout = new Wt::WTabWidget(); Wt::WContainerWidget *cw; - if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel1()));} + if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel1()));} if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel2()));} if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel3()));} if ((cw=bbCreateWidgetOfInput("Widget4",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel4()));} @@ -41,7 +41,7 @@ void LayoutTab::CreateWidget(Wt::WContainerWidget* parent) if ((cw=bbCreateWidgetOfInput("Widget8",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel8()));} if ((cw=bbCreateWidgetOfInput("Widget9",w)) != 0) {layout->addTab(cw,bbtk::std2wt(bbGetInputLabel9()));} - + w->setLayout(layout); bbSetOutputWidget( w ); diff --git a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h index 67c97c8..18ae410 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h @@ -72,7 +72,7 @@ BBTK_CATEGORY("__CategoryBlackBox__"); BBTK_INPUT(LayoutTab,Label6,"label 6",std::string,""); BBTK_INPUT(LayoutTab,Label7,"label 7",std::string,""); BBTK_INPUT(LayoutTab,Label8,"label 8",std::string,""); - BBTK_INPUT(LayoutTab,Label9,"label 9",std::string,""); + BBTK_INPUT(LayoutTab,Label9,"label 9",std::string,""); // BBTK_INPUT(LayoutTab,Orientation, // "Orientation (default T), 0=T=TOP , 1=R=RIGHT , 2=B=BOTTON , 3=L=LEFT " // ,std::string,""); diff --git a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~ index 18ae410..5018bd9 100644 --- a/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~ +++ b/wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~ @@ -20,15 +20,15 @@ class bbwt_EXPORT LayoutTab // 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(Widget1,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget2,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget3,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget4,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget5,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget6,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget7,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget8,Wt::WContainerWidget*); - BBTK_DECLARE_INPUT(Widget9,Wt::WContainerWidget*); + BBTK_DECLARE_INPUT(Widget1,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget2,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget3,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget4,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget5,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget6,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget7,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget8,Wt:WContainerWidget*); + BBTK_DECLARE_INPUT(Widget9,Wt:WContainerWidget*); BBTK_DECLARE_INPUT(Label1,std::string); BBTK_DECLARE_INPUT(Label2,std::string); BBTK_DECLARE_INPUT(Label3,std::string); @@ -55,15 +55,15 @@ BBTK_DESCRIPTION("gonzalez@creatis.insa-lyon.fr - LayoutTab for wt web apps."); BBTK_CATEGORY("__CategoryBlackBox__"); BBTK_DESCRIPTION("LayoutTab widget The label of each 'note book' will be the name of the object it contains"); - BBTK_INPUT(LayoutTab,Widget1,"widget 1",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget2,"widget 2",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget3,"widget 3",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget4,"widget 4",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget5,"widget 5",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget6,"widget 6",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget7,"widget 7",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget8,"widget 8",Wt::WContainerWidget*,""); - BBTK_INPUT(LayoutTab,Widget9,"widget 9",Wt::WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget1,"widget 1",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget2,"widget 2",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget3,"widget 3",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget4,"widget 4",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget5,"widget 5",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget6,"widget 6",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget7,"widget 7",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget8,"widget 8",Wt:WContainerWidget*,""); + BBTK_INPUT(LayoutTab,Widget9,"widget 9",Wt:WContainerWidget*,""); BBTK_INPUT(LayoutTab,Label1,"label 1",std::string,""); BBTK_INPUT(LayoutTab,Label2,"label 2",std::string,""); BBTK_INPUT(LayoutTab,Label3,"label 3",std::string,""); diff --git a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx index dfc7747..875d5b8 100644 --- a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx @@ -42,6 +42,8 @@ namespace bbwt Slider* mBox; Wt::WSlider *mwtSlider; Wt::WSlider *mResolutionOfSlider; + Wt::WText *textTitle; + Wt::WString tTitle; int min; int max; bool reactiveOnTrack; @@ -67,6 +69,7 @@ namespace bbwt : Wt::WContainerWidget(parent), mBox(box), + tTitle(title), min(vmin), max(vmax), reactiveOnTrack(reactiveontrack) @@ -112,6 +115,7 @@ namespace bbwt //mwtSlider->setValueText(title); mwtSlider->valueChanged().connect(this,&SliderWidget::OnSliderTrack); mwtSlider->sliderMoved().connect(this,&SliderWidget::OnSliderMove); + // mwtSlider->resize(Wt::WLength::Auto, 50); // If asked : creation of the other little slider which allows to change @@ -146,7 +150,8 @@ namespace bbwt //--------------------------------------------------------------------- // 2) Insertion of the components in the window std::cout<<"Creando SLIDER -- 4 "<addWidget(new Wt::WText(title),Wt::WBorderLayout::North); + textTitle = new Wt::WText(tTitle + bbtk::std2wt(" : ")+ mwtSlider->valueText()); + layout->addWidget(textTitle,Wt::WBorderLayout::North); layout->addWidget(mwtSlider,Wt::WBorderLayout::Center); std::cout<<"Creando SLIDER -- 5 "<bbSignalOutputModification(std::string("Out")); - + textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -218,6 +223,7 @@ namespace bbwt } // and signal that the output has changed mBox->bbSignalOutputModification(std::string("Out")); + textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -294,7 +300,8 @@ namespace bbwt ); // std::cout << "w = "<SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); - + w->setMinimumSize(Wt::WLength::Auto, 120); + w->setMaximumSize(Wt::WLength::Auto, 180); bbSetOutputWidget( w ); } diff --git a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ index 7d1939e..a73a877 100644 --- a/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ +++ b/wt/bbtk_wt_PKG/src/bbwtSlider.cxx~ @@ -42,6 +42,8 @@ namespace bbwt Slider* mBox; Wt::WSlider *mwtSlider; Wt::WSlider *mResolutionOfSlider; + Wt::WText *textTitle; + Wt::WString tTitle; int min; int max; bool reactiveOnTrack; @@ -67,6 +69,7 @@ namespace bbwt : Wt::WContainerWidget(parent), mBox(box), + tTitle(title), min(vmin), max(vmax), reactiveOnTrack(reactiveontrack) @@ -112,6 +115,7 @@ namespace bbwt //mwtSlider->setValueText(title); mwtSlider->valueChanged().connect(this,&SliderWidget::OnSliderTrack); mwtSlider->sliderMoved().connect(this,&SliderWidget::OnSliderMove); + // mwtSlider->resize(Wt::WLength::Auto, 50); // If asked : creation of the other little slider which allows to change @@ -146,7 +150,8 @@ namespace bbwt //--------------------------------------------------------------------- // 2) Insertion of the components in the window std::cout<<"Creando SLIDER -- 4 "<addWidget(new Wt::WText(title),,Wt::WBorderLayout::North); + textTitle = new Wt::WText(tTitle + bbtk::std2wt(" : ")+ mwtSlider->valueText()); + layout->addWidget(textTitle,Wt::WBorderLayout::North); layout->addWidget(mwtSlider,Wt::WBorderLayout::Center); std::cout<<"Creando SLIDER -- 5 "<bbSignalOutputModification(std::string("Out")); - + textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -218,6 +223,7 @@ namespace bbwt } // and signal that the output has changed mBox->bbSignalOutputModification(std::string("Out")); + textTitle->setText(tTitle + bbtk::std2wt(" : ") + mwtSlider->valueText()); } @@ -294,7 +300,8 @@ namespace bbwt ); // std::cout << "w = "<SetName( bbtk::std2wx( bbGetInputWinTitle() ) ); - + w->setMinimumSize(Wt::WLength::Auto, 120); + w->setMaximumSize(Wt::WLength::Auto, 200); bbSetOutputWidget( w ); } diff --git a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx index 6f72fd3..d19d0b7 100644 --- a/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx +++ b/wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx @@ -67,7 +67,7 @@ namespace bbwt mRenderer.init() ; \ " + w->jsRef() + ".mRenderer = mRenderer;"; - w->resize(Wt::WLength::Auto, 500); + w->resize(Wt::WLength::Auto, 700); } @@ -82,7 +82,7 @@ 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() +/*void ViewerNVWeb::Process() { //------------- This part works perfectly, uncomment it for use it safe @@ -146,7 +146,7 @@ void ViewerNVWeb::Process() w->doJavaScript(jsCom); */ - Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); + /* Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget(); cont++; std::string jsCom; @@ -188,9 +188,7 @@ void ViewerNVWeb::Process() - //} - //else if(cont == 2) - //{ + if(nType.size() >1) { @@ -199,18 +197,14 @@ void ViewerNVWeb::Process() " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow2->jsRef() + ".mRenderer.render();"; } - //} - //else if(cont == 3) - //{ + if(nType.size() >2 ) { jsCom = jsCom + "\ " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow3->jsRef() + ".mRenderer.render();"; } -// } -// else if(cont == 4) -// { + if(nType.size() > 3) { jsCom = jsCom + "\ @@ -220,17 +214,83 @@ void ViewerNVWeb::Process() " + w->jsRef() +".mVolume.windowLow =0;\ " + w->jsRef() +".mVolume.windowHigh =1900;"; - // jsCom = jsCom + "\ + + 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);\ + 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);"; + 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');\ @@ -240,19 +300,13 @@ void ViewerNVWeb::Process() 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);\ - },2000);"; + var upperThresholdController = volumegui.add(" + w->jsRef() +".mVolume, 'upperThreshold'," + w->jsRef() +".mVolume.min, " + w->jsRef() +".mVolume.max);"; } - // 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();"; - -// } -// } -// - + + + jsCom = jsCom + "\ + };\ + " + wtWindow1->jsRef() + ".mRenderer.render();"; @@ -264,6 +318,8 @@ void ViewerNVWeb::Process() } + + //-------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------- @@ -309,11 +365,14 @@ void ViewerNVWeb::loadImage() " + wtWindow3->jsRef() + ".mRenderer.render();\ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow4->jsRef() + ".mRenderer.render();\ - },1500);"; - - - // jsCom = "\ - setTimeout(function(){\ + },1500);\ + setTimeout(function(){\ + " + wtWindow2->jsRef() + ".mRenderer.render();\ + " + wtWindow3->jsRef() + ".mRenderer.render();\ + " + wtWindow4->jsRef() + ".mRenderer.render();\ + },3000);"; + + //jsCom = "\ var volume = new X.volume();\ volume.spacing = [0.7,0.7,0.7 ];\ volume.file = '" + bbGetInputImagePath() + "';\ @@ -322,9 +381,11 @@ void ViewerNVWeb::loadImage() ];\ " +w->jsRef() + ".mVolume.center = center;\ volume.center = [0,0,0];\ - },100);\ - " + wtWindow1->jsRef() + ".mRenderer.onShowtime=function(){\ - " + w->jsRef() +".mVolume.upperThreshold =20000;\ + setTimeout(function(){\ + " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ + },300);\ + " + wtWindow1->jsRef() + ".mRenderer.onShowTime = function(){\ + " + w->jsRef() +".mVolume.upperThreshold =20000;\ " + w->jsRef() +".mVolume.windowHigh =1670;\ var gui = new dat.GUI();\ var volumegui = gui.addFolder('Volume');\ @@ -341,67 +402,24 @@ void ViewerNVWeb::loadImage() " + wtWindow3->jsRef() + ".mRenderer.render();\ " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ " + wtWindow4->jsRef() + ".mRenderer.render();\ - };\ - setTimeout(function(){\ - " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow1->jsRef() + ".mRenderer.render();\ - },300);\ - "; - - // jsCom = jsCom + "\ - setTimeout(function(){\ - " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow2->jsRef() + ".mRenderer.render();"; - - - - // jsCom = jsCom + "\ - " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow3->jsRef() + ".mRenderer.render();"; - - - - // jsCom = jsCom + "\ - " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\ - " + wtWindow4->jsRef() + ".mRenderer.render();"; - + };\ + " + wtWindow1->jsRef() + ".mRenderer.render();"; + - // jsCom = jsCom + "\ - " + w->jsRef() +".mVolume = volume;\ - " + w->jsRef() +".mVolume.lowerThreshold =0;\ - " + w->jsRef() +".mVolume.upperThreshold =20000;\ - " + w->jsRef() +".mVolume.windowHigh =1670;\ - 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);\ - var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\ - var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\ - volumegui.open();\ - },1000);"; - - // jsCom = jsCom + "\ - setTimeout(function(){\ - 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);\ - var lowerWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowLow', 0,2000);\ - var upperWindowController = volumegui.add(" + w->jsRef() +".mVolume, 'windowHigh', 0,2000);\ - var sliceXController = volumegui.add(" + w->jsRef() +".mVolume, 'indexX', 0,volume.range[0] - 1);\ - var sliceYController = volumegui.add(" + w->jsRef() +".mVolume, 'indexY', 0,volume.range[1] - 1);\ - var sliceZController = volumegui.add(" + w->jsRef() +".mVolume, 'indexZ', 0,volume.range[2] - 1);\ - volumegui.open();\ - },500);"; std::cout<<"LOADzzzzzzzzzzzzzzzzzzzzzzzzzzzz"<doJavaScript(jsCom); + + //Wt::WApplication::instance()->refresh(); - wtWindow2->resize(Wt::WLength::Auto, 200); - wtWindow3->resize(Wt::WLength::Auto, 200); - wtWindow4->resize(Wt::WLength::Auto, 200); + // wtWindow2->resize(Wt::WLength::Auto, 200); + // wtWindow3->resize(Wt::WLength::Auto, 200); + // wtWindow4->resize(Wt::WLength::Auto, 200); + + + Wt::WApplication::instance()->refresh(); @@ -564,17 +582,17 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent) w->setLayout(l2); - + + wtWindow1->setStyleClass("black-box"); + wtWindow2->setStyleClass("black-box"); + wtWindow3->setStyleClass("black-box"); + wtWindow4->setStyleClass("black-box"); + wtWindow1->configureWt(); wtWindow2->configureWt(); wtWindow3->configureWt(); wtWindow4->configureWt(); - wtWindow1->setStyleClass("black-box"); - wtWindow2->setStyleClass("black-box"); - wtWindow3->setStyleClass("black-box"); - wtWindow4->setStyleClass("black-box"); - bbSetOutputviewer1(wtWindow1->jsRef()); bbSetOutputviewer2(wtWindow2->jsRef()); bbSetOutputviewer3(wtWindow3->jsRef()); -- 2.44.0