Salome HOME
Mesh redesine. New fields added to specify whether hypothesis is main or additional...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HypothesesUtils.cxx
index 75fde54b194d956fb5dfdfe53444a06156fb20e7..96f59ae8af1c8c99463bb220e114fb358b7a0377 100644 (file)
@@ -193,7 +193,9 @@ namespace SMESH{
   }
 
 
-  QStringList GetAvailableHypotheses(const bool isAlgo)
+  QStringList GetAvailableHypotheses( const bool isAlgo, 
+                                      const int theDim,                          
+                                      const bool isAux )
   {
     QStringList aHypList;
 
@@ -201,20 +203,14 @@ namespace SMESH{
     InitAvailableHypotheses();
 
     // fill list of hypotheses/algorithms
+    THypothesisDataMap* pMap = isAlgo ? &myAlgorithmsMap : &myHypothesesMap;
     THypothesisDataMap::iterator anIter;
-    if (isAlgo) {
-      anIter = myAlgorithmsMap.begin();
-      for (; anIter != myAlgorithmsMap.end(); anIter++) {
-       aHypList.append(((*anIter).first).c_str());
-      }
-    }
-    else {
-      anIter = myHypothesesMap.begin();
-      for (; anIter != myHypothesesMap.end(); anIter++) {
-       aHypList.append(((*anIter).first).c_str());
-      }
+    for ( anIter = pMap->begin(); anIter != pMap->end(); anIter++ )
+    {
+      HypothesisData* aData = (*anIter).second;
+      if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux )
+        aHypList.append(((*anIter).first).c_str());
     }
-
     return aHypList;
   }
 
@@ -254,9 +250,8 @@ namespace SMESH{
 
       // 2. Get names of plugin libraries
       HypothesisData* aHypData = GetHypothesisData(aHypType);
-      if (!aHypData) {
-       return aCreator;
-      }
+      if (!aHypData) 
+        return aCreator;
       QString aClientLibName = aHypData->ClientLibName;
       QString aServerLibName = aHypData->ServerLibName;