list<TopoDS_Shape>::iterator sh = shapeList.begin();
for ( ; sh != shapeList.end(); ++sh ) {
for ( TopoDS_Iterator it( *sh ); it.More(); it.Next() ) {
- ::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() );
- if ( aSubMesh )
- getSubMeshes( aSubMesh, theSubMeshList );
+ if ( ::SMESH_subMesh* aSubMesh = aMesh->GetSubMeshContaining( it.Value() ))
+ getSubMeshes( aSubMesh, theSubMeshList ); // add found submesh or explore deeper
else
// no submesh for a compound inside compound
shapeList.push_back( it.Value() );
}
break;
}
+ default: theSubMeshList.push_back( aSubMeshDS );
}
return size < theSubMeshList.size();
}
for ( int i = 0; sm != smList.end(); sm++ )
{
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();
}
}