[TD]allow cosmetic deletion via DEL
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -255,6 +255,8 @@ public:
|
||||
|
||||
static std::string translateArbitrary(std::string context, std::string baseName, std::string uniqueName);
|
||||
|
||||
static bool isCosmeticVertex(App::DocumentObject* owner, std::string element);
|
||||
static bool isCosmeticEdge(App::DocumentObject* owner, std::string element);
|
||||
|
||||
//debugging routines
|
||||
static void dumpVertexes(const char* text, const TopoDS_Shape& s);
|
||||
|
||||
Reference in New Issue
Block a user