1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0029830: STEPCAFControl_Reader poor performance - quadratic dependence

Various performance improvements in STEP read/write algorithms:
- Search for the  label of a shape or component shape is improved using map mechanism instead of brute force iteration.
- Invariant FindEntities() is moved out of the loop in the method getStyledItem in STEPCAFControl/STEPCAFControl_Writer.cxx.
- A pointer to the end of binders chain is added in Transfer_Binder class to speed up adding a binder to the chain.
- Small fixes are added  to eliminate excess copying of handles, calls of handle DownCasts and so on.

Stack overflow is removed during destruction of STEP model with long chains of Transfer_Binder.
It is possible to use the Draw commands ReadStep and WriteStep to read/write from the session without accessing the disk file (use '.' for the file name).

Performance test cases for STEP reading/writing have been added.
This commit is contained in:
msv
2018-06-01 14:38:39 +03:00
committed by bugmaster
parent 0a96e0bbc4
commit 63cdf48ec1
17 changed files with 349 additions and 185 deletions

View File

@@ -932,7 +932,7 @@ Standard_Boolean XCAFDoc_ShapeTool::GetReferredShape (const TDF_Label& L,
TDF_Label XCAFDoc_ShapeTool::AddComponent (const TDF_Label& assembly,
const TDF_Label& compL,
const TopLoc_Location &Loc) const
const TopLoc_Location &Loc)
{
TDF_Label L;
@@ -949,6 +949,14 @@ TDF_Label XCAFDoc_ShapeTool::AddComponent (const TDF_Label& assembly,
L = aTag.NewChild(assembly);
MakeReference ( L, compL, Loc );
// map shape to label
TopoDS_Shape aShape;
if (GetShape(L, aShape))
{
if (!myShapeLabels.IsBound(aShape))
myShapeLabels.Bind(aShape, L);
}
return L;
}