From: eap Date: Mon, 11 Feb 2008 15:14:11 +0000 (+0000) Subject: PAL18920: 2 Meshes with the same hypothesis : one compute well but the other not !?! X-Git-Tag: V4_1_1rc1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b88ec5abd8c049cb9f6b77508ece7e661c90f395;p=modules%2Fsmesh.git PAL18920: 2 Meshes with the same hypothesis : one compute well but the other not !?! fix GetSubMeshNodesId() for vertex submesh with several nodes --- diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 32e8ee2bc..3de13f6f6 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -1946,12 +1946,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 @@ -1961,16 +1961,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(); }