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

index cbe313518e800d4f0f468b61fc310371cbe61d83..4e25288cc3b24b150cbdb5f9ef879627a00267ff 100644 (file)
@@ -99,69 +99,65 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox);
 //-----------------------------------------------------------------
 void ShowNPoints::Process()
 {
-    if (mwxwidget!=NULL)
+    if (_mwxwidget!=NULL)
     {
-        mwxwidget->SetImage( bbGetInputImage() );
+        _mwxwidget->SetImage( bbGetInputImage() );
 //        mwxwidget->SetRenderer( bbGetInputRenderer() );
-        mwxwidget->SetReferencePoint( bbGetInputIn() );
-        mwxwidget->SetColour( bbGetInputColour() );
+        _mwxwidget->SetReferencePoint( bbGetInputIn() );
+        _mwxwidget->SetColour( bbGetInputColour() );
         //             mwxwidget->SetOpacity( bbGetInputOpacity() );
-        mwxwidget->SetRadio( bbGetInputRadio() );
-        if ( backOpacity!=bbGetInputOpacity() )
+        _mwxwidget->SetRadio( bbGetInputRadio() );
+        if ( _backOpacity!=bbGetInputOpacity() )
         {
-            backOpacity = bbGetInputOpacity();
-            mwxwidget->SetOpacity( bbGetInputOpacity() );
+            _backOpacity = bbGetInputOpacity();
+            _mwxwidget->SetOpacity( bbGetInputOpacity() );
         } // if backOpacity
-        //        if (firsttime==true)
-        //        {
-        //            firsttime=false;
-        if (onshowwidget==true)
+        if (_onshowwidget==true)
         {
-            mwxwidget->SetRenderer( bbGetInputRenderer() );
-            if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
+            _mwxwidget->SetRenderer( bbGetInputRenderer() );
+            if ( _mwxwidget->GetModelShowNPoints()->GetFirstTime()==false )
             {
-                mwxwidget->DetectCollectionActive();
+                _mwxwidget->DetectCollectionActive();
             }
-            if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
+            if ( _mwxwidget->GetModelShowNPoints()->GetFirstTime()==true )
             {
-                mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
-                mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() ,  bbGetInputInitLstIndexs() );
+                _mwxwidget->GetModelShowNPoints()->SetFirstTime(false);
+                _mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() ,  bbGetInputInitLstIndexs() );
             }
         } // if onshowwidget
-        //        } // firsttime OJO machete Eduardo pour ANDREAS a verificar
-        mwxwidget->AutoAddPoints();
-        mwxwidget->TrackingPoint();
-        bbSetOutputlstPointsX( mwxwidget->GetLstPointsX()               );
-        bbSetOutputlstPointsY( mwxwidget->GetLstPointsY()               );
-        bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ()               );
-        bbSetOutputlstLabels( mwxwidget->GetLstLabels()                 );
-        bbSetOutputlstIndexs( mwxwidget->GetLstIndexs()                 );
-        bbSetOutputlstSelectedIndexs( mwxwidget->GetLstSelectedIndexs() );
-        bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)mwxwidget );
+        _mwxwidget->AutoAddPoints();
+        _mwxwidget->TrackingPoint();
+        bbSetOutputlstPointsX( _mwxwidget->GetLstPointsX()               );
+        bbSetOutputlstPointsY( _mwxwidget->GetLstPointsY()               );
+        bbSetOutputlstPointsZ( _mwxwidget->GetLstPointsZ()               );
+        bbSetOutputlstLabels( _mwxwidget->GetLstLabels()                 );
+        bbSetOutputlstIndexs( _mwxwidget->GetLstIndexs()                 );
+        bbSetOutputlstSelectedIndexs( _mwxwidget->GetLstSelectedIndexs() );
+        bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)_mwxwidget );
     } // mwxwidget
 }
 
 //-----------------------------------------------------------------
 void ShowNPoints::CreateWidget(wxWindow* parent)
 {
-    mwxwidget = new WidgetShowNPointsBox( parent, this, bbGetInputType() );
-    bbSetOutputWidget( mwxwidget );
+    _mwxwidget = new WidgetShowNPointsBox( parent, this, bbGetInputType() );
+    bbSetOutputWidget( _mwxwidget );
 }
 
 //-----------------------------------------------------------------
 void  ShowNPoints::OnShowWidget()
 {
-    onshowwidget=true;
+    _onshowwidget=true;
 //    mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() ,  bbGetInputInitLstIndexs() );
 }
 
 //-----------------------------------------------------------------
 void ShowNPoints::bbUserSetDefaultValues()
 {
-    onshowwidget= false;
-    firsttime   = true;
-    backOpacity = -1;
-    mwxwidget   = NULL;
+    _onshowwidget= false;
+    _firsttime   = true;
+    _backOpacity = -1;
+    _mwxwidget   = NULL;
     bbSetInputRadio(10);
     bbSetInputOpacity(1);
     std::vector<double> colour;
index 0f4277f8e5b8a257b28ce9f5d08a6837ddf2f4f4..ac2fd8318c6c16b8c466db99f4e53e7463657110 100644 (file)
@@ -85,15 +85,15 @@ class /*BBTK_EXPORT*/ ShowNPoints
   void Process();
   BBTK_CREATE_WIDGET(CreateWidget);
   void CreateWidget(wxWindow*);
-  double backOpacity;
+  double _backOpacity;
     
     BBTK_ON_SHOW_WIDGET(OnShowWidget);
     void OnShowWidget();
-    bool onshowwidget;
+    bool _onshowwidget;
 
 private:
-    bool                    firsttime;
-       WidgetShowNPointsBox    *mwxwidget;
+    bool                    _firsttime;
+       WidgetShowNPointsBox    *_mwxwidget;
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ShowNPoints,bbtk::WxBlackBox);
index 923369513ee4f9baef106dc80abbff1ef6611cb6..56a1586998208d697a9189c95b77d302bbd5b781 100644 (file)
@@ -61,30 +61,31 @@ bbwxMaracas_N_ViewersWidget::~bbwxMaracas_N_ViewersWidget()
 //-------------------------------------------------------------
 void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
 {
-    /*
-    //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 (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()) )
+        {
+            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
 }
 
 //-------------------------------------------------------------
@@ -198,15 +199,17 @@ void ViewerNV::CreateWidget(wxWindow* parent)
 // when window is shown
 void ViewerNV::OnShowWidget()
 {
-    if (bbGetOutputWidget()!=NULL)
+    if (_mwxwidget!=NULL)
     {
-        bbGetOutputWidget()->Layout();
+        _onshowwidget = true;
+        _mwxwidget->Layout();
     } // if bbGetOutputWidget
 }
 
 //-------------------------------------------------------------
 void ViewerNV::bbUserSetDefaultValues()
 {
+    _onshowwidget           =   false;
        _currentimg                             =       NULL;
        _mwxwidget                              =       NULL;
        bbSetInputIn(NULL);
index af85daabb3f7578cae4087237faf3240e9da650a..ac9f6a15ce90b261a272e2907fe4b2cdb612e2ab 100644 (file)
@@ -102,10 +102,11 @@ class /*BBTK_EXPORT*/ ViewerNV
   BBTK_PROCESS(Process);
   void Process();
   BBTK_CREATE_WIDGET(CreateWidget);
-  BBTK_ON_SHOW_WIDGET(OnShowWidget);
-
   void CreateWidget(wxWindow* parent);
-  void OnShowWidget();
+    
+    BBTK_ON_SHOW_WIDGET(OnShowWidget);
+    void OnShowWidget();
+    bool _onshowwidget;
     
    std::vector<int>                            _point;
 private: