qskinny/src/nodes/QskLinesNode.h

78 lines
2.4 KiB
C
Raw Normal View History

2023-05-17 12:21:40 +00:00
/******************************************************************************
2024-01-17 13:31:45 +00:00
* QSkinny - Copyright (C) The authors
2023-05-17 12:21:40 +00:00
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_LINES_NODE_H
#define QSK_LINES_NODE_H
#include "QskBasicLinesNode.h"
2023-05-17 12:21:40 +00:00
#include <qvector.h>
class QskIntervalF;
class QskStippleMetrics;
class QTransform;
class QPointF;
2023-05-25 13:03:48 +00:00
class QLineF;
2023-11-15 10:47:56 +00:00
class QPolygonF;
2023-05-17 12:21:40 +00:00
/*
A node for stippled or solid lines.
For the moment limited to horizontal/vertical lines: TODO
*/
class QSK_EXPORT QskLinesNode : public QskBasicLinesNode
2023-05-17 12:21:40 +00:00
{
using Inherited = QskBasicLinesNode;
2023-11-15 10:47:56 +00:00
2023-05-17 12:21:40 +00:00
public:
QskLinesNode();
~QskLinesNode() override;
2023-05-25 13:03:48 +00:00
void updateGrid( const QColor&, qreal lineWidth,
2023-05-17 14:46:25 +00:00
const QskStippleMetrics&, const QTransform&, const QRectF&,
const QVector< qreal >&, const QVector< qreal >& );
2023-05-17 12:21:40 +00:00
2023-05-25 13:03:48 +00:00
void updateRect( const QColor&, qreal lineWidth,
2023-05-17 14:46:25 +00:00
const QskStippleMetrics&, const QTransform&, const QRectF& );
2023-05-17 12:21:40 +00:00
void updateLine( const QColor&, qreal lineWidth,
const QPointF&, const QPointF& );
2023-05-25 13:03:48 +00:00
void updateLine( const QColor&, qreal lineWidth,
const QskStippleMetrics&, const QTransform&,
const QPointF&, const QPointF& );
void updateLines( const QColor&, qreal lineWidth, const QVector< QLineF >& );
2023-05-25 13:03:48 +00:00
void updateLines( const QColor&, qreal lineWidth,
const QskStippleMetrics&, const QTransform&, const QVector< QLineF >& );
2023-11-15 10:47:56 +00:00
void updatePolygon( const QColor&, qreal lineWidth,
const QTransform&, const QPolygonF& );
2023-05-17 12:21:40 +00:00
private:
2023-05-25 13:03:48 +00:00
void updateLines( const QColor&, qreal lineWidth, const QskStippleMetrics&,
const QTransform&, int count, const QLineF* );
void updateGeometry( const QskStippleMetrics&, const QTransform&,
int count, const QLineF* );
2023-05-17 12:21:40 +00:00
void updateGeometry(
2023-05-17 14:46:25 +00:00
const QskStippleMetrics&, const QTransform&, const QRectF&,
const QVector< qreal >&, const QVector< qreal >& );
QSGGeometry::Point2D* setSolidLines(
Qt::Orientation, qreal, qreal,
const QTransform&, int count, const qreal* values,
QSGGeometry::Point2D* ) const;
QSGGeometry::Point2D* setStippledLines(
Qt::Orientation, qreal, qreal,
const QTransform&, int count, const qreal* values,
const QskStippleMetrics&, QSGGeometry::Point2D* ) const;
2023-05-17 12:21:40 +00:00
QskHashValue m_hash = 0.0;
2023-05-17 12:21:40 +00:00
};
#endif