From 61e9e7ace75f7444c5e55f80782771eb5f825a1a Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Tue, 14 Jan 2025 13:14:31 +0100 Subject: [PATCH] Test code --- bbtk/src/bbmaracasvisuShowNPoints.cxx | 66 +++++++++++++-------------- bbtk/src/bbmaracasvisuShowNPoints.h | 8 ++-- bbtk/src/bbmaracasvisuViewerNV.cxx | 55 +++++++++++----------- bbtk/src/bbmaracasvisuViewerNV.h | 7 +-- 4 files changed, 68 insertions(+), 68 deletions(-) diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index cbe3135..4e25288 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -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 colour; diff --git a/bbtk/src/bbmaracasvisuShowNPoints.h b/bbtk/src/bbmaracasvisuShowNPoints.h index 0f4277f..ac2fd83 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.h +++ b/bbtk/src/bbmaracasvisuShowNPoints.h @@ -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); diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 9233695..56a1586 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -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); diff --git a/bbtk/src/bbmaracasvisuViewerNV.h b/bbtk/src/bbmaracasvisuViewerNV.h index af85daa..ac9f6a1 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.h +++ b/bbtk/src/bbmaracasvisuViewerNV.h @@ -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 _point; private: -- 2.49.0