[TD]remove Hatches from Display when deleted

This commit is contained in:
wandererfan
2020-03-11 10:05:07 -04:00
committed by WandererFan
parent fd9183727e
commit fb035a9a0d
5 changed files with 32 additions and 2 deletions

View File

@@ -620,7 +620,8 @@ std::vector<TechDraw::DrawHatch*> DrawViewPart::getHatches() const
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)->getTypeId().isDerivedFrom(DrawHatch::getClassTypeId())) {
if ( ((*it)->getTypeId().isDerivedFrom(DrawHatch::getClassTypeId())) &&
(!(*it)->isRemoving()) ) {
TechDraw::DrawHatch* hatch = dynamic_cast<TechDraw::DrawHatch*>(*it);
result.push_back(hatch);
}
@@ -633,7 +634,8 @@ 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);
}