X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Mesh.cxx;h=94b1b7a72c22313edf9cb2d51fd369b3afac1de5;hp=49446080fa25794004ca7f9c81952eedf4b3d7e6;hb=22463abfc977f33a756ce1d6398c840b7a8e3af2;hpb=062d52d5db30036907ba749804a2a27bc7ef97f5 diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 49446080f..94b1b7a72 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -237,6 +237,26 @@ bool SMESH_Mesh::MeshExists( int meshId ) const return _myDocument ? bool( _myDocument->GetMesh( meshId )) : false; } +//================================================================================ +/*! + * \brief Return a mesh by id + */ +//================================================================================ + +SMESH_Mesh* SMESH_Mesh::FindMesh( int meshId ) const +{ + if ( _id == meshId ) + return (SMESH_Mesh*) this; + + if ( StudyContextStruct *aStudyContext = _gen->GetStudyContext( _studyId )) + { + std::map < int, SMESH_Mesh * >::iterator i_m = aStudyContext->mapMesh.find( meshId ); + if ( i_m != aStudyContext->mapMesh.end() ) + return i_m->second; + } + return NULL; +} + //============================================================================= /*! * \brief Set geometry to be meshed