Text Leader initial version

This commit is contained in:
wandererfan
2019-04-14 15:09:04 -04:00
committed by WandererFan
parent ccc3251511
commit abf419f68c
56 changed files with 9642 additions and 50 deletions

View File

@@ -45,6 +45,7 @@
#include "DrawViewClip.h"
#include "DrawProjGroup.h"
#include "DrawProjGroupItem.h"
#include "DrawLeaderLine.h"
#include "DrawUtil.h"
#include <Mod/TechDraw/App/DrawViewPy.h> // generated from DrawViewPy.xml
@@ -91,7 +92,6 @@ DrawView::~DrawView()
App::DocumentObjectExecReturn *DrawView::execute(void)
{
// Base::Console().Message("DV::execute() - %s\n",getNameInDocument());
handleXYLock();
requestPaint();
return App::DocumentObject::execute();
@@ -287,10 +287,11 @@ bool DrawView::checkFit(TechDraw::DrawPage* p) const
return result;
}
void DrawView::setPosition(double x, double y)
void DrawView::setPosition(double x, double y, bool force)
{
// Base::Console().Message("DV::setPosition(%.3f,%.3f) - \n",x,y,getNameInDocument());
if (!isLocked()) {
if ( (!isLocked()) ||
(force) ) {
X.setValue(x);
Y.setValue(y);
}
@@ -307,6 +308,26 @@ double DrawView::getScale(void) const
return result;
}
//return list of Leaders which reference this DV
std::vector<TechDraw::DrawLeaderLine*> DrawView::getLeaders() const
{
std::vector<TechDraw::DrawLeaderLine*> result;
std::vector<App::DocumentObject*> children = getInList();
for (std::vector<App::DocumentObject*>::iterator it = children.begin(); it != children.end(); ++it) {
if ((*it)->getTypeId().isDerivedFrom(DrawLeaderLine::getClassTypeId())) {
TechDraw::DrawLeaderLine* lead = dynamic_cast<TechDraw::DrawLeaderLine*>(*it);
result.push_back(lead);
}
}
return result;
}
void DrawView::addRandomVertex(Base::Vector3d pos)
{
(void) pos;
Base::Console().Message("DV::addRandomVertex()\n");
}
void DrawView::Restore(Base::XMLReader &reader)
{
// this is temporary code for backwards compat (within v0.17). can probably be deleted once there are no development