diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 08a4d6d62..308456021 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -660,6 +660,24 @@ throw(SALOME_Exception) return aSubMesh; } +//============================================================================= +/*! + * Get the SMESH_subMesh object implementation. Dont create it, return null + * if it does not exist. + */ +//============================================================================= + +SMESH_subMesh *SMESH_Mesh::GetSubMeshContaining(const int aShapeID) +throw(SALOME_Exception) +{ + Unexpect aCatch(SalomeException); + + map ::iterator i_sm = _mapSubMesh.find(aShapeID); + if (i_sm == _mapSubMesh.end()) + return NULL; + return i_sm->second; +} + //======================================================================= //function : IsUsedHypothesis //purpose : Return True if anHyp is used to mesh aSubShape diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 5753a5952..a91a8861b 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -129,6 +129,9 @@ public: SMESH_subMesh *GetSubMeshContaining(const TopoDS_Shape & aSubShape) throw(SALOME_Exception); + SMESH_subMesh *GetSubMeshContaining(const int aShapeID) + throw(SALOME_Exception); + const list < SMESH_subMesh * >& GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) throw(SALOME_Exception);