]> Creatis software - creaMaracasVisu.git/commitdiff
Test code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 14 Jan 2025 13:14:33 +0000 (14:14 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Tue, 14 Jan 2025 13:14:33 +0000 (14:14 +0100)
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
bbtk/src/bbmaracasvisuViewerNV.cxx
bbtk/src/bbmaracasvisuViewerNV.h

index 78aa9093a3dc2db8de4a544893477f9304894fa1..3e3ba0d6bdcbc06d4367586a5f2de5861b0942cf 100644 (file)
@@ -159,7 +159,7 @@ bool InteractorwxVtkBaseView::OnMouseMove()
         {
 //EED 2023-08-05
             _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
-//            _box->bbSignalOutputModification();
+            _box->bbSignalOutputModification();
 //ED2024-11-01 
 //            return _box->bbGetInputWithEventPropagation();
             return true;
index 56a1586998208d697a9189c95b77d302bbd5b781..83df745d64ca44311930dd61c52a30e97093e915 100644 (file)
@@ -61,31 +61,28 @@ bbwxMaracas_N_ViewersWidget::~bbwxMaracas_N_ViewersWidget()
 //-------------------------------------------------------------
 void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
 {
-    if (mbbViewerNV->_onshowwidget==true)
+    //EED2024-12-23  Refresh syncronisation (maracasvisu and bbtk)
+    wxMaracas_N_ViewersWidget::OnRefreshView(event);
+    if ( (backX!=(int)GetX()) || (backY!=(int)GetY()) || (backZ!=(int)GetZ()) )
     {
-        //EED2024-12-23  Refresh syncronisation (maracasvisu and bbtk)
-        wxMaracas_N_ViewersWidget::OnRefreshView(event);
-        if ( (backX!=(int)GetX()) || (backY!=(int)GetY()) || (backZ!=(int)GetZ()) )
-        {
-            backX = GetX();
-            backY = GetY();
-            backZ = GetZ();
-            mbbViewerNV->_point.clear();
-            mbbViewerNV->_point.push_back( (int)GetX() );
-            mbbViewerNV->_point.push_back( (int)GetY() );
-            mbbViewerNV->_point.push_back( (int)GetZ() );
-            mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
-            
-            //ED2024-11-01
-            bool ok=true;
-            if  (mbbViewerNV->bbGetInputReactivityType()==0) { ok=false; }
-            mbbViewerNV->bbSignalOutputModification(std::string("Point"),ok);
-            //         if  (mbbViewerNV->bbGetInputReactivityType()==1)
-            //         {
-            //             mbbViewerNV->bbSignalOutputModification(std::string("Point"),true);
-            //         } // if type        
-        } // if X Y Z
-    } // if _onshowwidget
+        backX = GetX();
+        backY = GetY();
+        backZ = GetZ();
+        mbbViewerNV->_point.clear();
+        mbbViewerNV->_point.push_back( (int)GetX() );
+        mbbViewerNV->_point.push_back( (int)GetY() );
+        mbbViewerNV->_point.push_back( (int)GetZ() );
+        mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
+        
+        //ED2024-11-01
+        bool ok=true;
+        if  (mbbViewerNV->bbGetInputReactivityType()==0) { ok=false; }
+        mbbViewerNV->bbSignalOutputModification(std::string("Point"),ok);
+        //             if  (mbbViewerNV->bbGetInputReactivityType()==1)
+        //             {
+        //                 mbbViewerNV->bbSignalOutputModification(std::string("Point"),true);
+        //             } // if type
+    } // if X Y Z
 }
 
 //-------------------------------------------------------------
@@ -114,72 +111,72 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ViewerNV,bbtk::WxBlackBox);
 //-------------------------------------------------------------
 void ViewerNV::Process()
 {
-       vtkImageData* img               = bbGetInputIn();
-       std::vector<int> type   = bbGetInputnTypeView();
-       if(img != NULL && _mwxwidget != NULL)
-       {
-               if(!compareVectors(type, _currenttype))
-               {
-                       _mwxwidget->SetType(&type);
+    vtkImageData* img          = bbGetInputIn();
+    std::vector<int> type      = bbGetInputnTypeView();
+    if(img != NULL && _mwxwidget != NULL)
+    {
+        if(!compareVectors(type, _currenttype))
+        {
+            _mwxwidget->SetType(&type);
             _mwxwidget->SetTDxWindow( bbGetInputTDxWindow() );
-                       _mwxwidget->UpdateLayout(img);
-               }else if (img != _currentimg){
-                       _mwxwidget->SetImage(img);
-               }
-//             _mwxwidget->RefreshView();
-               _currenttype    = type;
-               _currentimg     = img;
-               _point.clear();
-               _point.push_back( (int)_mwxwidget->GetX() );
-               _point.push_back( (int)_mwxwidget->GetY() );
-               _point.push_back( (int)_mwxwidget->GetZ() );
-               bbSetOutputPoint( _point                                  );
-
-               wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView( 1 );
-               wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView( 2 );
-               wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView( 3 );
-               wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView( 4 );
-               //wxwidget->RefreshView();
-               bbSetOutputwxVtkBaseView1( wvbv1 );
-               bbSetOutputwxVtkBaseView2( wvbv2 );
-               bbSetOutputwxVtkBaseView3( wvbv3 );
-               bbSetOutputwxVtkBaseView4( wvbv4 );
-               if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
-               if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
-               if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
-               if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
-               if (wvbv1!=NULL)
-               {
-                       bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
-                       updateObservers();
-               }
-               if(bbGetInputColorFunction()!=NULL)
-               {
-                       _mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
-               }
-               if( (bbGetInputColorLevel()!=-1) && (bbGetInputWindowLevel()!=-1))
-               {
-                       if(bbGetInputColorLevel() == 0)
-                       {
-                               _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , 0.1 );
-                       }else{
-                               _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , bbGetInputColorLevel() );
-                       }
-               }
-               _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
-/* Borrame
-               if (wvbv1!=NULL) 
-               {
-                       wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
-                       //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
-                       #if wxMAJOR_VERSION <= 2
-                               wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
-                       #else
-                               wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
-                       #endif                          
-               }
-*/
-       }//  mwxwidget != NULL
+            _mwxwidget->UpdateLayout(img);
+        }else if (img != _currentimg){
+            _mwxwidget->SetImage(img);
+        }
+        //             _mwxwidget->RefreshView();
+        _currenttype   = type;
+        _currentimg    = img;
+        _point.clear();
+        _point.push_back( (int)_mwxwidget->GetX() );
+        _point.push_back( (int)_mwxwidget->GetY() );
+        _point.push_back( (int)_mwxwidget->GetZ() );
+        bbSetOutputPoint( _point                                 );
+        
+        wxVtkBaseView *wvbv1 = _mwxwidget->GetwxVtkBaseView( 1 );
+        wxVtkBaseView *wvbv2 = _mwxwidget->GetwxVtkBaseView( 2 );
+        wxVtkBaseView *wvbv3 = _mwxwidget->GetwxVtkBaseView( 3 );
+        wxVtkBaseView *wvbv4 = _mwxwidget->GetwxVtkBaseView( 4 );
+        //wxwidget->RefreshView();
+        bbSetOutputwxVtkBaseView1( wvbv1 );
+        bbSetOutputwxVtkBaseView2( wvbv2 );
+        bbSetOutputwxVtkBaseView3( wvbv3 );
+        bbSetOutputwxVtkBaseView4( wvbv4 );
+        if (wvbv1!=NULL) { bbSetOutputRenderer1( wvbv1->GetRenderer() ); }
+        if (wvbv2!=NULL) { bbSetOutputRenderer2( wvbv2->GetRenderer() ); }
+        if (wvbv3!=NULL) { bbSetOutputRenderer3( wvbv3->GetRenderer() ); }
+        if (wvbv4!=NULL) { bbSetOutputRenderer4( wvbv4->GetRenderer() ); }
+        if (wvbv1!=NULL)
+        {
+            bbSetOutputInteractor1( wvbv1->GetWxVTKRenderWindowInteractor() );
+            updateObservers();
+        }
+        if(bbGetInputColorFunction()!=NULL)
+        {
+            _mwxwidget->setColorTransferFunction(bbGetInputColorFunction());
+        }
+        if( (bbGetInputColorLevel()!=-1) && (bbGetInputWindowLevel()!=-1))
+        {
+            if(bbGetInputColorLevel() == 0)
+            {
+                _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , 0.1 );
+            }else{
+                _mwxwidget->SetColorWindowLevel( bbGetInputWindowLevel() , bbGetInputColorLevel() );
+            }
+        }
+        _mwxwidget->SetInterpolate( bbGetInputInterpolate() );
+        /* Borrame
+         if (wvbv1!=NULL)
+         {
+         wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refresh
+         //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+         #if wxMAJOR_VERSION <= 2
+         wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+         #else
+         wvbv1->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessWindowEvent( newevent );
+         #endif
+         }
+         */
+    }//  mwxwidget != NULL
 }
 
 //-------------------------------------------------------------
@@ -201,7 +198,6 @@ void ViewerNV::OnShowWidget()
 {
     if (_mwxwidget!=NULL)
     {
-        _onshowwidget = true;
         _mwxwidget->Layout();
     } // if bbGetOutputWidget
 }
@@ -210,6 +206,7 @@ void ViewerNV::OnShowWidget()
 void ViewerNV::bbUserSetDefaultValues()
 {
     _onshowwidget           =   false;
+    _onshowwidget2          =   false;
        _currentimg                             =       NULL;
        _mwxwidget                              =       NULL;
        bbSetInputIn(NULL);
index ac9f6a15ce90b261a272e2907fe4b2cdb612e2ab..4a444c449ce2de210dcbc4be1df81b258c87cba5 100644 (file)
@@ -106,7 +106,6 @@ class /*BBTK_EXPORT*/ ViewerNV
     
     BBTK_ON_SHOW_WIDGET(OnShowWidget);
     void OnShowWidget();
-    bool _onshowwidget;
     
    std::vector<int>                            _point;
 private: