Changeset View
Changeset View
Standalone View
Standalone View
src/scenegraph/shadowedrectanglenode.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * SPDX-FileCopyrightText: 2020 Arjen Hiemstra <ahiemstra@heimr.nl> | ||||
3 | * | ||||
4 | * SPDX-License-Identifier: LGPL-2.0-or-later | ||||
5 | */ | ||||
6 | | ||||
7 | #pragma once | ||||
8 | | ||||
9 | #include <QSGGeometryNode> | ||||
10 | #include <QColor> | ||||
11 | #include <QVector2D> | ||||
12 | | ||||
13 | class ShadowedRectangleMaterial; | ||||
14 | | ||||
15 | class ShadowedRectangleNode : public QSGGeometryNode | ||||
16 | { | ||||
17 | public: | ||||
18 | ShadowedRectangleNode(); | ||||
19 | | ||||
20 | void setRect(const QRectF &rect); | ||||
21 | void setSize(qreal size); | ||||
22 | void setRadius(qreal radius); | ||||
23 | void setColor(const QColor &color); | ||||
24 | void setShadowColor(const QColor &color); | ||||
25 | void setOffset(const QVector2D &offset); | ||||
26 | | ||||
27 | void updateGeometry(); | ||||
28 | | ||||
29 | private: | ||||
30 | QSGGeometry *m_geometry; | ||||
31 | ShadowedRectangleMaterial *m_material; | ||||
32 | | ||||
33 | QRectF m_rect; | ||||
34 | qreal m_size = 0.0; | ||||
35 | qreal m_radius = 0.0; | ||||
36 | QVector2D m_offset = QVector2D{0.0, 0.0}; | ||||
37 | QVector2D m_aspect = QVector2D{1.0, 1.0}; | ||||
38 | }; |