]> Creatis software - creaWT.git/commitdiff
#2489 creaWt
authorFelipe Gonzalez <gonzalez@ei-ed-345.creatis.insa-lyon.fr>
Thu, 9 Jul 2015 14:09:38 +0000 (16:09 +0200)
committerFelipe Gonzalez <gonzalez@ei-ed-345.creatis.insa-lyon.fr>
Thu, 9 Jul 2015 14:09:38 +0000 (16:09 +0200)
wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx

index 34c75e619eecc69d7a210fc5869fe87da7d3bdad..4957d90ab0b591563dbe21da4a7edfffad7c6933 100644 (file)
@@ -334,6 +334,40 @@ void ViewerNVWeb::loadImage()
        
   std::cout<<"Process ----"<<std::endl; 
 
+
+  //jsCom = "\
+                       var volume = new X.volume();\
+                       volume.spacing = [0.7,0.7,0.7 ];\
+                       volume.file = '" + bbGetInputImagePath() + "';\
+                       " +w->jsRef() + ".mVolume = volume;\
+                       setTimeout(function(){\
+                       var center = [0,0,0\
+                  ];\
+                       " +w->jsRef() + ".mVolume.center = center;\
+                       volume.center = [0,0,0];\
+                       " + wtWindow1->jsRef() + ".mRenderer.add(" + w->jsRef() + ".mVolume);\
+                       " + 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');\
+                  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);\
+                       " + wtWindow2->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+                         " + wtWindow2->jsRef() + ".mRenderer.render();\
+                       " + wtWindow3->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+                         " + wtWindow3->jsRef() + ".mRenderer.render();\
+                       " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
+                         " + wtWindow4->jsRef() + ".mRenderer.render();\
+                         };\
+                       " + wtWindow1->jsRef() + ".mRenderer.render();\
+                       },500";
+
   jsCom = "\
                        var volume = new X.volume();\
                        volume.spacing = [0.7,0.7,0.7 ];\
@@ -367,7 +401,7 @@ void ViewerNVWeb::loadImage()
                          " + wtWindow4->jsRef() + ".mRenderer.render();\
                      },1500);";
                      
-    //jsCom = "\
+   // jsCom = "\
                        var volume = new X.volume();\
                        volume.spacing = [0.7,0.7,0.7 ];\
                        volume.file = '" + bbGetInputImagePath() + "';\
@@ -480,7 +514,7 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent)
     
     l->addWidget(wtWindow1);
     l->addWidget(wtWindow2);
-    
+    l->setResizable(0,true,400);
     w->setLayout(l);
     
                wtWindow1->configureWt();       
@@ -520,11 +554,12 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent)
                
                l->addWidget(wtWindow2);
                l->addWidget(wtWindow3);
+               l->setResizable(0,true,400);
                aux1->setLayout(l);
                
                l2->addWidget(wtWindow1);
                l2->addWidget(aux1);
-               
+               l2->setResizable(0,true,400);
                w->setLayout(l2);
                
          wtWindow1->configureWt();     
@@ -570,11 +605,14 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent)
                l->addWidget(wtWindow2,0,1);
                l->addWidget(wtWindow3,0,2);
                l->addWidget(wtWindow4,0,3);
+               l->setColumnResizable(0,true,400);
+               l->setColumnResizable(1,true,400);
+               l->setColumnResizable(2,true,400);
                aux1->setLayout(l);
                
                l2->addWidget(wtWindow1);
                l2->addWidget(aux1);
-               
+               l2->setResizable(0,true,400);
                w->setLayout(l2);