Salome HOME
+ bool IsUsedHypothesis(const SMESHDS_Hypothesis * H) const;
authoreap <eap@opencascade.com>
Fri, 28 Oct 2011 12:49:19 +0000 (12:49 +0000)
committereap <eap@opencascade.com>
Fri, 28 Oct 2011 12:49:19 +0000 (12:49 +0000)
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_Mesh.hxx

index 4328f923e23b0251796f0e8eb51b37ad7bc4cbc1..d5c7e172fe4d0dbecc188dc6c07d12f2f520aab7 100644 (file)
@@ -1145,6 +1145,21 @@ SMESHDS_Mesh::GetHypothesis(const TopoDS_Shape & S) const
   return empty;
 }
 
+//================================================================================
+/*!
+ * \brief returns true if the hypothesis is assigned to any sub-shape
+ */
+//================================================================================
+
+bool SMESHDS_Mesh::IsUsedHypothesis(const SMESHDS_Hypothesis * H) const
+{
+  ShapeToHypothesis::Iterator s2h( myShapeToHypothesis );
+  for ( ; s2h.More(); s2h.Next() )
+    if ( std::find( s2h.Value().begin(), s2h.Value().end(), H ) != s2h.Value().end() )
+      return true;
+  return false;
+}
+
 //=======================================================================
 //function : GetScript
 //purpose  : 
index ad1d79832d05880a8d6b4ac590fdaf0db62dcaa1..f91f152cea8477621425fdb8c3d60f39b5355c74 100644 (file)
@@ -422,6 +422,7 @@ public:
 
   bool HasHypothesis(const TopoDS_Shape & S);
   const std::list<const SMESHDS_Hypothesis*>& GetHypothesis(const TopoDS_Shape & S) const;
+  bool IsUsedHypothesis(const SMESHDS_Hypothesis * H) const;
   SMESHDS_Script * GetScript();
   void ClearScript();
   int ShapeToIndex(const TopoDS_Shape & aShape) const;