From: jfa Date: Tue, 24 May 2005 05:49:07 +0000 (+0000) Subject: PAL8769: Limitation to give values in Spin boxes. Now coordinates and displacements... X-Git-Tag: T2_2_4a~5 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=281105176b2f9d8bd27ea95702f4bc56b10f5697 PAL8769: Limitation to give values in Spin boxes. Now coordinates and displacements values can be within interval [-1e+15, 1e+15] --- diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index fd903bbc6..ad1310f4b 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -27,19 +27,20 @@ #include "SMESHGUI_CreatePatternDlg.h" -#include "QAD_Desktop.h" -#include "QAD_FileDlg.h" - -#include "SMESHGUI_PatternWidget.h" -#include "SMESHGUI_SpinBox.h" #include "SMESHGUI.h" -#include "SALOME_Selection.h" -#include "SALOME_ListIteratorOfListOfFilter.hxx" -#include "SALOMEGUI_QtCatchCorbaException.hxx" -#include "SMESH_NumberFilter.hxx" #include "SMESHGUI_Utils.h" #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_PatternUtils.h" +#include "SMESHGUI_PatternWidget.h" + +#include "SMESH_NumberFilter.hxx" + +#include "SALOME_Selection.h" +#include "SALOME_ListIteratorOfListOfFilter.hxx" +#include "SALOMEGUI_QtCatchCorbaException.hxx" + +#include "QAD_Desktop.h" +#include "QAD_FileDlg.h" #include diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h index 40fbfe1b7..bfc198119 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h @@ -39,7 +39,6 @@ class SMESHGUI_PatternWidget; class QCloseEvent; class QFrame; class QLineEdit; -class SMESHGUI_SpinBox; class QPushButton; class SALOME_Selection; class QRadioButton; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 989518fe0..b92744b0a 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -287,11 +287,12 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( QWidget* parent, /***************************************************************/ // Initialisations - XSpin->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - YSpin->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - ZSpin->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - AngleSpin->RangeStepAndValidator( -999999.999, +999999.999, 5.0, 3 ); - + XSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + YSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + ZSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + AngleSpin->RangeStepAndValidator( COORD_MIN, COORD_MAX, 5.0, 3 ); + //?? AngleSpin->RangeStepAndValidator( -360., +360., 5.0, 3 ); + mySelection = Sel; mySMESHGUI = SMESHGUI::GetSMESHGUI() ; mySMESHGUI->SetActiveDialogBox( this ) ; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 7e3ad503f..239bbadd6 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -202,9 +202,9 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg( QWidget* parent, const char* name, SMESHGUI_ExtrusionDlgLayout->addWidget( GroupArguments, 1, 0 ); /* Initialisations */ - SpinBox_Dx->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Dy->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Dz->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox_Dx->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Dy->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Dz->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps); SpinBox_NbSteps->setValidator(anIntValidator); diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx index 85ecdbec9..b1fdd4978 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx @@ -33,6 +33,7 @@ #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_IdValidator.h" #include "SMESHGUI_SpinBox.h" + #include "SMESH_Actor.h" #include "SMDS_Mesh.hxx" @@ -222,7 +223,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( QWidget* parent, const char* nam SMESHGUI_MergeNodesDlgLayout->addWidget( GroupEdit, 3, 0 ); /* Initialisations */ - SpinBoxTolerance->RangeStepAndValidator( 0.0, 999999.999, 0.1, 3 ); + SpinBoxTolerance->RangeStepAndValidator( 0.0, COORD_MAX, 0.1, 3 ); SpinBoxTolerance->SetValue(1e-05); RadioButton1->setChecked( TRUE ); diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index e163f8095..7368c374b 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -166,9 +166,9 @@ QFrame* SMESHGUI_MoveNodesDlg::createMainFrame( QWidget* theParent ) new QLabel( tr( "SMESH_Z" ), aCoordGrp ); myZ = new SMESHGUI_SpinBox( aCoordGrp ); - myX->RangeStepAndValidator( -999999.999, +999999.999, 25.0, 3 ); - myY->RangeStepAndValidator( -999999.999, +999999.999, 25.0, 3 ); - myZ->RangeStepAndValidator( -999999.999, +999999.999, 25.0, 3 ); + myX->RangeStepAndValidator( COORD_MIN, COORD_MAX, 25.0, 3 ); + myY->RangeStepAndValidator( COORD_MIN, COORD_MAX, 25.0, 3 ); + myZ->RangeStepAndValidator( COORD_MIN, COORD_MAX, 25.0, 3 ); QVBoxLayout* aLay = new QVBoxLayout( aFrame ); aLay->addWidget( aPixGrp ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index 48a59a962..a2ea7b7ca 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -40,7 +40,6 @@ class QGroupBox; class QListBox; class QFrame; class QLineEdit; -class SMESHGUI_SpinBox; class QPushButton; class SALOME_Selection; class SMESH_Actor; diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 67b0daa23..ec80e17ce 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -356,9 +356,9 @@ void SMESHGUI_NodesDlg::Init(SALOME_Selection* Sel) step = 25.0 ; /* min, max, step and decimals for spin boxes */ - SpinBox_X->RangeStepAndValidator( -999.999, +999.999, step, 3 ) ; - SpinBox_Y->RangeStepAndValidator( -999.999, +999.999, step, 3 ) ; - SpinBox_Z->RangeStepAndValidator( -999.999, +999.999, step, 3 ) ; + SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ) ; + SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ) ; + SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, 3 ) ; SpinBox_X->SetValue( 0.0 ) ; SpinBox_Y->SetValue( 0.0 ) ; SpinBox_Z->SetValue( 0.0 ) ; diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index f7782b57d..fc22822b9 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -263,20 +263,21 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( QWidget* parent, const char* nam SMESHGUI_RevolutionDlgLayout->addWidget( GroupArguments, 1, 0 ); /* Initialisations */ - SpinBox_X->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Y->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Z->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DX->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DY->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DZ->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox_X->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Y->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Z->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DX->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DY->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DZ->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); - SpinBox_Angle->RangeStepAndValidator( -999999.999, +999999.999, 5.0, 3 ); + SpinBox_Angle->RangeStepAndValidator( COORD_MIN, COORD_MAX, 5.0, 3 ); + //??SpinBox_Angle->RangeStepAndValidator( -360., +360., 5.0, 3 ); QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps); SpinBox_NbSteps->setValidator(anIntValidator); SpinBox_NbSteps->setRange( 1, 999999 ); - SpinBox_Tolerance->RangeStepAndValidator( 0.0, +999999.999, 0.1, 6 ); + SpinBox_Tolerance->RangeStepAndValidator( 0.0, COORD_MAX, 0.1, 6 ); GroupArguments->show(); RadioButton1->setChecked( TRUE ); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index fd7253b76..55b9396f0 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -34,6 +34,7 @@ #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_MeshUtils.h" #include "SMESHGUI_IdValidator.h" + #include "SMESH_Actor.h" #include "SMESH_TypeFilter.hxx" #include "SMDS_Mesh.hxx" @@ -253,14 +254,15 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( QWidget* parent, const char* name, S SMESHGUI_RotationDlgLayout->addWidget( GroupArguments, 1, 0 ); /* Initialisations */ - SpinBox_X->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Y->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Z->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DX->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DY->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DZ->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - - SpinBox_Angle->RangeStepAndValidator( -999999.999, +999999.999, 5.0, 3 ); + SpinBox_X->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Y->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Z->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DX->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DY->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DZ->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + + SpinBox_Angle->RangeStepAndValidator( COORD_MIN, COORD_MAX, 5.0, 3 ); + //??SpinBox_Angle->RangeStepAndValidator( -360., +360., 5.0, 3 ); GroupArguments->show(); myConstructorId = 0 ; diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index b25953d4c..a3126dafc 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -34,13 +34,12 @@ #include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_MeshUtils.h" -#include "SMESHGUI_SpinBox.h" - -#include "utilities.h" -#include "SALOME_Selection.h" #include "SMESH_Actor.h" #include "SMDS_Mesh.hxx" +#include "SALOME_Selection.h" +#include "utilities.h" + #include #include #include diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h index 9aed20635..13513f3bb 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h @@ -35,7 +35,6 @@ class QCloseEvent; class QFrame; class QLineEdit; -class SMESHGUI_SpinBox; class QPushButton; class SALOME_Selection; class SMESH_Actor; diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 3099baeb0..99b1aafa6 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -215,7 +215,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( QWidget* parent, const char* name, QIntValidator* anIntValidator = new QIntValidator(SpinBox_IterationLimit); SpinBox_IterationLimit->setValidator(anIntValidator); SpinBox_IterationLimit->setRange( 1, 999999 ); - SpinBox_AspectRatio->RangeStepAndValidator( 0.0, +999999.999, 0.1, 3 ); + SpinBox_AspectRatio->RangeStepAndValidator( 0.0, COORD_MAX, 0.1, 3 ); GroupArguments->show(); myConstructorId = 0 ; diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.cxx b/src/SMESHGUI/SMESHGUI_SpinBox.cxx index 017b37b33..a8f90184a 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.cxx +++ b/src/SMESHGUI/SMESHGUI_SpinBox.cxx @@ -40,6 +40,7 @@ using namespace std; SMESHGUI_SpinBox::SMESHGUI_SpinBox( QWidget* parent, const char* name ) : QAD_SpinBoxDbl( parent, name) { + setPrecision(16); } diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.h b/src/SMESHGUI/SMESHGUI_SpinBox.h index fab8312d2..fea99fdce 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.h +++ b/src/SMESHGUI/SMESHGUI_SpinBox.h @@ -31,6 +31,9 @@ #include "QAD_SpinBoxDbl.h" +#define COORD_MIN -1e+15 +#define COORD_MAX +1e+15 + //================================================================================= // class : SMESHGUI_SpinBox // purpose : Derivated from QAD_SpinBoxDbl class diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 1186ce9d4..f05875d3c 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -34,6 +34,7 @@ #include "SMESHGUI_MeshUtils.h" #include "SMESHGUI_IdValidator.h" #include "SMESHGUI_SpinBox.h" + #include "SMESH_Actor.h" #include "SMESH_TypeFilter.hxx" #include "SMDS_Mesh.hxx" @@ -251,12 +252,12 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( QWidget* parent, const char* name, S SMESHGUI_SymmetryDlgLayout->addWidget( GroupArguments, 1, 0 ); /* Initialisations */ - SpinBox_X->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Y->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_Z->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DX->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DY->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox_DZ->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox_X->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Y->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_Z->RangeStepAndValidator ( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DX->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DY->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox_DZ->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); GroupArguments->show(); RadioButton1->setChecked( TRUE ); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 0bb568609..af8a439ac 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -34,6 +34,7 @@ #include "SMESHGUI_MeshUtils.h" #include "SMESHGUI_IdValidator.h" #include "SMESHGUI_SpinBox.h" + #include "SMESH_Actor.h" #include "SMESH_TypeFilter.hxx" #include "SMDS_Mesh.hxx" @@ -235,12 +236,12 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( QWidget* parent, const char* n SMESHGUI_TranslationDlgLayout->addWidget( GroupArguments, 1, 0 ); /* Initialisations */ - SpinBox1_1->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox1_2->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox1_3->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox2_1->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox2_2->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); - SpinBox2_3->RangeStepAndValidator( -999999.999, +999999.999, 10.0, 3 ); + SpinBox1_1->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox1_2->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox1_3->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox2_1->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox2_2->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); + SpinBox2_3->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10.0, 3 ); GroupArguments->show(); RadioButton1->setChecked( TRUE );