*** empty log message ***
This commit is contained in:
parent
d32bd5c9d6
commit
f58f52a559
@ -27,6 +27,7 @@
|
||||
#include <SMESHGUI_Utils.h>
|
||||
#include <SMESHGUI_HypothesesUtils.h>
|
||||
#include <SMESHGUI_SpinBox.h>
|
||||
#include <SMESHGUI.h>
|
||||
|
||||
// IDL includes
|
||||
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
||||
@ -36,7 +37,7 @@
|
||||
|
||||
// SALOME GUI includes
|
||||
#include <SalomeApp_Tools.h>
|
||||
#include <QtxIntSpinBox.h>
|
||||
#include <SalomeApp_IntSpinBox.h>
|
||||
|
||||
// Qt includes
|
||||
#include <QLabel>
|
||||
@ -129,7 +130,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
||||
|
||||
// * 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 );
|
||||
@ -217,26 +218,41 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
||||
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 );
|
||||
@ -250,7 +266,11 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
||||
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 );
|
||||
@ -270,26 +290,37 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
||||
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 =
|
||||
@ -297,11 +328,15 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
||||
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)
|
||||
|
@ -31,7 +31,7 @@
|
||||
class QCheckBox;
|
||||
class QLineEdit;
|
||||
class QRadioButton;
|
||||
class QtxIntSpinBox;
|
||||
class SalomeApp_IntSpinBox;
|
||||
class SMESHGUI_SpinBox;
|
||||
|
||||
class NETGENPLUGIN_EXPORT NETGENPluginGUI_SimpleCreator : public SMESHGUI_GenericHypothesisCreator
|
||||
@ -60,7 +60,7 @@ protected slots:
|
||||
private:
|
||||
QLineEdit * myName;
|
||||
|
||||
QtxIntSpinBox* myNbSeg;
|
||||
SalomeApp_IntSpinBox* myNbSeg;
|
||||
SMESHGUI_SpinBox* myLength;
|
||||
QRadioButton* myNbSegRadioBut, *myLengthRadioBut;
|
||||
|
||||
|
@ -114,7 +114,7 @@ void NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength(CORBA::Double segmentLen
|
||||
catch (SALOME_Exception& S_ex) {
|
||||
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
|
||||
}
|
||||
SMESH::TPythonDump() << _this() << ".LocalLength( " << segmentLength << " )";
|
||||
SMESH::TPythonDump() << _this() << ".SetLocalLength( " << segmentLength << " )";
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user