Skip to content
Snippets Groups Projects
Commit 788b9ce0 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix for #1289: make sure to delete removed entities in GModel during sync also...

fix for #1289: make sure to delete removed entities in GModel during sync also with unbindWithoutChecks(): otherwise if some tags are reused (because entities have previsously been removed before the unbind, but without a sync between the two operations) we would find the (wrong) original entities in the GModel.


(cherry picked from commit 72b91c25)
parent 599dba9c
Branches
Tags
No related merge requests found
...@@ -583,6 +583,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -583,6 +583,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _solidTag.Find(solid); int tag = _solidTag.Find(solid);
_solidTag.UnBind(solid); _solidTag.UnBind(solid);
_tagSolid.UnBind(tag); _tagSolid.UnBind(tag);
_toRemove.insert(std::make_pair(3, tag));
} }
} }
for(exp0.Init(shape, TopAbs_SHELL); exp0.More(); exp0.Next()) { for(exp0.Init(shape, TopAbs_SHELL); exp0.More(); exp0.Next()) {
...@@ -591,6 +592,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -591,6 +592,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _shellTag.Find(shell); int tag = _shellTag.Find(shell);
_shellTag.UnBind(shell); _shellTag.UnBind(shell);
_tagShell.UnBind(tag); _tagShell.UnBind(tag);
_toRemove.insert(std::make_pair(-2, tag));
} }
} }
for(exp0.Init(shape, TopAbs_FACE); exp0.More(); exp0.Next()) { for(exp0.Init(shape, TopAbs_FACE); exp0.More(); exp0.Next()) {
...@@ -599,6 +601,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -599,6 +601,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _faceTag.Find(face); int tag = _faceTag.Find(face);
_faceTag.UnBind(face); _faceTag.UnBind(face);
_tagFace.UnBind(tag); _tagFace.UnBind(tag);
_toRemove.insert(std::make_pair(2, tag));
} }
} }
for(exp0.Init(shape, TopAbs_WIRE); exp0.More(); exp0.Next()) { for(exp0.Init(shape, TopAbs_WIRE); exp0.More(); exp0.Next()) {
...@@ -607,6 +610,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -607,6 +610,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _wireTag.Find(wire); int tag = _wireTag.Find(wire);
_wireTag.UnBind(wire); _wireTag.UnBind(wire);
_tagWire.UnBind(tag); _tagWire.UnBind(tag);
_toRemove.insert(std::make_pair(-1, tag));
} }
} }
for(exp0.Init(shape, TopAbs_EDGE); exp0.More(); exp0.Next()) { for(exp0.Init(shape, TopAbs_EDGE); exp0.More(); exp0.Next()) {
...@@ -615,6 +619,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -615,6 +619,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _edgeTag.Find(edge); int tag = _edgeTag.Find(edge);
_edgeTag.UnBind(edge); _edgeTag.UnBind(edge);
_tagEdge.UnBind(tag); _tagEdge.UnBind(tag);
_toRemove.insert(std::make_pair(1, tag));
} }
} }
for(exp0.Init(shape, TopAbs_VERTEX); exp0.More(); exp0.Next()) { for(exp0.Init(shape, TopAbs_VERTEX); exp0.More(); exp0.Next()) {
...@@ -623,6 +628,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape) ...@@ -623,6 +628,7 @@ void OCC_Internals::unbindWithoutChecks(TopoDS_Shape shape)
int tag = _vertexTag.Find(vertex); int tag = _vertexTag.Find(vertex);
_vertexTag.UnBind(vertex); _vertexTag.UnBind(vertex);
_tagVertex.UnBind(tag); _tagVertex.UnBind(tag);
_toRemove.insert(std::make_pair(0, tag));
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment