Implementation of the issue 21276: EDF 1857 SMESH: Order of algorithms in the combobox

This commit is contained in:
rnv 2011-09-22 11:56:53 +00:00
parent 4a818e20d5
commit 92675bafdf
4 changed files with 29 additions and 14 deletions

View 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)

View 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;

View 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);
}
}
}

View 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;