From 2884e2221b0afc70e9769d963522d8be0e963720 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 24 Apr 2007 07:35:12 +0000 Subject: [PATCH] Fix error on attempt to assign a hypothesis. --- src/SMESHDS/SMESHDS_Mesh.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; -- 2.30.2