- <b>Volumic gradation</b> - Defines the volumic ratio between 2 consecutive elements.
WARNING: Changing the default value of this parameter may dramatically decrease the quality of the resulting mesh.
-- <b>Option as text</b> - allows to input in the command line any text
-for MG-Tetra, for example, advanced options.
+- A table at the page bottom allows to input in the command line any text
+for MG-Tetra, for example, advanced options. <br>
+<b>Add option</b> - adds a line to the table where you can type an option and its value as text.
+A check box in the first column activates/deactivates the option of the current row. A deactivated option will be erased upon pressing \a Ok.
+
\ref ghs3d_top "Back to top"
/*!
* To set hiden/undocumented/advanced options
*/
- void SetTextOption(in string option);
+ void SetAdvancedOption(in string option);
+ string GetAdvancedOption();
+ void SetTextOption(in string option); // obsolete
string GetTextOption();
/*!
* To define the volumic gradation
## Sets command line option as text.
# @param option command line option
def SetTextOption(self, option):
- self.Parameters().SetTextOption(option)
+ self.Parameters().SetAdvancedOption(option)
+ pass
+
+ ## Sets command line option as text.
+ # @param option command line option
+ def SetAdvancedOption(self, option):
+ self.Parameters().SetAdvancedOption(option)
pass
pass # end of GHS3D_Algorithm class
}
//=======================================================================
-//function : SetTextOption
+//function : SetAdvancedOption
//=======================================================================
-void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option)
+void GHS3DPlugin_Hypothesis::SetAdvancedOption(const std::string& option)
{
if ( myTextOption != option ) {
myTextOption = option;
}
//=======================================================================
-//function : GetTextOption
+//function : GetAdvancedOption
//=======================================================================
-std::string GHS3DPlugin_Hypothesis::GetTextOption() const
+std::string GHS3DPlugin_Hypothesis::GetAdvancedOption() const
{
return myTextOption;
}
/*!
* To set hiden/undocumented/advanced options
*/
- void SetTextOption(const std::string& option);
- std::string GetTextOption() const;
+ void SetAdvancedOption(const std::string& option);
+ std::string GetAdvancedOption() const;
/*!
* To define the volumic gradation
*/
void GHS3DPlugin_Hypothesis_i::SetTextOption(const char* option)
{
ASSERT(myBaseImpl);
- this->GetImpl()->SetTextOption(option);
- SMESH::TPythonDump() << _this() << ".SetTextOption( '" << option << "' )";
+ this->GetImpl()->SetAdvancedOption(option);
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << option << "' )";
}
//=======================================================================
char* GHS3DPlugin_Hypothesis_i::GetTextOption()
{
ASSERT(myBaseImpl);
- return CORBA::string_dup( this->GetImpl()->GetTextOption().c_str() );
+ return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
+}
+
+//=======================================================================
+//function : SetAdvancedOption
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis_i::SetAdvancedOption(const char* option)
+{
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetAdvancedOption(option);
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << option << "' )";
+}
+
+//=======================================================================
+//function : GetAdvancedOption
+//=======================================================================
+
+char* GHS3DPlugin_Hypothesis_i::GetAdvancedOption()
+{
+ ASSERT(myBaseImpl);
+ return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
}
//=======================================================================
/*!
* To set hiden/undocumented/advanced options
*/
- void SetTextOption(const char* option);
+ void SetAdvancedOption(const char* option);
+ char* GetAdvancedOption();
+ void SetTextOption(const char* option); // obsolete
char* GetTextOption();
/*!
* To define the volumic gradation
${KERNEL_SALOMELocalTrace}
${GEOM_GEOM}
${SMESH_SMESH}
- ${SMESH_GeomSelectionTools}
+ ${SMESH_PluginUtils}
${SMESH_StdMeshersGUI}
${SMESH_SMESHFiltersSelection}
${GUI_suit}
: QWidget( parent, f )
{
setupUi( this );
+ advOptionTable->layout()->setMargin( 0 );
}
GHS3DPluginGUI_AdvWidget::~GHS3DPluginGUI_AdvWidget()
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximum">
+ <property name="maximum" stdset="0">
<number>999999999</number>
</property>
</widget>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="maximum">
+ <property name="maximum" stdset="0">
<number>999999999</number>
</property>
</widget>
<string>Advanced meshing options</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
- <item row="7" column="1">
- <widget class="QLineEdit" name="textOptionLineEdit"/>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="gradationLabel">
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="FEMCorrectionCheck">
<property name="text">
- <string>Volumic gradation</string>
+ <string>Use FEM correction</string>
</property>
</widget>
</item>
- <item row="7" column="0">
- <widget class="QLabel" name="textOptionLabel">
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="removeInitialCentralPointCheck">
<property name="text">
- <string>Option as text</string>
+ <string>Remove initial central point</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="SMESHGUI_SpinBox" name="gradationSpinBox"/>
</item>
- <item row="0" column="0">
- <widget class="QCheckBox" name="createNewNodesCheck">
- <property name="text">
- <string>Create new nodes</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="removeInitialCentralPointCheck">
+ <item row="6" column="0">
+ <widget class="QLabel" name="gradationLabel">
<property name="text">
- <string>Remove initial central point</string>
+ <string>Volumic gradation</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QCheckBox" name="FEMCorrectionCheck">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="createNewNodesCheck">
<property name="text">
- <string>Use FEM correction</string>
+ <string>Create new nodes</string>
</property>
</widget>
</item>
</property>
</widget>
</item>
+ <item row="7" column="0" colspan="2">
+ <widget class="SMESH_AdvOptionsWdg" name="advOptionTable" native="true"/>
+ </item>
</layout>
</widget>
</item>
<customwidgets>
<customwidget>
<class>SMESHGUI_SpinBox</class>
- <extends>QSpinBox</extends>
- <header>SMESHGUI_SpinBox.h</header>
+ <extends>QDoubleSpinBox</extends>
+ <header location="global">SMESHGUI_SpinBox.h</header>
</customwidget>
<customwidget>
<class>SalomeApp_IntSpinBox</class>
- <extends>QSpinBox</extends>
- <header>SalomeApp_IntSpinBox.h</header>
+ <extends>QLineEdit</extends>
+ <header location="global">SalomeApp_IntSpinBox.h</header>
+ </customwidget>
+ <customwidget>
+ <class>SMESH_AdvOptionsWdg</class>
+ <extends>QWidget</extends>
+ <header location="global">SMESH_AdvOptionsWdg.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources/>
#include <boost/algorithm/string.hpp>
-namespace {
-
-#ifdef WIN32
-#include <windows.h>
-#else
-#include <sys/sysinfo.h>
-#endif
-
- long maxAvailableMemory()
- {
-#ifdef WIN32
- // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
- MEMORYSTATUSEX statex;
- statex.dwLength = sizeof (statex);
- long err = GlobalMemoryStatusEx (&statex);
- if (err != 0) {
- long totMB =
- statex.ullTotalPhys / 1024 / 1024 +
- statex.ullTotalPageFile / 1024 / 1024 +
- statex.ullTotalVirtual / 1024 / 1024;
- return (long) ( 0.7 * totMB );
- }
-#else
- struct sysinfo si;
- long err = sysinfo( &si );
- if ( err == 0 ) {
- long totMB =
- si.totalram * si.mem_unit / 1024 / 1024 +
- si.totalswap * si.mem_unit / 1024 / 1024 ;
- return (long) ( 0.7 * totMB );
- }
-#endif
- return 0;
- }
-}
-
//
// BEGIN EnforcedVertexTableWidgetDelegate
//
myAdvWidget->FEMCorrectionCheck ->setText (tr( "FEM_CORRECTION" ));
myAdvWidget->gradationLabel ->setText (tr( "GHS3D_GRADATION" ));
myAdvWidget->gradationSpinBox->RangeStepAndValidator(0.0, 5.0, 0.05, "length_precision");
- myAdvWidget->textOptionLabel->setText(tr( "TEXT_OPTION" ));
// Enforced vertices parameters
myEnfGroup = new QWidget();
myAdvWidget->boundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery );
myAdvWidget->FEMCorrectionCheck ->setChecked ( data.myFEMCorrection );
myAdvWidget->gradationSpinBox ->setValue ( data.myGradation );
- myAdvWidget->textOptionLineEdit ->setText ( data.myTextOption );
+ myAdvWidget->advOptionTable ->SetCustomOptions( data.myTextOption );
myAdvWidget->logInFileCheck ->setChecked ( !data.myLogInStandardOutput );
myAdvWidget->removeLogOnSuccessCheck ->setChecked ( data.myRemoveLogOnSuccess );
h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
h_data.myFEMCorrection = h->GetFEMCorrection();
h_data.myGradation = h->GetGradation();
- h_data.myTextOption = h->GetTextOption();
+ h_data.myTextOption = h->GetAdvancedOption();
h_data.myLogInStandardOutput = h->GetStandardOutputLog();
h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess();
GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
MESSAGE("vertices->length(): " << vertices->length());
h_data.myEnforcedVertices.clear();
- for (int i=0 ; i<vertices->length() ; i++) {
+ for (CORBA::ULong i=0 ; i<vertices->length() ; i++) {
TEnfVertex* myVertex = new TEnfVertex();
myVertex->name = CORBA::string_dup(vertices[i].name.in());
myVertex->geomEntry = CORBA::string_dup(vertices[i].geomEntry.in());
myVertex->size = vertices[i].size;
myVertex->isCompound = vertices[i].isCompound;
if (vertices[i].coords.length()) {
- for (int c = 0; c < vertices[i].coords.length() ; c++)
+ for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++)
myVertex->coords.push_back(vertices[i].coords[c]);
MESSAGE("Add enforced vertex ("<< myVertex->coords.at(0) << ","<< myVertex->coords.at(1) << ","<< myVertex->coords.at(2) << ") ="<< myVertex->size);
}
GHS3DPlugin::GHS3DEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
MESSAGE("enfMeshes->length(): " << enfMeshes->length());
h_data.myEnforcedMeshes.clear();
- for (int i=0 ; i<enfMeshes->length() ; i++) {
+ for (CORBA::ULong i=0 ; i<enfMeshes->length() ; i++) {
TEnfMesh* myEnfMesh = new TEnfMesh();
myEnfMesh->name = CORBA::string_dup(enfMeshes[i].name.in());
myEnfMesh->entry = CORBA::string_dup(enfMeshes[i].entry.in());
h->SetFEMCorrection ( h_data.myFEMCorrection );
if ( h->GetGradation() != h_data.myGradation )
h->SetGradation ( h_data.myGradation );
- if ( h->GetTextOption() != h_data.myTextOption )
- h->SetTextOption ( h_data.myTextOption.toLatin1().constData() );
+ if ( h->GetAdvancedOption() != h_data.myTextOption )
+ h->SetAdvancedOption ( h_data.myTextOption.toLatin1().constData() );
if ( h->GetStandardOutputLog() != h_data.myLogInStandardOutput )
h->SetStandardOutputLog( h_data.myLogInStandardOutput );
if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess )
h_data.myBoundaryRecovery = myAdvWidget->boundaryRecoveryCheck->isChecked();
h_data.myFEMCorrection = myAdvWidget->FEMCorrectionCheck->isChecked();
h_data.myGradation = myAdvWidget->gradationSpinBox->value();
- h_data.myTextOption = myAdvWidget->textOptionLineEdit->text();
+ h_data.myTextOption = myAdvWidget->advOptionTable->GetCustomOptions();
h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked();
h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();