From cb56117ba14d4655fbcf835778c4a6117ead698d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 6 Nov 2019 15:11:26 +0300 Subject: [PATCH] #17845 [EDF] Modifications of Automatic meshing 1) Make "Free Hexahedralization" unavailable if NETGEN preferred over MeshGems 2) BUG: Hyposets do work only with English language --- resources/StdMeshers.xml.in | 2 ++ src/SMESHGUI/SMESHGUI_Hypotheses.h | 1 + src/SMESHGUI/SMESHGUI_MeshDlg.cxx | 9 ++++++--- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 10 ++++++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/resources/StdMeshers.xml.in b/resources/StdMeshers.xml.in index 72525e124..3126c2318 100644 --- a/resources/StdMeshers.xml.in +++ b/resources/StdMeshers.xml.in @@ -608,6 +608,8 @@ 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"/> diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index 1543af914..454ac1ae3 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -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; diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx index d9f403a4a..787a34469 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.cxx @@ -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() ); } //================================================================================ diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index c33a4fe92..8ee061cd7 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -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 ); } -- 2.39.2