From a5468aa66e55df66ca3dbebed4e1fe6e685d81f1 Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 11 Apr 2008 15:50:30 +0000 Subject: [PATCH] SMESHGUI_HypothesesUtils.* : replace STL classes (map, list, ...) by Qt classes (QMap, QList, ...) --- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index af86ea9cb..627d34e17 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -44,9 +44,12 @@ #include // STL includes -#include #include +// Qt includes +#include +//#include + // Other includes #ifdef WNT #include @@ -74,14 +77,15 @@ static int MYDEBUG = 0; namespace SMESH { - typedef std::map THypothesisDataMap; + typedef QMap THypothesisDataMap; THypothesisDataMap myHypothesesMap; THypothesisDataMap myAlgorithmsMap; - typedef std::map THypCreatorMap; + typedef QMap THypCreatorMap; THypCreatorMap myHypCreatorMap; std::list myListOfHypothesesSets; + //QList myListOfHypothesesSets; void processHypothesisStatus(const int theHypStatus, SMESH::SMESH_Hypothesis_ptr theHyp, @@ -169,10 +173,8 @@ namespace SMESH bool ok = reader.parse(source); file.close(); if (ok) { - myHypothesesMap.insert( aXmlHandler->myHypothesesMap.begin(), - aXmlHandler->myHypothesesMap.end() ); - myAlgorithmsMap.insert( aXmlHandler->myAlgorithmsMap.begin(), - aXmlHandler->myAlgorithmsMap.end() ); + myHypothesesMap = QMap( aXmlHandler->myHypothesesMap ); + myAlgorithmsMap = QMap( aXmlHandler->myAlgorithmsMap ); myListOfHypothesesSets.splice( myListOfHypothesesSets.begin(), aXmlHandler->myListOfHypothesesSets ); } @@ -219,14 +221,14 @@ namespace SMESH THypothesisDataMap::iterator anIter; for ( anIter = pMap->begin(); anIter != pMap->end(); anIter++ ) { - HypothesisData* aData = (*anIter).second; + HypothesisData* aData = anIter.value(); if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) if (checkGeometry){ if (aData->IsNeedGeometry == isNeedGeometry) - aHypList.append(((*anIter).first).c_str()); + aHypList.append(anIter.key().c_str()); } else - aHypList.append(((*anIter).first).c_str()); + aHypList.append(anIter.key().c_str()); } return aHypList; } @@ -240,6 +242,7 @@ namespace SMESH InitAvailableHypotheses(); std::list::iterator hypoSet = myListOfHypothesesSets.begin(); + //QList::iterator hypoSet = myListOfHypothesesSets.begin(); for ( ; hypoSet != myListOfHypothesesSets.end(); ++hypoSet ) { HypothesesSet* aSet = *hypoSet; @@ -254,6 +257,7 @@ namespace SMESH HypothesesSet* GetHypothesesSet(const QString& theSetName) { std::list::iterator hypoSet = myListOfHypothesesSets.begin(); + //QList::iterator hypoSet = myListOfHypothesesSets.begin(); for ( ; hypoSet != myListOfHypothesesSets.end(); ++hypoSet ) { HypothesesSet* aSet = *hypoSet; @@ -272,12 +276,12 @@ namespace SMESH THypothesisDataMap::iterator type_data = myHypothesesMap.find(aHypType.toLatin1().data()); if (type_data != myHypothesesMap.end()) { - aHypData = type_data->second; + aHypData = type_data.value(); } else { type_data = myAlgorithmsMap.find(aHypType.toLatin1().data()); if (type_data != myAlgorithmsMap.end()) - aHypData = type_data->second; + aHypData = type_data.value(); } return aHypData; } -- 2.39.2