*/
void SetKeepFiles(in boolean toKeep);
boolean GetKeepFiles();
+ /*!
+ * Verbose level [0-10]
+ * 0 - no standard output,
+ * 2 - prints the data, quality statistics of the skin and final meshes and
+ * indicates when the final mesh is being saved. In addition the software
+ * gives indication regarding the CPU time.
+ * 10 - same as 2 plus the main steps in the computation, quality statistics
+ * histogram of the skin mesh, quality statistics histogram together with
+ * the characteristics of the final mesh.
+ */
+ void SetVerboseLevel(in short level);
+ short GetVerboseLevel();
+ /*!
+ * To create new nodes
+ */
+ void SetToCreateNewNodes(in boolean toCreate);
+ boolean GetToCreateNewNodes();
+ /*!
+ * To use boundary recovery version which tries to create mesh on a very poor
+ * quality surface mesh
+ */
+ void SetToUseBoundaryRecoveryVersion(in boolean toUse);
+ boolean GetToUseBoundaryRecoveryVersion();
+ /*!
+ * To set hiden/undocumented/advanced options
+ */
+ void SetTextOption(in string option);
+ string GetTextOption();
};
};
}
return error(COMPERR_BAD_INPUT_MESH);
}
+ OSD_File( aResultFileName ).Remove(); // needed for boundary recovery module usage
// -----------------
// run ghs3d mesher
}
return error(COMPERR_BAD_INPUT_MESH);
}
+ OSD_File( aResultFileName ).Remove(); // needed for boundary recovery module usage
// -----------------
// run ghs3d mesher
_name = "GHS3D_Parameters";
_param_algo_dim = 3;
- myToMeshHoles = DefaultMeshHoles();
- myMaximumMemory = -1;//DefaultMaximumMemory();
- myInitialMemory = -1;//DefaultInitialMemory();
- myOptimizationLevel = DefaultOptimizationLevel();
- myWorkingDirectory = DefaultWorkingDirectory();
- myKeepFiles = DefaultKeepFiles();
+ myToMeshHoles = DefaultMeshHoles();
+ myMaximumMemory = -1;//DefaultMaximumMemory();
+ myInitialMemory = -1;//DefaultInitialMemory();
+ myOptimizationLevel = DefaultOptimizationLevel();
+ myWorkingDirectory = DefaultWorkingDirectory();
+ myKeepFiles = DefaultKeepFiles();
+ myVerboseLevel = DefaultVerboseLevel();
+ myToCreateNewNodes = DefaultToCreateNewNodes();
+ myToUseBoundaryRecoveryVersion = DefaultToUseBoundaryRecoveryVersion();
}
//=======================================================================
//function : SetWorkingDirectory
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetWorkingDirectory(string path)
+void GHS3DPlugin_Hypothesis::SetWorkingDirectory(const string& path)
{
if ( myWorkingDirectory != path ) {
myWorkingDirectory = path;
return myKeepFiles;
}
+//=======================================================================
+//function : SetVerboseLevel
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetVerboseLevel(short level)
+{
+ if ( myVerboseLevel != level ) {
+ myVerboseLevel = level;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetVerboseLevel
+//=======================================================================
+
+short GHS3DPlugin_Hypothesis::GetVerboseLevel() const
+{
+ return myVerboseLevel;
+}
+
+//=======================================================================
+//function : SetToCreateNewNodes
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetToCreateNewNodes(bool toCreate)
+{
+ if ( myToCreateNewNodes != toCreate ) {
+ myToCreateNewNodes = toCreate;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetToCreateNewNodes
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetToCreateNewNodes() const
+{
+ return myToCreateNewNodes;
+}
+
+//=======================================================================
+//function : SetToUseBoundaryRecoveryVersion
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetToUseBoundaryRecoveryVersion(bool toUse)
+{
+ if ( myToUseBoundaryRecoveryVersion != toUse ) {
+ myToUseBoundaryRecoveryVersion = toUse;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetToUseBoundaryRecoveryVersion
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::GetToUseBoundaryRecoveryVersion() const
+{
+ return myToUseBoundaryRecoveryVersion;
+}
+
+//=======================================================================
+//function : SetTextOption
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetTextOption(const string& option)
+{
+ if ( myTextOption != option ) {
+ myTextOption = option;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetTextOption
+//=======================================================================
+
+string GHS3DPlugin_Hypothesis::GetTextOption() const
+{
+ return myTextOption;
+}
+
+
//=======================================================================
//function : DefaultMeshHoles
//=======================================================================
return false;
}
+//=======================================================================
+//function : DefaultVerboseLevel
+//=======================================================================
+
+short GHS3DPlugin_Hypothesis::DefaultVerboseLevel()
+{
+ return 10;
+}
+
+//=======================================================================
+//function : DefaultToCreateNewNodes
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::DefaultToCreateNewNodes()
+{
+ return true;
+}
+
+//=======================================================================
+//function : DefaultToUseBoundaryRecoveryVersion
+//=======================================================================
+
+bool GHS3DPlugin_Hypothesis::DefaultToUseBoundaryRecoveryVersion()
+{
+ return false;
+}
+
//=======================================================================
//function : SaveTo
//=======================================================================
ostream & GHS3DPlugin_Hypothesis::SaveTo(ostream & save)
{
- save << (int) myToMeshHoles << " ";
- save << myMaximumMemory << " ";
- save << myInitialMemory << " ";
- save << myOptimizationLevel << " ";
- save << myWorkingDirectory << " ";
- save << (int)myKeepFiles << " ";
+ save << (int) myToMeshHoles << " ";
+ save << myMaximumMemory << " ";
+ save << myInitialMemory << " ";
+ save << myOptimizationLevel << " ";
+ save << myWorkingDirectory << " ";
+ save << (int)myKeepFiles << " ";
+ save << myVerboseLevel << " ";
+ save << (int)myToCreateNewNodes << " ";
+ save << (int)myToUseBoundaryRecoveryVersion << " ";
+ save << myTextOption << " ";
return save;
}
if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty
myKeepFiles = false;
myWorkingDirectory.clear();
- return load;
}
else if ( myWorkingDirectory == "1" ) {
myKeepFiles = true;
myWorkingDirectory.clear();
- return load;
}
}
else
load.clear(ios::badbit | load.rdstate());
+ if ( !myWorkingDirectory.empty() ) {
+ isOK = (load >> i);
+ if (isOK)
+ myKeepFiles = i;
+ else
+ load.clear(ios::badbit | load.rdstate());
+ }
+
isOK = (load >> i);
if (isOK)
- myKeepFiles = i;
+ myVerboseLevel = (short) i;
+ else
+ load.clear(ios::badbit | load.rdstate());
+
+ isOK = (load >> i);
+ if (isOK)
+ myToCreateNewNodes = (bool) i;
+ else
+ load.clear(ios::badbit | load.rdstate());
+
+ isOK = (load >> myTextOption);
+ if (isOK)
+ ;
else
load.clear(ios::badbit | load.rdstate());
#else
TCollection_AsciiString cmd( "ghs3d.exe" );
#endif
+ // check if any option is overridden by hyp->myTextOption
+ bool m = hyp ? ( hyp->myTextOption.find("-m") == string::npos ) : true;
+ bool M = hyp ? ( hyp->myTextOption.find("-M") == string::npos ) : true;
+ bool c = hyp ? ( hyp->myTextOption.find("-c") == string::npos ) : true;
+ bool o = hyp ? ( hyp->myTextOption.find("-o") == string::npos ) : true;
+ bool p0= hyp ? ( hyp->myTextOption.find("-p0")== string::npos ) : true;
+ bool C = hyp ? ( hyp->myTextOption.find("-C") == string::npos ) : true;
+ bool v = hyp ? ( hyp->myTextOption.find("-v") == string::npos ) : true;
+
+ // if use boundary recovery version, few options are allowed
+ bool useBndRecovery = !C;
+ if ( !useBndRecovery && hyp )
+ useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
// ghs3d needs to know amount of memory it may use (MB).
// Default memory is defined at ghs3d installation but it may be not enough,
// so allow to use about all available memory
- short aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
- cmd += " -m ";
- if ( aMaximumMemory < 0 )
- cmd += DefaultMaximumMemory();
- else
- cmd += aMaximumMemory;
- short aInitialMemory = hyp ? hyp->myInitialMemory : -1;
- cmd += " -M ";
- if ( aInitialMemory > 0 )
- cmd += aInitialMemory;
- else
- cmd += "100";
-
+ if ( m ) {
+ short aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
+ cmd += " -m ";
+ if ( aMaximumMemory < 0 )
+ cmd += DefaultMaximumMemory();
+ else
+ cmd += aMaximumMemory;
+ }
+ if ( M && !useBndRecovery ) {
+ short aInitialMemory = hyp ? hyp->myInitialMemory : -1;
+ cmd += " -M ";
+ if ( aInitialMemory > 0 )
+ cmd += aInitialMemory;
+ else
+ cmd += "100";
+ }
// component to mesh
// 0 , all components to be meshed
// 1 , only the main ( outermost ) component to be meshed
- bool aToMeshHoles = hyp ? hyp->myToMeshHoles : DefaultMeshHoles();
- if ( aToMeshHoles )
- cmd += " -c 0";
- else
- cmd += " -c 1";
+ if ( c && !useBndRecovery ) {
+ bool aToMeshHoles = hyp ? hyp->myToMeshHoles : DefaultMeshHoles();
+ if ( aToMeshHoles )
+ cmd += " -c 0";
+ else
+ cmd += " -c 1";
+ }
// optimization level
- short aOptimizationLevel = hyp ? hyp->myOptimizationLevel : DefaultOptimizationLevel();
- if ( aOptimizationLevel >= 0 && aOptimizationLevel < 4 ) {
- char* level[] = { "none" , "light" , "standard" , "strong" };
- cmd += " -o ";
- cmd += level[ aOptimizationLevel ];
+ if ( o && hyp && !useBndRecovery ) {
+ if ( hyp->myOptimizationLevel >= 0 && hyp->myOptimizationLevel < 4 ) {
+ char* level[] = { "none" , "light" , "standard" , "strong" };
+ cmd += " -o ";
+ cmd += level[ hyp->myOptimizationLevel ];
+ }
+ }
+
+ // to create internal nodes
+ if ( p0 && hyp && !hyp->myToCreateNewNodes ) {
+ cmd += " -p0";
+ }
+
+ // verbose mode
+ if ( v && hyp ) {
+ cmd += " -v ";
+ cmd += hyp->myVerboseLevel;
+ }
+
+ // boundary recovery version
+ if ( useBndRecovery ) {
+ cmd += " -C";
+ }
+
+ // options as text
+ if ( hyp && !hyp->myTextOption.empty() ) {
+ cmd += " ";
+ cmd += (char*) hyp->myTextOption.c_str();
}
return cmd.ToCString();
/*!
* Path to working directory
*/
- void SetWorkingDirectory(string path);
+ void SetWorkingDirectory(const string& path);
string GetWorkingDirectory() const;
/*!
* To keep working files or remove them. Log file remains in case of errors anyway.
*/
void SetKeepFiles(bool toKeep);
bool GetKeepFiles() const;
+ /*!
+ * Verbose level [0-10]
+ * 0 - no standard output,
+ * 2 - prints the data, quality statistics of the skin and final meshes and
+ * indicates when the final mesh is being saved. In addition the software
+ * gives indication regarding the CPU time.
+ * 10 - same as 2 plus the main steps in the computation, quality statistics
+ * histogram of the skin mesh, quality statistics histogram together with
+ * the characteristics of the final mesh.
+ */
+ void SetVerboseLevel(short level);
+ short GetVerboseLevel() const;
+ /*!
+ * To create new nodes
+ */
+ void SetToCreateNewNodes(bool toCreate);
+ bool GetToCreateNewNodes() const;
+ /*!
+ * To use boundary recovery version which tries to create mesh on a very poor
+ * quality surface mesh
+ */
+ void SetToUseBoundaryRecoveryVersion(bool toUse);
+ bool GetToUseBoundaryRecoveryVersion() const;
+ /*!
+ * To set hiden/undocumented/advanced options
+ */
+ void SetTextOption(const string& option);
+ string GetTextOption() const;
static bool DefaultMeshHoles();
static short DefaultMaximumMemory();
static short DefaultOptimizationLevel();
static string DefaultWorkingDirectory();
static bool DefaultKeepFiles();
+ static short DefaultVerboseLevel();
+ static bool DefaultToCreateNewNodes();
+ static bool DefaultToUseBoundaryRecoveryVersion();
/*!
* \brief Return command to run ghs3d mesher excluding file prefix (-f)
/*!
* \brief Does nothing
- * \param theMesh - the built mesh
- * \param theShape - the geometry of interest
- * \retval bool - always false
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
private:
- bool myToMeshHoles;
- short myMaximumMemory;
- short myInitialMemory;
- short myOptimizationLevel;
- std::string myWorkingDirectory;
- bool myKeepFiles;
+ bool myToMeshHoles;
+ short myMaximumMemory;
+ short myInitialMemory;
+ short myOptimizationLevel;
+ bool myKeepFiles;
+ string myWorkingDirectory;
+ short myVerboseLevel;
+ bool myToCreateNewNodes;
+ bool myToUseBoundaryRecoveryVersion;
+ string myTextOption;
+
};
return this->GetImpl()->GetKeepFiles();
}
+//=======================================================================
+//function : SetVerboseLevel
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetVerboseLevel(CORBA::Short level)
+ throw ( SALOME::SALOME_Exception )
+{
+ if (level < 0 || level > 10 )
+ THROW_SALOME_CORBA_EXCEPTION( "Invalid verbose level, valid range is [0-10]",
+ SALOME::BAD_PARAM );
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetVerboseLevel(level);
+ SMESH::TPythonDump() << _this() << ".SetVerboseLevel( " << level << " )";
+}
+
+//=======================================================================
+//function : GetVerboseLevel
+//=======================================================================
+
+CORBA::Short GHS3DPlugin_Hypothesis_i::GetVerboseLevel()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetVerboseLevel();
+}
+
+//=======================================================================
+//function : SetToCreateNewNodes
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetToCreateNewNodes(CORBA::Boolean toCreate)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetToCreateNewNodes(toCreate);
+ SMESH::TPythonDump() << _this() << ".SetToCreateNewNodes( " << toCreate << " )";
+}
+
+//=======================================================================
+//function : GetToCreateNewNodes
+//=======================================================================
+
+CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToCreateNewNodes()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetToCreateNewNodes();
+}
+
+//=======================================================================
+//function : SetToUseBoundaryRecoveryVersion
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetToUseBoundaryRecoveryVersion(toUse);
+ SMESH::TPythonDump() << _this() << ".SetToUseBoundaryRecoveryVersion( " << toUse << " )";
+}
+
+//=======================================================================
+//function : GetToUseBoundaryRecoveryVersion
+//=======================================================================
+
+CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToUseBoundaryRecoveryVersion()
+{
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetToUseBoundaryRecoveryVersion();
+}
+
+//=======================================================================
+//function : SetTextOption
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetTextOption(const char* option)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetTextOption(option);
+ SMESH::TPythonDump() << _this() << ".SetTextOption( '" << option << "' )";
+}
+
+//=======================================================================
+//function : GetTextOption
+//=======================================================================
+
+char* GHS3DPlugin_Hypothesis_i::GetTextOption()
+{
+ ASSERT(myBaseImpl);
+ return CORBA::string_dup( this->GetImpl()->GetTextOption().c_str() );
+}
+
//=============================================================================
/*!
- * GHS3DPlugin_Hypothesis_i::GetImpl
- *
* Get implementation
*/
//=============================================================================
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
- * \param type - dimension (see SMESH::Dimension enumeration)
- * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
- *
- * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
*/
void SetKeepFiles(CORBA::Boolean toKeep);
CORBA::Boolean GetKeepFiles();
+ /*!
+ * Verbose level [0-10]
+ * 0 - no standard output,
+ * 2 - prints the data, quality statistics of the skin and final meshes and
+ * indicates when the final mesh is being saved. In addition the software
+ * gives indication regarding the CPU time.
+ * 10 - same as 2 plus the main steps in the computation, quality statistics
+ * histogram of the skin mesh, quality statistics histogram together with
+ * the characteristics of the final mesh.
+ */
+ void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
+ CORBA::Short GetVerboseLevel();
+ /*!
+ * To create new nodes
+ */
+ void SetToCreateNewNodes(CORBA::Boolean toCreate);
+ CORBA::Boolean GetToCreateNewNodes();
+ /*!
+ * To use boundary recovery version which tries to create mesh on a very poor
+ * quality surface mesh
+ */
+ void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
+ CORBA::Boolean GetToUseBoundaryRecoveryVersion();
+ /*!
+ * To set hiden/undocumented/advanced options
+ */
+ void SetTextOption(const char* option);
+ char* GetTextOption();
// Get implementation
::GHS3DPlugin_Hypothesis* GetImpl();
// advanced parameters
myAdvGroup = new QGroupBox( 3, Qt::Horizontal, fr, "myAdvGroup" );
lay->addWidget( myAdvGroup );
+ QFrame* anAdvFrame = new QFrame(myAdvGroup, "anAdvFrame");
+ QGridLayout* anAdvLayout = new QGridLayout(anAdvFrame, 8, 3);
+ anAdvLayout->setSpacing(6);
+ anAdvLayout->setAutoAdd(false);
- myMaximumMemoryCheck = new QCheckBox( tr("MAX_MEMORY_SIZE"), myAdvGroup );
+ myMaximumMemoryCheck = new QCheckBox( tr("MAX_MEMORY_SIZE"), anAdvFrame );
- myMaximumMemorySpin = new QSpinBox( myAdvGroup );
+ myMaximumMemorySpin = new QSpinBox( anAdvFrame );
myMaximumMemorySpin->setMinValue( 1 );
myMaximumMemorySpin->setMaxValue( maxAvailableMemory() );
myMaximumMemorySpin->setLineStep( 10 );
- new QLabel( tr("MEGABYTE"), myAdvGroup);
+ QLabel* aMegabyteLabel = new QLabel( tr("MEGABYTE"), anAdvFrame);
- myInitialMemoryCheck = new QCheckBox( tr("INIT_MEMORY_SIZE"), myAdvGroup );
+ myInitialMemoryCheck = new QCheckBox( tr("INIT_MEMORY_SIZE"), anAdvFrame );
- myInitialMemorySpin = new QSpinBox( myAdvGroup );
+ myInitialMemorySpin = new QSpinBox( anAdvFrame );
myInitialMemorySpin->setMinValue( 1 );
myInitialMemorySpin->setMaxValue( maxAvailableMemory() );
myInitialMemorySpin->setLineStep( 10 );
- new QLabel( tr("MEGABYTE"), myAdvGroup);
- new QLabel( tr( "WORKING_DIR" ), myAdvGroup );
- QPushButton* dirBtn = new QPushButton( tr( "SELECT_DIR"), myAdvGroup, "dirBtn");
- myWorkingDir = new QLineEdit( myAdvGroup, "myWorkingDir");
+ QLabel* aWorkinDirLabel = new QLabel( tr( "WORKING_DIR" ), anAdvFrame );
+ QPushButton* dirBtn = new QPushButton( tr( "SELECT_DIR"), anAdvFrame, "dirBtn");
+ myWorkingDir = new QLineEdit( anAdvFrame, "myWorkingDir");
myWorkingDir->setReadOnly( true );
- myKeepFiles = new QCheckBox( tr( "KEEP_WORKING_FILES" ), myAdvGroup );
+ myKeepFiles = new QCheckBox( tr( "KEEP_WORKING_FILES" ), anAdvFrame );
+
+ QLabel* aVerboseLevelLabel = new QLabel( tr("VERBOSE_LEVEL"), anAdvFrame);
+ myVerboseLevelSpin = new QSpinBox( anAdvFrame );
+ myVerboseLevelSpin->setMinValue( 0 );
+ myVerboseLevelSpin->setMaxValue( 10 );
+ myVerboseLevelSpin->setLineStep( 1 );
+
+ myToCreateNewNodesCheck = new QCheckBox( tr( "TO_ADD_NODES" ), anAdvFrame );
+
+ myBoundaryRecoveryCheck = new QCheckBox( tr( "RECOVERY_VERSION" ), anAdvFrame );
+
+ QLabel* aTextOptionLabel = new QLabel( tr( "TEXT_OPTION" ), anAdvFrame );
+ myTextOption = new QLineEdit( anAdvFrame, "myTextOption");
+
+
+ anAdvLayout->addWidget(myMaximumMemoryCheck, 0, 0);
+ anAdvLayout->addWidget(myMaximumMemorySpin, 0, 1);
+ anAdvLayout->addWidget(aMegabyteLabel, 0, 2);
+
+ anAdvLayout->addWidget(myInitialMemoryCheck, 1, 0);
+ anAdvLayout->addWidget(myInitialMemorySpin, 1, 1);
+ anAdvLayout->addWidget(aMegabyteLabel, 1, 2);
+
+ anAdvLayout->addWidget(aWorkinDirLabel, 2, 0);
+ anAdvLayout->addWidget(dirBtn, 2, 1);
+ anAdvLayout->addWidget(myWorkingDir, 2, 2);
+
+ anAdvLayout->addWidget(myKeepFiles, 3, 0);
+ anAdvLayout->addWidget(aVerboseLevelLabel, 4, 0);
+ anAdvLayout->addWidget(myVerboseLevelSpin, 4, 1);
+
+ anAdvLayout->addWidget(myToCreateNewNodesCheck, 5, 0);
+
+ anAdvLayout->addMultiCellWidget(myBoundaryRecoveryCheck, 6, 6, 0, 1);
+
+ anAdvLayout->addWidget(aTextOptionLabel, 7, 0);
+ anAdvLayout->addMultiCellWidget(myTextOption,7, 7, 1, 2);
+
+
connect( tab, SIGNAL( selected(int) ), this, SLOT( onTabSelected(int) ) );
- connect( myMaximumMemoryCheck, SIGNAL( toggled(bool) ), this, SLOT( onMemCheckToggled(bool) ));
- connect( myInitialMemoryCheck, SIGNAL( toggled(bool) ), this, SLOT( onMemCheckToggled(bool) ));
+ connect( myMaximumMemoryCheck, SIGNAL( toggled(bool) ), this, SLOT( onCheckToggled(bool) ));
+ connect( myInitialMemoryCheck, SIGNAL( toggled(bool) ), this, SLOT( onCheckToggled(bool) ));
+ connect( myBoundaryRecoveryCheck,SIGNAL(toggled(bool)), this, SLOT( onCheckToggled(bool) ));
connect( dirBtn, SIGNAL( clicked() ), this, SLOT( onDirBtnClicked() ) );
return fr;
dlg()->adjustSize();
}
-void GHS3DPluginGUI_HypothesisCreator::onMemCheckToggled(bool on)
+void GHS3DPluginGUI_HypothesisCreator::onCheckToggled(bool on)
{
- if ( sender() == myMaximumMemoryCheck )
+ const QObject * aSender = sender();
+ if ( aSender == myMaximumMemoryCheck )
myMaximumMemorySpin->setEnabled( on );
- else
+
+ else if ( aSender == myInitialMemoryCheck )
myInitialMemorySpin->setEnabled( on );
+
+ else if ( aSender == myBoundaryRecoveryCheck ) {
+ myOptimizationLevelCombo->setEnabled( !on );
+ myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !on );
+ myInitialMemoryCheck->setEnabled( !on );
+ myOptimizationLevelCombo->setEnabled( !on );
+ }
+
}
void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
myToMeshHolesCheck ->setChecked ( data.myToMeshHoles );
myOptimizationLevelCombo->setCurrentItem( data.myOptimizationLevel );
myMaximumMemoryCheck ->setChecked ( data.myMaximumMemory > 0 );
- myMaximumMemorySpin ->setValue ( std::max( data.myMaximumMemory, myMaximumMemorySpin->minValue() ));
+ myMaximumMemorySpin ->setValue ( std::max( data.myMaximumMemory,
+ myMaximumMemorySpin->minValue() ));
myInitialMemoryCheck ->setChecked ( data.myInitialMemory > 0 );
- myInitialMemorySpin ->setValue ( std::max( data.myInitialMemory, myInitialMemorySpin->minValue() ));
+ myInitialMemorySpin ->setValue ( std::max( data.myInitialMemory,
+ myInitialMemorySpin->minValue() ));
myWorkingDir ->setText ( data.myWorkingDir );
myKeepFiles ->setChecked ( data.myKeepFiles );
-
- myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
- myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() );
+ myVerboseLevelSpin ->setValue ( data.myVerboseLevel );
+ myToCreateNewNodesCheck ->setChecked ( data.myToCreateNewNodes );
+ myBoundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery );
+ myTextOption ->setText ( data.myTextOption );
+
+ myOptimizationLevelCombo->setEnabled ( !data.myBoundaryRecovery );
+ myMaximumMemorySpin ->setEnabled ( myMaximumMemoryCheck->isChecked() );
+ myInitialMemorySpin ->setEnabled ( myInitialMemoryCheck->isChecked() &&
+ !data.myBoundaryRecovery );
+ myInitialMemoryCheck ->setEnabled (!data.myBoundaryRecovery );
+ myOptimizationLevelCombo->setEnabled (!data.myBoundaryRecovery );
}
QString GHS3DPluginGUI_HypothesisCreator::storeParams() const
readParamsFromWidgets( data );
storeParamsToHypo( data );
- QString valStr = " -c " + QString::number( !data.myToMeshHoles );
- if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 4 ) {
+ QString valStr = "";
+
+ if ( !data.myBoundaryRecovery )
+ valStr = "-c " + QString::number( !data.myToMeshHoles );
+
+ if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 4 && !data.myBoundaryRecovery) {
char* level[] = { "none" , "light" , "standard" , "strong" };
valStr += " -o ";
valStr += level[ data.myOptimizationLevel ];
}
-
+ if ( data.myMaximumMemory > 0 ) {
+ valStr += " -m ";
+ valStr += QString::number( data.myMaximumMemory );
+ }
+ if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
+ valStr += " -M ";
+ valStr += QString::number( data.myInitialMemory );
+ }
+ valStr += " -v ";
+ valStr += QString::number( data.myVerboseLevel );
+
+ if ( !data.myToCreateNewNodes )
+ valStr += " -p0";
+
+ if ( data.myBoundaryRecovery )
+ valStr += " -C";
+
+ valStr += " ";
+ valStr += data.myTextOption;
+
return valStr;
}
h_data.myOptimizationLevel = h->GetOptimizationLevel();
h_data.myKeepFiles = h->GetKeepFiles();
h_data.myWorkingDir = h->GetWorkingDirectory();
+ h_data.myVerboseLevel = h->GetVerboseLevel();
+ h_data.myToCreateNewNodes = h->GetToCreateNewNodes();
+ h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
+ h_data.myTextOption = h->GetTextOption();
return true;
}
h->SetOptimizationLevel( h_data.myOptimizationLevel );
if ( h->GetKeepFiles() != h_data.myKeepFiles )
h->SetKeepFiles ( h_data.myKeepFiles );
- if (h->GetWorkingDirectory() != h_data.myWorkingDir )
+ if ( h->GetWorkingDirectory() != h_data.myWorkingDir )
h->SetWorkingDirectory ( h_data.myWorkingDir );
+ if ( h->GetVerboseLevel() != h_data.myVerboseLevel )
+ h->SetVerboseLevel ( h_data.myVerboseLevel );
+ if ( h->GetToCreateNewNodes() != h_data.myToCreateNewNodes )
+ h->SetToCreateNewNodes( h_data.myToCreateNewNodes );
+ if ( h->GetToUseBoundaryRecoveryVersion() != h_data.myBoundaryRecovery )
+ h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
+ if ( h->GetTextOption() != h_data.myTextOption )
+ h->SetTextOption ( h_data.myTextOption );
}
catch(const SALOME::SALOME_Exception& ex)
{
h_data.myOptimizationLevel = myOptimizationLevelCombo->currentItem();
h_data.myKeepFiles = myKeepFiles->isChecked();
h_data.myWorkingDir = myWorkingDir->text();
+ h_data.myVerboseLevel = myVerboseLevelSpin->value();
+ h_data.myToCreateNewNodes = myToCreateNewNodesCheck->isChecked();
+ h_data.myBoundaryRecovery = myBoundaryRecoveryCheck->isChecked();
+ h_data.myTextOption = myTextOption->text();
return true;
}
bool myKeepFiles;
QString myWorkingDir;
QString myName;
+ short myVerboseLevel;
+ bool myToCreateNewNodes;
+ bool myBoundaryRecovery;
+ QString myTextOption;
+
} GHS3DHypothesisData;
/*!
protected slots:
void onTabSelected(int);
- void onMemCheckToggled(bool);
+ void onCheckToggled(bool);
void onDirBtnClicked();
private:
QSpinBox* myInitialMemorySpin;
QLineEdit* myWorkingDir;
QCheckBox* myKeepFiles;
+ QSpinBox* myVerboseLevelSpin;
+ QCheckBox* myToCreateNewNodesCheck;
+ QCheckBox* myBoundaryRecoveryCheck;
+ QLineEdit* myTextOption;
};
#endif
msgid "KEEP_WORKING_FILES"
msgstr "To keep working files"
-msgid ""
-msgstr ""
+msgid "VERBOSE_LEVEL"
+msgstr "Verbose level"
+
+msgid "TO_ADD_NODES"
+msgstr "To create new nodes"
+
+msgid "RECOVERY_VERSION"
+msgstr "To use boundary recovery version"
+
+msgid "TEXT_OPTION"
+msgstr "Option as text"
msgid "GHS3D_HYPOTHESIS"