Issue 0020580: improved validation in integer and double spin boxes, possibility to adjust input field precision through preferences
This commit is contained in:
parent
090ca6925e
commit
a0117b464f
@ -30,6 +30,7 @@
|
|||||||
#include <SMESHGUI_Utils.h>
|
#include <SMESHGUI_Utils.h>
|
||||||
#include <SMESHGUI_HypothesesUtils.h>
|
#include <SMESHGUI_HypothesesUtils.h>
|
||||||
#include <SMESHGUI.h>
|
#include <SMESHGUI.h>
|
||||||
|
#include <SMESHGUI_SpinBox.h>
|
||||||
|
|
||||||
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
||||||
|
|
||||||
@ -38,8 +39,6 @@
|
|||||||
|
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
|
|
||||||
#include <SalomeApp_DoubleSpinBox.h>
|
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
@ -110,11 +109,8 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
|
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
|
||||||
myMaxSize = new SalomeApp_DoubleSpinBox( GroupC1 );
|
myMaxSize = new SMESHGUI_SpinBox( GroupC1 );
|
||||||
myMaxSize->setDecimals( 7 );
|
myMaxSize->RangeStepAndValidator( 1e-07, 1e+06, 10., "length_precision" );
|
||||||
myMaxSize->setMinimum( 1e-07 );
|
|
||||||
myMaxSize->setMaximum( 1e+06 );
|
|
||||||
myMaxSize->setSingleStep( 10 );
|
|
||||||
aGroupLayout->addWidget( myMaxSize, row, 1 );
|
aGroupLayout->addWidget( myMaxSize, row, 1 );
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
@ -132,26 +128,22 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
|||||||
row++;
|
row++;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
|
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
|
||||||
myGrowthRate = new SalomeApp_DoubleSpinBox( GroupC1 );
|
myGrowthRate = new SMESHGUI_SpinBox( GroupC1 );
|
||||||
myGrowthRate->setMinimum( 0.1 );
|
myGrowthRate->RangeStepAndValidator( .1, 10., .1, "parametric_precision" );
|
||||||
myGrowthRate->setMaximum( 10 );
|
|
||||||
myGrowthRate->setSingleStep( 0.1 );
|
|
||||||
aGroupLayout->addWidget( myGrowthRate, row, 1 );
|
aGroupLayout->addWidget( myGrowthRate, row, 1 );
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
const double VALUE_MAX = 1.0e+6;
|
const double VALUE_MAX = 1.0e+6;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
|
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
|
||||||
myNbSegPerEdge = new SalomeApp_DoubleSpinBox( GroupC1 );
|
myNbSegPerEdge = new SMESHGUI_SpinBox( GroupC1 );
|
||||||
myNbSegPerEdge->setMinimum( 0.2 );
|
myNbSegPerEdge->RangeStepAndValidator( .2, VALUE_MAX, .1, "parametric_precision" );
|
||||||
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
|
||||||
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
|
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
|
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
|
||||||
myNbSegPerRadius = new SalomeApp_DoubleSpinBox( GroupC1 );
|
myNbSegPerRadius = new SMESHGUI_SpinBox( GroupC1 );
|
||||||
myNbSegPerRadius->setMinimum( 0.2 );
|
myNbSegPerRadius->RangeStepAndValidator( .2, VALUE_MAX, .1, "parametric_precision" );
|
||||||
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
|
||||||
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
|
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <SMESHGUI_Hypotheses.h>
|
#include <SMESHGUI_Hypotheses.h>
|
||||||
|
|
||||||
class SalomeApp_DoubleSpinBox;
|
class SMESHGUI_SpinBox;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
@ -79,13 +79,13 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QLineEdit* myName;
|
QLineEdit* myName;
|
||||||
SalomeApp_DoubleSpinBox* myMaxSize;
|
SMESHGUI_SpinBox* myMaxSize;
|
||||||
QCheckBox* mySecondOrder;
|
QCheckBox* mySecondOrder;
|
||||||
QCheckBox* myOptimize;
|
QCheckBox* myOptimize;
|
||||||
QComboBox* myFineness;
|
QComboBox* myFineness;
|
||||||
SalomeApp_DoubleSpinBox* myGrowthRate;
|
SMESHGUI_SpinBox* myGrowthRate;
|
||||||
SalomeApp_DoubleSpinBox* myNbSegPerEdge;
|
SMESHGUI_SpinBox* myNbSegPerEdge;
|
||||||
SalomeApp_DoubleSpinBox* myNbSegPerRadius;
|
SMESHGUI_SpinBox* myNbSegPerRadius;
|
||||||
QCheckBox* myAllowQuadrangles;
|
QCheckBox* myAllowQuadrangles;
|
||||||
|
|
||||||
bool myIs2D;
|
bool myIs2D;
|
||||||
|
@ -151,7 +151,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
|||||||
// * local length
|
// * local length
|
||||||
myLengthRadioBut = new QRadioButton( tr( "SMESH_LOCAL_LENGTH_HYPOTHESIS" ), dimGroup );
|
myLengthRadioBut = new QRadioButton( tr( "SMESH_LOCAL_LENGTH_HYPOTHESIS" ), dimGroup );
|
||||||
myLength = new SMESHGUI_SpinBox( dimGroup );
|
myLength = new SMESHGUI_SpinBox( dimGroup );
|
||||||
myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, 6 );
|
myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, "length_precision" );
|
||||||
myLength->setValue( 1. );
|
myLength->setValue( 1. );
|
||||||
dimLay->addWidget( myLengthRadioBut, dimRow, 0 );
|
dimLay->addWidget( myLengthRadioBut, dimRow, 0 );
|
||||||
dimLay->addWidget( myLength, dimRow, 1 );
|
dimLay->addWidget( myLength, dimRow, 1 );
|
||||||
@ -178,7 +178,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
|||||||
// * max area
|
// * max area
|
||||||
dimLay->addWidget( new QLabel( tr( "SMESH_MAX_ELEMENT_AREA_HYPOTHESIS" ), dimGroup), dimRow, 0);
|
dimLay->addWidget( new QLabel( tr( "SMESH_MAX_ELEMENT_AREA_HYPOTHESIS" ), dimGroup), dimRow, 0);
|
||||||
myArea = new SMESHGUI_SpinBox( dimGroup );
|
myArea = new SMESHGUI_SpinBox( dimGroup );
|
||||||
myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, 6 );
|
myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, "area_precision" );
|
||||||
myArea->setValue( 1. );
|
myArea->setValue( 1. );
|
||||||
dimLay->addWidget( myArea, dimRow, 1 );
|
dimLay->addWidget( myArea, dimRow, 1 );
|
||||||
dimRow++;
|
dimRow++;
|
||||||
@ -205,7 +205,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
|||||||
// * max volume
|
// * max volume
|
||||||
dimLay->addWidget(new QLabel( tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"), dimGroup), dimRow, 0);
|
dimLay->addWidget(new QLabel( tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"), dimGroup), dimRow, 0);
|
||||||
myVolume = new SMESHGUI_SpinBox( dimGroup );
|
myVolume = new SMESHGUI_SpinBox( dimGroup );
|
||||||
myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, 6 );
|
myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, "volume_precision" );
|
||||||
myVolume->setValue( 1. );
|
myVolume->setValue( 1. );
|
||||||
dimLay->addWidget( myVolume, dimRow, 1 );
|
dimLay->addWidget( myVolume, dimRow, 1 );
|
||||||
dimRow++;
|
dimRow++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user