-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <vtkMapper.h>
#include <vtkDataSet.h>
-static double OFF_UPDATE_RATE = 0.00001;
-static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
+static double OFF_UPDATE_RATE = 0.0001;
+static double FLOAT_TOLERANCE = 1.0 / VTK_FLOAT_MAX;
namespace
{
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 0, 0);
- QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 0, 1);
aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
aGridLayout->addWidget(aLabel, 1, 0);
- QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+ QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
aGridLayout->addWidget(aDblSpinBox, 1, 1);
aGridLayout->addWidget(aLabel, 0, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 0, 1);
myCurrentUpdateRateLineEdit = aLineEdit;
aGridLayout->addWidget(aLabel, 1, 0);
QLineEdit* aLineEdit = new QLineEdit( aGroupBox );
- aLineEdit->setReadOnly( TRUE );
+ aLineEdit->setReadOnly( true );
aGridLayout->addWidget(aLineEdit, 1, 1);
myNumberOfCellsLineEdit = aLineEdit;
aHBoxLayout->setSpacing(6);
{
QPushButton* aPushButton = new QPushButton(tr("OK"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickOk()));
}
{
QPushButton* aPushButton = new QPushButton(tr("Apply"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickApply()));
}
aHBoxLayout->addStretch();
{
QPushButton* aPushButton = new QPushButton(tr("Close"), aGroupBox);
- aPushButton->setDefault(TRUE);
- aPushButton->setAutoDefault(TRUE);
+ aPushButton->setDefault(true);
+ aPushButton->setAutoDefault(true);
aHBoxLayout->addWidget(aPushButton);
connect(aPushButton, SIGNAL(clicked()), this, SLOT(onClickClose()));
}
{
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);
}
/*!
SVTK_UpdateRateDlg
::onClickOk()
{
- Update();
+ onClickApply();
onClickClose();
}
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();
}
/*!