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.myMaxSizeVar = getVariableName("SetMaxSize");
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.myGrowthRateVar = getVariableName("SetGrowthRate");
h_data.myNbSegPerEdge = h->GetNbSegPerEdge();
- h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
+ h_data.myNbSegPerEdgeVar = getVariableName("SetNbSegPerEdge");
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
- h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString("");
+ h_data.myNbSegPerRadiusVar = getVariableName("SetNbSegPerRadius");
h_data.myMinSize = h->GetMinSize();
- h_data.myMinSizeVar = (aParameters->length() > 4) ? QString(aParameters[4].in()) : QString("");
+ h_data.myMinSizeVar = getVariableName("SetMinSize");
if ( myIs2D )
{
}
that->myLocalSizeMap[entry] = valstring;
}
-
+
return true;
}
{
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
- QStringList aVariablesList;
+ h->SetVarParameter( h_data.myMaxSizeVar.toLatin1().constData(), "SetMaxSize");
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;
if( fineness==UserDefined )
{
+ h->SetVarParameter( h_data.myGrowthRateVar.toLatin1().constData(), "SetGrowthRate");
h->SetGrowthRate( h_data.myGrowthRate );
+ h->SetVarParameter( h_data.myNbSegPerEdgeVar.toLatin1().constData(), "SetNbSegPerEdge");
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
+ h->SetVarParameter( h_data.myNbSegPerRadiusVar.toLatin1().constData(), "SetNbSegPerRadius");
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
-
- aVariablesList.append(h_data.myGrowthRateVar);
- aVariablesList.append(h_data.myNbSegPerEdgeVar);
- aVariablesList.append(h_data.myNbSegPerRadiusVar);
}
+ h->SetVarParameter( h_data.myMinSizeVar.toLatin1().constData(), "SetMinSize");
h->SetMinSize( h_data.myMinSize );
- aVariablesList.append(h_data.myMinSizeVar);
if ( myIs2D )
{
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- if( fineness==UserDefined )
- {
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- }
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
-
QMapIterator<QString,QString> i(myLocalSizeMap);
while (i.hasNext()) {
i.next();
if ( nbSeg ) {
myLength->setEnabled( false );
myNbSeg->setEnabled( true );
- aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
+ aPrm = getVariableName("SetNumberOfSegments");
if(aPrm.isEmpty())
myNbSeg->setValue( nbSeg );
else
else {
myNbSeg->setEnabled( false );
myLength->setEnabled( true );
- aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
+ aPrm = getVariableName("SetLocalLength");
if(aPrm.isEmpty())
myLength->setValue( h->GetLocalLength() );
else
if ( double area = h->GetMaxElementArea() ) {
myLenFromEdgesCheckBox->setChecked( false );
myArea->setEnabled( true );
- aPrm = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
+ aPrm = getVariableName("SetMaxElementArea");
if(aPrm.isEmpty())
myArea->setValue( area );
else
if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false );
myVolume->setEnabled( true );
- aPrm = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
+ aPrm = getVariableName("SetMaxElementVolume");
if(aPrm.isEmpty())
myVolume->setValue( volume );
else
// 1D
- QStringList aVariablesList;
if ( myNbSeg->isEnabled() ) {
+ h->SetVarParameter( myNbSeg->text().toLatin1().constData(), "SetNumberOfSegments");
h->SetNumberOfSegments( myNbSeg->value() );
valStr += "nbSeg=" + myNbSeg->text();
- aVariablesList.append(myNbSeg->text());
}
else {
+ h->SetVarParameter( myLength->text().toLatin1().constData(), "SetLocalLength");
h->SetLocalLength( myLength->value() );
valStr += "len=" + myLength->text();
- aVariablesList.append(myLength->text());
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
-
// 2D
if ( myArea->isEnabled() ) {
+ h->SetVarParameter( myArea->text().toLatin1().constData(), "SetMaxElementArea");
h->SetMaxElementArea( myArea->value() );
valStr += "; area=" + myArea->text();
- aVariablesList.append(myArea->text());
}
else {
h->LengthFromEdges();
valStr += "; lenFromEdges";
- aVariablesList.append(QString());
}
if ( myAllowQuadCheckBox )
h->SetAllowQuadrangles( myAllowQuadCheckBox->isChecked() );
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
-
// 3D
if ( myVolume ) {
NETGENPlugin_SimpleHypothesis_3D_var h =
NETGENPlugin_SimpleHypothesis_3D::_narrow( hypothesis() );
if ( myVolume->isEnabled() ) {
+ h->SetVarParameter( myVolume->text().toLatin1().constData(), "SetMaxElementVolume");
h->SetMaxElementVolume( myVolume->value() );
valStr += "; vol=" + myVolume->text();
- aVariablesList.append( myVolume->text());
}
else {
h->LengthFromFaces();
valStr += "; lenFromFaces";
- aVariablesList.append(QString());
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
}
}
catch(const SALOME::SALOME_Exception& ex)