Salome HOME
Implementation of the issue 21276: EDF 1857 SMESH: Order of algorithms in the combobox
authorrnv <rnv@opencascade.com>
Thu, 22 Sep 2011 11:56:53 +0000 (11:56 +0000)
committerrnv <rnv@opencascade.com>
Thu, 22 Sep 2011 11:56:53 +0000 (11:56 +0000)
bin/smesh_setenv.py
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESHGUI/SMESHGUI_XmlHandler.cxx
src/SMESHGUI/SMESHGUI_XmlHandler.h

index 18b1dcc50d4c011ed66617a90923b1030107bdac..c0b3f3dc8a84628f4834023765b2e3ce3b93a9b9 100644 (file)
@@ -29,12 +29,13 @@ def set_env(args):
 
     python_version="python%d.%d" % sys.version_info[0:2]
 
-    os.environ["SMESH_MeshersList"]="StdMeshers"
+
     if not os.environ.has_key("SALOME_StdMeshersResources"):
         os.environ["SALOME_StdMeshersResources"] \
         = os.environ["SMESH_ROOT_DIR"]+"/share/"+salome_subdir+"/resources/smesh"
         pass
     if args.has_key("SMESH_plugins"):
+       plugin_list = []
         for plugin in args["SMESH_plugins"]:
             plugin_root = ""
             if os.environ.has_key(plugin+"_ROOT_DIR"):
@@ -46,8 +47,7 @@ def set_env(args):
                     pass
                 pass
             if plugin_root != "":
-                os.environ["SMESH_MeshersList"] \
-                = os.environ["SMESH_MeshersList"]+":"+plugin
+               plugin_list.append(plugin)
                 if not os.environ.has_key("SALOME_"+plugin+"Resources"):
                     os.environ["SALOME_"+plugin+"Resources"] \
                     = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
@@ -65,3 +65,5 @@ def set_env(args):
                     pass
                 pass
             pass
+       plugin_list.append("StdMeshers")
+       os.environ["SMESH_MeshersList"] = ":".join(plugin_list)
\ No newline at end of file
index 87cdf60ebfebc66e71dcba4102ffa0f80095781c..c1411fa2c126862e4d8c135e0193c209e5350b14 100644 (file)
@@ -53,6 +53,7 @@
 #include <QDir>
 //#include <QList>
 
+
 // Other includes
 #ifdef WNT
 #include <windows.h>
@@ -80,10 +81,10 @@ static int MYDEBUG = 0;
 
 namespace SMESH
 {
-  typedef QMap<QString,HypothesisData*> THypothesisDataMap;
+  typedef IMap<QString,HypothesisData*> THypothesisDataMap;
   THypothesisDataMap myHypothesesMap;
   THypothesisDataMap myAlgorithmsMap;
-
+  
   // BUG 0020378
   //typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
   //THypCreatorMap myHypCreatorMap;
@@ -217,8 +218,17 @@ namespace SMESH
           bool ok = reader.parse(source);
           file.close();
           if (ok) {
-            myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
-            myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
+
+           THypothesisDataMap::ConstIterator it1 = aXmlHandler->myHypothesesMap.begin();
+           
+           for( ;it1 != aXmlHandler->myHypothesesMap.end(); it1++)
+             myHypothesesMap.insert( it1.key(), it1.value() );
+           
+           
+           it1 = aXmlHandler->myAlgorithmsMap.begin();
+           for( ;it1 != aXmlHandler->myAlgorithmsMap.end(); it1++)
+             myAlgorithmsMap.insert( it1.key(), it1.value() );
+           
             QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
             for ( it = aXmlHandler->myListOfHypothesesSets.begin(); 
                   it != aXmlHandler->myListOfHypothesesSets.end();
@@ -269,7 +279,7 @@ namespace SMESH
     bool checkGeometry = ( !isNeedGeometry && isAlgo );
     // fill list of hypotheses/algorithms
     THypothesisDataMap& pMap = isAlgo ? myAlgorithmsMap : myHypothesesMap;
-    THypothesisDataMap::iterator anIter;
+    THypothesisDataMap::ConstIterator anIter;
     for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
       HypothesisData* aData = anIter.value();
       if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
@@ -336,10 +346,10 @@ namespace SMESH
     // Init list of available hypotheses, if needed
     InitAvailableHypotheses();
 
-    if (myHypothesesMap.find(aHypType) != myHypothesesMap.end()) {
+    if (myHypothesesMap.contains(aHypType)) {
       aHypData = myHypothesesMap[aHypType];
     }
-    else if (myAlgorithmsMap.find(aHypType) != myAlgorithmsMap.end()) {
+    else if (myAlgorithmsMap.contains(aHypType)) {
       aHypData = myAlgorithmsMap[aHypType];
     }
     return aHypData;
index b4cff1e938235958190276f72c50e984a00a401c..6c84814337e1c059d94bb09d59f4da2bebad0282 100644 (file)
@@ -165,11 +165,11 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&,
 
       if (qName == "algorithm")
       {
-        myAlgorithmsMap[aHypAlType] = aHypData;
+        myAlgorithmsMap.insert(aHypAlType,aHypData);
       }
       else
       {
-        myHypothesesMap[aHypAlType] = aHypData;
+        myHypothesesMap.insert(aHypAlType,aHypData);
       }
     }
   }
index fce170460e29c3b2862699031232a63f697b2e73..8adc03d3dbb8eef020bdd45ae460fedd96e9560f 100644 (file)
@@ -35,6 +35,9 @@
 #include <QMap>
 #include <QList>
 
+//GUI includes
+#include <QtxMap.h>
+
 class HypothesisData;
 class HypothesesSet;
 
@@ -55,8 +58,8 @@ public:
   bool     fatalError( const QXmlParseException& );
 
 public:
-  QMap<QString, HypothesisData*>         myHypothesesMap;
-  QMap<QString, HypothesisData*>         myAlgorithmsMap;
+  IMap<QString, HypothesisData*>         myHypothesesMap;
+  IMap<QString, HypothesisData*>         myAlgorithmsMap;
 
   QList<HypothesesSet*>                  myListOfHypothesesSets;