52 #ifndef VCONTROLPOINTSPLINE_H
53 #define VCONTROLPOINTSPLINE_H
55 #include <qcompilerdetection.h>
56 #include <QGraphicsItem>
57 #include <QMetaObject>
64 #include "../vgeometry/vgeometrydef.h"
65 #include "../vgeometry/vsplinepath.h"
66 #include "../vmisc/def.h"
77 QGraphicsItem * parent =
nullptr);
79 const QPointF &controlPoint,
const QPointF &splinePoint,
83 virtual int type() const Q_DECL_OVERRIDE {
return Type;}
86 virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
87 QWidget *widget =
nullptr) Q_DECL_OVERRIDE;
112 virtual
void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
113 virtual
void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
114 QVariant
itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
115 virtual
void mousePressEvent( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
116 virtual
void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
117 virtual
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event ) Q_DECL_OVERRIDE;
131 void setCtrlLine(const QPointF &controlPoint, const QPointF &splinePoint);
The VControlPointSpline class control spline point.
qint32 indexSpline
indexSpline index spline in list..
QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
itemChange handle item change.
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
void showContextMenu(QGraphicsSceneContextMenuEvent *event)
showContextMenu emit when need show tool's context menu.
void ControlPointChangePosition(const qint32 &indexSpline, SplinePointPosition position, const QPointF &pos)
ControlPointChangePosition emit when control point change position.
SplinePointPosition position
position position point in spline.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
hoverEnterEvent handle hover enter events.
virtual ~VControlPointSpline()=default
void setCtrlLine(const QPointF &controlPoint, const QPointF &splinePoint)
virtual int type() const Q_DECL_OVERRIDE
void setEnabledPoint(bool enable)
setEnabledPoint disable or enable control point.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
VScaledLine * controlLine
controlLine pointer to line control point.
VControlPointSpline(const qint32 &indexSpline, SplinePointPosition position, QGraphicsItem *parent=nullptr)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
void refreshCtrlPoint(const qint32 &indexSpline, SplinePointPosition pos, const QPointF &controlPoint, const QPointF &splinePoint, bool freeAngle=true, bool freeLength=true)
refreshCtrlPoint refresh the control point.