]> Creatis software - creaWT.git/blobdiff - wt/bbtk_wt_PKG/src/bbwtViewerNVWeb.cxx
#3052 creaWT Feature New Normal - Install documentation
[creaWT.git] / wt / bbtk_wt_PKG / src / bbwtViewerNVWeb.cxx
index 094ef1277eaf0d149445932f9b6e9555e1188918..9bc8f5c1a6b1e324a5513ec960cc30ee43a823f1 100644 (file)
@@ -73,8 +73,6 @@ namespace bbwt
 
  
   w->doJavaScript(jsCom);
-  std::cout<<"       REF:   "<<w->jsRef()<<std::endl;
-       std::cout<<"       CREANDO TIPO:   "<<mType<<" ---  "<<jsCom<<std::endl;
 
   }
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(wt,ViewerNVWeb)
@@ -91,7 +89,10 @@ void ViewerNVWeb::Process()
 {
        Wt::WContainerWidget* w = (Wt::WContainerWidget*)bbGetOutputWidget();
        std::string jsCom;      
-printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
+FILE *flog;
+flog=fopen("/var/www/testwtdbg/docroot/appli1/imagesTMP/bbtk-Web.log","a+");
+fprintf(flog,"EED %p ViewerNVWeb::Process START %s\n", this, bbGetInputImagePath().c_str() );
+fclose(flog);
        bool ok;
        FILE *ff=fopen( bbGetInputImagePath().c_str() , "r" );
        if (ff)
@@ -126,25 +127,31 @@ printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
                   ";
 */
 
-/*
+flog=fopen("/var/www/testwtdbg/docroot/appli1/imagesTMP/bbtk-Web.log","a+");
+fprintf(flog,"  EED ViewerNVWeb::Process firsttime = false\n" );
+fclose(flog);
+
                          jsCom = "\
                                try{\
-                                   " +w->jsRef() + ".mVolume.file = '" + bbGetInputImagePath() + "';\
-                                   setTimeout(function(){\
-                               " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
-                                   " + wtWindow1->jsRef() + ".mRenderer.render();\
-                             },300);\
+                                       " +w->jsRef() + ".mVolume.file = '" + bbGetInputImagePath() + "';\
+                                       " +w->jsRef() + ".mVolume.modified(true);\
+                               " + wtWindow1->jsRef() + ".mRenderer.render();\
+                                       alert('firsttime=false');\
                                } catch (err) {\
                                } \
                   ";
 
                        w->doJavaScript(jsCom);
-*/
 
                }
 
                if (firstTime==true)
                {
+
+flog=fopen("/var/www/testwtdbg/docroot/appli1/imagesTMP/bbtk-Web.log","a+");
+fprintf(flog,"  EED ViewerNVWeb::Process firsttime = true \n" );
+fclose(flog);
+
                        firstTime=false;
                          jsCom = "\
                                        try{\
@@ -158,6 +165,7 @@ printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
                                    setTimeout(function(){\
                                        " + wtWindow1->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
                                            " + wtWindow1->jsRef() + ".mRenderer.render();\
+                                                       alert('(1) firsttime=true');\
                                },300);\
                                    setTimeout(function(){\
                                        " + w->jsRef() +".mVolume.upperThreshold =20000;\
@@ -177,11 +185,14 @@ printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
                                        " + wtWindow3->jsRef() + ".mRenderer.render();\
                                        " + wtWindow4->jsRef() + ".mRenderer.add(" +w->jsRef() + ".mVolume);\
                                        " + wtWindow4->jsRef() + ".mRenderer.render();\
-                               },3000);\
+                                                       alert('(2) firsttime=true');\
+                               },10000);\
                                        } catch(err) { \
                                        } \
                                        ";
                              
+
+
           // jsCom = "\
                                var volume = new X.volume();\
                                volume.spacing = [0.7,0.7,0.7 ];\
@@ -224,7 +235,11 @@ printf("EED ViewerNVWeb::Process %s\n", bbGetInputImagePath().c_str() );
        // wtWindow3->resize(Wt::WLength::Auto, 200);
        // wtWindow4->resize(Wt::WLength::Auto, 200);
         
+flog=fopen("/var/www/testwtdbg/docroot/appli1/imagesTMP/bbtk-Web.log","a+");
+fprintf(flog,"EED ViewerNVWeb::Process END \n" );
+fclose(flog);
         
+
         Wt::WApplication::instance()->refresh();
        
 
@@ -270,7 +285,6 @@ void ViewerNVWeb::CreateWidget(Wt::WContainerWidget* parent)
                wtWindow1 = new Viewer_NV(w,nType[0]);
                wtWindow1->configureWt();
                wtWindow1->setStyleClass("black-box");
-               std::cout<<"   PRUEBA 1 RENDERER"<<std::endl;
                bbSetOutputviewer1(wtWindow1->jsRef());
        }
        else if(nType.size() == 2)