Salome HOME
In GetSubMesh(), assure calling fillAncestorsMap() for each compound
authoreap <eap@opencascade.com>
Mon, 20 May 2013 09:11:12 +0000 (09:11 +0000)
committereap <eap@opencascade.com>
Mon, 20 May 2013 09:11:12 +0000 (09:11 +0000)
(take into account that a compound can be added to SMESHDS_Mesh at
creation of group on geometry)

src/SMESH/SMESH_Mesh.cxx

index b43a419..22fd2e4 100644 (file)
@@ -918,10 +918,9 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
     if ( it.More() )
     {
       index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
-      if ( index > _nbSubShapes ) _nbSubShapes = index; // not to create sm for this group again
-
       // fill map of Ancestors
-      fillAncestorsMap(aSubShape);
+      while ( _nbSubShapes < index )
+        fillAncestorsMap( _myMeshDS->IndexToShape( ++_nbSubShapes ));
     }
   }
 //   if ( !index )