1 | // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H |
5 | #define QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H |
6 | |
7 | #include <Qt3DExtras/qt3dextras_global.h> |
8 | #include <Qt3DCore/qgeometry.h> |
9 | #include <QtCore/QString> |
10 | #include <QtGui/QFont> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | namespace Qt3DCore { |
15 | |
16 | class QAttribute; |
17 | |
18 | } // namespace Qt3DCore |
19 | |
20 | namespace Qt3DExtras { |
21 | |
22 | class QExtrudedTextGeometryPrivate; |
23 | |
24 | class Q_3DEXTRASSHARED_EXPORT QExtrudedTextGeometry : public Qt3DCore::QGeometry |
25 | { |
26 | Q_OBJECT |
27 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) |
28 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged) |
29 | Q_PROPERTY(float extrusionLength READ extrusionLength WRITE setDepth NOTIFY depthChanged) |
30 | Q_PROPERTY(Qt3DCore::QAttribute *positionAttribute READ positionAttribute CONSTANT) |
31 | Q_PROPERTY(Qt3DCore::QAttribute *normalAttribute READ normalAttribute CONSTANT) |
32 | Q_PROPERTY(Qt3DCore::QAttribute *indexAttribute READ indexAttribute CONSTANT) |
33 | |
34 | public: |
35 | explicit QExtrudedTextGeometry(Qt3DCore::QNode *parent = nullptr); |
36 | ~QExtrudedTextGeometry(); |
37 | |
38 | Qt3DCore::QAttribute *positionAttribute() const; |
39 | Qt3DCore::QAttribute *normalAttribute() const; |
40 | Qt3DCore::QAttribute *indexAttribute() const; |
41 | QString text() const; |
42 | QFont font() const; |
43 | float extrusionLength() const; |
44 | |
45 | public Q_SLOTS: |
46 | void setText(const QString &text); |
47 | void setFont(const QFont &font); |
48 | void setDepth(float extrusionLength); |
49 | |
50 | Q_SIGNALS: |
51 | void textChanged(const QString &text); |
52 | void fontChanged(const QFont &font); |
53 | void depthChanged(float extrusionLength); |
54 | |
55 | protected: |
56 | explicit QExtrudedTextGeometry(QExtrudedTextGeometryPrivate &dd, QNode *parent = nullptr); |
57 | |
58 | private: |
59 | Q_DECLARE_PRIVATE(QExtrudedTextGeometry) |
60 | }; |
61 | |
62 | } // namespace Qt3DExtras |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H |
67 |