From 1b212c135ef80f1594527bd3c9efce8c4d93973e Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 24 May 2005 05:14:25 +0000 Subject: [PATCH] PAL8769: Limitation to give values in Spin boxes. Now coordinates and displacements values can be within interval [-1e+15, 1e+15] --- src/BasicGUI/BasicGUI_CircleDlg.cxx | 2 +- src/BasicGUI/BasicGUI_EllipseDlg.cxx | 4 +- src/BasicGUI/BasicGUI_MarkerDlg.cxx | 2 +- src/BasicGUI/BasicGUI_PlaneDlg.cxx | 6 +-- src/BasicGUI/BasicGUI_PointDlg.cxx | 12 ++--- src/BasicGUI/BasicGUI_VectorDlg.cxx | 6 +-- src/DlgRef/DlgRef_SpinBox.cxx | 1 + src/DlgRef/DlgRef_SpinBox.h | 5 +- src/EntityGUI/EntityGUI_SketcherDlg.cxx | 52 +++++++++---------- src/GenerationGUI/GenerationGUI_PrismDlg.cxx | 2 +- src/GenerationGUI/GenerationGUI_RevolDlg.cxx | 2 +- .../OperationGUI_ArchimedeDlg.cxx | 6 +-- src/OperationGUI/OperationGUI_ChamferDlg.cxx | 2 +- src/OperationGUI/OperationGUI_ClippingDlg.cxx | 4 +- src/OperationGUI/OperationGUI_FilletDlg.cxx | 6 +-- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 6 +-- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 12 ++--- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 8 +-- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 4 +- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 8 +-- .../TransformationGUI_MultiRotationDlg.cxx | 10 ++-- .../TransformationGUI_MultiTranslationDlg.cxx | 12 ++--- .../TransformationGUI_OffsetDlg.cxx | 2 +- .../TransformationGUI_RotationDlg.cxx | 2 +- .../TransformationGUI_ScaleDlg.cxx | 2 +- .../TransformationGUI_TranslationDlg.cxx | 6 +-- 26 files changed, 94 insertions(+), 90 deletions(-) diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 105e3becd..64c718485 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -117,7 +117,7 @@ void BasicGUI_CircleDlg::Init() double aStep = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, aStep, 3); + GroupPntVecR->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); GroupPntVecR->SpinBox_DX->SetValue( 100 ); /* signals and slots connections */ diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 9f8d5bb90..9165c7579 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -104,8 +104,8 @@ void BasicGUI_EllipseDlg::Init() double aMajorR( 200. ), aMinorR( 100. ); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, 999.999, step, 3 ); - GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, 999.999, step, 3 ); + GroupPoints->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 ); + GroupPoints->SpinBox_DY->RangeStepAndValidator( 0.001, COORD_MAX, step, 3 ); GroupPoints->SpinBox_DX->SetValue( aMajorR ); GroupPoints->SpinBox_DY->SetValue( aMinorR ); diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 3cabd35f8..c281aec78 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -170,7 +170,7 @@ void BasicGUI_MarkerDlg::Init( SALOME_Selection* theSel ) QString aStr = QAD_CONFIG->getSetting( "Geometry:SettingsGeomStep" ); for ( DataMap::iterator anIter = myData.begin(); anIter != myData.end(); ++anIter ) { - anIter.data()->RangeStepAndValidator( -999.999, 999.999, aStr.toDouble(), 3 ); + anIter.data()->RangeStepAndValidator( COORD_MIN, COORD_MAX, aStr.toDouble(), 3 ); connect( anIter.data(), SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged( double ) ) ); } diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index a8298c652..ed7476365 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -126,11 +126,11 @@ void BasicGUI_PlaneDlg::Init() double aTrimSize = 2000.0; /* min, max, step and decimals for spin boxes */ - GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, 10000000.0, aStep, 3 ); + GroupPntDir->SpinBox_DX->RangeStepAndValidator( 0.001, COORD_MAX, aStep, 3 ); GroupPntDir->SpinBox_DX->SetValue( aTrimSize ); - Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); + Group3Pnts->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); Group3Pnts->SpinBox_DX->SetValue( aTrimSize ); - GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, 10000000.0, aStep, 3); + GroupFace->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, aStep, 3); GroupFace->SpinBox_DX->SetValue( aTrimSize ); /* signals and slots connections */ diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index d5f72b81b..212c8b67c 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -153,16 +153,16 @@ void BasicGUI_PointDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes */ - GroupXYZ->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupXYZ->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupXYZ->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupXYZ->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupXYZ->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupXYZ->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupXYZ->SpinBox_DX->SetValue(0.0); GroupXYZ->SpinBox_DY->SetValue(0.0); GroupXYZ->SpinBox_DZ->SetValue(0.0); - GroupRefPoint->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupRefPoint->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupRefPoint->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupRefPoint->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupRefPoint->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupRefPoint->SpinBox_DX->SetValue(0.0); GroupRefPoint->SpinBox_DY->SetValue(0.0); GroupRefPoint->SpinBox_DZ->SetValue(0.0); diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 0af637cb3..b192879a0 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -110,9 +110,9 @@ void BasicGUI_VectorDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double dx( 0. ), dy( 0. ), dz( 200. ); GroupDimensions->SpinBox_DX->SetValue( dx ); diff --git a/src/DlgRef/DlgRef_SpinBox.cxx b/src/DlgRef/DlgRef_SpinBox.cxx index 5dc0e0463..d7c8f4f96 100644 --- a/src/DlgRef/DlgRef_SpinBox.cxx +++ b/src/DlgRef/DlgRef_SpinBox.cxx @@ -38,6 +38,7 @@ using namespace std; DlgRef_SpinBox::DlgRef_SpinBox(QWidget* parent, const char* name) : QAD_SpinBoxDbl(parent, name) { + setPrecision(16); } diff --git a/src/DlgRef/DlgRef_SpinBox.h b/src/DlgRef/DlgRef_SpinBox.h index eec1c40e5..d9275ca84 100644 --- a/src/DlgRef/DlgRef_SpinBox.h +++ b/src/DlgRef/DlgRef_SpinBox.h @@ -29,7 +29,10 @@ #ifndef GEOMSPINBOX_H #define GEOMSPINBOX_H -#include "QAD_SpinBoxDbl.h" +#include "QAD_SpinBoxDbl.h" + +#define COORD_MIN -1e+15 +#define COORD_MAX +1e+15 //================================================================================= // class : DlgRef_SpinBox diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index bd150b1ad..b6e2d1689 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -243,16 +243,16 @@ void EntityGUI_SketcherDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes */ - Group1Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group4Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group4Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group4Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, step, 3); - Group4Spin->SpinBox_DS->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group1Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group4Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group4Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group4Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + Group4Spin->SpinBox_DS->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); /* displays Dialog */ GroupConstructors->setEnabled(false); @@ -350,8 +350,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId) if ( constructorId == 1 ) { // XY mySketchType = PT_ABS; - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_X2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_Y2")); myX = 0.0; @@ -366,8 +366,8 @@ void EntityGUI_SketcherDlg::PointClicked(int constructorId) else if ( constructorId == 0 ) { // DXDY mySketchType = PT_RELATIVE; - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_DX2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_DY2")); myDX = 0.0; @@ -420,8 +420,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) myLength = 100.0; if ( myConstructorDirId == 2 ) { // Angle - Group2Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group2Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group2Spin->SpinBox_DX->SetValue(myAngle); Group2Spin->buttonApply->setFocus(); @@ -496,9 +496,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) } else if ( myConstructorDirId == 3 ) { // DXDY - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 0.1, 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 0.1, 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_VX2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_VY2")); myDX = 0.0; @@ -535,9 +535,9 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_ANGLE_LENGTH; - Group3Spin->SpinBox_DX->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); - Group3Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group3Spin->SpinBox_DZ->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group3Spin->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); + Group3Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); + Group3Spin->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group3Spin->TextLabel1->setText(tr("GEOM_SKETCHER_ANGLE2")); Group3Spin->TextLabel2->setText(tr("GEOM_SKETCHER_RADIUS2")); Group3Spin->TextLabel3->setText(tr("GEOM_SKETCHER_ANGLE2")); @@ -555,8 +555,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_PER_LENGTH; - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); myRadius = 100.0; @@ -572,8 +572,8 @@ void EntityGUI_SketcherDlg::Dir2Clicked(int constructorId) if ( constructorId == 2 ) { // Length mySketchType = DIR_TAN_LENGTH; - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 100., 3); - Group2Spin->SpinBox_DY->RangeStepAndValidator(-999999.999, 999999.999, 5., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 100., 3); + Group2Spin->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5., 3); Group2Spin->TextLabel1->setText(tr("GEOM_SKETCHER_RADIUS2")); Group2Spin->TextLabel2->setText(tr("GEOM_SKETCHER_ANGLE2")); myRadius = 100.0; diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index bd18da9b4..afad21c8c 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -108,7 +108,7 @@ void GenerationGUI_PrismDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, +999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); /* signals and slots connections */ diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index f811dba46..61a762726 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -107,7 +107,7 @@ void GenerationGUI_RevolDlg::Init() double SpecificStep = 5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(45.0); /* signals and slots connections */ diff --git a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx index 26a867ae2..40170cce2 100644 --- a/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx +++ b/src/OperationGUI/OperationGUI_ArchimedeDlg.cxx @@ -101,9 +101,9 @@ void OperationGUI_ArchimedeDlg::Init( SALOME_Selection* Sel ) double SpecificStep1 = 0.1; double SpecificStep2 = 0.01; /* min, max, myStep and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, myStep, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, SpecificStep1, 3); - GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, 999.999, SpecificStep2, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, myStep, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep1, 3); + GroupPoints->SpinBox_DZ->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep2, 3); GroupPoints->SpinBox_DX->SetValue( 100.0 ); GroupPoints->SpinBox_DY->SetValue( 1.0 ); diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 856d941d1..09b5912a5 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -140,7 +140,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg( QWidget* parent, SALOME_Select double SpecificStep = 10.0; QMap< int, DlgRef_SpinBox* >::iterator anIter; for ( anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter ) - anIter.data()->RangeStepAndValidator( 0.001, 999.999, SpecificStep, 3 ); + anIter.data()->RangeStepAndValidator( 0.001, COORD_MAX, SpecificStep, 3 ); /* Initialisations */ Init( mySelection ); diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index 932627e35..bd54b2ed7 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -108,8 +108,8 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( QWidget* parent, const char* Layout1->addWidget( GroupArguments, 2, 0 ); /* Initialisations */ - SpinBox_Near->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Far->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox_Near->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Far->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); //GeometryGUI* aGeomGUI = GeometryGUI::GetGeomGUI(); diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index ae49d6c2e..a498f3cdb 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -97,9 +97,9 @@ OperationGUI_FilletDlg::OperationGUI_FilletDlg( QWidget* parent, SALOME_Selectio /***************************************************************/ double SpecificStep = 10.0; - Group1->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group2->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); - Group3->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, SpecificStep, 3); + Group1->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); + Group2->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); + Group3->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, SpecificStep, 3); /* Initialisations */ Init( mySelection ); diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index de16e300b..8a3e3885a 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -109,9 +109,9 @@ void PrimitiveGUI_BoxDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double initValue = 200.0; GroupDimensions->SpinBox_DX->SetValue(initValue); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index 2a4055a6b..ad9f97a7a 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -111,12 +111,12 @@ void PrimitiveGUI_ConeDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupPoints->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, 999.999, step, 3); - GroupDimensions->SpinBox_DZ->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupPoints->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.000, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); double aRadius1(100.0), aRadius2(0.0), aHeight(300.0); GroupPoints->SpinBox_DX->SetValue(aRadius1); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 4da544407..2dd87f493 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -110,13 +110,13 @@ void PrimitiveGUI_CylinderDlg::Init() /* min, max, step and decimals for spin boxes & initial values */ /* First constructor : radius */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); /* First constructor : algebric height */ - GroupPoints->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); /* Second constructor : radius */ - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); /* Second constructor : algebric height */ - GroupDimensions->SpinBox_DY->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); GroupPoints->SpinBox_DY->SetValue(300.0); diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index f1dbaf002..cc05a2c3d 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -105,8 +105,8 @@ void PrimitiveGUI_SphereDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(100.0); GroupDimensions->SpinBox_DX->SetValue(100.0); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index 3c622ef4d..c6ff5af3d 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -109,10 +109,10 @@ void PrimitiveGUI_TorusDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, 999.999, step, 3); - GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DX->RangeStepAndValidator(0.001, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY->RangeStepAndValidator(0.001, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->SetValue(300.0); GroupPoints->SpinBox_DY->SetValue(100.0); diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 441abea0a..1a34fb8fb 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -116,13 +116,13 @@ void TransformationGUI_MultiRotationDlg::Init() double SpecificStep1 = 5; double SpecificStep2 = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(1.0, COORD_MAX, SpecificStep2, 3); GroupPoints->SpinBox_DX->SetValue(myNbTimes1); - GroupDimensions->SpinBox_DX1->RangeStepAndValidator(-999.999, 999.999, SpecificStep1, 3); - GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); - GroupDimensions->SpinBox_DX2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, 999.999, SpecificStep2, 3); + GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep1, 3); + GroupDimensions->SpinBox_DY1->RangeStepAndValidator( 1.0, COORD_MAX, SpecificStep2, 3); + GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY2->RangeStepAndValidator( 1.0, COORD_MAX, SpecificStep2, 3); GroupDimensions->SpinBox_DX1->SetValue(myAng); GroupDimensions->SpinBox_DY1->SetValue(myNbTimes1); GroupDimensions->SpinBox_DX2->SetValue(myStep); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index 108dbb1dd..81668ba38 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -121,15 +121,15 @@ void TransformationGUI_MultiTranslationDlg::Init() double SpecificStep = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox_DY->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox_DY->RangeStepAndValidator( 1.0, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(myStepU); GroupPoints->SpinBox_DY->SetValue(myNbTimesU); - GroupDimensions->SpinBox_DX1->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY1->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); - GroupDimensions->SpinBox_DX2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupDimensions->SpinBox_DY2->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); + GroupDimensions->SpinBox_DX1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY1->RangeStepAndValidator( 1.0, COORD_MAX, SpecificStep, 3); + GroupDimensions->SpinBox_DX2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupDimensions->SpinBox_DY2->RangeStepAndValidator( 1.0, COORD_MAX, SpecificStep, 3); GroupDimensions->SpinBox_DX1->SetValue(myStepU); GroupDimensions->SpinBox_DY1->SetValue(myNbTimesU); GroupDimensions->SpinBox_DX2->SetValue(myStepV); diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index ba0cd6381..3a7a9cc4a 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -98,7 +98,7 @@ void TransformationGUI_OffsetDlg::Init() double step = 1; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox_DX->setPrecision(5); GroupPoints->SpinBox_DX->setDblPrecision(1e-05); GroupPoints->SpinBox_DX->SetValue(1e-05); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index 66fde50d0..c440fb477 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -77,7 +77,7 @@ TransformationGUI_RotationDlg::TransformationGUI_RotationDlg(QWidget* parent, c double anAngle = 0; double SpecificStep = 5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(anAngle); // Activate Create a Copy mode diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index bcfec2b55..9ea31756d 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -79,7 +79,7 @@ TransformationGUI_ScaleDlg::TransformationGUI_ScaleDlg(QWidget* parent, const ch double aFactor = 2.0; double SpecificStep = 0.5; /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox_DX->RangeStepAndValidator(-999.999, 999.999, SpecificStep, 3); + GroupPoints->SpinBox_DX->RangeStepAndValidator(COORD_MIN, COORD_MAX, SpecificStep, 3); GroupPoints->SpinBox_DX->SetValue(aFactor); // Activate Create a Copy mode diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 0654d2ad4..8395089c7 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -116,9 +116,9 @@ void TransformationGUI_TranslationDlg::Init() double step = St.toDouble(); /* min, max, step and decimals for spin boxes & initial values */ - GroupPoints->SpinBox1->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox2->RangeStepAndValidator(-999.999, 999.999, step, 3); - GroupPoints->SpinBox3->RangeStepAndValidator(-999.999, 999.999, step, 3); + GroupPoints->SpinBox1->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox2->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); + GroupPoints->SpinBox3->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, 3); GroupPoints->SpinBox1->SetValue(0.0); GroupPoints->SpinBox2->SetValue(0.0); -- 2.39.2