From: jfa Date: Tue, 24 Apr 2007 07:35:12 +0000 (+0000) Subject: Fix error on attempt to assign a hypothesis. X-Git-Tag: V4_0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2884e2221b0afc70e9769d963522d8be0e963720;p=modules%2Fsmesh.git Fix error on attempt to assign a hypothesis. --- diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index e2bf53c6e..9f48b7b15 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -112,11 +112,15 @@ void SMESHDS_Mesh::ShapeToMesh(const TopoDS_Shape & S) bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H) { - list& alist= + if (!myShapeToHypothesis.IsBound(SS.Oriented(TopAbs_FORWARD))) { + list aList; + myShapeToHypothesis.Bind(SS.Oriented(TopAbs_FORWARD), aList); + } + list& alist = myShapeToHypothesis(SS.Oriented(TopAbs_FORWARD)); // ignore orientation of SS //Check if the Hypothesis is still present - list::iterator ith=find(alist.begin(),alist.end(), H ); + list::iterator ith = find(alist.begin(),alist.end(), H ); if (alist.end() != ith) return false;