Seamly2D
Code documentation
VSimpleCurve Class Reference

#include <vsimplecurve.h>

Inheritance diagram for VSimpleCurve:
Collaboration diagram for VSimpleCurve:

Public Types

enum  { Type = UserType + static_cast<int>(Vis::SimpleCurve) }
 
- Public Types inherited from VCurvePathItem
enum  { Type = UserType + static_cast<int>(Vis::CurvePathItem) }
 

Public Slots

void CurveChoosed ()
 
void CurveSelected (bool selected)
 

Signals

void Choosed (quint32 id)
 Choosed send id when clicked. More...
 
void Selected (bool selected, quint32 id)
 
- Signals inherited from VAbstractSimple
void showContextMenu (QGraphicsSceneContextMenuEvent *event, quint32 id=null_id)
 
void Delete ()
 

Public Member Functions

 VSimpleCurve (quint32 id, const QSharedPointer< VAbstractCurve > &curve, QObject *parent=nullptr)
 
virtual ~VSimpleCurve () Q_DECL_EQ_DEFAULT
 
virtual int type () const Q_DECL_OVERRIDE
 
void RefreshGeometry (const QSharedPointer< VAbstractCurve > &curve)
 
- Public Member Functions inherited from VAbstractSimple
 VAbstractSimple (quint32 id, QObject *parent=nullptr)
 
virtual ~VAbstractSimple ()=default
 
virtual void ToolSelectionType (const SelectionType &type)
 
GOType GetType () const
 
void SetType (const GOType &value)
 
- Public Member Functions inherited from VCurvePathItem
 VCurvePathItem (QGraphicsItem *parent=nullptr)
 
virtual ~VCurvePathItem ()=default
 
virtual QPainterPath shape () const Q_DECL_OVERRIDE
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
 
void SetDirectionArrows (const QVector< QPair< QLineF, QLineF >> &arrows)
 
void SetPoints (const QVector< QPointF > &points)
 

Protected Member Functions

virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
 
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
 
virtual void keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
virtual void ScalePenWidth () Q_DECL_OVERRIDE
 

Private Attributes

QSharedPointer< VAbstractCurvem_curve
 
bool m_isHovered
 

Additional Inherited Members

- Protected Attributes inherited from VAbstractSimple
quint32 id
 id spline id. More...
 
SelectionType selectionType
 
GOType type
 

Detailed Description

Definition at line 72 of file vsimplecurve.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Definition at line 80 of file vsimplecurve.h.

Constructor & Destructor Documentation

◆ VSimpleCurve()

VSimpleCurve::VSimpleCurve ( quint32  id,
const QSharedPointer< VAbstractCurve > &  curve,
QObject *  parent = nullptr 
)

Definition at line 73 of file vsimplecurve.cpp.

◆ ~VSimpleCurve()

virtual VSimpleCurve::~VSimpleCurve ( )
virtual

Member Function Documentation

◆ Choosed

void VSimpleCurve::Choosed ( quint32  id)
signal

Choosed send id when clicked.

Parameters
idpoint id.

Referenced by CurveChoosed(), VAbstractOperation::InitCurve(), mousePressEvent(), and mouseReleaseEvent().

◆ contextMenuEvent()

void VSimpleCurve::contextMenuEvent ( QGraphicsSceneContextMenuEvent *  event)
protectedvirtual

Definition at line 182 of file vsimplecurve.cpp.

References VAbstractSimple::showContextMenu().

◆ CurveChoosed

void VSimpleCurve::CurveChoosed ( )
slot

Definition at line 102 of file vsimplecurve.cpp.

References Choosed().

◆ CurveSelected

void VSimpleCurve::CurveSelected ( bool  selected)
slot

Definition at line 108 of file vsimplecurve.cpp.

References Selected().

◆ hoverEnterEvent()

void VSimpleCurve::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 152 of file vsimplecurve.cpp.

References m_curve, m_isHovered, and VCurvePathItem::SetDirectionArrows().

◆ hoverLeaveEvent()

void VSimpleCurve::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Definition at line 163 of file vsimplecurve.cpp.

References m_isHovered, and VCurvePathItem::SetDirectionArrows().

◆ itemChange()

QVariant VSimpleCurve::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protectedvirtual

Definition at line 171 of file vsimplecurve.cpp.

References Selected().

◆ keyReleaseEvent()

void VSimpleCurve::keyReleaseEvent ( QKeyEvent *  event)
protectedvirtual

Definition at line 188 of file vsimplecurve.cpp.

References VAbstractSimple::Delete().

◆ mousePressEvent()

void VSimpleCurve::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 114 of file vsimplecurve.cpp.

References ByMouseRelease, Choosed(), and VAbstractSimple::selectionType.

◆ mouseReleaseEvent()

void VSimpleCurve::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual

Definition at line 139 of file vsimplecurve.cpp.

References ByMouseRelease, Choosed(), and VAbstractSimple::selectionType.

◆ RefreshGeometry()

void VSimpleCurve::RefreshGeometry ( const QSharedPointer< VAbstractCurve > &  curve)

◆ ScalePenWidth()

void VSimpleCurve::ScalePenWidth ( )
protectedvirtual

◆ Selected

void VSimpleCurve::Selected ( bool  selected,
quint32  id 
)
signal

◆ type()

virtual int VSimpleCurve::type ( ) const
inlinevirtual

Reimplemented from VCurvePathItem.

Definition at line 79 of file vsimplecurve.h.

References Type.

Member Data Documentation

◆ m_curve

QSharedPointer<VAbstractCurve> VSimpleCurve::m_curve
private

Definition at line 108 of file vsimplecurve.h.

Referenced by hoverEnterEvent(), RefreshGeometry(), and ScalePenWidth().

◆ m_isHovered

bool VSimpleCurve::m_isHovered
private

Definition at line 109 of file vsimplecurve.h.

Referenced by hoverEnterEvent(), hoverLeaveEvent(), RefreshGeometry(), and ScalePenWidth().


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