From 5f480091d3e52270de27b804fbdddc7e5b4c9120 Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 31 Aug 2016 12:09:18 +0300 Subject: [PATCH] INT PAL 53156: 'Close' doesn't cancel changes in 'Update rate' dialog. --- src/SVTK/SVTK_UpdateRateDlg.cxx | 36 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index 0ebbd3f7c..67b8e3a7f 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -49,7 +49,7 @@ #include #include -static double OFF_UPDATE_RATE = 0.00001; +static double OFF_UPDATE_RATE = 0.0001; static double FLOAT_TOLERANCE = 1.0 / VTK_FLOAT_MAX; namespace @@ -332,18 +332,13 @@ SVTK_UpdateRateDlg { vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice(); - double anUpdateRate; - if(myIsEnableUpdateRateGroupBox->isChecked()){ - anUpdateRate = AdjustUpdateRate(myRWInteractor,myDesiredUpdateRateSblSpinBox->value()); - aRWI->SetDesiredUpdateRate(anUpdateRate); - anUpdateRate = AdjustUpdateRate(myRWInteractor,myStillUpdateRateSblSpinBox->value()); - aRWI->SetStillUpdateRate(anUpdateRate); - }else{ - aRWI->SetDesiredUpdateRate(OFF_UPDATE_RATE); - aRWI->SetStillUpdateRate(OFF_UPDATE_RATE); - } + double aDesirableUpdateRate = aRWI->GetDesiredUpdateRate(); + double aStillUpdateRate = aRWI->GetStillUpdateRate(); + bool isUpdateRate = (aDesirableUpdateRate != OFF_UPDATE_RATE) || (aStillUpdateRate != OFF_UPDATE_RATE); - myRWInteractor->getRenderWindow()->Render(); + myIsEnableUpdateRateGroupBox->setChecked(isUpdateRate); + myDesiredUpdateRateSblSpinBox->setValue(aDesirableUpdateRate); + myStillUpdateRateSblSpinBox->setValue(aStillUpdateRate); } /*! @@ -353,7 +348,7 @@ void SVTK_UpdateRateDlg ::onClickOk() { - Update(); + onClickApply(); onClickClose(); } @@ -364,7 +359,20 @@ void SVTK_UpdateRateDlg ::onClickApply() { - Update(); + vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice(); + double anUpdateRate; + if (myIsEnableUpdateRateGroupBox->isChecked()) { + anUpdateRate = AdjustUpdateRate(myRWInteractor,myDesiredUpdateRateSblSpinBox->value()); + aRWI->SetDesiredUpdateRate(anUpdateRate); + anUpdateRate = AdjustUpdateRate(myRWInteractor,myStillUpdateRateSblSpinBox->value()); + aRWI->SetStillUpdateRate(anUpdateRate); + } + else { + aRWI->SetDesiredUpdateRate(OFF_UPDATE_RATE); + aRWI->SetStillUpdateRate(OFF_UPDATE_RATE); + } + + myRWInteractor->getRenderWindow()->Render(); } /*! -- 2.39.2