1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
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
12QT_BEGIN_NAMESPACE
13
14namespace Qt3DCore {
15
16class QAttribute;
17
18} // namespace Qt3DCore
19
20namespace Qt3DExtras {
21
22class QExtrudedTextGeometryPrivate;
23
24class 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
34public:
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
45public Q_SLOTS:
46 void setText(const QString &text);
47 void setFont(const QFont &font);
48 void setDepth(float extrusionLength);
49
50Q_SIGNALS:
51 void textChanged(const QString &text);
52 void fontChanged(const QFont &font);
53 void depthChanged(float extrusionLength);
54
55protected:
56 explicit QExtrudedTextGeometry(QExtrudedTextGeometryPrivate &dd, QNode *parent = nullptr);
57
58private:
59 Q_DECLARE_PRIVATE(QExtrudedTextGeometry)
60};
61
62} // namespace Qt3DExtras
63
64QT_END_NAMESPACE
65
66#endif // QT3DEXTRAS_QEXTRUDEDTEXTGEOMETRY_H
67

source code of qt3d/src/extras/3dtext/qextrudedtextgeometry.h