From c916e4712de3b614d388ee66439d8271b864571d Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 11 Feb 2008 15:14:32 +0000 Subject: [PATCH] PAL18920: 2 Meshes with the same hypothesis : one compute well but the other not !?! fix GetSubMeshNodesId() for vertex submesh with several nodes --- src/SMESH_I/SMESH_Mesh_i.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 78b6c1cc5..b5b02de8d 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -1900,12 +1900,12 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CO SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); if(!SDSM) return aResult._retn(); - map theElems; - if( !all || (SDSM->NbElements()==0 && SDSM->NbNodes()==1) ) { + set theElems; + if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh SMDS_NodeIteratorPtr nIt = SDSM->GetNodes(); while ( nIt->more() ) { const SMDS_MeshNode* elem = nIt->next(); - theElems.insert( make_pair(elem->GetID(),elem) ); + theElems.insert( elem->GetID() ); } } else { // all nodes of submesh elements @@ -1915,16 +1915,16 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CO SMDS_ElemIteratorPtr nIt = anElem->nodesIterator(); while ( nIt->more() ) { const SMDS_MeshElement* elem = nIt->next(); - theElems.insert( make_pair(elem->GetID(),elem) ); + theElems.insert( elem->GetID() ); } } } aResult->length(theElems.size()); - map::iterator itElem; + set::iterator itElem; int i = 0; for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) - aResult[i++] = (*itElem).first; + aResult[i++] = *itElem; return aResult._retn(); } -- 2.39.2