PAL11200. Fix for a submesh on a wire

This commit is contained in:
eap 2006-02-16 08:12:48 +00:00
parent a668071aa4
commit c179781b62

View File

@ -128,9 +128,8 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh,
list<TopoDS_Shape>::iterator sh = shapeList.begin(); list<TopoDS_Shape>::iterator sh = shapeList.begin();
for ( ; sh != shapeList.end(); ++sh ) { for ( ; sh != shapeList.end(); ++sh ) {
for ( TopoDS_Iterator it( *sh ); it.More(); it.Next() ) { for ( TopoDS_Iterator it( *sh ); it.More(); it.Next() ) {
::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() ); if ( ::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() ))
if ( aSubMesh ) getSubMeshes( aSubMesh, theSubMeshList ); // add found submesh or explore deeper
getSubMeshes( aSubMesh, theSubMeshList );
else else
// no submesh for a compound inside compound // no submesh for a compound inside compound
shapeList.push_back( it.Value() ); shapeList.push_back( it.Value() );
@ -147,6 +146,7 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh,
} }
break; break;
} }
default: theSubMeshList.push_back( aSubMeshDS );
} }
return size < theSubMeshList.size(); return size < theSubMeshList.size();
} }
@ -274,7 +274,7 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId()
for ( int i = 0; sm != smList.end(); sm++ ) for ( int i = 0; sm != smList.end(); sm++ )
{ {
SMDS_ElemIteratorPtr anIt = (*sm)->GetElements(); SMDS_ElemIteratorPtr anIt = (*sm)->GetElements();
for ( int n = aSubMeshDS->NbElements(); i < n && anIt->more(); i++ ) for ( ; i < nbElems && anIt->more(); i++ )
aResult[i] = anIt->next()->GetID(); aResult[i] = anIt->next()->GetID();
} }
} }