]> Creatis software - creaWT.git/commitdiff
#2498 creaWt Feature New Normal wt-version kernel
authorFelipe Gonzalez <gonzalez@ei-ed-345.creatis.insa-lyon.fr>
Wed, 8 Jul 2015 12:53:31 +0000 (14:53 +0200)
committerFelipe Gonzalez <gonzalez@ei-ed-345.creatis.insa-lyon.fr>
Wed, 8 Jul 2015 12:53:31 +0000 (14:53 +0200)
wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx
wt/bbtk_wt_PKG/src/bbwtLayoutSplit.cxx~
wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx
wt/bbtk_wt_PKG/src/bbwtLayoutTab.cxx~
wt/bbtk_wt_PKG/src/bbwtLayoutTab.h
wt/bbtk_wt_PKG/src/bbwtLayoutTab.h~
wt/bbtk_wt_PKG/src/bbwtSlider.cxx
wt/bbtk_wt_PKG/src/bbwtSlider.cxx~
wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx

index de0e7552fbde29cdeca33ae58c55e14a9a8eacca..1e06e093134ed09620e1f2a7050fba879105dad2 100644 (file)
@@ -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)
 //===== 
index e4cc8655aa77a1d3316b47a2fccc16134c0a849c..4769aaaf2b01e0358f4c6191a886a3119adf0a2b 100644 (file)
@@ -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)
 //===== 
index 00ed3f8784411f527d0751911db9bdbba19c8eb3..e0d5947f286bbd8c7d8a26918637400cf277092f 100644 (file)
@@ -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)
 //===== 
index e0d5947f286bbd8c7d8a26918637400cf277092f..a0437165ed6193666ccf3072af85e6b5ea73146b 100644 (file)
@@ -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 );    
 
   
index 67c97c8ba15420531a0b832f5a0b7ae9cfcd2214..18ae410f808e4466ad2e9b5a819be724aacbdc9f 100644 (file)
@@ -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,"");
index 18ae410f808e4466ad2e9b5a819be724aacbdc9f..5018bd9905db671036228d9b5dcef5644f113e53 100644 (file)
@@ -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,"");
index dfc7747d5a820fbe0153eab131f35ace4352ada9..875d5b833dc7426314a77136be5b693958804851 100644 (file)
@@ -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  "<<std::endl;
-               layout->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  "<<std::endl;
     // Insert the sizer in the main panel and refresh the layout
@@ -201,7 +206,7 @@ namespace bbwt
                }
     // and signal that the output has changed
     mBox->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 = "<<w<<std::endl;
     // w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-         
+    w->setMinimumSize(Wt::WLength::Auto, 120);
+         w->setMaximumSize(Wt::WLength::Auto, 180);
     bbSetOutputWidget( w );
   }
   
index 7d1939e3c623f41d7df9f167eb879cd542b070fe..a73a877526890a0940486dca7fdfa4be3430a82c 100644 (file)
@@ -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  "<<std::endl;
-               layout->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  "<<std::endl;
     // Insert the sizer in the main panel and refresh the layout
@@ -201,7 +206,7 @@ namespace bbwt
                }
     // and signal that the output has changed
     mBox->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 = "<<w<<std::endl;
     // w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-         
+    w->setMinimumSize(Wt::WLength::Auto, 120);
+         w->setMaximumSize(Wt::WLength::Auto, 200);
     bbSetOutputWidget( w );
   }
   
index 6f72fd322a0dc34b2dc63bf9761527a56a35c254..d19d0b7e4efaa331d5cc5cb305f685b1eaa134d8 100644 (file)
@@ -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>>>>"<<jsCom<<std::endl;
+       //w->doJavaScript(jsCom);
+       
+       Wt::WApplication::instance()->refresh();
+  
+
+
+}*/
+
+void ViewerNVWeb::Process()
+{
+
+
+  Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget();
+
+       cont++;
+       std::string jsCom;
+       
+  std::cout<<"Process ----"<<std::endl; 
+
+   jsCom = "\
+                       var volume = new X.volume();\
+                       volume.spacing = [0.7,0.7,0.7 ];\
+                       volume.center = [0,0,0];\
+                       volume.file = '" + bbGetInputImagePath() + "';\
+                                                                       " + w->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"<<jsCom<<std::endl;
        w->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());