]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
#17845 [EDF] Modifications of Automatic meshing
authoreap <eap@opencascade.com>
Wed, 6 Nov 2019 12:11:26 +0000 (15:11 +0300)
committereap <eap@opencascade.com>
Fri, 24 Jan 2020 16:09:39 +0000 (19:09 +0300)
1) Make "Free Hexahedralization" unavailable if NETGEN preferred over MeshGems
2) BUG: Hyposets do work only with English language

resources/StdMeshers.xml.in
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/SMESHGUI/SMESHGUI_MeshDlg.cxx
src/SMESHGUI/SMESHGUI_MeshOp.cxx

index 72525e1246dc39a8ddf7cb0d8a5811ff957ae26c..3126c2318bcf197c09c0aec24adce48adf903d43 100644 (file)
                     quad-dominated="true"
                     hypos="MG-CADSurf Parameters"
                     algos="MG-CADSurf, MG-Hexa"
+                    alt-hypos="None"
+                    alt-algos="None"
                     intern-edge-hypos="LocalLength"
                     intern-edge-algos="Regular_1D"/>
 
index 1543af914c29dd169ce77bf290d8e3a64f578790..454ac1ae363717565bbdc075e68c6d7da603e776 100644 (file)
@@ -229,6 +229,7 @@ public:
   QString name() const;
   bool toUseCommonSize() const { return myUseCommonSize; }
   bool isQuadDominated() const { return myQuadDominated; }
+  bool hasAlgo( SetType type ) const { return !myAlgoList[ type ].isEmpty(); }
   //int count( bool, SetType ) const;
 
   int maxDim() const;
index d9f403a4ad49532b204c101596ff2db4b662ef4d..787a3446958e1c9436f05c32d6a9c8bb3c6f07af 100644 (file)
@@ -744,8 +744,11 @@ void SMESHGUI_MeshDlg::setHypoSets( const QStringList& theSets )
     myHypoSetButton->setPopupMode( QToolButton::InstantPopup );
   }
   aHypoSetPopup->clear();
-  for ( int i = 0, n = theSets.count(); i < n; i++ ) {
-    aHypoSetPopup->addAction( tr( theSets[ i ].toUtf8().data() ));
+  for ( int i = 0, n = theSets.count(); i < n; i++ )
+  {
+    QAction* action = new QAction( tr( theSets[ i ].toUtf8().data() ));
+    action->setData( theSets[ i ] );
+    aHypoSetPopup->addAction( action );
   }
   myHypoSetButton->setEnabled( !aHypoSetPopup->isEmpty() );
 }
@@ -760,7 +763,7 @@ void SMESHGUI_MeshDlg::setHypoSets( const QStringList& theSets )
 //================================================================================
 void SMESHGUI_MeshDlg::onHypoSetPopup( QAction* a )
 {
-  emit hypoSet( a->text() );
+  emit hypoSet( a->data().toString() );
 }
   
 //================================================================================
index c33a4fe927cf45fac1d706b6b8439eef6b475445..8ee061cd71400c8d44b125d2d585a1ca2785b60a 100644 (file)
@@ -2946,9 +2946,19 @@ void SMESHGUI_MeshOp::updateHypoSets()
       }
       currentHypoSet->setAlgoAvailable( sType, isAvailable );
     }
+    if ( currentHypoSet->hasAlgo( HypothesesSet::MAIN ) &&
+         currentHypoSet->hasAlgo( HypothesesSet::ALT ))
+    {
+      HypothesesSet::SetType setType = HypothesesSet::getPreferredHypType();
+      if ( !currentHypoSet->getAlgoAvailable( setType ))
+        continue; // not add if a preferred type not available currently
+    }
+
     if ( currentHypoSet->getAlgoAvailable( HypothesesSet::MAIN ) ||
          currentHypoSet->getAlgoAvailable( HypothesesSet::ALT ))
+    {
       aFilteredHypothesesSetsList.append( *inHypoSetName );
+    }
   }
   myDlg->setHypoSets( aFilteredHypothesesSetsList );
 }