Fix idSourceToNodeSet() for the case of mesh with free nodes

This commit is contained in:
eap 2011-03-21 10:19:55 +00:00
parent 81dcf37720
commit cb561f9569

View File

@ -311,7 +311,15 @@ namespace {
if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] )) if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] ))
theNodeSet.insert( theNodeSet.end(), n); theNodeSet.insert( theNodeSet.end(), n);
} }
else { else if ( SMESH::DownCast<SMESH_Mesh_i*>( theObject ))
{
SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator();
while ( nIt->more( ))
if( const SMDS_MeshElement * elem = nIt->next() )
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());
}
else
{
for(int i = 0; i < aElementsId->length(); i++) for(int i = 0; i < aElementsId->length(); i++)
if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] )) if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] ))
theNodeSet.insert( elem->begin_nodes(), elem->end_nodes()); theNodeSet.insert( elem->begin_nodes(), elem->end_nodes());