]> Creatis software - creaMaracasVisu.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Sat, 21 Aug 2010 15:19:11 +0000 (15:19 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Sat, 21 Aug 2010 15:19:11 +0000 (15:19 +0000)
bbtk/bbs/appli/exampleShowNPoints.bbs
bbtk/src/bbmaracasvisuShowNPoints.cxx
bbtk/src/bbmaracasvisuViewerNV.cxx
bbtk/src/bbmaracasvisuViewerNV.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx

index cf6a07cd372ba79826c0ff8e4fbfa3eb1f7d30d8..e0f81d0816e1e8b355327018a4ede3717269712e 100644 (file)
@@ -18,23 +18,23 @@ load creaMaracasVisu
 
 # Use new box (choose the way you want to select images)
 # -----------------------------------------------------
-load creaImageIO
-new ImagesReader chooser
+
+#load creaImageIO
+#new ImageReader chooser
 
 # Concatenate all the supposed-to-be consistent 2D images into a single vtkImageData
 # WARNING : File names alphabetical order is suposed to be meaningful ...
 
-new ConcatImages reader
-   connect chooser.Out reader.In
+#new ConcatImages reader
+#   connect chooser.Out reader.In
 
 
 
 # Here loads hola.mhd
 # -------------------------
-/*
+
 include vtk/boxes/bbLoadHola
 new LoadHola reader
-*/
 
 # uncomment next lines to have a file selector
 # ---------------------------------------------
index dd99af86d3307564fef36a03cee7d874ac5f445f..1b1845a45eba39a50fa37478d1c3f44d59b03f2a 100644 (file)
@@ -63,9 +63,9 @@ namespace bbcreaMaracasVisu
          sizer1->Add(btnDeleteAllPoints);
          sizer1->Add(txtNrPoints);
          sizer1->Add(txOpacity);
-         sizer1->Add(sdrOpacity);
+         sizer1->Add(sdrOpacity,1,wxGROW );
          sizer1->Add(txRadio);
-         sizer1->Add(sdrRadio);
+         sizer1->Add(sdrRadio,1,wxGROW );
          sizer1->Add(btnSavePoints);
          sizer1->Add(btnLoadPoints);
 
@@ -128,7 +128,7 @@ void WidgetShowNPoints::SetOpacity(double opacity)
 {
        this->mopacity=opacity;
        //NTU: For Slider
-       sdrOpacity->SetValue(this->mopacity*100.0);
+       sdrOpacity->SetValue(this->mopacity/100.0);
 }
 
 //------------------------------------------------------------------------
@@ -454,7 +454,8 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
 
 void ShowNPoints::Process()
 {
-       if (mwxwidget!=NULL){
+       if (mwxwidget!=NULL)
+       {
                mwxwidget->SetRenderer( bbGetInputRenderer() );
                mwxwidget->SetPoint( bbGetInputIn() );
                mwxwidget->SetImage( bbGetInputImage() );
@@ -472,14 +473,7 @@ void ShowNPoints::Process()
 void ShowNPoints::CreateWidget(wxWindow* parent)
 {
        mwxwidget = new WidgetShowNPoints( parent, this);
-       mwxwidget->SetPoint( bbGetInputIn() );
-
-       if (bbGetInputImage()==NULL)
-       {
-               printf("Missing Image  (ShowNPoints) \n");
-       }
-
-   bbSetOutputWidget( mwxwidget );
+        bbSetOutputWidget( mwxwidget );
 }
 
 void ShowNPoints::bbUserSetDefaultValues()
index c1f8149ea20b0a1f56f2f1433a6c8d79f6d6a336..e404aaf4a0d2eabf7b24a5d64f6807dc0dc6e0d9 100644 (file)
@@ -60,7 +60,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox);
 //-------------------------------------------------------------
 void ViewerNV::Process()
 {      
-
        vtkImageData* img = bbGetInputIn();     
 /*
        double spc[3];
@@ -75,12 +74,8 @@ void ViewerNV::Process()
 */
        std::vector<int> type = bbGetInputnTypeView();
 
-//     std::cout<<"img "<<img<<std::endl;
-//     std::cout<<"widget "<<mwxwidget<<std::endl;
-       
-       if(img != NULL && mwxwidget != NULL){// && !enter){
-//     if( mwxwidget != NULL){// && !enter){
-               
+
+       if(img != NULL && mwxwidget != NULL){
                if(!compareVectors(type, currenttype)){
                        mwxwidget->SetType(&type);
                        mwxwidget->UpdateLayout(img);                   
@@ -89,7 +84,11 @@ void ViewerNV::Process()
                        //mwxwidget->UpdateLayout(img);
                }
 
-               mwxwidget->ConfigureVTK();
+               if (firsttime==true)  // EED  21 aout 2010
+               {
+                       firsttime=false;
+                       mwxwidget->ConfigureVTK();
+               }
                mwxwidget->RefreshView();
 
                currenttype = type;
@@ -119,20 +118,26 @@ void ViewerNV::Process()
                if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
                if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
 
-               if (wvbv1!=NULL) { bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() ); 
+               if (wvbv1!=NULL) 
+               { 
+                       bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() ); 
                        updateObservers();
                }
 
-               if(bbGetInputColorFunction()!=NULL){
+               if(bbGetInputColorFunction()!=NULL)
+               {
                        mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
                }
 
-               if(bbGetInputWindowLevel()!=-1){
-            mwxwidget->setWindowLevel(bbGetInputWindowLevel());
+               if(bbGetInputWindowLevel()!=-1)
+               {
+                   mwxwidget->setWindowLevel(bbGetInputWindowLevel());
                }
 
-               if(bbGetInputColorLevel()!=-1){
-                       if(bbGetInputColorLevel() == 0){
+               if(bbGetInputColorLevel()!=-1)
+               {
+                       if(bbGetInputColorLevel() == 0)
+                       {
                                std::cout<<"colorlevel "<<bbGetInputColorLevel()<<std::endl;
                                mwxwidget->setColorLevel(0.1);
                        }else{
@@ -159,46 +164,47 @@ void ViewerNV::CreateWidget(wxWindow* parent)
 //-------------------------------------------------------------
 void ViewerNV::bbUserSetDefaultValues()
 {
-               mwxwidget = NULL;
-               bbSetInputIn(NULL);
-
-               bbSetInputObs1(NULL);
-               bbSetInputObs2(NULL);
-               bbSetInputObs3(NULL);
-               bbSetInputObs4(NULL);
-               bbSetInputObs5(NULL);
-
-               std::vector<int> vecNTypeViwer;
-               vecNTypeViwer.push_back(5);
-               vecNTypeViwer.push_back(0);
-               vecNTypeViwer.push_back(1);
-               vecNTypeViwer.push_back(3);
-               bbSetInputnTypeView(vecNTypeViwer);
-
-               bbSetOutputwxVtkBaseView1( NULL );
-               bbSetOutputwxVtkBaseView2( NULL );
-               bbSetOutputwxVtkBaseView3( NULL );
-               bbSetOutputwxVtkBaseView4( NULL );
-               bbSetOutputRenderer1( NULL );
-               bbSetOutputRenderer2( NULL );
-               bbSetOutputRenderer3( NULL );
-               bbSetOutputRenderer4( NULL );
-               bbSetInputColorFunction(NULL);
-               bbSetInputWindowLevel(-1);
-               bbSetInputColorLevel(-1);
+       firsttime=true;
+       mwxwidget = NULL;
+       bbSetInputIn(NULL);
+
+       bbSetInputObs1(NULL);
+       bbSetInputObs2(NULL);
+       bbSetInputObs3(NULL);
+       bbSetInputObs4(NULL);
+       bbSetInputObs5(NULL);
+
+       std::vector<int> vecNTypeViwer;
+       vecNTypeViwer.push_back(5);
+       vecNTypeViwer.push_back(0);
+       vecNTypeViwer.push_back(1);
+       vecNTypeViwer.push_back(3);
+       bbSetInputnTypeView(vecNTypeViwer);
+
+       bbSetOutputwxVtkBaseView1( NULL );
+       bbSetOutputwxVtkBaseView2( NULL );
+       bbSetOutputwxVtkBaseView3( NULL );
+       bbSetOutputwxVtkBaseView4( NULL );
+       bbSetOutputRenderer1( NULL );
+       bbSetOutputRenderer2( NULL );
+       bbSetOutputRenderer3( NULL );
+       bbSetOutputRenderer4( NULL );
+       bbSetInputColorFunction(NULL);
+       bbSetInputWindowLevel(-1);
+       bbSetInputColorLevel(-1);
 }
 
-       //-----------------------------------------------------------------     
-       void ViewerNV::bbUserInitializeProcessing()
-       {
-       }
+//-----------------------------------------------------------------    
+void ViewerNV::bbUserInitializeProcessing()
+{
+}
        
-       //-----------------------------------------------------------------     
-       void ViewerNV::bbUserFinalizeProcessing()
-       {
-       }
+//-----------------------------------------------------------------    
+void ViewerNV::bbUserFinalizeProcessing()
+{
+}
        
-       //-----------------------------------------------------------------     
+//-----------------------------------------------------------------    
        
        
        
index 8dc7acefa95e3cd2ef438156fe9ee07a5c709a90..e654f011b31e623eb0791ee5c2e5c9a4d5f7af27 100644 (file)
@@ -68,7 +68,7 @@ class /*BBTK_EXPORT*/ ViewerNV
 
    std::vector<int>                    point;
 private:       
-       bool    enter;
+       bool    firsttime;
 
        vtkImageData* currentimg;
        std::vector<int>  currenttype;
index bf749e6620b70d7eced6ca83f1921234ade995b7..58fc9ecbd72bff3307a35851b61beef84e57598d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   wxMaracas
   Module:    $RCSfile: wxMaracas_ViewerWidget.cxx,v $
   Language:  C++
-  Date:      $Date: 2010/04/29 16:05:34 $
-  Version:   $Revision: 1.28 $
+  Date:      $Date: 2010/08/21 15:19:14 $
+  Version:   $Revision: 1.29 $
 
   Copyright: (c) 2002, 2003
   License:
                if ( mwidgetMesure       !=NULL ) { mwidgetMesure->SetMesureScale( 1 );         }
                if ( mwxsphereview       !=NULL ) { mwxsphereview->Configure();                 }
 
-               if (mwxvtk3Dbaseview_Clipping3D !=NULL) {
-                       mwxvtk3Dbaseview_Clipping3D->Configure();       
-                       
+               if (mwxvtk3Dbaseview_Clipping3D !=NULL) 
+               {
+                       mwxvtk3Dbaseview_Clipping3D->Configure();                               
                }
 
-               if (vtkmpr3Ddataviewer                  !=NULL) {                       
-                       vtkmpr3Ddataviewer->Configure();
-                       
+               if (vtkmpr3Ddataviewer                  !=NULL)
+               {                       
+                       vtkmpr3Ddataviewer->Configure();                        
                }
-               if (mwxvtkmpr3Dview                     !=NULL) { 
-                       
+
+               if (mwxvtkmpr3Dview                     !=NULL)
+               {                       
                        mwxvtkmpr3Dview->Configure();
                        mwxvtkmpr3Dview->ResetCamera(ext,org,spc);
-
                }
 
-               if (mwxvtkclipping3Dview                !=NULL) { mwxvtkclipping3Dview->Configure();    }
+               if (mwxvtkclipping3Dview                !=NULL) 
+               { 
+                       mwxvtkclipping3Dview->Configure();      
+               }
                
                //if(vtkmpr3Ddataviewer!=NULL){vtkmpr3Ddataviewer->Configure();}
 //             RefreshView();