Salome HOME
stable order in the partition algorithm
authorasl <asl@opencascade.com>
Tue, 28 Oct 2014 12:29:38 +0000 (12:29 +0000)
committerasl <asl@opencascade.com>
Tue, 28 Oct 2014 12:29:38 +0000 (12:29 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_SplitToZonesTool.cxx
src/HYDROData/HYDROData_SplitToZonesTool.h

index b9c17a895048e8d78dcd6ff0f56b8d03f421540f..5e0ce79ec10159a36f052a1b24c417a36676baee 100644 (file)
@@ -879,6 +879,7 @@ Handle(HYDROData_Region) HYDROData_CalculationCase::addNewRegion( const Handle(H
                                                                   bool isPrefix )
 {
   TDF_Label aNewLab = myLab.FindChild( DataTag_ChildRegion ).NewChild();
+  int aTag = aNewLab.Tag();
 
   Handle(HYDROData_Region) aNewRegion =
     Handle(HYDROData_Region)::DownCast( HYDROData_Iterator::CreateObject( aNewLab, KIND_REGION ) );
index fabf15d9340c3b2e68d4ba38a4dda6aebf26cd1e..3df841ed040d9a09a29f351170c004f87d8f46ea 100644 (file)
@@ -201,7 +201,7 @@ HYDROData_SplitToZonesTool::SplitDataList
     QStringList aListOfNames;
     for (int i=0;i < anInputGroupList.size() ;i++) {
       const TopoDS_Shape& aSh = anInputGroupList.at(i).Shape;
-      aDM3.Bind(aSh, anInputGroupList.at(i).ObjectNames);
+      aDM3.Add(aSh, anInputGroupList.at(i).ObjectNames);
     }
   }
 
@@ -214,7 +214,7 @@ HYDROData_SplitToZonesTool::SplitDataList
   aBB.MakeCompound(aCmp);
   for (int i=0;i < anInputSplitDataList.size() ;i++) {
     const TopoDS_Shape& aSh = anInputSplitDataList.at(i).Shape;
-    aDM3.Bind(aSh, anInputSplitDataList.at(i).ObjectNames);
+    aDM3.Add(aSh, anInputSplitDataList.at(i).ObjectNames);
     aLS.Append(aSh);
     aBB.Add(aCmp,aSh);
 #ifdef DEB_SPLIT_TO_ZONES
@@ -277,7 +277,7 @@ HYDROData_SplitToZonesTool::SplitDataList
           ********************************************************************* */
       if(!foundF) // face is not modified
         aList.Append (anIt.Value());
-      aDM1.Bind(anIt.Value(), aList);
+      aDM1.Add(anIt.Value(), aList);
   #ifdef DEB_SPLIT_TO_ZONES
       TCollection_AsciiString aName;
   #endif
@@ -313,7 +313,7 @@ HYDROData_SplitToZonesTool::SplitDataList
             cout << aName.ToCString()<< " = " << exp.Current().TShape() <<endl;
   #endif
           }
-          aDM1.Bind(exp.Current(), aList);
+          aDM1.Add(exp.Current(), aList);
         }
       }
     }
@@ -352,10 +352,10 @@ HYDROData_SplitToZonesTool::SplitDataList
               aBndView.Add(anEdge);
               QStringList aListOfNames;
               aListOfNames.append(aBndName);
-              aDM3.Bind(anEdge, aListOfNames);
+              aDM3.Add(anEdge, aListOfNames);
               TopTools_ListOfShape aList;
               aList.Append(anEdge);
-              aDM1.Bind(anEdge,aList);
+              aDM1.Add(anEdge,aList);
             }
             HYDROData_MapOfShape aView;
             exp.Init (aResult, TopAbs_FACE);
@@ -365,7 +365,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                 const TopTools_ListOfShape& aListOfNew = mkCom.Modified(aFace);
                 //cout << "Modified: " << aListOfNew.Extent() <<endl;                                    
                 if(!aListOfNew.IsEmpty()) {
-                  aDM4.Bind(aFace, aListOfNew);
+                  aDM4.Add(aFace, aListOfNew);
 #ifdef DEB_SPLIT_TO_ZONES
                   //TCollection_AsciiString aName = aNam + i + ".brep";
                   //BRepTools::Write(aListOfNew.Last(), aName.ToCString());                
@@ -384,7 +384,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                        else {
                         TopTools_ListOfShape aList; 
                         aList.Append(aFace);
-                        aDM4.Bind(aFace, aList); //the same face - not modified
+                        aDM4.Add(aFace, aList); //the same face - not modified
                        }
                     }
              }
@@ -396,7 +396,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                  aView.Add(anEdge);
                  const TopTools_ListOfShape& aListOfNewEd = mkCom.Modified(anEdge);                 
                  if(!aListOfNewEd.IsEmpty())
-                   aDM4.Bind(anEdge, aListOfNewEd);
+                   aDM4.Add(anEdge, aListOfNewEd);
                  else {
                    if(!mkCom.IsDeleted(anEdge)) {
                      const TopTools_ListOfShape& aListOfGenEd = mkCom.Generated(anEdge);
@@ -405,7 +405,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                      } else {
                        TopTools_ListOfShape aList; 
                        aList.Append(anEdge);
-                       aDM4.Bind(anEdge, aList);//the same edge - not modified
+                       aDM4.Add(anEdge, aList);//the same edge - not modified
                      }
                    }
                  }
@@ -432,7 +432,7 @@ HYDROData_SplitToZonesTool::SplitDataList
              }
 #endif
              if(!aListOfNewEd.IsEmpty())
-               aDM4.Bind(anEdge, aListOfNewEd);
+               aDM4.Add(anEdge, aListOfNewEd);
              else {
                if(!mkCom.IsDeleted(anEdge)) {
                  const TopTools_ListOfShape& aListOfGenEd = mkCom.Generated(anEdge);
@@ -441,7 +441,7 @@ HYDROData_SplitToZonesTool::SplitDataList
                  } else {
                    TopTools_ListOfShape aList; 
                    aList.Append(anEdge);
-                   aDM4.Bind(anEdge, aList);//the same edge - not modified
+                   aDM4.Add(anEdge, aList);//the same edge - not modified
                  }
                }
              }
@@ -456,13 +456,13 @@ HYDROData_SplitToZonesTool::SplitDataList
              TopTools_ListOfShape aList;
              aList.Append(aKey);
              const TopTools_ListOfShape& aListOfNew = mIt.Value();
-             aDM1.Bind(aKey, aListOfNew);
+             aDM1.Add(aKey, aListOfNew);
              TopTools_ListIteratorOfListOfShape it(aListOfNew);
              for(;it.More();it.Next()) {
-               if(!aDM2.IsBound(it.Value()))
-                 aDM2.Bind(it.Value(), aList);
+               if(!aDM2.Contains(it.Value()))
+                 aDM2.Add(it.Value(), aList);
                else {
-                 TopTools_ListOfShape& aList = aDM2.ChangeFind(it.Value());
+                 TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it.Value());
                  aList.Prepend(aKey);
                }
              }
@@ -477,16 +477,16 @@ HYDROData_SplitToZonesTool::SplitDataList
              const TopTools_ListOfShape& aListOfNew = aMIt.Value();
              TopTools_ListIteratorOfListOfShape it(aListOfNew);
              for(;it.More();it.Next()) {// iterate new: b1, b2, b3...
-               if(!aDM4.IsBound(it.Value())) // bi - is deleted
+               if(!aDM4.Contains(it.Value())) // bi - is deleted
                  continue; // go to the next bi
                else {
-                  const TopTools_ListOfShape& aListOfNew4 = aDM4.Find(it.Value());
+                 const TopTools_ListOfShape& aListOfNew4 = aDM4.FindFromKey(it.Value());
                   TopTools_ListIteratorOfListOfShape it4(aListOfNew4); // {c1, c2, c3,...}
                   for(;it4.More();it4.Next()) {
-                    if(!aDM2.IsBound(it4.Value()))
-                      aDM2.Bind(it4.Value(), aList);
+                    if(!aDM2.Contains(it4.Value()))
+                      aDM2.Add(it4.Value(), aList);
                     else {
-                      TopTools_ListOfShape& aList = aDM2.ChangeFind(it4.Value());
+                      TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it4.Value());
                       aList.Prepend(aKey);
                     }
                   }
@@ -513,10 +513,10 @@ HYDROData_SplitToZonesTool::SplitDataList
       const TopTools_ListOfShape& aListOfNew = aMIt.Value();
       TopTools_ListIteratorOfListOfShape it(aListOfNew);
       for(;it.More();it.Next()) {
-        if(!aDM2.IsBound(it.Value()))
-          aDM2.Bind(it.Value(), aList);
+        if(!aDM2.Contains(it.Value()))
+          aDM2.Add(it.Value(), aList);
         else {
-          TopTools_ListOfShape& aList = aDM2.ChangeFind(it.Value());
+          TopTools_ListOfShape& aList = aDM2.ChangeFromKey(it.Value());
           aList.Prepend(aKey);
         }
       }
@@ -546,8 +546,8 @@ HYDROData_SplitToZonesTool::SplitDataList
     TopTools_ListIteratorOfListOfShape it(aListOfOld);
     for(int j =1;it.More();it.Next(),j++) {    
       const TopoDS_Shape& aSh = it.Value(); //old
-      if(aDM3.IsBound(aSh)) {
-        const QStringList& ObjectNames = aDM3.Find(aSh);    
+      if(aDM3.Contains(aSh)) {
+        const QStringList& ObjectNames = aDM3.FindFromKey(aSh);    
         aListOfNames.append(ObjectNames);
 #ifdef DEB_SPLIT_TO_ZONES
         TCollection_AsciiString aName = aNam4 + i +"_" + j + ".brep";
index c80f66fe3ef6480c26c13c089214d6305d35d70d..67b6bdc046c4276066f7afde90c4218172b38928 100644 (file)
@@ -8,8 +8,8 @@
 #include <TopoDS_Compound.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopTools_ShapeMapHasher.hxx>
-#include <NCollection_Map.hxx>
-#include <NCollection_DataMap.hxx>
+#include <NCollection_IndexedMap.hxx>
+#include <NCollection_IndexedDataMap.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <QStringList>
 
@@ -54,11 +54,11 @@ public:
 
   typedef QList        <SplitData> SplitDataList;
   typedef QListIterator<SplitData> SplitDataListIterator;  
-  typedef NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> HYDROData_MapOfShape;
+  typedef NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> HYDROData_MapOfShape;
   typedef HYDROData_MapOfShape::Iterator HYDROData_MapIteratorOfMapOfShape;
-  typedef NCollection_DataMap<TopoDS_Shape, TopTools_ListOfShape, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfShape;
+  typedef NCollection_IndexedDataMap<TopoDS_Shape, TopTools_ListOfShape, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfShape;
   typedef HYDROData_DataMapOfShapeListOfShape::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape;
-  typedef NCollection_DataMap<TopoDS_Shape,  QStringList, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfString;
+  typedef NCollection_IndexedDataMap<TopoDS_Shape,  QStringList, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfString;
   typedef HYDROData_DataMapOfShapeListOfString::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfString;
   #undef _NCollection_MapHasher