Salome HOME
tests 1 to 7 OK, 8 and above failed
[modules/hydro.git] / src / HYDROData / HYDROData_GeomTool.cxx
index 8423f6d314083b7a514fdf993d29ea673841e2cb..3d54e13f34e87e59f3cb4d8b03723619ca9f2f92 100644 (file)
@@ -164,7 +164,7 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::publishShapeInGEOM(
 GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GEOM_Gen_var theGeomEngine, 
   SALOMEDS::Study_ptr theStudy, 
   const TopoDS_Shape& theShape,   
-  const NCollection_IndexedDataMap<TopoDS_Shape, QString>& aFacesToNameModif,  
+  const NCollection_IndexedDataMap<TopoDS_Shape, QString, TopTools_ShapeMapHasher>& aFacesToNameModif,  
   const QString& theName,
   QString& theGeomObjEntry)
 { 
@@ -175,6 +175,14 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE
 
   TopTools_MapOfShape mapShape;
 
+  NCollection_IndexedDataMap<TopoDS_Shape, QString, TopTools_ShapeMapHasher> aFF2N;
+  for (int i = 1; i <= aFacesToNameModif.Extent(); i++)
+  {
+    TopExp_Explorer exp (aFacesToNameModif.FindKey(i), TopAbs_FACE);
+    for (;exp.More(); exp.Next())
+      aFF2N.Add(exp.Current(), aFacesToNameModif.FindFromIndex(i));
+  }
+
   TopExp_Explorer exp (theShape, TopAbs_FACE);
   QVector<QString> Names;
   for (; exp.More(); exp.Next())
@@ -183,7 +191,7 @@ GEOM::GEOM_Object_ptr HYDROData_GeomTool::ExplodeShapeInGEOMandPublish( GEOM::GE
     if (mapShape.Add(csh))
     {
       //listShape.Append(csh);
-      QString Qstr = aFacesToNameModif.FindFromKey(csh);
+      QString Qstr = aFF2N.FindFromKey(csh);
       Names.push_back(Qstr);
     }
   }