PAL13639 (EDF PAL 317 : SMESH : Create "0D Hypothesis")

enable submeshes on vertices
This commit is contained in:
eap 2007-02-19 16:32:46 +00:00
parent 2aab1df9bb
commit 331304764c

View File

@ -210,12 +210,18 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all)
for ( ; sm != smList.end(); ++sm )
{
SMDS_ElemIteratorPtr eIt = (*sm)->GetElements();
if ( eIt->more() ) {
while ( eIt->more() ) {
const SMDS_MeshElement* anElem = eIt->next();
SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
} else {
SMDS_NodeIteratorPtr nIt = (*sm)->GetNodes();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
}
return nodeIds.size();
}
@ -225,12 +231,18 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all)
if ( all ) { // all nodes of submesh elements
SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements();
if ( eIt->more() ) {
while ( eIt->more() ) {
const SMDS_MeshElement* anElem = eIt->next();
SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
} else {
SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
return nodeIds.size();
}
@ -317,12 +329,18 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle
if ( theElemType == SMESH::NODE )
{
SMDS_ElemIteratorPtr eIt = (*sm)->GetElements();
if ( eIt->more() ) {
while ( eIt->more() ) {
const SMDS_MeshElement* anElem = eIt->next();
SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
} else {
SMDS_NodeIteratorPtr nIt = (*sm)->GetNodes();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
}
else
{
@ -340,12 +358,18 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle
if ( theElemType == SMESH::NODE && aSubMeshDS )
{
SMDS_ElemIteratorPtr eIt = aSubMeshDS->GetElements();
if ( eIt->more() ) {
while ( eIt->more() ) {
const SMDS_MeshElement* anElem = eIt->next();
SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
} else {
SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes();
while ( nIt->more() )
nodeIds.insert( nIt->next()->GetID() );
}
}
if ( theElemType == SMESH::NODE )