#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Tools.h>
-
#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Notebook.h>
#include <QComboBox>
#include <QLabel>
{
}
-bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg) const
+bool NETGENPluginGUI_HypothesisCreator::checkParams(QString& msg, QStringList& absentParams) const
{
NetgenHypothesisData data_old, data_new;
readParamsFromHypo( data_old );
bool res = storeParamsToHypo( data_new );
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;
+ res = myMaxSize->isValid(msg,absentParams,true) && res;
+ res = myGrowthRate->isValid(msg,absentParams,true) && res; ;
+ res = myNbSegPerEdge->isValid(msg,absentParams,true) && res;
+ res = myNbSegPerRadius->isValid(msg,absentParams,true) && res;
return res;
}
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
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.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.myOptimize = h->GetOptimize();
h_data.myFineness = (int) h->GetFineness();
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.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.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters[3].in()) : QString("");
+ h_data.myNbSegPerRadiusVar = (aParameters->length() > 3) ? QString(aParameters->operator[](3).in()) : QString("");
if ( myIs2D )
{
h_2d->SetQuadAllowed( h_data.myAllowQuadrangles );
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- if( fineness==UserDefined )
- {
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
- }
-
+ getNotebook()->setParameters( h, aVariablesList );
}
catch(const SALOME::SALOME_Exception& ex)
{
NETGENPluginGUI_HypothesisCreator( const QString& );
virtual ~NETGENPluginGUI_HypothesisCreator();
- virtual bool checkParams(QString& msg) const;
+ virtual bool checkParams(QString& msg, QStringList& absentParams) const;
virtual QString helpPage() const;
protected:
// SALOME GUI includes
#include <SalomeApp_Tools.h>
#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_Notebook.h>
// Qt includes
#include <QLabel>
{
}
-bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg) const
+bool NETGENPluginGUI_SimpleCreator::checkParams(QString& msg, QStringList& absentParams) const
{
bool result = true;
- result = myNbSeg->isValid(msg,true) && result;
- result = myLength->isValid(msg,true) && result;
- result = myArea->isValid(msg,true) && result;
+ result = myNbSeg->isValid(msg,absentParams,true) && result;
+ result = myLength->isValid(msg,absentParams,true) && result;
+ result = myArea->isValid(msg,absentParams,true) && result;
if (myVolume)
- result = myVolume->isValid(msg,true) && result;
+ result = myVolume->isValid(msg,absentParams,true) && result;
return result;
}
// set values of hypothesis
- SMESH::ListOfParameters_var aParameters = h->GetLastParameters();
+ SALOME::StringArray* aParameters = h->GetParameters();
// 1D
int nbSeg = isCreation() ? dfltNbSeg : (int) h->GetNumberOfSegments();
if ( nbSeg ) {
myLength->setEnabled( false );
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())
myNbSeg->setValue( nbSeg );
else
else {
myNbSeg->setEnabled( false );
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())
myLength->setValue( h->GetLocalLength() );
else
if ( double area = h->GetMaxElementArea() ) {
myLenFromEdgesCheckBox->setChecked( false );
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())
myArea->setValue( area );
else
if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false );
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())
myVolume->setValue( volume );
else
aVariablesList.append(myLength->text());
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
-
// 2D
if ( myArea->isEnabled() ) {
h->SetMaxElementArea( myArea->value() );
aVariablesList.append(QString());
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
-
// 3D
if ( myVolume ) {
NETGENPlugin_SimpleHypothesis_3D_var h =
valStr += "; lenFromFaces";
aVariablesList.append(QString());
}
- h->SetParameters(aVariablesList.join(":").toLatin1().constData());
}
+
+ getNotebook()->setParameters( h, aVariablesList );
}
catch(const SALOME::SALOME_Exception& ex)
{
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
virtual ~NETGENPluginGUI_SimpleCreator();
- virtual bool checkParams(QString& msg) const;
+ virtual bool checkParams(QString& msg, QStringList& absentParams) const;
virtual QString helpPage() const;
protected: