// Set property for deflection value for spinboxes
setPreferenceProperty( defl, "min", 1.0e-07 );
- setPreferenceProperty( defl, "max", 10000.0 );
- setPreferenceProperty( defl, "step", 0.0001 );
+ setPreferenceProperty( defl, "max", 1.0 );
+ setPreferenceProperty( defl, "step", 1.0e-04 );
+ setPreferenceProperty( defl, "precision", 10 );
// Set property vertex marker type
QList<QVariant> aMarkerTypeIndicesList;
GEOMToolsGUI_DeflectionDlg * DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
(SUIT_Session::session()->activeApplication()->desktop());
DeflectionDlg->setDC(aDC);
- if (DeflectionDlg->exec()) {
- SUIT_OverrideCursor();
- double aNewDC = DeflectionDlg->getDC();
- for (; ic->MoreCurrent(); ic->NextCurrent()) {
- CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
- ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
- ic->Redisplay(CurObject);
+ double aNewDC = 0.0;
+ bool ok = false;
+ while (!ok) {
+ if (DeflectionDlg->exec()) {
+ SUIT_OverrideCursor();
+ aNewDC = DeflectionDlg->getDC();
+ ok = (1e-07 <= aNewDC && aNewDC <= 1.0); // spinbox can return zero
+ if (ok) {
+ for (; ic->MoreCurrent(); ic->NextCurrent()) {
+ CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
+ ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
+ ic->Redisplay(CurObject);
+ }
+ }
+ }
+ else {
+ ok = true;
}
}
}
TextLabel1->setText(tr("GEOM_DEFLECTION"));
GroupC1Layout->addWidget(TextLabel1, 0, 0);
+ //SpinBox = new SalomeApp_DoubleSpinBox (/*min*/1.0e-07, /*max*/1.0, /*step*/1.0e-04, GroupC1);
SpinBox = new SalomeApp_DoubleSpinBox (GroupC1);
+ SpinBox->setPrecision( 10 );
+ SpinBox->setDecimals( 10 );
+ SpinBox->setRange( 1.0e-07, 1.0 );
+ SpinBox->setSingleStep( 1.0e-04 );
+ //SpinBox->setMinimum(1.0e-07);
+ //SpinBox->setMaximum(1.0);
+ //SpinBox->setStep(1.0e-04);
SpinBox->setObjectName("SpinBoxU");
SpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- SpinBox->setMinimum(0);
- SpinBox->setValue(1);
+ SpinBox->setValue(1.0e-04);
GroupC1Layout->addWidget(SpinBox, 0, 1);
/***************************************************************/