*** empty log message ***
This commit is contained in:
parent
d32bd5c9d6
commit
f58f52a559
@ -27,6 +27,7 @@
|
|||||||
#include <SMESHGUI_Utils.h>
|
#include <SMESHGUI_Utils.h>
|
||||||
#include <SMESHGUI_HypothesesUtils.h>
|
#include <SMESHGUI_HypothesesUtils.h>
|
||||||
#include <SMESHGUI_SpinBox.h>
|
#include <SMESHGUI_SpinBox.h>
|
||||||
|
#include <SMESHGUI.h>
|
||||||
|
|
||||||
// IDL includes
|
// IDL includes
|
||||||
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
||||||
@ -36,7 +37,7 @@
|
|||||||
|
|
||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
#include <QtxIntSpinBox.h>
|
#include <SalomeApp_IntSpinBox.h>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -129,7 +130,7 @@ QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
|||||||
|
|
||||||
// * number of segments
|
// * number of segments
|
||||||
myNbSegRadioBut = new QRadioButton( tr( "SMESH_NB_SEGMENTS_HYPOTHESIS" ), dimGroup );
|
myNbSegRadioBut = new QRadioButton( tr( "SMESH_NB_SEGMENTS_HYPOTHESIS" ), dimGroup );
|
||||||
myNbSeg = new QtxIntSpinBox( dimGroup );
|
myNbSeg = new SalomeApp_IntSpinBox( dimGroup );
|
||||||
myNbSeg->setMinimum( 1 );
|
myNbSeg->setMinimum( 1 );
|
||||||
myNbSeg->setMaximum( 9999 );
|
myNbSeg->setMaximum( 9999 );
|
||||||
myNbSeg->setValue( 1 );
|
myNbSeg->setValue( 1 );
|
||||||
@ -217,26 +218,41 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
|
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
|
||||||
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
|
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
|
||||||
|
|
||||||
|
SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
|
||||||
|
|
||||||
// 1D
|
// 1D
|
||||||
int nbSeg = (int) h->GetNumberOfSegments();
|
int nbSeg = (int) h->GetNumberOfSegments();
|
||||||
myNbSegRadioBut->setChecked( nbSeg );
|
myNbSegRadioBut->setChecked( nbSeg );
|
||||||
myLengthRadioBut->setChecked( !nbSeg );
|
myLengthRadioBut->setChecked( !nbSeg );
|
||||||
|
QString aPrm;
|
||||||
if ( nbSeg ) {
|
if ( nbSeg ) {
|
||||||
myLength->setEnabled( false );
|
myLength->setEnabled( false );
|
||||||
myNbSeg->setEnabled( true );
|
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 {
|
else {
|
||||||
myNbSeg->setEnabled( false );
|
myNbSeg->setEnabled( false );
|
||||||
myLength->setEnabled( true );
|
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
|
// 2D
|
||||||
if ( double area = h->GetMaxElementArea() ) {
|
if ( double area = h->GetMaxElementArea() ) {
|
||||||
myLenFromEdgesCheckBox->setChecked( false );
|
myLenFromEdgesCheckBox->setChecked( false );
|
||||||
myArea->setEnabled( true );
|
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 {
|
else {
|
||||||
myLenFromEdgesCheckBox->setChecked( true );
|
myLenFromEdgesCheckBox->setChecked( true );
|
||||||
@ -250,7 +266,11 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
if ( double volume = (double) h->GetMaxElementVolume() ) {
|
if ( double volume = (double) h->GetMaxElementVolume() ) {
|
||||||
myLenFromFacesCheckBox->setChecked( false );
|
myLenFromFacesCheckBox->setChecked( false );
|
||||||
myVolume->setEnabled( true );
|
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 {
|
else {
|
||||||
myLenFromFacesCheckBox->setChecked( true );
|
myLenFromFacesCheckBox->setChecked( true );
|
||||||
@ -270,26 +290,37 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
|||||||
if( isCreation() )
|
if( isCreation() )
|
||||||
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() );
|
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 1D
|
// 1D
|
||||||
|
QStringList aVariablesList;
|
||||||
if ( myNbSeg->isEnabled() ) {
|
if ( myNbSeg->isEnabled() ) {
|
||||||
h->SetNumberOfSegments( myNbSeg->value() );
|
h->SetNumberOfSegments( myNbSeg->value() );
|
||||||
valStr += "nbSeg=" + myNbSeg->text();
|
valStr += "nbSeg=" + myNbSeg->text();
|
||||||
|
aVariablesList.append(myNbSeg->text());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
h->SetLocalLength( myLength->value() );
|
h->SetLocalLength( myLength->value() );
|
||||||
valStr += "len=" + myNbSeg->text();
|
valStr += "len=" + myLength->text();
|
||||||
|
aVariablesList.append(myLength->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||||
|
|
||||||
// 2D
|
// 2D
|
||||||
if ( myArea->isEnabled() ) {
|
if ( myArea->isEnabled() ) {
|
||||||
h->SetMaxElementArea( myArea->value() );
|
h->SetMaxElementArea( myArea->value() );
|
||||||
valStr += "; area=" + myArea->text();
|
valStr += "; area=" + myArea->text();
|
||||||
|
aVariablesList.append(myArea->text());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
h->LengthFromEdges();
|
h->LengthFromEdges();
|
||||||
valStr += "; lenFromEdges";
|
valStr += "; lenFromEdges";
|
||||||
|
aVariablesList.append(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||||
|
|
||||||
// 3D
|
// 3D
|
||||||
if ( myVolume ) {
|
if ( myVolume ) {
|
||||||
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
|
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
|
||||||
@ -297,11 +328,15 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
|||||||
if ( myVolume->isEnabled() ) {
|
if ( myVolume->isEnabled() ) {
|
||||||
h->SetMaxElementVolume( myVolume->value() );
|
h->SetMaxElementVolume( myVolume->value() );
|
||||||
valStr += "; vol=" + myVolume->text();
|
valStr += "; vol=" + myVolume->text();
|
||||||
|
aVariablesList.append( myVolume->text());
|
||||||
|
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
h->LengthFromFaces();
|
h->LengthFromFaces();
|
||||||
valStr += "; lenFromFaces";
|
valStr += "; lenFromFaces";
|
||||||
|
aVariablesList.append(QString());
|
||||||
}
|
}
|
||||||
|
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& ex)
|
catch(const SALOME::SALOME_Exception& ex)
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QRadioButton;
|
class QRadioButton;
|
||||||
class QtxIntSpinBox;
|
class SalomeApp_IntSpinBox;
|
||||||
class SMESHGUI_SpinBox;
|
class SMESHGUI_SpinBox;
|
||||||
|
|
||||||
class NETGENPLUGIN_EXPORT NETGENPluginGUI_SimpleCreator : public SMESHGUI_GenericHypothesisCreator
|
class NETGENPLUGIN_EXPORT NETGENPluginGUI_SimpleCreator : public SMESHGUI_GenericHypothesisCreator
|
||||||
@ -60,7 +60,7 @@ protected slots:
|
|||||||
private:
|
private:
|
||||||
QLineEdit * myName;
|
QLineEdit * myName;
|
||||||
|
|
||||||
QtxIntSpinBox* myNbSeg;
|
SalomeApp_IntSpinBox* myNbSeg;
|
||||||
SMESHGUI_SpinBox* myLength;
|
SMESHGUI_SpinBox* myLength;
|
||||||
QRadioButton* myNbSegRadioBut, *myLengthRadioBut;
|
QRadioButton* myNbSegRadioBut, *myLengthRadioBut;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength(CORBA::Double segmentLen
|
|||||||
catch (SALOME_Exception& S_ex) {
|
catch (SALOME_Exception& S_ex) {
|
||||||
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
|
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