53 #include "../vwidgets/global.h"
54 #include "../vgeometry/vabstractcurve.h"
60 : QGraphicsPathItem(parent),
69 QPainterPath itemPath;
73 for (qint32 i = 0; i <
m_points.count()-1; ++i)
87 if (arrowsPath != QPainterPath())
89 itemPath.addPath(arrowsPath);
91 itemPath.setFillRule(Qt::WindingFill);
104 if (arrowsPath != QPainterPath())
108 QPen arrowPen(pen());
109 arrowPen.setStyle(Qt::SolidLine);
111 painter->setPen(arrowPen);
112 painter->setBrush(brush());
113 painter->drawPath(arrowsPath);
118 QGraphicsPathItem::paint(painter, option, widget);
138 QPen toolPen = pen();
139 toolPen.setWidthF(width);
static const qreal lengthCurveDirectionArrow
static QPainterPath ShowDirection(const QVector< DirectionArrow > &arrows, qreal width)
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
QVector< QPointF > m_points
void SetPoints(const QVector< QPointF > &points)
virtual void ScalePenWidth()
void SetDirectionArrows(const QVector< QPair< QLineF, QLineF >> &arrows)
virtual QPainterPath shape() const Q_DECL_OVERRIDE
QVector< QPair< QLineF, QLineF > > m_directionArrows
VCurvePathItem(QGraphicsItem *parent=nullptr)
const qreal widthMainLine
qreal sceneScale(QGraphicsScene *scene)
QPainterPath ItemShapeFromPath(const QPainterPath &path, const QPen &pen)
qreal scaleWidth(qreal width, qreal scale)