From 245c0f137d40a4da5e4ada0eaa653e36464cfc55 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 23 Mar 2005 09:36:30 +0000 Subject: [PATCH] task "Polyhedral elements". Add GetSubmeshContaining( shapeID ) --- src/SMESH/SMESH_Mesh.cxx | 18 ++++++++++++++++++ src/SMESH/SMESH_Mesh.hxx | 3 +++ 2 files changed, 21 insertions(+) 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); -- 2.39.2