Fix error on attempt to assign a hypothesis.

This commit is contained in:
jfa 2007-04-24 07:35:12 +00:00
parent 2d4013ab7a
commit 2884e2221b

View File

@ -112,11 +112,15 @@ void SMESHDS_Mesh::ShapeToMesh(const TopoDS_Shape & S)
bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS, bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS,
const SMESHDS_Hypothesis * H) const SMESHDS_Hypothesis * H)
{ {
list<const SMESHDS_Hypothesis *>& alist= if (!myShapeToHypothesis.IsBound(SS.Oriented(TopAbs_FORWARD))) {
list<const SMESHDS_Hypothesis *> aList;
myShapeToHypothesis.Bind(SS.Oriented(TopAbs_FORWARD), aList);
}
list<const SMESHDS_Hypothesis *>& alist =
myShapeToHypothesis(SS.Oriented(TopAbs_FORWARD)); // ignore orientation of SS myShapeToHypothesis(SS.Oriented(TopAbs_FORWARD)); // ignore orientation of SS
//Check if the Hypothesis is still present //Check if the Hypothesis is still present
list<const SMESHDS_Hypothesis*>::iterator ith=find(alist.begin(),alist.end(), H ); list<const SMESHDS_Hypothesis*>::iterator ith = find(alist.begin(),alist.end(), H );
if (alist.end() != ith) return false; if (alist.end() != ith) return false;