From b5c970f7f6160c6d4f7536a333ab92c0a2f2678b Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Mon, 13 Jan 2025 17:06:56 +0100 Subject: [PATCH] #3573 Bug Refresh windows --- bbtk/src/bbmaracasvisuShowNPoints.cxx | 9 +++++++++ .../interface/wxWindows/widgets/ViewShowNPoints.cxx | 10 ++++++++-- .../interface/wxWindows/widgets/WidgetShowNPoints.cxx | 6 +++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index 1e5c528..94a80a9 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -99,6 +99,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox); //----------------------------------------------------------------- void ShowNPoints::Process() { + printf("EED ShowNPoints::Process start \n"); if (mwxwidget!=NULL) { mwxwidget->SetImage( bbGetInputImage() ); @@ -107,6 +108,7 @@ void ShowNPoints::Process() mwxwidget->SetColour( bbGetInputColour() ); // mwxwidget->SetOpacity( bbGetInputOpacity() ); mwxwidget->SetRadio( bbGetInputRadio() ); + printf("EED ShowNPoints::Process flag 1 \n"); if ( backOpacity!=bbGetInputOpacity() ) { backOpacity = bbGetInputOpacity(); @@ -117,16 +119,22 @@ void ShowNPoints::Process() // firsttime=false; if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==false ) { + printf("EED ShowNPoints::Process flag 2.1 \n"); mwxwidget->DetectCollectionActive(); + printf("EED ShowNPoints::Process flag 2.2 \n"); } if ( mwxwidget->GetModelShowNPoints()->GetFirstTime()==true ) { + printf("EED ShowNPoints::Process flag 3 \n"); mwxwidget->GetModelShowNPoints()->SetFirstTime(false); mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() , bbGetInputInitLstIndexs() ); } // } // firsttime OJO machete Eduardo pour ANDREAS a verificar + printf("EED ShowNPoints::Process flag 10 \n"); mwxwidget->AutoAddPoints(); + printf("EED ShowNPoints::Process flag 20 \n"); mwxwidget->TrackingPoint(); + printf("EED ShowNPoints::Process flag 30 \n"); bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() ); bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() ); bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() ); @@ -135,6 +143,7 @@ void ShowNPoints::Process() bbSetOutputlstSelectedIndexs( mwxwidget->GetLstSelectedIndexs() ); bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)mwxwidget ); } // mwxwidget + printf("EED ShowNPoints::Process end \n"); } //----------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx index 0bd5f74..9091848 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ViewShowNPoints.cxx @@ -56,7 +56,10 @@ void ViewShowNPoints::RefreshEachPoint() void ViewShowNPoints::RefreshPoints() { RefreshEachPoint(); - renderer->GetRenderWindow()->Render(); + if (renderer!=NULL) + { + renderer->GetRenderWindow()->Render(); + } } //------------------------------------------------------------------------ @@ -111,7 +114,10 @@ void ViewShowNPoints::AddPoint() //------------------------------------------------------------------------ void ViewShowNPoints::Render() { - renderer->GetRenderWindow()->Render(); + if (renderer!=NULL) + { + renderer->GetRenderWindow()->Render(); + } } //------------------------------------------------------------------------ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 6ded365..40d7ec0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -1761,7 +1761,11 @@ void WidgetShowNPoints::RefreshColourCollection() lstViewShowNPoints[iCollection]->RefreshEachPoint(); }// if mActualCollection } // for i - lstViewShowNPoints[mActualCollection] -> renderer->GetRenderWindow()->Render(); + + if (lstViewShowNPoints[mActualCollection]->renderer != NULL) + { + lstViewShowNPoints[mActualCollection]->renderer->GetRenderWindow()->Render(); + } // if renderer } //------------------------------------------------------------------------ -- 2.49.0