Merge from BR_DumpPython_Extension branch (from tag mergeto_BR_V5_Dev_28Jan09)
This commit is contained in:
parent
bc77de347b
commit
65c52403fa
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <SMESHGUI_Utils.h>
|
#include <SMESHGUI_Utils.h>
|
||||||
#include <SMESHGUI_HypothesesUtils.h>
|
#include <SMESHGUI_HypothesesUtils.h>
|
||||||
|
#include <SMESHGUI.h>
|
||||||
|
|
||||||
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
|
||||||
|
|
||||||
@ -37,7 +38,7 @@
|
|||||||
|
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
|
|
||||||
#include <QtxDoubleSpinBox.h>
|
#include <SalomeApp_DoubleSpinBox.h>
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -68,13 +69,18 @@ NETGENPluginGUI_HypothesisCreator::~NETGENPluginGUI_HypothesisCreator()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NETGENPluginGUI_HypothesisCreator::checkParams() const
|
bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
|
||||||
{
|
{
|
||||||
NetgenHypothesisData data_old, data_new;
|
NetgenHypothesisData data_old, data_new;
|
||||||
readParamsFromHypo( data_old );
|
readParamsFromHypo( data_old );
|
||||||
readParamsFromWidgets( data_new );
|
readParamsFromWidgets( data_new );
|
||||||
bool res = storeParamsToHypo( data_new );
|
bool res = storeParamsToHypo( data_new );
|
||||||
storeParamsToHypo( data_old );
|
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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,7 +110,7 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
|
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
|
||||||
myMaxSize = new QtxDoubleSpinBox( GroupC1 );
|
myMaxSize = new SalomeApp_DoubleSpinBox( GroupC1 );
|
||||||
myMaxSize->setDecimals( 7 );
|
myMaxSize->setDecimals( 7 );
|
||||||
myMaxSize->setMinimum( 1e-07 );
|
myMaxSize->setMinimum( 1e-07 );
|
||||||
myMaxSize->setMaximum( 1e+06 );
|
myMaxSize->setMaximum( 1e+06 );
|
||||||
@ -126,7 +132,7 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
|||||||
row++;
|
row++;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
|
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->setMinimum( 0.1 );
|
||||||
myGrowthRate->setMaximum( 10 );
|
myGrowthRate->setMaximum( 10 );
|
||||||
myGrowthRate->setSingleStep( 0.1 );
|
myGrowthRate->setSingleStep( 0.1 );
|
||||||
@ -136,14 +142,14 @@ QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
|
|||||||
const double VALUE_MAX = 1.0e+6;
|
const double VALUE_MAX = 1.0e+6;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
|
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->setMinimum( 0.2 );
|
||||||
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
||||||
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
|
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
|
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->setMinimum( 0.2 );
|
||||||
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
|
||||||
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
|
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
|
||||||
@ -173,13 +179,30 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const
|
|||||||
|
|
||||||
if( myName )
|
if( myName )
|
||||||
myName->setText( data.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 );
|
mySecondOrder->setChecked( data.mySecondOrder );
|
||||||
myOptimize->setChecked( data.myOptimize );
|
myOptimize->setChecked( data.myOptimize );
|
||||||
myFineness->setCurrentIndex( data.myFineness );
|
myFineness->setCurrentIndex( data.myFineness );
|
||||||
myGrowthRate->setValue( data.myGrowthRate );
|
|
||||||
myNbSegPerEdge->setValue( data.myNbSegPerEdge );
|
if(data.myGrowthRateVar.isEmpty())
|
||||||
myNbSegPerRadius->setValue( data.myNbSegPerRadius );
|
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)
|
if (myIs2D)
|
||||||
myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
|
myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
|
||||||
|
|
||||||
@ -219,14 +242,20 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromHypo( NetgenHypothesisData
|
|||||||
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
|
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
|
||||||
h_data.myName = isCreation() && data ? data->Label : "";
|
h_data.myName = isCreation() && data ? data->Label : "";
|
||||||
|
|
||||||
|
SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
|
||||||
|
|
||||||
h_data.myMaxSize = h->GetMaxSize();
|
h_data.myMaxSize = h->GetMaxSize();
|
||||||
|
h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
||||||
h_data.mySecondOrder = h->GetSecondOrder();
|
h_data.mySecondOrder = h->GetSecondOrder();
|
||||||
h_data.myOptimize = h->GetOptimize();
|
h_data.myOptimize = h->GetOptimize();
|
||||||
|
|
||||||
h_data.myFineness = (int) h->GetFineness();
|
h_data.myFineness = (int) h->GetFineness();
|
||||||
h_data.myGrowthRate = h->GetGrowthRate();
|
h_data.myGrowthRate = h->GetGrowthRate();
|
||||||
|
h_data.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
|
||||||
h_data.myNbSegPerEdge = h->GetNbSegPerEdge();
|
h_data.myNbSegPerEdge = h->GetNbSegPerEdge();
|
||||||
|
h_data.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
|
||||||
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
|
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
|
||||||
|
h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString("");
|
||||||
|
|
||||||
if ( myIs2D )
|
if ( myIs2D )
|
||||||
{
|
{
|
||||||
@ -250,8 +279,9 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
|
|||||||
{
|
{
|
||||||
if( isCreation() )
|
if( isCreation() )
|
||||||
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
|
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
|
||||||
|
QStringList aVariablesList;
|
||||||
h->SetMaxSize( h_data.myMaxSize );
|
h->SetMaxSize( h_data.myMaxSize );
|
||||||
|
aVariablesList.append(h_data.myMaxSizeVar);
|
||||||
h->SetSecondOrder( h_data.mySecondOrder );
|
h->SetSecondOrder( h_data.mySecondOrder );
|
||||||
h->SetOptimize( h_data.myOptimize );
|
h->SetOptimize( h_data.myOptimize );
|
||||||
int fineness = h_data.myFineness;
|
int fineness = h_data.myFineness;
|
||||||
@ -262,6 +292,10 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
|
|||||||
h->SetGrowthRate( h_data.myGrowthRate );
|
h->SetGrowthRate( h_data.myGrowthRate );
|
||||||
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
|
h->SetNbSegPerEdge( h_data.myNbSegPerEdge );
|
||||||
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
|
h->SetNbSegPerRadius( h_data.myNbSegPerRadius );
|
||||||
|
|
||||||
|
aVariablesList.append(h_data.myGrowthRateVar);
|
||||||
|
aVariablesList.append(h_data.myNbSegPerEdgeVar);
|
||||||
|
aVariablesList.append(h_data.myNbSegPerRadiusVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( myIs2D )
|
if ( myIs2D )
|
||||||
@ -272,6 +306,15 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
|
|||||||
if ( !h_2d->_is_nil() )
|
if ( !h_2d->_is_nil() )
|
||||||
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
|
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)
|
catch(const SALOME::SALOME_Exception& ex)
|
||||||
{
|
{
|
||||||
@ -285,6 +328,7 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD
|
|||||||
{
|
{
|
||||||
h_data.myName = myName ? myName->text() : "";
|
h_data.myName = myName ? myName->text() : "";
|
||||||
h_data.myMaxSize = myMaxSize->value();
|
h_data.myMaxSize = myMaxSize->value();
|
||||||
|
h_data.myMaxSizeVar = myMaxSize->text();
|
||||||
h_data.mySecondOrder = mySecondOrder->isChecked();
|
h_data.mySecondOrder = mySecondOrder->isChecked();
|
||||||
h_data.myOptimize = myOptimize->isChecked();
|
h_data.myOptimize = myOptimize->isChecked();
|
||||||
h_data.myFineness = myFineness->currentIndex();
|
h_data.myFineness = myFineness->currentIndex();
|
||||||
@ -292,6 +336,11 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD
|
|||||||
h_data.myNbSegPerEdge = myNbSegPerEdge->value();
|
h_data.myNbSegPerEdge = myNbSegPerEdge->value();
|
||||||
h_data.myNbSegPerRadius = myNbSegPerRadius->value();
|
h_data.myNbSegPerRadius = myNbSegPerRadius->value();
|
||||||
|
|
||||||
|
h_data.myGrowthRateVar = myGrowthRate->text();
|
||||||
|
h_data.myNbSegPerEdgeVar = myNbSegPerEdge->text();
|
||||||
|
h_data.myNbSegPerRadiusVar = myNbSegPerRadius->text();
|
||||||
|
|
||||||
|
|
||||||
if ( myIs2D )
|
if ( myIs2D )
|
||||||
h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked();
|
h_data.myAllowQuadrangles = myAllowQuadrangles->isChecked();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include <SMESHGUI_Hypotheses.h>
|
#include <SMESHGUI_Hypotheses.h>
|
||||||
|
|
||||||
class QtxDoubleSpinBox;
|
class SalomeApp_DoubleSpinBox;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
@ -43,6 +43,7 @@ typedef struct
|
|||||||
int myFineness;
|
int myFineness;
|
||||||
bool mySecondOrder, myAllowQuadrangles, myOptimize;
|
bool mySecondOrder, myAllowQuadrangles, myOptimize;
|
||||||
QString myName;
|
QString myName;
|
||||||
|
QString myMaxSizeVar, myGrowthRateVar, myNbSegPerEdgeVar, myNbSegPerRadiusVar;
|
||||||
} NetgenHypothesisData;
|
} NetgenHypothesisData;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -56,7 +57,7 @@ public:
|
|||||||
NETGENPluginGUI_HypothesisCreator( const QString& );
|
NETGENPluginGUI_HypothesisCreator( const QString& );
|
||||||
virtual ~NETGENPluginGUI_HypothesisCreator();
|
virtual ~NETGENPluginGUI_HypothesisCreator();
|
||||||
|
|
||||||
virtual bool checkParams() const;
|
virtual bool checkParams(QString& msg) const;
|
||||||
virtual QString helpPage() const;
|
virtual QString helpPage() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -78,13 +79,13 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QLineEdit* myName;
|
QLineEdit* myName;
|
||||||
QtxDoubleSpinBox* myMaxSize;
|
SalomeApp_DoubleSpinBox* myMaxSize;
|
||||||
QCheckBox* mySecondOrder;
|
QCheckBox* mySecondOrder;
|
||||||
QCheckBox* myOptimize;
|
QCheckBox* myOptimize;
|
||||||
QComboBox* myFineness;
|
QComboBox* myFineness;
|
||||||
QtxDoubleSpinBox* myGrowthRate;
|
SalomeApp_DoubleSpinBox* myGrowthRate;
|
||||||
QtxDoubleSpinBox* myNbSegPerEdge;
|
SalomeApp_DoubleSpinBox* myNbSegPerEdge;
|
||||||
QtxDoubleSpinBox* myNbSegPerRadius;
|
SalomeApp_DoubleSpinBox* myNbSegPerRadius;
|
||||||
QCheckBox* myAllowQuadrangles;
|
QCheckBox* myAllowQuadrangles;
|
||||||
|
|
||||||
bool myIs2D;
|
bool myIs2D;
|
||||||
|
@ -28,6 +28,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)
|
||||||
@ -37,7 +38,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>
|
||||||
@ -82,9 +83,16 @@ NETGENPluginGUI_SimpleCreator::~NETGENPluginGUI_SimpleCreator()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NETGENPluginGUI_SimpleCreator::checkParams() const
|
bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg) const
|
||||||
{
|
{
|
||||||
return true;
|
bool result = true;
|
||||||
|
result = myNbSeg->isValid(msg,true) && result;
|
||||||
|
result = myLength->isValid(msg,true) && result;
|
||||||
|
result = myArea->isValid(msg,true) && result;
|
||||||
|
if (myVolume)
|
||||||
|
result = myVolume->isValid(msg,true) && result;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
|
||||||
@ -132,7 +140,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 );
|
||||||
@ -237,26 +245,41 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
|
|
||||||
// set values of hypothesis
|
// set values of hypothesis
|
||||||
|
|
||||||
|
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 );
|
||||||
@ -269,7 +292,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 );
|
||||||
@ -289,26 +316,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_SimpleHypothesis_3D_var h =
|
NETGENPlugin_SimpleHypothesis_3D_var h =
|
||||||
@ -316,11 +354,14 @@ 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());
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
@ -33,7 +33,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_GUI_EXPORT NETGENPluginGUI_SimpleCreator :
|
class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_SimpleCreator :
|
||||||
@ -45,7 +45,7 @@ public:
|
|||||||
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
|
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
|
||||||
virtual ~NETGENPluginGUI_SimpleCreator();
|
virtual ~NETGENPluginGUI_SimpleCreator();
|
||||||
|
|
||||||
virtual bool checkParams() const;
|
virtual bool checkParams(QString& msg) const;
|
||||||
virtual QString helpPage() const;
|
virtual QString helpPage() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -63,7 +63,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;
|
||||||
|
|
||||||
|
@ -115,7 +115,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