mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-15 10:08:35 +05:00
Bug 0020229: Perf of MakeSphere and RemoveObject. Allow to re-use empty label, following the _lastCleared one.
This commit is contained in:
parent
9d1cc3492c
commit
85bed9f0cb
@ -233,6 +233,12 @@ Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType)
|
||||
if (_lastCleared.Root() == aDoc->Main().Root()) {
|
||||
useExisting = true;
|
||||
aChild = _lastCleared;
|
||||
// 0020229: if next label exists and is empty, try to reuse it
|
||||
Standard_Integer aNextTag = aChild.Tag() + 1;
|
||||
TDF_Label aNextL = aDoc->Main().FindChild(aNextTag, Standard_False);
|
||||
if (!aNextL.IsNull() && !aNextL.HasAttribute())
|
||||
_lastCleared = aNextL;
|
||||
else
|
||||
_lastCleared.Nullify();
|
||||
}
|
||||
}
|
||||
@ -273,6 +279,12 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape,
|
||||
if (_lastCleared.Root() == aDoc->Main().Root()) {
|
||||
useExisting = true;
|
||||
aChild = _lastCleared;
|
||||
// 0020229: if next label exists and is empty, try to reuse it
|
||||
Standard_Integer aNextTag = aChild.Tag() + 1;
|
||||
TDF_Label aNextL = aDoc->Main().FindChild(aNextTag, Standard_False);
|
||||
if (!aNextL.IsNull() && !aNextL.HasAttribute())
|
||||
_lastCleared = aNextL;
|
||||
else
|
||||
_lastCleared.Nullify();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user