From: eap Date: Fri, 28 Oct 2011 12:49:19 +0000 (+0000) Subject: + bool IsUsedHypothesis(const SMESHDS_Hypothesis * H) const; X-Git-Tag: V6_4_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=72f74a3ee127ebb841e5396c9e043cac1d8f09bb;p=modules%2Fsmesh.git + bool IsUsedHypothesis(const SMESHDS_Hypothesis * H) const; --- diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 4328f923e..d5c7e172f 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -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 : diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index ad1d79832..f91f152ce 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -422,6 +422,7 @@ public: bool HasHypothesis(const TopoDS_Shape & S); const std::list& 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;