Salome HOME
task "Polyhedral elements". Add GetSubmeshContaining( shapeID )
authoreap <eap@opencascade.com>
Wed, 23 Mar 2005 09:36:30 +0000 (09:36 +0000)
committereap <eap@opencascade.com>
Wed, 23 Mar 2005 09:36:30 +0000 (09:36 +0000)
src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx

index 08a4d6d627a26471dae77ebb9a2afadce9cc1006..308456021be04dd5705e11f232379155f971161b 100644 (file)
@@ -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 <int, SMESH_subMesh *>::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
index 5753a5952d7fa8347333322227eac5216ed2e963..a91a8861bf0157125b55dfc93d7fe91c1a55cafe 100644 (file)
@@ -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);