Seamly2D
Code documentation
VControlPointSpline Class Reference

The VControlPointSpline class control spline point. More...

#include <vcontrolpointspline.h>

Inheritance diagram for VControlPointSpline:
Collaboration diagram for VControlPointSpline:

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

VScaledLinecontrolLine
 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
 

Detailed Description

The VControlPointSpline class control spline point.

Definition at line 72 of file vcontrolpointspline.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 84 of file vcontrolpointspline.h.

Constructor & Destructor Documentation

◆ VControlPointSpline() [1/2]

VControlPointSpline::VControlPointSpline ( const qint32 &  indexSpline,
SplinePointPosition  position,
QGraphicsItem *  parent = nullptr 
)

Definition at line 78 of file vcontrolpointspline.cpp.

References init().

◆ VControlPointSpline() [2/2]

VControlPointSpline::VControlPointSpline ( const qint32 &  indexSpline,
SplinePointPosition  position,
const QPointF &  controlPoint,
const QPointF &  splinePoint,
bool  freeAngle,
bool  freeLength,
QGraphicsItem *  parent = nullptr 
)

VControlPointSpline constructor.

Parameters
indexSplineindex spline in list.
positionposition point in spline.
controlPointcontrol point.
splinePointspline point.
parentparent object.

Definition at line 98 of file vcontrolpointspline.cpp.

References init(), and setCtrlLine().

◆ ~VControlPointSpline()

virtual VControlPointSpline::~VControlPointSpline ( )
virtualdefault

Member Function Documentation

◆ contextMenuEvent()

void VControlPointSpline::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protectedvirtual

Definition at line 265 of file vcontrolpointspline.cpp.

References showContextMenu().

◆ ControlPointChangePosition

void VControlPointSpline::ControlPointChangePosition ( const qint32 &  indexSpline,
SplinePointPosition  position,
const QPointF &  pos 
)
signal

ControlPointChangePosition emit when control point change position.

Parameters
indexSplineindex spline in list.
positionposition point in spline.
posnew posotion.

Referenced by itemChange(), VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().

◆ hoverEnterEvent()

void VControlPointSpline::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

hoverEnterEvent handle hover enter events.

Parameters
eventhover move event.

Reimplemented from SceneRect.

Definition at line 133 of file vcontrolpointspline.cpp.

References cursorArrowOpenHand, freeAngle, freeLength, SceneRect::hoverEnterEvent(), and SetItemOverrideCursor().

◆ hoverLeaveEvent()

void VControlPointSpline::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented from SceneRect.

Definition at line 143 of file vcontrolpointspline.cpp.

References freeAngle, freeLength, and SceneRect::hoverLeaveEvent().

◆ init()

void VControlPointSpline::init ( )
private

◆ itemChange()

QVariant VControlPointSpline::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protected

itemChange handle item change.

Parameters
changechange.
valuevalue.
Returns
value.

Definition at line 159 of file vcontrolpointspline.cpp.

References controlLine, ControlPointChangePosition(), freeAngle, freeLength, VMainGraphicsScene::getScenePos(), indexSpline, position, SCASSERT, and VMainGraphicsView::SceneVisibleArea().

◆ mousePressEvent()

void VControlPointSpline::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

◆ mouseReleaseEvent()

void VControlPointSpline::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

◆ paint()

void VControlPointSpline::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = nullptr 
)
virtual

Reimplemented from SceneRect.

Definition at line 119 of file vcontrolpointspline.cpp.

References controlLine, correctColor(), and SceneRect::paint().

◆ refreshCtrlPoint

void VControlPointSpline::refreshCtrlPoint ( const qint32 &  indexSpline,
SplinePointPosition  pos,
const QPointF &  controlPoint,
const QPointF &  splinePoint,
bool  freeAngle = true,
bool  freeLength = true 
)
slot

refreshCtrlPoint refresh the control point.

Parameters
indexSplineindex spline in list.
posposition point in spline.
controlPointcontrol point.
splinePointspline point.

Definition at line 299 of file vcontrolpointspline.cpp.

References freeAngle, freeLength, indexSpline, position, and setCtrlLine().

◆ setCtrlLine()

void VControlPointSpline::setCtrlLine ( const QPointF &  controlPoint,
const QPointF &  splinePoint 
)
private

◆ setEnabledPoint

void VControlPointSpline::setEnabledPoint ( bool  enable)
slot

setEnabledPoint disable or enable control point.

Parameters
enabletrue - enable.

Definition at line 317 of file vcontrolpointspline.cpp.

References controlLine.

Referenced by VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().

◆ showContextMenu

void VControlPointSpline::showContextMenu ( QGraphicsSceneContextMenuEvent *  event)
signal

showContextMenu emit when need show tool's context menu.

Parameters
eventcontext menu event.

Referenced by contextMenuEvent(), VToolSpline::VToolSpline(), and VToolSplinePath::VToolSplinePath().

◆ type()

virtual int VControlPointSpline::type ( ) const
inlinevirtual

Reimplemented from SceneRect.

Definition at line 83 of file vcontrolpointspline.h.

References Type.

Member Data Documentation

◆ controlLine

VScaledLine* VControlPointSpline::controlLine
protected

controlLine pointer to line control point.

Definition at line 110 of file vcontrolpointspline.h.

Referenced by init(), itemChange(), paint(), setCtrlLine(), and setEnabledPoint().

◆ freeAngle

bool VControlPointSpline::freeAngle
private

◆ freeLength

bool VControlPointSpline::freeLength
private

◆ indexSpline

qint32 VControlPointSpline::indexSpline
private

indexSpline index spline in list..

Definition at line 122 of file vcontrolpointspline.h.

Referenced by itemChange(), and refreshCtrlPoint().

◆ position

SplinePointPosition VControlPointSpline::position
private

position position point in spline.

Definition at line 125 of file vcontrolpointspline.h.

Referenced by itemChange(), and refreshCtrlPoint().


The documentation for this class was generated from the following files: