The VControlPointSpline class control spline point. More...
#include <vcontrolpointspline.h>
Public Types | |
enum | { Type = UserType + static_cast<int>(Vis::ControlPointSpline) } |
Public Types inherited from SceneRect | |
enum | { Type = UserType + static_cast<int>(Vis::ScenePoint) } |
Public Slots | |
void | refreshCtrlPoint (const qint32 &indexSpline, SplinePointPosition pos, const QPointF &controlPoint, const QPointF &splinePoint, bool freeAngle=true, bool freeLength=true) |
refreshCtrlPoint refresh the control point. More... | |
void | setEnabledPoint (bool enable) |
setEnabledPoint disable or enable control point. More... | |
Signals | |
void | ControlPointChangePosition (const qint32 &indexSpline, SplinePointPosition position, const QPointF &pos) |
ControlPointChangePosition emit when control point change position. More... | |
void | showContextMenu (QGraphicsSceneContextMenuEvent *event) |
showContextMenu emit when need show tool's context menu. More... | |
Public Member Functions | |
VControlPointSpline (const qint32 &indexSpline, SplinePointPosition position, QGraphicsItem *parent=nullptr) | |
VControlPointSpline (const qint32 &indexSpline, SplinePointPosition position, const QPointF &controlPoint, const QPointF &splinePoint, bool freeAngle, bool freeLength, QGraphicsItem *parent=nullptr) | |
VControlPointSpline constructor. More... | |
virtual | ~VControlPointSpline ()=default |
virtual int | type () const Q_DECL_OVERRIDE |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE |
Public Member Functions inherited from SceneRect | |
SceneRect (const QColor &lineColor, QGraphicsItem *parent=nullptr) | |
virtual | ~SceneRect ()=default |
virtual void | refreshPointGeometry (const VPointF &point) |
Protected Member Functions | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
hoverEnterEvent handle hover enter events. More... | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE |
itemChange handle item change. More... | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE |
Protected Member Functions inherited from SceneRect | |
void | setOnlyPoint (bool value) |
bool | isOnlyPoint () const |
void | setPointColor (const QString &value) |
Protected Attributes | |
VScaledLine * | controlLine |
controlLine pointer to line control point. More... | |
Protected Attributes inherited from SceneRect | |
QColor | m_rectColor |
bool | m_onlyPoint |
m_rectColor color of point. More... | |
bool | m_isHovered |
bool | m_showPointName |
Private Member Functions | |
void | init () |
void | setCtrlLine (const QPointF &controlPoint, const QPointF &splinePoint) |
Private Attributes | |
qint32 | indexSpline |
indexSpline index spline in list.. More... | |
SplinePointPosition | position |
position position point in spline. More... | |
bool | freeAngle |
bool | freeLength |
The VControlPointSpline class control spline point.
Definition at line 72 of file vcontrolpointspline.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 84 of file vcontrolpointspline.h.
VControlPointSpline::VControlPointSpline | ( | const qint32 & | indexSpline, |
SplinePointPosition | position, | ||
QGraphicsItem * | parent = nullptr |
||
) |
Definition at line 78 of file vcontrolpointspline.cpp.
References init().
VControlPointSpline::VControlPointSpline | ( | const qint32 & | indexSpline, |
SplinePointPosition | position, | ||
const QPointF & | controlPoint, | ||
const QPointF & | splinePoint, | ||
bool | freeAngle, | ||
bool | freeLength, | ||
QGraphicsItem * | parent = nullptr |
||
) |
VControlPointSpline constructor.
indexSpline | index spline in list. |
position | position point in spline. |
controlPoint | control point. |
splinePoint | spline point. |
parent | parent object. |
Definition at line 98 of file vcontrolpointspline.cpp.
References init(), and setCtrlLine().
|
virtualdefault |
|
protectedvirtual |
Definition at line 265 of file vcontrolpointspline.cpp.
References showContextMenu().
|
signal |
ControlPointChangePosition emit when control point change position.
indexSpline | index spline in list. |
position | position point in spline. |
pos | new posotion. |
Referenced by itemChange(), VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().
|
protectedvirtual |
hoverEnterEvent handle hover enter events.
event | hover move event. |
Reimplemented from SceneRect.
Definition at line 133 of file vcontrolpointspline.cpp.
References cursorArrowOpenHand, freeAngle, freeLength, SceneRect::hoverEnterEvent(), and SetItemOverrideCursor().
|
protectedvirtual |
Reimplemented from SceneRect.
Definition at line 143 of file vcontrolpointspline.cpp.
References freeAngle, freeLength, and SceneRect::hoverLeaveEvent().
|
private |
Definition at line 271 of file vcontrolpointspline.cpp.
References controlLine, VScaledLine::setBasicWidth(), SceneRect::setOnlyPoint(), and widthHairLine.
Referenced by VControlPointSpline().
|
protected |
itemChange handle item change.
change | change. |
value | value. |
Definition at line 159 of file vcontrolpointspline.cpp.
References controlLine, ControlPointChangePosition(), freeAngle, freeLength, VMainGraphicsScene::getScenePos(), indexSpline, position, SCASSERT, and VMainGraphicsView::SceneVisibleArea().
|
protectedvirtual |
Definition at line 239 of file vcontrolpointspline.cpp.
References cursorArrowCloseHand, freeAngle, freeLength, and SetItemOverrideCursor().
|
protectedvirtual |
Definition at line 252 of file vcontrolpointspline.cpp.
References cursorArrowOpenHand, freeAngle, freeLength, and SetItemOverrideCursor().
|
virtual |
Reimplemented from SceneRect.
Definition at line 119 of file vcontrolpointspline.cpp.
References controlLine, correctColor(), and SceneRect::paint().
|
slot |
refreshCtrlPoint refresh the control point.
indexSpline | index spline in list. |
pos | position point in spline. |
controlPoint | control point. |
splinePoint | spline point. |
Definition at line 299 of file vcontrolpointspline.cpp.
References freeAngle, freeLength, indexSpline, position, and setCtrlLine().
|
private |
Definition at line 283 of file vcontrolpointspline.cpp.
References controlLine, VGObject::LineIntersectCircle(), scaledRadius(), and sceneScale().
Referenced by refreshCtrlPoint(), and VControlPointSpline().
|
slot |
setEnabledPoint disable or enable control point.
enable | true - enable. |
Definition at line 317 of file vcontrolpointspline.cpp.
References controlLine.
Referenced by VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().
|
signal |
showContextMenu emit when need show tool's context menu.
event | context menu event. |
Referenced by contextMenuEvent(), VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().
|
inlinevirtual |
|
protected |
controlLine pointer to line control point.
Definition at line 110 of file vcontrolpointspline.h.
Referenced by init(), itemChange(), paint(), setCtrlLine(), and setEnabledPoint().
|
private |
Definition at line 127 of file vcontrolpointspline.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), itemChange(), mousePressEvent(), mouseReleaseEvent(), and refreshCtrlPoint().
|
private |
Definition at line 128 of file vcontrolpointspline.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), itemChange(), mousePressEvent(), mouseReleaseEvent(), and refreshCtrlPoint().
|
private |
indexSpline index spline in list..
Definition at line 122 of file vcontrolpointspline.h.
Referenced by itemChange(), and refreshCtrlPoint().
|
private |
position position point in spline.
Definition at line 125 of file vcontrolpointspline.h.
Referenced by itemChange(), and refreshCtrlPoint().