57 #include <QGraphicsLineItem>
58 #include <QGraphicsScene>
59 #include <QGraphicsSceneMouseEvent>
64 #include <QSharedPointer>
69 #include "../../../../undocommands/label/movelabel.h"
70 #include "../../../../undocommands/label/showpointname.h"
71 #include "../ifc/exception/vexception.h"
72 #include "../ifc/exception/vexceptionbadid.h"
73 #include "../ifc/ifcdef.h"
74 #include "../ifc/xml/vabstractpattern.h"
75 #include "../vmisc/diagnostic.h"
76 #include "../vmisc/logging.h"
77 #include "../vgeometry/vgobject.h"
78 #include "../vgeometry/vpointf.h"
79 #include "../vmisc/vabstractapplication.h"
80 #include "../vpatterndb/vcontainer.h"
81 #include "../vwidgets/vgraphicssimpletextitem.h"
82 #include "../vwidgets/scalesceneitems.h"
83 #include "../../../vabstracttool.h"
84 #include "../../vdrawtool.h"
85 #include "../vabstractpoint.h"
88 QT_WARNING_DISABLE_CLANG(
"-Wmissing-prototypes")
89 QT_WARNING_DISABLE_INTEL(1418)
91 Q_LOGGING_CATEGORY(vToolSinglePoint, "v.toolSinglePoint")
104 const QColor &lineColor, QGraphicsItem *parent)
119 return ObjectName<VPointF>(
m_id);
148 return point->isShowPointName();
162 point->setShowPointName(visible);
182 point->setMx(pos.x());
183 point->setMy(pos.y());
189 if (QGraphicsScene *sc = scene())
222 VScenePoint::mousePressEvent(event);
225 if (not (flags() & ItemIsSelectable) && scene())
227 scene()->clearSelection();
236 if (event->button() == Qt::LeftButton)
254 m_pointName->setFlag(QGraphicsItem::ItemIsMovable, move);
266 setSelected(selected);
289 if (event->button() == Qt::LeftButton)
294 VScenePoint::mouseReleaseEvent(event);
313 if (change == QGraphicsItem::ItemSelectedChange)
321 return VScenePoint::itemChange(change, value);
331 switch (event->key())
347 VScenePoint::keyReleaseEvent ( event );
374 setAcceptHoverEvents(enabled);
380 setFlag(QGraphicsItem::ItemIsSelectable, enabled);
392 m_pointName->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
void SetPointName(quint32 id, const QString &name)
The VContainer class container of all variables.
const QSharedPointer< T > GeometricObject(const quint32 &id) const
void SetAttribute(QDomElement &domElement, const QString &name, const T &value) const
SetAttribute set attribute in pattern file. Replace "," by ".".
void setEnabled(bool enabled)
void setPosition(QPointF pos)
void textSelectionType(const SelectionType &type)
void showContextMenu(QGraphicsSceneContextMenuEvent *event)
showContextMenu emit when need show tool context menu.
void nameChangedPosition(const QPointF &pos)
nameChangedPosition emit when label change position.
void pointSelected(bool selected)
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.
VGraphicsSimpleTextItem * m_pointName
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
VScaledLine * m_pointLeader
namePoint point text.
virtual void refreshPointGeometry(const VPointF &point)
const QString AttrShowPointName