From ddf0cf3136a6c5a459abae4bf1f9c714f6f45c86 Mon Sep 17 00:00:00 2001 From: donovaly Date: Tue, 16 Jun 2020 00:08:42 +0200 Subject: [PATCH] [TD] code optimization for DrawViewPart Use same code for GeomHatch and Hatch in DrawViewPart as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=47536&start=10 --- src/Mod/TechDraw/App/DrawViewPart.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index ea096a61d47f..d22fac572d19 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -622,14 +622,11 @@ void DrawViewPart::extractFaces() std::vector DrawViewPart::getHatches() const { -// Base::Console().Message("DVP::getHatches()\n"); std::vector result; std::vector children = getInList(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ((*it)->isRemoving()) { - continue; - } - if ((*it)->getTypeId().isDerivedFrom(DrawHatch::getClassTypeId())) { + if ( ((*it)->getTypeId().isDerivedFrom(DrawHatch::getClassTypeId())) && + (!(*it)->isRemoving()) ) { TechDraw::DrawHatch* hatch = dynamic_cast(*it); result.push_back(hatch); } @@ -642,7 +639,7 @@ std::vector DrawViewPart::getGeomHatches() const std::vector result; std::vector children = getInList(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ( ((*it)->getTypeId().isDerivedFrom(DrawGeomHatch::getClassTypeId())) && + if ( ((*it)->getTypeId().isDerivedFrom(DrawGeomHatch::getClassTypeId())) && (!(*it)->isRemoving()) ) { TechDraw::DrawGeomHatch* geom = dynamic_cast(*it); result.push_back(geom);