From 586f8120ea0605b206231220f94f1eb64b0adffa Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 21 Oct 2019 13:34:29 +0200 Subject: [PATCH] some Timers in LoadOCC, don't read edge names --- libsrc/occ/occgeom.cpp | 22 ++++++++++++++++------ libsrc/occ/occgeom.hpp | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/libsrc/occ/occgeom.cpp b/libsrc/occ/occgeom.cpp index fb8006f6..bb95ee88 100644 --- a/libsrc/occ/occgeom.cpp +++ b/libsrc/occ/occgeom.cpp @@ -1310,6 +1310,10 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a void LoadOCCInto(OCCGeometry* occgeo, const char* filename) { + static Timer timer_all("LoadOCC"); RegionTimer rtall(timer_all); + static Timer timer_readfile("LoadOCC-ReadFile"); + static Timer timer_transfer("LoadOCC-Transfer"); + static Timer timer_getnames("LoadOCC-get names"); // Initiate a dummy XCAF Application to handle the STEP XCAF Document static Handle_XCAFApp_Application dummy_app = XCAFApp_Application::GetApplication(); @@ -1326,19 +1330,23 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a } dummy_app->NewDocument ("STEP-XCAF",step_doc); + timer_readfile.Start(); STEPCAFControl_Reader reader; // Enable transfer of colours reader.SetColorMode(Standard_True); reader.SetNameMode(Standard_True); Standard_Integer stat = reader.ReadFile((char*)filename); + timer_readfile.Stop(); + timer_transfer.Start(); if(stat != IFSelect_RetDone) { throw NgException("Couldn't load OCC geometry"); } reader.Transfer(step_doc); + timer_transfer.Stop(); // Read in the shape(s) and the colours present in the STEP File Handle_XCAFDoc_ShapeTool step_shape_contents = XCAFDoc_DocumentTool::ShapeTool(step_doc->Main()); @@ -1376,6 +1384,7 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a occgeo->snames.Append(name); TopExp_Explorer exp0,exp1; + timer_getnames.Start(); for (exp0.Init(occgeo->shape, TopAbs_FACE); exp0.More(); exp0.Next()) { TopoDS_Face face = TopoDS::Face(exp0.Current()); @@ -1383,13 +1392,14 @@ void STEP_GetEntityName(const TopoDS_Shape & theShape, STEPCAFControl_Reader * a if (name == string("")) snprintf(name, 50, "bc_%zu", occgeo->fnames.Size()); occgeo->fnames.Append(name); - for (exp1.Init(face, TopAbs_EDGE); exp1.More(); exp1.Next()) - { - TopoDS_Edge edge = TopoDS::Edge(exp1.Current()); - STEP_GetEntityName(edge,&reader,name); - occgeo->enames.Append(name); - } +// for (exp1.Init(face, TopAbs_EDGE); exp1.More(); exp1.Next()) +// { +// TopoDS_Edge edge = TopoDS::Edge(exp1.Current()); +// STEP_GetEntityName(edge,&reader,name); +// occgeo->enames.Append(name); +// } } + timer_getnames.Stop(); // Gerhard BEGIN // cout << "Solid Names: "<snames.Size();i++) diff --git a/libsrc/occ/occgeom.hpp b/libsrc/occ/occgeom.hpp index 45f06026..25369ac7 100644 --- a/libsrc/occ/occgeom.hpp +++ b/libsrc/occ/occgeom.hpp @@ -216,7 +216,7 @@ namespace netgen TopTools_IndexedMapOfShape fmap, emap, vmap, somap, shmap, wmap; NgArray fsingular, esingular, vsingular; Box<3> boundingbox; - NgArray fnames, enames, snames; + NgArray fnames, /*enames,*/ snames; // Philippose - 29/01/2009 // OpenCascade XDE Support // XCAF Handle to make the face colours available to the rest of