#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
#include <SMESHGUI_SpinBox.h>
+#include <SMESHGUI.h>
// IDL includes
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
// SALOME GUI includes
#include <SalomeApp_Tools.h>
-#include <QtxIntSpinBox.h>
+#include <SalomeApp_IntSpinBox.h>
// Qt includes
#include <QLabel>
// * number of segments
myNbSegRadioBut = new QRadioButton( tr( "SMESH_NB_SEGMENTS_HYPOTHESIS" ), dimGroup );
- myNbSeg = new QtxIntSpinBox( dimGroup );
+ myNbSeg = new SalomeApp_IntSpinBox( dimGroup );
myNbSeg->setMinimum( 1 );
myNbSeg->setMaximum( 9999 );
myNbSeg->setValue( 1 );
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
+ SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
+
// 1D
int nbSeg = (int) h->GetNumberOfSegments();
myNbSegRadioBut->setChecked( nbSeg );
myLengthRadioBut->setChecked( !nbSeg );
+ QString aPrm;
if ( nbSeg ) {
myLength->setEnabled( false );
myNbSeg->setEnabled( true );
- myNbSeg->setValue( nbSeg );
+ aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
+ if(aPrm.isEmpty())
+ myNbSeg->setValue( nbSeg );
+ else
+ myNbSeg->setText(aPrm);
}
else {
myNbSeg->setEnabled( false );
myLength->setEnabled( true );
- myLength->setValue( h->GetLocalLength() );
+ aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
+ if(aPrm.isEmpty())
+ myLength->setValue( h->GetLocalLength() );
+ else
+ myLength->setText(aPrm);
}
// 2D
if ( double area = h->GetMaxElementArea() ) {
myLenFromEdgesCheckBox->setChecked( false );
myArea->setEnabled( true );
- myArea->setValue( area );
+ aPrm = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
+ if(aPrm.isEmpty())
+ myArea->setValue( area );
+ else
+ myArea->setText( aPrm );
}
else {
myLenFromEdgesCheckBox->setChecked( true );
if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false );
myVolume->setEnabled( true );
- myVolume->setValue( volume );
+ aPrm = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
+ if(aPrm.isEmpty())
+ myVolume->setValue( volume );
+ else
+ myVolume->setText( aPrm );
}
else {
myLenFromFacesCheckBox->setChecked( true );
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() );
+
+
// 1D
+ QStringList aVariablesList;
if ( myNbSeg->isEnabled() ) {
h->SetNumberOfSegments( myNbSeg->value() );
valStr += "nbSeg=" + myNbSeg->text();
+ aVariablesList.append(myNbSeg->text());
}
else {
h->SetLocalLength( myLength->value() );
- valStr += "len=" + myNbSeg->text();
+ valStr += "len=" + myLength->text();
+ aVariablesList.append(myLength->text());
}
+
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
// 2D
if ( myArea->isEnabled() ) {
h->SetMaxElementArea( myArea->value() );
valStr += "; area=" + myArea->text();
+ aVariablesList.append(myArea->text());
}
else {
h->LengthFromEdges();
valStr += "; lenFromEdges";
+ aVariablesList.append(QString());
}
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+
// 3D
if ( myVolume ) {
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
if ( myVolume->isEnabled() ) {
h->SetMaxElementVolume( myVolume->value() );
valStr += "; vol=" + myVolume->text();
+ aVariablesList.append( myVolume->text());
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
}
else {
h->LengthFromFaces();
valStr += "; lenFromFaces";
+ aVariablesList.append(QString());
}
+ h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
}
}
catch(const SALOME::SALOME_Exception& ex)