Salome HOME
task "Polyhedral elements". Add GetSubmeshContaining( shapeID )
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
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