[TD]allow cosmetic deletion via DEL

This commit is contained in:
wandererfan
2023-09-15 10:04:51 -04:00
committed by WandererFan
parent cde6afe847
commit 82db4a3e47
4 changed files with 83 additions and 5 deletions

View File

@@ -69,6 +69,7 @@
#include "GeometryObject.h"
#include "LineGroup.h"
#include "Preferences.h"
#include "DrawViewPart.h"
using namespace TechDraw;
@@ -1625,6 +1626,27 @@ std::string DrawUtil::translateArbitrary(std::string context, std::string baseNa
return ssTranslated + suffix;
}
// true if owner->element is a cosmetic vertex
bool DrawUtil::isCosmeticVertex(App::DocumentObject* owner, std::string element)
{
auto ownerView = static_cast<TechDraw::DrawViewPart*>(owner);
auto vertex = ownerView->getVertex(element);
if (vertex) {
return vertex->getCosmetic();
}
return false;
}
// true if owner->element is a cosmetic edge
bool DrawUtil::isCosmeticEdge(App::DocumentObject* owner, std::string element)
{
auto ownerView = static_cast<TechDraw::DrawViewPart*>(owner);
auto edge = ownerView->getEdge(element);
if (edge) {
return edge->getCosmetic();
}
return false;
}
//============================
// various debugging routines.