Navigation Menu

Skip to content

Commit

Permalink
[TD] code optimization for DrawViewPart
Browse files Browse the repository at this point in the history
Use same code for GeomHatch and Hatch in DrawViewPart as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=47536&start=10
  • Loading branch information
donovaly authored and WandererFan committed Jun 16, 2020
1 parent d804eb6 commit ddf0cf3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Mod/TechDraw/App/DrawViewPart.cpp
Expand Up @@ -622,14 +622,11 @@ void DrawViewPart::extractFaces()

std::vector<TechDraw::DrawHatch*> DrawViewPart::getHatches() const
{
// Base::Console().Message("DVP::getHatches()\n");
std::vector<TechDraw::DrawHatch*> result;
std::vector<App::DocumentObject*> children = getInList();
for (std::vector<App::DocumentObject*>::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<TechDraw::DrawHatch*>(*it);
result.push_back(hatch);
}
Expand All @@ -642,7 +639,7 @@ std::vector<TechDraw::DrawGeomHatch*> DrawViewPart::getGeomHatches() const
std::vector<TechDraw::DrawGeomHatch*> result;
std::vector<App::DocumentObject*> children = getInList();
for (std::vector<App::DocumentObject*>::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<TechDraw::DrawGeomHatch*>(*it);
result.push_back(geom);
Expand Down

0 comments on commit ddf0cf3

Please sign in to comment.