0020206: EDF SMESH 987: Netgen1D2D3D +submesh

in GetSubMesh(), fix detection of SMESHDS_SubMesh'es of geom groups
This commit is contained in:
eap 2009-03-11 15:09:46 +00:00
parent 6f2fdeb795
commit e49d9ab359

View File

@ -85,7 +85,7 @@ SMESH_Mesh::SMESH_Mesh(int theLocalId,
SMESH_Gen* theGen, SMESH_Gen* theGen,
bool theIsEmbeddedMode, bool theIsEmbeddedMode,
SMESHDS_Document* theDocument): SMESHDS_Document* theDocument):
_groupId( 0 ) _groupId( 0 ), _nbSubShapes( 0 )
{ {
MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)"); MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
_id = theLocalId; _id = theLocalId;
@ -166,6 +166,7 @@ void SMESH_Mesh::ShapeToMesh(const TopoDS_Shape & aShape)
{ {
_myMeshDS->ShapeToMesh(aShape); _myMeshDS->ShapeToMesh(aShape);
_isShapeToMesh = true; _isShapeToMesh = true;
_nbSubShapes = _myMeshDS->MaxShapeIndex();
// fill _mapAncestors // fill _mapAncestors
int desType, ancType; int desType, ancType;
@ -822,7 +823,7 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape)
int index = _myMeshDS->ShapeToIndex(aSubShape); int index = _myMeshDS->ShapeToIndex(aSubShape);
// for submeshes on GEOM Group // for submeshes on GEOM Group
if ( !index && aSubShape.ShapeType() == TopAbs_COMPOUND ) { if (( !index || index > _nbSubShapes ) && aSubShape.ShapeType() == TopAbs_COMPOUND ) {
TopoDS_Iterator it( aSubShape ); TopoDS_Iterator it( aSubShape );
if ( it.More() ) if ( it.More() )
index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() ); index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );