Remove ctor args from QGIView and descendents.
This commit is contained in:
parent
4fe9267eeb
commit
b883434318
|
@ -46,10 +46,8 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIProjGroup::QGIProjGroup(const QPoint &pos, QGraphicsScene *scene)
|
QGIProjGroup::QGIProjGroup()
|
||||||
:QGIViewCollection(pos, scene)
|
|
||||||
{
|
{
|
||||||
setPos(pos);
|
|
||||||
origin = new QGraphicsItemGroup();
|
origin = new QGraphicsItemGroup();
|
||||||
origin->setParentItem(this);
|
origin->setParentItem(this);
|
||||||
|
|
||||||
|
@ -64,10 +62,6 @@ QGIProjGroup::QGIProjGroup(const QPoint &pos, QGraphicsScene *scene)
|
||||||
borderVisible = false;
|
borderVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIProjGroup::~QGIProjGroup()
|
|
||||||
{
|
|
||||||
//TODO: if the QGIVO is deleted, should we clean up any remaining QGIVParts??
|
|
||||||
}
|
|
||||||
|
|
||||||
TechDraw::DrawProjGroup * QGIProjGroup::getDrawView(void) const
|
TechDraw::DrawProjGroup * QGIProjGroup::getDrawView(void) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,8 +47,10 @@ class TechDrawGuiExport QGIProjGroup : public QGIViewCollection
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGIProjGroup(const QPoint &position, QGraphicsScene *scene);
|
QGIProjGroup();
|
||||||
~QGIProjGroup();
|
|
||||||
|
// TODO: if the QGIVO is deleted, should we clean up any remaining QGIVParts??
|
||||||
|
~QGIProjGroup() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 113};
|
enum {Type = QGraphicsItem::UserType + 113};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
@ -74,8 +76,8 @@ private:
|
||||||
/// Convenience function
|
/// Convenience function
|
||||||
TechDraw::DrawProjGroup * getDrawView(void) const;
|
TechDraw::DrawProjGroup * getDrawView(void) const;
|
||||||
|
|
||||||
QGraphicsRectItem * m_backgroundItem;
|
QGraphicsRectItem *m_backgroundItem;
|
||||||
QGraphicsItem*origin;
|
QGraphicsItem *origin;
|
||||||
QPoint mousePos;
|
QPoint mousePos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ using namespace TechDrawGui;
|
||||||
|
|
||||||
void _debugRect(char* text, QRectF r);
|
void _debugRect(char* text, QRectF r);
|
||||||
|
|
||||||
QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
|
QGIView::QGIView()
|
||||||
:QGraphicsItemGroup(),
|
:QGraphicsItemGroup(),
|
||||||
locked(false),
|
locked(false),
|
||||||
borderVisible(true),
|
borderVisible(true),
|
||||||
|
@ -70,7 +70,6 @@ QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
|
||||||
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
setFlag(QGraphicsItem::ItemSendsScenePositionChanges, true);
|
||||||
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);
|
||||||
setAcceptHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
setPos(pos);
|
|
||||||
|
|
||||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
|
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
|
||||||
|
@ -89,10 +88,6 @@ QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
|
||||||
m_font.setFamily(QString::fromStdString(fontName));
|
m_font.setFamily(QString::fromStdString(fontName));
|
||||||
m_font.setPointSize(5.0); //scene units (mm), not points
|
m_font.setPointSize(5.0); //scene units (mm), not points
|
||||||
|
|
||||||
//Add object to scene
|
|
||||||
if(scene) // TODO: Get rid of the ctor args as in the refactor attempt
|
|
||||||
scene->addItem(this);
|
|
||||||
|
|
||||||
m_decorPen.setStyle(Qt::DashLine);
|
m_decorPen.setStyle(Qt::DashLine);
|
||||||
m_decorPen.setWidth(0); // 0 => 1px "cosmetic pen"
|
m_decorPen.setWidth(0); // 0 => 1px "cosmetic pen"
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class TechDrawGuiExport QGIView : public QObject, public QGraphicsItemGroup
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGIView(const QPoint &position, QGraphicsScene *scene);
|
QGIView();
|
||||||
virtual ~QGIView() = default;
|
virtual ~QGIView() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 101};
|
enum {Type = QGraphicsItem::UserType + 101};
|
||||||
|
|
|
@ -55,8 +55,7 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewAnnotation::QGIViewAnnotation(const QPoint &pos, QGraphicsScene *scene)
|
QGIViewAnnotation::QGIViewAnnotation()
|
||||||
:QGIView(pos, scene)
|
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGraphicsItem::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
@ -73,10 +72,6 @@ QGIViewAnnotation::QGIViewAnnotation(const QPoint &pos, QGraphicsScene *scene)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewAnnotation::~QGIViewAnnotation()
|
|
||||||
{
|
|
||||||
// m_textItem belongs to this group and will be deleted by Qt
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant QGIViewAnnotation::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIViewAnnotation::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,8 +43,10 @@ class TechDrawGuiExport QGIViewAnnotation : public QGIView
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit QGIViewAnnotation(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewAnnotation();
|
||||||
~QGIViewAnnotation();
|
|
||||||
|
/// m_textItem belongs to this group and will be deleted by Qt
|
||||||
|
~QGIViewAnnotation() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 120};
|
enum {Type = QGraphicsItem::UserType + 120};
|
||||||
int type() const override { return Type;}
|
int type() const override { return Type;}
|
||||||
|
|
|
@ -50,8 +50,7 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewClip::QGIViewClip(const QPoint &pos, QGraphicsScene *scene)
|
QGIViewClip::QGIViewClip()
|
||||||
:QGIView(pos, scene)
|
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGraphicsItem::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
@ -70,9 +69,6 @@ QGIViewClip::QGIViewClip(const QPoint &pos, QGraphicsScene *scene)
|
||||||
m_frame->setRect(0.,0.,5.,5.);
|
m_frame->setRect(0.,0.,5.,5.);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewClip::~QGIViewClip()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant QGIViewClip::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIViewClip::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,8 +43,8 @@ class TechDrawGuiExport QGIViewClip : public QGIView
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit QGIViewClip(const QPoint &position, QGraphicsScene *scene);
|
QGIViewClip();
|
||||||
~QGIViewClip();
|
~QGIViewClip() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 123};
|
enum {Type = QGraphicsItem::UserType + 123};
|
||||||
int type() const override { return Type;}
|
int type() const override { return Type;}
|
||||||
|
|
|
@ -43,10 +43,9 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewCollection::QGIViewCollection(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
QGIViewCollection::QGIViewCollection()
|
||||||
{
|
{
|
||||||
setFlags(QGraphicsItem::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsSelectable);
|
||||||
setPos(pos);
|
|
||||||
|
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
|
|
||||||
|
@ -55,10 +54,6 @@ QGIViewCollection::QGIViewCollection(const QPoint &pos, QGraphicsScene *scene) :
|
||||||
setFlag(QGraphicsItem::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewCollection::~QGIViewCollection()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant QGIViewCollection::itemChange(GraphicsItemChange change, const QVariant &value)
|
QVariant QGIViewCollection::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,8 +47,8 @@ class TechDrawGuiExport QGIViewCollection : public QGIView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QGIViewCollection(const QPoint &position, QGraphicsScene *scene);
|
QGIViewCollection();
|
||||||
~QGIViewCollection();
|
~QGIViewCollection() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 110};
|
enum {Type = QGraphicsItem::UserType + 110};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
|
@ -157,8 +157,7 @@ void QGIDatumLabel::mouseReleaseEvent( QGraphicsSceneMouseEvent * event)
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
|
QGIViewDimension::QGIViewDimension() :
|
||||||
QGIView(pos, scene),
|
|
||||||
hasHover(false)
|
hasHover(false)
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
|
@ -209,9 +208,6 @@ QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
|
||||||
toggleBorder(false);
|
toggleBorder(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewDimension::~QGIViewDimension()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGIViewDimension::setViewPartFeature(TechDraw::DrawViewDimension *obj)
|
void QGIViewDimension::setViewPartFeature(TechDraw::DrawViewDimension *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -88,8 +88,8 @@ class TechDrawGuiExport QGIViewDimension : public QGIView
|
||||||
public:
|
public:
|
||||||
enum {Type = QGraphicsItem::UserType + 106};
|
enum {Type = QGraphicsItem::UserType + 106};
|
||||||
|
|
||||||
explicit QGIViewDimension(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewDimension();
|
||||||
~QGIViewDimension();
|
~QGIViewDimension() = default;
|
||||||
|
|
||||||
void setViewPartFeature(TechDraw::DrawViewDimension *obj);
|
void setViewPartFeature(TechDraw::DrawViewDimension *obj);
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
|
@ -60,8 +60,7 @@ void _dumpPath(const char* text,QPainterPath path);
|
||||||
const float lineScaleFactor = 1.; // temp fiddle for devel
|
const float lineScaleFactor = 1.; // temp fiddle for devel
|
||||||
const float vertexScaleFactor = 2.; // temp fiddle for devel
|
const float vertexScaleFactor = 2.; // temp fiddle for devel
|
||||||
|
|
||||||
QGIViewPart::QGIViewPart(const QPoint &pos, QGraphicsScene *scene)
|
QGIViewPart::QGIViewPart()
|
||||||
:QGIView(pos, scene)
|
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGraphicsItem::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
|
@ -48,7 +48,7 @@ class TechDrawGuiExport QGIViewPart : public QGIView
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit QGIViewPart(const QPoint &position, QGraphicsScene *scene);
|
explicit QGIViewPart();
|
||||||
~QGIViewPart();
|
~QGIViewPart();
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 102};
|
enum {Type = QGraphicsItem::UserType + 102};
|
||||||
|
|
|
@ -47,15 +47,6 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewSection::QGIViewSection(const QPoint &pos, QGraphicsScene *scene) :QGIViewPart(pos, scene)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QGIViewSection::~QGIViewSection()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGIViewSection::draw()
|
void QGIViewSection::draw()
|
||||||
{
|
{
|
||||||
if (!isVisible()) {
|
if (!isVisible()) {
|
||||||
|
|
|
@ -42,8 +42,8 @@ class TechDrawGuiExport QGIViewSection : public QGIViewPart
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit QGIViewSection(const QPoint &position, QGraphicsScene *scene);
|
QGIViewSection() = default;
|
||||||
~QGIViewSection();
|
~QGIViewSection() = default;
|
||||||
|
|
||||||
virtual void draw() override;
|
virtual void draw() override;
|
||||||
void updateView(bool update = false) override;
|
void updateView(bool update = false) override;
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewSpreadsheet::QGIViewSpreadsheet() : QGIViewSymbol(QPoint(), nullptr)
|
QGIViewSpreadsheet::QGIViewSpreadsheet()
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGraphicsItem::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
@ -53,9 +53,6 @@ QGIViewSpreadsheet::QGIViewSpreadsheet() : QGIViewSymbol(QPoint(), nullptr)
|
||||||
setFlag(QGraphicsItem::ItemIsMovable, true);
|
setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIViewSpreadsheet::~QGIViewSpreadsheet()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGIViewSpreadsheet::setViewFeature(TechDraw::DrawViewSpreadsheet *obj)
|
void QGIViewSpreadsheet::setViewFeature(TechDraw::DrawViewSpreadsheet *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,8 +45,8 @@ class TechDrawGuiExport QGIViewSpreadsheet : public QGIViewSymbol
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QGIViewSpreadsheet();
|
QGIViewSpreadsheet();
|
||||||
~QGIViewSpreadsheet();
|
~QGIViewSpreadsheet() = default;
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 124};
|
enum {Type = QGraphicsItem::UserType + 124};
|
||||||
int type() const { return Type;}
|
int type() const { return Type;}
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
using namespace TechDrawGui;
|
using namespace TechDrawGui;
|
||||||
|
|
||||||
QGIViewSymbol::QGIViewSymbol(const QPoint &pos, QGraphicsScene *scene) :QGIView(pos, scene)
|
QGIViewSymbol::QGIViewSymbol()
|
||||||
{
|
{
|
||||||
setHandlesChildEvents(false);
|
setHandlesChildEvents(false);
|
||||||
setCacheMode(QGraphicsItem::NoCache);
|
setCacheMode(QGraphicsItem::NoCache);
|
||||||
|
|
|
@ -46,7 +46,7 @@ class TechDrawGuiExport QGIViewSymbol : public QGIView
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QGIViewSymbol(const QPoint &position, QGraphicsScene *scene);
|
QGIViewSymbol();
|
||||||
~QGIViewSymbol();
|
~QGIViewSymbol();
|
||||||
|
|
||||||
enum {Type = QGraphicsItem::UserType + 121};
|
enum {Type = QGraphicsItem::UserType + 121};
|
||||||
|
|
|
@ -160,7 +160,13 @@ void QGVPage::drawBackground(QPainter *p, const QRectF &)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int QGVPage::addView(QGIView * view) {
|
int QGVPage::addView(QGIView *view)
|
||||||
|
{
|
||||||
|
auto ourScene( scene() );
|
||||||
|
assert(ourScene);
|
||||||
|
|
||||||
|
ourScene->addItem(view);
|
||||||
|
|
||||||
views.push_back(view);
|
views.push_back(view);
|
||||||
|
|
||||||
// Find if it belongs to a parent
|
// Find if it belongs to a parent
|
||||||
|
@ -187,7 +193,8 @@ int QGVPage::addView(QGIView * view) {
|
||||||
|
|
||||||
QGIView * QGVPage::addViewPart(TechDraw::DrawViewPart *part)
|
QGIView * QGVPage::addViewPart(TechDraw::DrawViewPart *part)
|
||||||
{
|
{
|
||||||
QGIViewPart *viewPart = new QGIViewPart(QPoint(0,0), scene());
|
auto viewPart( new QGIViewPart );
|
||||||
|
|
||||||
viewPart->setViewPartFeature(part);
|
viewPart->setViewPartFeature(part);
|
||||||
|
|
||||||
addView(viewPart);
|
addView(viewPart);
|
||||||
|
@ -196,7 +203,8 @@ QGIView * QGVPage::addViewPart(TechDraw::DrawViewPart *part)
|
||||||
|
|
||||||
QGIView * QGVPage::addViewSection(TechDraw::DrawViewPart *part)
|
QGIView * QGVPage::addViewSection(TechDraw::DrawViewPart *part)
|
||||||
{
|
{
|
||||||
QGIViewSection *viewSection = new QGIViewSection(QPoint(0,0), scene());
|
auto viewSection( new QGIViewSection );
|
||||||
|
|
||||||
viewSection->setViewPartFeature(part);
|
viewSection->setViewPartFeature(part);
|
||||||
|
|
||||||
addView(viewSection);
|
addView(viewSection);
|
||||||
|
@ -204,7 +212,8 @@ QGIView * QGVPage::addViewSection(TechDraw::DrawViewPart *part)
|
||||||
}
|
}
|
||||||
|
|
||||||
QGIView * QGVPage::addProjectionGroup(TechDraw::DrawProjGroup *view) {
|
QGIView * QGVPage::addProjectionGroup(TechDraw::DrawProjGroup *view) {
|
||||||
QGIViewCollection *qview = new QGIProjGroup(QPoint(0,0), scene());
|
auto qview( new QGIProjGroup );
|
||||||
|
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
addView(qview);
|
addView(qview);
|
||||||
return qview;
|
return qview;
|
||||||
|
@ -212,7 +221,8 @@ QGIView * QGVPage::addProjectionGroup(TechDraw::DrawProjGroup *view) {
|
||||||
|
|
||||||
QGIView * QGVPage::addDrawView(TechDraw::DrawView *view)
|
QGIView * QGVPage::addDrawView(TechDraw::DrawView *view)
|
||||||
{
|
{
|
||||||
QGIView *qview = new QGIView(QPoint(0,0), scene());
|
auto qview( new QGIView );
|
||||||
|
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
addView(qview);
|
addView(qview);
|
||||||
return qview;
|
return qview;
|
||||||
|
@ -220,7 +230,8 @@ QGIView * QGVPage::addDrawView(TechDraw::DrawView *view)
|
||||||
|
|
||||||
QGIView * QGVPage::addDrawViewCollection(TechDraw::DrawViewCollection *view)
|
QGIView * QGVPage::addDrawViewCollection(TechDraw::DrawViewCollection *view)
|
||||||
{
|
{
|
||||||
QGIViewCollection *qview = new QGIViewCollection(QPoint(0,0), scene());
|
auto qview( new QGIViewCollection );
|
||||||
|
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
addView(qview);
|
addView(qview);
|
||||||
return qview;
|
return qview;
|
||||||
|
@ -230,7 +241,8 @@ QGIView * QGVPage::addDrawViewCollection(TechDraw::DrawViewCollection *view)
|
||||||
QGIView * QGVPage::addDrawViewAnnotation(TechDraw::DrawViewAnnotation *view)
|
QGIView * QGVPage::addDrawViewAnnotation(TechDraw::DrawViewAnnotation *view)
|
||||||
{
|
{
|
||||||
// This essentially adds a null view feature to ensure view size is consistent
|
// This essentially adds a null view feature to ensure view size is consistent
|
||||||
QGIViewAnnotation *qview = new QGIViewAnnotation(QPoint(0,0), this->scene());
|
auto qview( new QGIViewAnnotation );
|
||||||
|
|
||||||
qview->setViewAnnoFeature(view);
|
qview->setViewAnnoFeature(view);
|
||||||
|
|
||||||
addView(qview);
|
addView(qview);
|
||||||
|
@ -241,7 +253,8 @@ QGIView * QGVPage::addDrawViewSymbol(TechDraw::DrawViewSymbol *view)
|
||||||
{
|
{
|
||||||
QPoint qp(view->X.getValue(),view->Y.getValue());
|
QPoint qp(view->X.getValue(),view->Y.getValue());
|
||||||
// This essentially adds a null view feature to ensure view size is consistent
|
// This essentially adds a null view feature to ensure view size is consistent
|
||||||
QGIViewSymbol *qview = new QGIViewSymbol(qp, scene());
|
auto qview( new QGIViewSymbol );
|
||||||
|
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
|
|
||||||
addView(qview);
|
addView(qview);
|
||||||
|
@ -250,8 +263,9 @@ QGIView * QGVPage::addDrawViewSymbol(TechDraw::DrawViewSymbol *view)
|
||||||
|
|
||||||
QGIView * QGVPage::addDrawViewClip(TechDraw::DrawViewClip *view)
|
QGIView * QGVPage::addDrawViewClip(TechDraw::DrawViewClip *view)
|
||||||
{
|
{
|
||||||
QPoint qp(view->X.getValue(),view->Y.getValue());
|
auto qview( new QGIViewClip );
|
||||||
QGIViewClip *qview = new QGIViewClip(qp, scene());
|
|
||||||
|
qview->setPosition(view->X.getValue(), view->Y.getValue());
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
|
|
||||||
addView(qview);
|
addView(qview);
|
||||||
|
@ -260,7 +274,7 @@ QGIView * QGVPage::addDrawViewClip(TechDraw::DrawViewClip *view)
|
||||||
|
|
||||||
QGIView * QGVPage::addDrawViewSpreadsheet(TechDraw::DrawViewSpreadsheet *view)
|
QGIView * QGVPage::addDrawViewSpreadsheet(TechDraw::DrawViewSpreadsheet *view)
|
||||||
{
|
{
|
||||||
QGIViewSpreadsheet *qview(new QGIViewSpreadsheet);
|
auto qview( new QGIViewSpreadsheet );
|
||||||
|
|
||||||
qview->setViewFeature(view);
|
qview->setViewFeature(view);
|
||||||
|
|
||||||
|
@ -270,7 +284,12 @@ QGIView * QGVPage::addDrawViewSpreadsheet(TechDraw::DrawViewSpreadsheet *view)
|
||||||
|
|
||||||
QGIView * QGVPage::addViewDimension(TechDraw::DrawViewDimension *dim)
|
QGIView * QGVPage::addViewDimension(TechDraw::DrawViewDimension *dim)
|
||||||
{
|
{
|
||||||
QGIViewDimension *dimGroup = new QGIViewDimension(QPoint(0,0), scene());
|
auto dimGroup( new QGIViewDimension );
|
||||||
|
|
||||||
|
auto ourScene( scene() );
|
||||||
|
assert(ourScene);
|
||||||
|
ourScene->addItem(dimGroup);
|
||||||
|
|
||||||
dimGroup->setViewPartFeature(dim);
|
dimGroup->setViewPartFeature(dim);
|
||||||
|
|
||||||
// TODO consider changing dimension feature to use another property for label position
|
// TODO consider changing dimension feature to use another property for label position
|
||||||
|
|
Loading…
Reference in New Issue
Block a user