First compilable version
This commit is contained in:
parent
10fc3eb3e0
commit
2e650d124a
@ -37,8 +37,8 @@
|
|||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
|
|
||||||
#include <SalomeApp_DoubleSpinBox.h>
|
#include <SalomeApp_DoubleSpinBox.h>
|
||||||
|
#include <SalomeApp_Notebook.h>
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -69,7 +69,7 @@ NETGENPluginGUI_HypothesisCreator::~NETGENPluginGUI_HypothesisCreator()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
|
bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg, QStringList& absentParams) const
|
||||||
{
|
{
|
||||||
NetgenHypothesisData data_old, data_new;
|
NetgenHypothesisData data_old, data_new;
|
||||||
readParamsFromHypo( data_old );
|
readParamsFromHypo( data_old );
|
||||||
@ -77,10 +77,10 @@ bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
|
|||||||
bool res = storeParamsToHypo( data_new );
|
bool res = storeParamsToHypo( data_new );
|
||||||
storeParamsToHypo( data_old );
|
storeParamsToHypo( data_old );
|
||||||
|
|
||||||
res = myMaxSize->isValid(msg,true) && res;
|
res = myMaxSize->isValid(msg,absentParams,true) && res;
|
||||||
res = myGrowthRate->isValid(msg,true) && res; ;
|
res = myGrowthRate->isValid(msg,absentParams,true) && res; ;
|
||||||
res = myNbSegPerEdge->isValid(msg,true) && res;
|
res = myNbSegPerEdge->isValid(msg,absentParams,true) && res;
|
||||||
res = myNbSegPerRadius->isValid(msg,true) && res;
|
res = myNbSegPerRadius->isValid(msg,absentParams,true) && res;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,20 +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();
|
SALOME::StringArray* aParameters = h->GetParameters();
|
||||||
|
|
||||||
h_data.myMaxSize = h->GetMaxSize();
|
h_data.myMaxSize = h->GetMaxSize();
|
||||||
h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
h_data.myMaxSizeVar = (aParameters->length() > 0) ? QString(aParameters->operator[](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.myGrowthRateVar = (aParameters->length() > 1) ? QString(aParameters->operator[](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.myNbSegPerEdgeVar = (aParameters->length() > 2) ? QString(aParameters->operator[](2).in()) : QString("");
|
||||||
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
|
h_data.myNbSegPerRadius = h->GetNbSegPerRadius();
|
||||||
h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString("");
|
h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters->operator[](3).in()) : QString("");
|
||||||
|
|
||||||
if ( myIs2D )
|
if ( myIs2D )
|
||||||
{
|
{
|
||||||
@ -307,14 +307,7 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
|
|||||||
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
|
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
|
||||||
}
|
}
|
||||||
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
getNotebook()->setParameters( h, aVariablesList );
|
||||||
if( fineness==UserDefined )
|
|
||||||
{
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& ex)
|
catch(const SALOME::SALOME_Exception& ex)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,7 @@ public:
|
|||||||
NETGENPluginGUI_HypothesisCreator( const QString& );
|
NETGENPluginGUI_HypothesisCreator( const QString& );
|
||||||
virtual ~NETGENPluginGUI_HypothesisCreator();
|
virtual ~NETGENPluginGUI_HypothesisCreator();
|
||||||
|
|
||||||
virtual bool checkParams(QString& msg) const;
|
virtual bool checkParams(QString& msg, QStringList& absentParams) const;
|
||||||
virtual QString helpPage() const;
|
virtual QString helpPage() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
// SALOME GUI includes
|
// SALOME GUI includes
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
#include <SalomeApp_IntSpinBox.h>
|
#include <SalomeApp_IntSpinBox.h>
|
||||||
|
#include <SalomeApp_Notebook.h>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -83,14 +84,14 @@ NETGENPluginGUI_SimpleCreator::~NETGENPluginGUI_SimpleCreator()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg) const
|
bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg, QStringList& absentParams) const
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
result = myNbSeg->isValid(msg,true) && result;
|
result = myNbSeg->isValid(msg,absentParams,true) && result;
|
||||||
result = myLength->isValid(msg,true) && result;
|
result = myLength->isValid(msg,absentParams,true) && result;
|
||||||
result = myArea->isValid(msg,true) && result;
|
result = myArea->isValid(msg,absentParams,true) && result;
|
||||||
if (myVolume)
|
if (myVolume)
|
||||||
result = myVolume->isValid(msg,true) && result;
|
result = myVolume->isValid(msg,absentParams,true) && result;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -243,7 +244,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
|
|
||||||
// set values of hypothesis
|
// set values of hypothesis
|
||||||
|
|
||||||
SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
|
SALOME::StringArray* aParameters = h->GetParameters();
|
||||||
|
|
||||||
// 1D
|
// 1D
|
||||||
int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments();
|
int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments();
|
||||||
@ -253,7 +254,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
if ( nbSeg ) {
|
if ( nbSeg ) {
|
||||||
myLength->setEnabled( false );
|
myLength->setEnabled( false );
|
||||||
myNbSeg->setEnabled( true );
|
myNbSeg->setEnabled( true );
|
||||||
aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
aPrm = (aParameters->length() > 0) ? QString(aParameters->operator[](0).in()) : QString("");
|
||||||
if(aPrm.isEmpty())
|
if(aPrm.isEmpty())
|
||||||
myNbSeg->setValue( nbSeg );
|
myNbSeg->setValue( nbSeg );
|
||||||
else
|
else
|
||||||
@ -262,7 +263,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
else {
|
else {
|
||||||
myNbSeg->setEnabled( false );
|
myNbSeg->setEnabled( false );
|
||||||
myLength->setEnabled( true );
|
myLength->setEnabled( true );
|
||||||
aPrm = (aParameters->length() > 0) ? QString(aParameters[0].in()) : QString("");
|
aPrm = (aParameters->length() > 0) ? QString(aParameters->operator[](0).in()) : QString("");
|
||||||
if(aPrm.isEmpty())
|
if(aPrm.isEmpty())
|
||||||
myLength->setValue( h->GetLocalLength() );
|
myLength->setValue( h->GetLocalLength() );
|
||||||
else
|
else
|
||||||
@ -273,7 +274,7 @@ void NETGENPluginGUI_SimpleCreator::retrieveParams() const
|
|||||||
if ( double area = h->GetMaxElementArea() ) {
|
if ( double area = h->GetMaxElementArea() ) {
|
||||||
myLenFromEdgesCheckBox->setChecked( false );
|
myLenFromEdgesCheckBox->setChecked( false );
|
||||||
myArea->setEnabled( true );
|
myArea->setEnabled( true );
|
||||||
aPrm = (aParameters->length() > 1) ? QString(aParameters[1].in()) : QString("");
|
aPrm = (aParameters->length() > 1) ? QString(aParameters->operator[](1).in()) : QString("");
|
||||||
if(aPrm.isEmpty())
|
if(aPrm.isEmpty())
|
||||||
myArea->setValue( area );
|
myArea->setValue( area );
|
||||||
else
|
else
|
||||||
@ -290,7 +291,7 @@ 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 );
|
||||||
aPrm = (aParameters->length() > 2) ? QString(aParameters[2].in()) : QString("");
|
aPrm = (aParameters->length() > 2) ? QString(aParameters->operator[](2).in()) : QString("");
|
||||||
if(aPrm.isEmpty())
|
if(aPrm.isEmpty())
|
||||||
myVolume->setValue( volume );
|
myVolume->setValue( volume );
|
||||||
else
|
else
|
||||||
@ -329,8 +330,6 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
|||||||
aVariablesList.append(myLength->text());
|
aVariablesList.append(myLength->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
|
|
||||||
// 2D
|
// 2D
|
||||||
if ( myArea->isEnabled() ) {
|
if ( myArea->isEnabled() ) {
|
||||||
h->SetMaxElementArea( myArea->value() );
|
h->SetMaxElementArea( myArea->value() );
|
||||||
@ -343,8 +342,6 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
|||||||
aVariablesList.append(QString());
|
aVariablesList.append(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
|
|
||||||
// 3D
|
// 3D
|
||||||
if ( myVolume ) {
|
if ( myVolume ) {
|
||||||
NETGENPlugin_SimpleHypothesis_3D_var h =
|
NETGENPlugin_SimpleHypothesis_3D_var h =
|
||||||
@ -359,8 +356,9 @@ QString NETGENPluginGUI_SimpleCreator::storeParams() const
|
|||||||
valStr += "; lenFromFaces";
|
valStr += "; lenFromFaces";
|
||||||
aVariablesList.append(QString());
|
aVariablesList.append(QString());
|
||||||
}
|
}
|
||||||
h->SetParameters(aVariablesList.join(":").toLatin1().constData());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNotebook()->setParameters( h, aVariablesList );
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception& ex)
|
catch(const SALOME::SALOME_Exception& ex)
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
|
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
|
||||||
virtual ~NETGENPluginGUI_SimpleCreator();
|
virtual ~NETGENPluginGUI_SimpleCreator();
|
||||||
|
|
||||||
virtual bool checkParams(QString& msg) const;
|
virtual bool checkParams(QString& msg, QStringList& absentParams) const;
|
||||||
virtual QString helpPage() const;
|
virtual QString helpPage() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user