55 #include <QDomElement>
58 #include <QSharedPointer>
63 #include "../../../../undocommands/label/movedoublelabel.h"
64 #include "../../../../undocommands/label/showdoublepointname.h"
65 #include "../ifc/exception/vexception.h"
66 #include "../ifc/exception/vexceptionbadid.h"
67 #include "../ifc/xml/vabstractpattern.h"
68 #include "../vgeometry/vgobject.h"
69 #include "../vgeometry/vpointf.h"
70 #include "../vmisc/vabstractapplication.h"
71 #include "../vmisc/logging.h"
72 #include "../vpatterndb/vcontainer.h"
73 #include "../vwidgets/../ifc/ifcdef.h"
74 #include "../vwidgets/vsimplepoint.h"
75 #include "../../../vabstracttool.h"
76 #include "../../../vdatatool.h"
77 #include "../../vdrawtool.h"
78 #include "../vabstractpoint.h"
82 QGraphicsItem *parent)
84 , QGraphicsPathItem(parent)
86 , secondPoint(nullptr)
114 return ObjectName<VPointF>(
p1id);
126 return ObjectName<VPointF>(
p2id);
142 else if (
object ==
p2id)
171 point->setShowPointName(visible);
177 point->setShowPointName(visible);
198 this->setEnabled(enabled);
252 point->
setMx(pos.x());
253 point->
setMy(pos.y());
264 point->
setMx(pos.x());
265 point->
setMy(pos.y());
285 firstPoint->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
286 secondPoint->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
333 if (change == QGraphicsItem::ItemSelectedChange)
346 return QGraphicsPathItem::itemChange(change, value);
356 switch (event->key())
372 QGraphicsPathItem::keyReleaseEvent ( event );
386 if (obj->id() ==
p1id)
396 else if (obj->id() ==
p2id)
452 const QString toolTipStr = QString(
"<table>"
453 "<tr> <td><b>%1:</b> %2</td> </tr>"
virtual QString getTagName() const Q_DECL_OVERRIDE
void SetPointName(quint32 id, const QString &name)
void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=null_id)
The VContainer class container of all variables.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
static const QSharedPointer< VGObject > GetFakeGObject(quint32 id)
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
virtual QString name() const
name return name graphical object.
static void NewSceneRect(QGraphicsScene *sc, QGraphicsView *view, QGraphicsItem *item=nullptr)
NewSceneRect calculate scene rect what contains all items and doesn't less that size of scene view.
The VPointF class keep data of point.
void setMx(qreal mx)
setMx set offset name respect to x
void setMy(qreal my)
setMy set offset name respect to y
qreal mx() const
mx return offset name respect to x
bool isShowPointName() const
qreal my() const
my return offset name respect to y
virtual void refreshPointGeometry(const VPointF &point)
void nameChangedPosition(const QPointF &pos, quint32 id)
void SetEnabled(bool enabled)
void EnableToolMove(bool move)
void Choosed(quint32 id)
Choosed send id when clicked.
void allowTextHover(bool enabled)
void allowTextSelectable(bool enabled)
void Selected(bool selected, quint32 id)
virtual void ToolSelectionType(const SelectionType &type) Q_DECL_OVERRIDE
const QString AttrShowPointName2
const QString AttrShowPointName1