Salome HOME
The search of shapes in the map is corrected by workaround.
authoradv <adv@opencascade.com>
Mon, 13 Jan 2014 11:47:27 +0000 (11:47 +0000)
committeradv <adv@opencascade.com>
Mon, 13 Jan 2014 11:47:27 +0000 (11:47 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx

index bcbd1964dd8109d60c05a5f91b5243c72f804a48..5ec5856081718b834caafa6794e524067641b72d 100644 (file)
@@ -736,12 +736,19 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var
     {
       const TopoDS_Shape& aShape = aGroupDef.Shapes.Value( i );
 
-      const TopoDS_Shape& ModifiedShape = aSewing.Modified( aShape );
-      if ( ModifiedShape.IsNull() )
+      const TopoDS_Shape& aModifiedShape = aSewing.Modified( aShape );
+      if ( aModifiedShape.IsNull() )
         continue;
 
-      int anIndex = aMapOfSubShapes.FindIndex( ModifiedShape );
-      if ( anIndex > 0 ) aGroupIndexes.Append( anIndex );
+      // Workaround for TopTools_IndexedMapOfShape::FindIndex()
+      for ( int anIndex = 1; anIndex <= aMapOfSubShapes.Extent(); anIndex++ )
+      {
+        if ( aModifiedShape.IsPartner( aMapOfSubShapes.FindKey( anIndex ) ) )
+        {
+          aGroupIndexes.Append( anIndex );
+          break;
+        }
+      }
     }
 
     if ( !aGroupIndexes.IsEmpty() )