]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
0022172: [CEA 790] create the groups corresponding to domains
authoreap <eap@opencascade.com>
Fri, 24 May 2013 11:41:20 +0000 (11:41 +0000)
committereap <eap@opencascade.com>
Fri, 24 May 2013 11:41:20 +0000 (11:41 +0000)
"To make groups of domains" option has been added.

doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png
doc/salome/gui/GHS3DPLUGIN/input/ghs3d_hypo.doc
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.h
src/GUI/GHS3DPlugin_msg_en.ts

index e272cefdd0ba5f5bc8e99c25749cf4423fca8751..e71688edaae24fe3806061178a7beaab3aa6c0a2 100644 (file)
Binary files a/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png and b/doc/salome/gui/GHS3DPLUGIN/images/ghs3d_parameters_basic.png differ
index 9cececfb087d62392251dfee9696012d08086dc5..9ed28b5332c5c1149d40e627f319eadea6c90d33 100644 (file)
@@ -22,6 +22,14 @@ create mesh in the holes inside a solid shape, else only the outermost
 shape will be meshed. Volumic elements created within holes are bound
 to the solid.
 
+- <b>To make groups of domains</b> - if checked, the algorithm will
+create groups of just generated elements corresponding to each mesh
+domain.<br>
+The groups are created provided that 
+ - <b>To mesh holes</b> is switched on,
+ - the mesh is not based on geometry, e.g. imported from file, and 
+ - there are several domains in the mesh.
+
 - <b>Optimization level</b> - allows choosing the required
 optimization level (higher level of optimisation provides better mesh,
 but can be time-consuming):
index 78cb1fa5566e9150d09468ed8dc2fc4df6ba8ca7..04517b58e5ac029620ba4f60d9ab1e3611e7598e 100644 (file)
 //  File   : GHS3DPluginGUI_HypothesisCreator.cxx
 //  Author : Michael Zorin
 //  Module : GHS3DPlugin
-//  $Header: 
 //
 #include "GHS3DPluginGUI_HypothesisCreator.h"
-// #include "GHS3DPluginGUI_EnforcedDelegates.h"
 #include "GHS3DPluginGUI_Enums.h"
 
-#include "GeometryGUI.h"
+#include <GeometryGUI.h>
 
 #include <SMESHGUI_Utils.h>
 #include <SMESHGUI_SpinBox.h>
@@ -294,7 +292,7 @@ QWidget *EnforcedMeshTableWidgetDelegate::createEditor(QWidget *parent,
 void EnforcedMeshTableWidgetDelegate::setEditorData(QWidget *editor,
                                                const QModelIndex &index) const
 {
-       QItemDelegate::setEditorData(editor, index);
+        QItemDelegate::setEditorData(editor, index);
 }
 
 void EnforcedMeshTableWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
@@ -392,7 +390,9 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
   }
 
   myToMeshHolesCheck = new QCheckBox( tr( "GHS3D_TO_MESH_HOLES" ), myStdGroup );
-  aStdLayout->addWidget( myToMeshHolesCheck, row++, 0, 1, 2 );
+  aStdLayout->addWidget( myToMeshHolesCheck, row, 0, 1, 1 );
+  myToMakeGroupsOfDomains = new QCheckBox( tr( "GHS3D_TO_MAKE_DOMAIN_GROUPS" ), myStdGroup );
+  aStdLayout->addWidget( myToMakeGroupsOfDomains, row++, 1, 1, 1 );
 
   aStdLayout->addWidget( new QLabel( tr( "GHS3D_OPTIMIZATIOL_LEVEL" ), myStdGroup ), row, 0, 1, 1 );
   myOptimizationLevelCombo = new QComboBox( myStdGroup );
@@ -645,6 +645,7 @@ QFrame* GHS3DPluginGUI_HypothesisCreator::buildFrame()
   tab->setCurrentIndex( STD_TAB );
 
   // connections
+  connect( myToMeshHolesCheck,      SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
   connect( myMaximumMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
   connect( myInitialMemoryCheck,    SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
   connect( myBoundaryRecoveryCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
@@ -1384,6 +1385,13 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex()
   myEnforcedTableWidget->selectionModel()->clearSelection();
 }
 
+void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn)
+{
+  myToMakeGroupsOfDomains->setEnabled( isOn );
+  if ( !isOn )
+    myToMakeGroupsOfDomains->setChecked( false );
+}
+
 void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
 {
   QString dir = SUIT_FileDlg::getExistingDirectory( dlg(), myWorkingDir->text(), QString() );
@@ -1393,6 +1401,7 @@ void GHS3DPluginGUI_HypothesisCreator::onDirBtnClicked()
 
 void GHS3DPluginGUI_HypothesisCreator::updateWidgets()
 {
+  myToMakeGroupsOfDomains->setEnabled( myToMeshHolesCheck->isChecked() );
   myMaximumMemorySpin->setEnabled( myMaximumMemoryCheck->isChecked() );
   myInitialMemoryCheck->setEnabled( !myBoundaryRecoveryCheck->isChecked() );
   myInitialMemorySpin->setEnabled( myInitialMemoryCheck->isChecked() && !myBoundaryRecoveryCheck->isChecked() );
@@ -1424,6 +1433,7 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
     myName->setText( data.myName );
   
   myToMeshHolesCheck               ->setChecked    ( data.myToMeshHoles );
+  myToMakeGroupsOfDomains          ->setChecked    ( data.myToMakeGroupsOfDomains );
   myOptimizationLevelCombo         ->setCurrentIndex( data.myOptimizationLevel );
   myMaximumMemoryCheck             ->setChecked    ( data.myMaximumMemory > 0 );
   myMaximumMemorySpin              ->setValue      ( qMax( data.myMaximumMemory,
@@ -1668,6 +1678,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromHypo( GHS3DHypothesisData&
   h_data.myName = isCreation() && data ? hypName() : "";
 
   h_data.myToMeshHoles                = h->GetToMeshHoles();
+  h_data.myToMakeGroupsOfDomains      = h->GetToMeshHoles() && h->GetToMakeGroupsOfDomains();
   h_data.myMaximumMemory              = h->GetMaximumMemory();
   h_data.myInitialMemory              = h->GetInitialMemory();
   h_data.myInitialMemory              = h->GetInitialMemory();
@@ -1741,6 +1752,8 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD
 
     if ( h->GetToMeshHoles() != h_data.myToMeshHoles ) // avoid duplication of DumpPython commands
       h->SetToMeshHoles      ( h_data.myToMeshHoles       );
+    if ( h->GetToMakeGroupsOfDomains() != h_data.myToMakeGroupsOfDomains )
+      h->SetToMakeGroupsOfDomains( h_data.myToMakeGroupsOfDomains );
     if ( h->GetMaximumMemory() != h_data.myMaximumMemory )
       h->SetMaximumMemory    ( h_data.myMaximumMemory     );
     if ( h->GetInitialMemory() != h_data.myInitialMemory )
@@ -1854,6 +1867,7 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat
   MESSAGE("GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets");
   h_data.myName                       = myName ? myName->text() : "";
   h_data.myToMeshHoles                = myToMeshHolesCheck->isChecked();
+  h_data.myToMakeGroupsOfDomains      = myToMakeGroupsOfDomains->isChecked();
   h_data.myMaximumMemory              = myMaximumMemoryCheck->isChecked() ? myMaximumMemorySpin->value() : -1;
   h_data.myInitialMemory              = myInitialMemoryCheck->isChecked() ? myInitialMemorySpin->value() : -1;
   h_data.myOptimizationLevel          = myOptimizationLevelCombo->currentIndex();
index 44641a5651fb12e08ab66366070771eb1418ba26..a9830d904b63f33fc9d3f5cddea6023d39ca0589 100644 (file)
@@ -140,7 +140,7 @@ typedef std::set< TEnfMesh*, CompareEnfMeshes > TEnfMeshList;
 
 typedef struct
 {
-  bool    myToMeshHoles,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint;
+  bool    myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint;
   int     myMaximumMemory,myInitialMemory,myOptimizationLevel;
   QString myName,myWorkingDir,myTextOption;
   double  myGradation;
@@ -173,6 +173,7 @@ protected:
   virtual QString  type() const;
 
 protected slots:
+  void                onToMeshHoles(bool);
   void                onDirBtnClicked();
   void                updateWidgets();
   
@@ -209,6 +210,7 @@ private:
   QWidget*            myStdGroup;
   QLineEdit*          myName;
   QCheckBox*          myToMeshHolesCheck;
+  QCheckBox*          myToMakeGroupsOfDomains;
   QComboBox*          myOptimizationLevelCombo;
 
   QWidget*            myAdvGroup;
index 9c8884bcd4b7b21e81a4e37b6333c6465b50a581..b77bcb38ee62f1ec9424b7f7b00105049a96b5e8 100644 (file)
         <source>GHS3D_TO_MESH_HOLES</source>
         <translation>To mesh holes</translation>
     </message>
+    <message>
+        <source>GHS3D_TO_MAKE_DOMAIN_GROUPS</source>
+        <translation>To make groups of domains</translation>
+    </message>
     <message>
         <source>INIT_MEMORY_SIZE</source>
         <translation>Initial memory size</translation>