<li>sd 4 : meshes non-manifold geometries as such and generates subdomains accordingly.</li>
</ul>
</li>
-
-<li><b>Options as text</b> - allows to input in the command line any text for MG-Hexa, for example, advanced options.
-</li>
</ul>
\note If MG-CADSurf is used as 2D algo, and if a GMF file is defined as output file (using SetGMFFile(my2Dmesh.mesh)), then MG-Hexa will use this file as input.
<br><b>See Also</b> a sample TUI Script of the \ref tui_hexotic "creation of a MG-Hexa mesh"
+\section hexotic_adv_options Advanced parameters
+
+\image html hexotic_advanced_options.png
+
+In \b Advanced tab page you can specify advanced options of MG-Hexa not exposed in other pages.
+
+<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.
+
\section hexotic_local_size_parameters Local size
The local size allows you to drive locally the density of the 3D mesh.
void SetHexoticMaxMemory(in long value);
long GetHexoticMaxMemory();
- void SetTextOptions(in string option);
+ void SetAdvancedOption(in string option);
+ string GetAdvancedOption();
+ void SetTextOptions(in string option);// obsolete
string GetTextOptions();
void SetSizeMapEntry(in string entry,
SET(_link_LIBRARIES
${SMESH_SMESH}
${SMESH_StdMeshersGUI}
+ ${SMESH_PluginUtils}
${CAS_KERNEL}
${GUI_suit}
${GUI_qtx}
#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
-#include "SMESH_NumberFilter.hxx"
+#include <SMESH_NumberFilter.hxx>
+#include <SMESH_AdvOptionsWdg.h>
#include "utilities.h"
// Main widget tabs identification
enum {
STD_TAB = 0,
+ ADV_TAB,
SMP_TAB,
VL_TAB
};
l->addWidget( myStdWidget, row++, 0, 1, 3 );
myStdWidget->onSdModeSelected(SD_MODE_4);
+ myAdvWidget = new SMESH_AdvOptionsWdg( aTabWidget );
// SIZE MAPS TAB
QWidget* aSmpGroup = new QWidget();
// resizeEvent();
- aTabWidget->insertTab( STD_TAB, aStdGroup, tr( "SMESH_ARGUMENTS" ) );
- aTabWidget->insertTab( SMP_TAB, aSmpGroup, tr( "LOCAL_SIZE" ) );
- aTabWidget->insertTab( VL_TAB, aVLGroup, tr( "Hexotic_VISCOUS_LAYERS") );
+ aTabWidget->insertTab( STD_TAB, aStdGroup, tr( "SMESH_ARGUMENTS" ));
+ aTabWidget->insertTab( ADV_TAB, myAdvWidget, tr( "SMESH_ADVANCED" ));
+ aTabWidget->insertTab( SMP_TAB, aSmpGroup, tr( "LOCAL_SIZE" ));
+ aTabWidget->insertTab( VL_TAB, aVLGroup, tr( "Hexotic_VISCOUS_LAYERS"));
myIs3D = true;
myStdWidget->myHexoticSdMode->setCurrentIndex(data.myHexoticSdMode);
- myStdWidget->myTextOptions->setText(data.myTextOptions);
+ myAdvWidget->SetCustomOptions(data.myTextOptions);
HexoticPlugin_Hypothesis::THexoticSizeMaps::const_iterator it = data.mySizeMaps.begin();
for ( int row = 0; it != data.mySizeMaps.end(); it++, row++ )
h_data.myHexoticVerbosity = h->GetHexoticVerbosity();
h_data.myHexoticMaxMemory = h->GetHexoticMaxMemory();
h_data.myHexoticSdMode = h->GetHexoticSdMode()-1;
- h_data.myTextOptions = h->GetTextOptions();
+ h_data.myTextOptions = h->GetAdvancedOption();
// Size maps
HexoticPlugin::HexoticPluginSizeMapsList_var sizeMaps = h->GetSizeMaps();
h->SetHexoticVerbosity( h_data.myHexoticVerbosity );
h->SetHexoticMaxMemory( h_data.myHexoticMaxMemory );
h->SetHexoticSdMode( h_data.myHexoticSdMode+1 );
- h->SetTextOptions( h_data.myTextOptions.toLatin1().constData() );
+ h->SetAdvancedOption( h_data.myTextOptions.toLatin1().constData() );
HexoticPlugin_Hypothesis::THexoticSizeMaps::const_iterator it;
h_data.myHexoticVerbosity = myStdWidget->myHexoticVerbosity->value();
h_data.myHexoticMaxMemory = myStdWidget->myHexoticMaxMemory->value();
h_data.myHexoticSdMode = myStdWidget->myHexoticSdMode->currentIndex();
- h_data.myTextOptions = myStdWidget->myTextOptions->text();
+ h_data.myTextOptions = myAdvWidget->GetCustomOptions();
h_data.myMinSize = myStdWidget->myMinSize->text().isEmpty() ? 0.0 : myStdWidget->myMinSize->value();
h_data.myMaxSize = myStdWidget->myMaxSize->text().isEmpty() ? 0.0 : myStdWidget->myMaxSize->value();
class HexoticPluginGUI_StdWidget;
class HexoticPluginGUI_SizeMapsWidget;
class HexoticPluginGUI_ViscousLayersWidget;
+class SMESH_AdvOptionsWdg;
typedef struct
{
private:
-// QWidget* myStdGroup;
- QLineEdit* myName;
- HexoticPluginGUI_StdWidget* myStdWidget;
+// QWidget* myStdGroup;
+ QLineEdit* myName;
+ HexoticPluginGUI_StdWidget* myStdWidget;
+ SMESH_AdvOptionsWdg* myAdvWidget;
HexoticPluginGUI_SizeMapsWidget* mySmpWidget;
HexoticPluginGUI_ViscousLayersWidget* myVLWidget;
StdMeshersGUI_ObjectReferenceParamWdg* myGeomSelWdg;
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
- <property name="margin">
+ <property name="leftMargin">
<number>0</number>
</property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item row="3" column="0" colspan="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Hexotic_SHARP_ANGLE_THRESHOLD</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="3">
+ <widget class="QSpinBox" name="myHexoticMaxMemory">
+ <property name="maximum">
+ <number>99999</number>
+ </property>
+ <property name="singleStep">
+ <number>128</number>
+ </property>
+ <property name="value">
+ <number>2048</number>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="hexoticInputSize">
<property name="title">
</layout>
</widget>
</item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Hexotic_MAX_MEMORY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Hexotic_WORKING_DIR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="2">
+ <widget class="QPushButton" name="dirBtn">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Hexotic_SELECT_DIR</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" colspan="2">
+ <widget class="QCheckBox" name="myHexoticInvalidElements">
+ <property name="text">
+ <string>Hexotic_INVALID_ELEMENTS</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="3">
+ <widget class="QSpinBox" name="myHexoticVerbosity">
+ <property name="maximum">
+ <number>2</number>
+ </property>
+ <property name="value">
+ <number>1</number>
+ </property>
+ </widget>
+ </item>
<item row="0" column="2" colspan="2">
<widget class="QGroupBox" name="hexoticInputLevel">
<property name="title">
</layout>
</widget>
</item>
- <item row="1" column="0" colspan="2">
- <widget class="QCheckBox" name="myHexoticIgnoreRidges">
- <property name="text">
- <string>Hexotic_IGNORE_RIDGES</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="2">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Hexotic_SHARP_ANGLE_THRESHOLD</string>
- </property>
- </widget>
- </item>
<item row="3" column="3">
<widget class="SalomeApp_DoubleSpinBox" name="myHexoticSharpAngleThreshold"/>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Hexotic_NB_PROC</string>
- </property>
- </widget>
- </item>
<item row="4" column="3">
<widget class="SalomeApp_IntSpinBox" name="myHexoticNbProc"/>
</item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_7">
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="myHexoticIgnoreRidges">
<property name="text">
- <string>Hexotic_WORKING_DIR</string>
+ <string>Hexotic_IGNORE_RIDGES</string>
</property>
</widget>
</item>
- <item row="5" column="1" colspan="2">
- <widget class="QPushButton" name="dirBtn">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_6">
<property name="text">
- <string>Hexotic_SELECT_DIR</string>
+ <string>Hexotic_NB_PROC</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLineEdit" name="myHexoticWorkingDir"/>
</item>
- <item row="7" column="0">
- <widget class="QLabel" name="label_8">
- <property name="text">
- <string>Hexotic_VERBOSITY</string>
- </property>
- </widget>
- </item>
- <item row="7" column="3">
- <widget class="QSpinBox" name="myHexoticVerbosity">
- <property name="maximum">
- <number>2</number>
- </property>
- <property name="value">
- <number>1</number>
- </property>
- </widget>
- </item>
<item row="8" column="0" colspan="4">
<widget class="QGroupBox" name="groupBox">
<property name="title">
</layout>
</widget>
</item>
- <item row="9" column="0" colspan="4">
- <widget class="QGroupBox" name="groupBoxAdvanced">
- <property name="title">
- <string>Hexotic_ADVANCED</string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="margin">
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string>Hexotic_TEXT_OPTIONS</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="myTextOptions"/>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="2" colspan="2">
- <widget class="QCheckBox" name="myHexoticInvalidElements">
- <property name="text">
- <string>Hexotic_INVALID_ELEMENTS</string>
- </property>
- </widget>
- </item>
- <item row="6" column="0">
- <widget class="QLabel" name="label_9">
+ <item row="7" column="0">
+ <widget class="QLabel" name="label_8">
<property name="text">
- <string>Hexotic_MAX_MEMORY</string>
- </property>
- </widget>
- </item>
- <item row="6" column="3">
- <widget class="QSpinBox" name="myHexoticMaxMemory">
- <property name="maximum">
- <number>99999</number>
- </property>
- <property name="singleStep">
- <number>128</number>
- </property>
- <property name="value">
- <number>2048</number>
+ <string>Hexotic_VERBOSITY</string>
</property>
</widget>
</item>
self.Parameters().UnsetSizeMap(theObject)
return self.Parameters()
+ ## Set values of advanced options
+ # @param theOptions string in a form "option_1 v1 option_2 v2"
+ def SetAdvancedOption(self, theOptions):
+ self.Parameters().SetAdvancedOption(theOptions)
+ def GetAdvancedOption(self):
+ return self.Parameters().GetAdvancedOption()
+
## (OBSOLETE) Defines "MinMaxQuad" hypothesis to give three MG-Hexa parameters
# @param min minimal level of recursive partitioning on the initial octree cube
# @param max maximal level of recursive partitioning on the initial octree cube
case 4: { // "Edges"
nodeDim = 2;
aHexoticElement = theMesh->AddEdge( node[0], node[1] );
- int iNode = 1;
- if ( nodeAssigne[ nodeID[0] ] == 0 || nodeAssigne[ nodeID[0] ] == 2 )
- iNode = 0;
+ // int iNode = 1;
+ // if ( nodeAssigne[ nodeID[0] ] == 0 || nodeAssigne[ nodeID[0] ] == 2 )
+ // iNode = 0;
shapeID = dummy;
break;
}
_hexoticVerbosity = hyp->GetHexoticVerbosity();
_hexoticMaxMemory = hyp->GetHexoticMaxMemory();
_hexoticSdMode = hyp->GetHexoticSdMode();
- _textOptions = hyp->GetTextOptions();
+ _textOptions = hyp->GetAdvancedOption();
_sizeMaps = hyp->GetSizeMaps();
_nbLayers = hyp->GetNbLayers();
_firstLayerSize = hyp->GetFirstLayerSize();
}
}
+void HexoticPlugin_Hypothesis::SetAdvancedOption(const std::string& theOptions)
+{
+ if (_textOptions != theOptions ) {
+ _textOptions = theOptions;
+ NotifySubMeshesHypothesisModification();
+ }
+}
void HexoticPlugin_Hypothesis::SetTextOptions(const std::string& theOptions)
{
if (_textOptions != theOptions ) {
save<<"hexoticSdMode="<<_hexoticSdMode<<";";
save<<"hexoticVerbosity="<<_hexoticVerbosity<<";";
save<<"hexoticMaxMemory="<<_hexoticMaxMemory<<";";
- replace(_textOptions.begin(), _textOptions.end(), ' ', '*');
- save<<"textOptions="<<_textOptions<<";";
+ std::string textOptions = _textOptions; // save _textOptions
+ replace(textOptions.begin(), textOptions.end(), ' ', '*');
+ save<<"textOptions="<<textOptions<<";";
THexoticSizeMaps::iterator it = _sizeMaps.begin();
if ( it != _sizeMaps.end() )
{
void SetHexoticMaxMemory(int theVal);
int GetHexoticMaxMemory() const { return _hexoticMaxMemory; }
- void SetTextOptions(const std::string& theOptions);
+ void SetAdvancedOption(const std::string& theOptions);
+ std::string GetAdvancedOption() const { return _textOptions; }
+ void SetTextOptions(const std::string& theOptions); // obsolete
std::string GetTextOptions() const { return _textOptions; }
// Size Maps
{
// MESSAGE("HexoticPlugin_Hypothesis_i::SetTextOptions");
ASSERT(myBaseImpl);
- std::string oldValue(GetTextOptions());
- this->GetImpl()->SetTextOptions(theOptions);
+ std::string oldValue(GetAdvancedOption());
+ this->GetImpl()->SetAdvancedOption(theOptions);
if (theOptions != oldValue)
- SMESH::TPythonDump() << _this() << ".SetTextOptions( '" << theOptions << "' )";
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptions << "' )";
+}
+
+void HexoticPlugin_Hypothesis_i::SetAdvancedOption(const char* theOptions)
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::SetAdvancedOption");
+ ASSERT(myBaseImpl);
+ std::string oldValue(GetAdvancedOption());
+ this->GetImpl()->SetAdvancedOption(theOptions);
+ if (theOptions != oldValue)
+ SMESH::TPythonDump() << _this() << ".SetAdvancedOption( '" << theOptions << "' )";
}
HexoticPlugin::HexoticPluginSizeMapsList* HexoticPlugin_Hypothesis_i::GetSizeMaps ()
return this->GetImpl()->GetHexoticMaxMemory();
}
+char* HexoticPlugin_Hypothesis_i::GetAdvancedOption()
+{
+ // MESSAGE("HexoticPlugin_Hypothesis_i::GetAdvancedOption");
+ ASSERT(myBaseImpl);
+ return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
+}
char* HexoticPlugin_Hypothesis_i::GetTextOptions()
{
// MESSAGE("HexoticPlugin_Hypothesis_i::GetTextOptions");
ASSERT(myBaseImpl);
- return CORBA::string_dup( this->GetImpl()->GetTextOptions().c_str() );
+ return CORBA::string_dup( this->GetImpl()->GetAdvancedOption().c_str() );
}
CORBA::Long HexoticPlugin_Hypothesis_i::GetNbLayers()
void SetHexoticMaxMemory(CORBA::Long theVal);
CORBA::Long GetHexoticMaxMemory();
- void SetTextOptions(const char* theOptions);
+ void SetAdvancedOption(const char* theOptions);
+ char* GetAdvancedOption();
+ void SetTextOptions(const char* theOptions); // obsolete
char* GetTextOptions();
void SetSizeMapEntry(const char* theEntry, CORBA::Double theSize);