#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include <SalomeApp_Tools.h>
-#include <QtxDoubleSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
#include <QComboBox>
#include <QLabel>
{
}
-bool NETGENPluginGUI_HypothesisCreator::checkParams() const
+bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
{
NetgenHypothesisData data_old, data_new;
readParamsFromHypo( data_old );
readParamsFromWidgets( data_new );
bool res = storeParamsToHypo( data_new );
storeParamsToHypo( data_old );
+
+ res = myMaxSize->isValid(msg,true) && res;
+ res = myGrowthRate->isValid(msg,true) && res; ;
+ res = myNbSegPerEdge->isValid(msg,true) && res;
+ res = myNbSegPerRadius->isValid(msg,true) && res;
return res;
}
}
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
- myMaxSize = new QtxDoubleSpinBox( GroupC1 );
+ myMaxSize = new SalomeApp_DoubleSpinBox( GroupC1 );
myMaxSize->setDecimals( 7 );
myMaxSize->setMinimum( 1e-07 );
myMaxSize->setMaximum( 1e+06 );
row++;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
- myGrowthRate = new QtxDoubleSpinBox( GroupC1 );
+ myGrowthRate = new SalomeApp_DoubleSpinBox( GroupC1 );
myGrowthRate->setMinimum( 0.1 );
myGrowthRate->setMaximum( 10 );
myGrowthRate->setSingleStep( 0.1 );
const double VALUE_MAX = 1.0e+6;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
- myNbSegPerEdge = new QtxDoubleSpinBox( GroupC1 );
+ myNbSegPerEdge = new SalomeApp_DoubleSpinBox( GroupC1 );
myNbSegPerEdge->setMinimum( 0.2 );
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
row++;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
- myNbSegPerRadius = new QtxDoubleSpinBox( GroupC1 );
+ myNbSegPerRadius = new SalomeApp_DoubleSpinBox( GroupC1 );
myNbSegPerRadius->setMinimum( 0.2 );
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
if( myName )
myName->setText( data.myName );
- myMaxSize->setValue( data.myMaxSize );
+ if(data.myMaxSizeVar.isEmpty())
+ myMaxSize->setValue( data.myMaxSize );
+ else
+ myMaxSize->setText( data.myMaxSizeVar );
+
mySecondOrder->setChecked( data.mySecondOrder );
myOptimize->setChecked( data.myOptimize );
myFineness->setCurrentIndex( data.myFineness );
- myGrowthRate->setValue( data.myGrowthRate );
- myNbSegPerEdge->setValue( data.myNbSegPerEdge );
- myNbSegPerRadius->setValue( data.myNbSegPerRadius );
+
+ if(data.myGrowthRateVar.isEmpty())
+ myGrowthRate->setValue( data.myGrowthRate );
+ else
+ myGrowthRate->setText( data.myGrowthRateVar );
+
+ if(data.myNbSegPerEdgeVar.isEmpty())
+ myNbSegPerEdge->setValue( data.myNbSegPerEdge );
+ else
+ myNbSegPerEdge->setText( data.myNbSegPerEdgeVar );
+
+ if(data.myNbSegPerRadiusVar.isEmpty())
+ myNbSegPerRadius->setValue( data.myNbSegPerRadius );
+ else
+ myNbSegPerRadius->setText( data.myNbSegPerRadiusVar );
+
if (myIs2D)
myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
h_data.myName = isCreation() && data ? data->Label : "";
+ SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
+
h_data.myMaxSize = h->GetMaxSize();
+ h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
h_data.mySecondOrder = h->GetSecondOrder();
h_data.myOptimize = h->GetOptimize();
h_data.myFineness = (int) h->GetFineness();
h_data.myGrowthRate = h->GetGrowthRate();
+ h_data.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
h_data.myNbSegPerEdge = h->GetNbSegPerEdge();
+ h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
+ h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString("");
if ( myIs2D )
{
{
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
-
+ QStringList aVariablesList;
h->SetMaxSize( h_data.myMaxSize );
+ aVariablesList.append(h_data.myMaxSizeVar);
h->SetSecondOrder( h_data.mySecondOrder );
h->SetOptimize( h_data.myOptimize );
int fineness = h_data.myFineness;
h->SetGrowthRate( h_data.myGrowthRate );
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
+
+ aVariablesList.append(h_data.myGrowthRateVar);
+ aVariablesList.append(h_data.myNbSegPerEdgeVar);
+ aVariablesList.append(h_data.myNbSegPerRadiusVar);
}
if ( myIs2D )
if ( !h_2d->_is_nil() )
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
}
+
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+ if( fineness==UserDefined )
+ {
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+ }
+
}
catch(const SALOME::SALOME_Exception& ex)
{
{
h_data.myName = myName ? myName->text() : "";
h_data.myMaxSize = myMaxSize->value();
+ h_data.myMaxSizeVar = myMaxSize->text();
h_data.mySecondOrder = mySecondOrder->isChecked();
h_data.myOptimize = myOptimize->isChecked();
h_data.myFineness = myFineness->currentIndex();
h_data.myGrowthRate = myGrowthRate->value();
h_data.myNbSegPerEdge = myNbSegPerEdge->value();
h_data.myNbSegPerRadius = myNbSegPerRadius->value();
+
+ h_data.myGrowthRateVar = myGrowthRate->text();
+ h_data.myNbSegPerEdgeVar = myNbSegPerEdge->text();
+ h_data.myNbSegPerRadiusVar = myNbSegPerRadius->text();
+
if ( myIs2D )
h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked();