1 | // Copyright (C) 2014 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_QCYLINDERMESH_H |
5 | #define QT3DEXTRAS_QCYLINDERMESH_H |
6 | |
7 | #include <Qt3DExtras/qt3dextras_global.h> |
8 | #include <Qt3DRender/qgeometryrenderer.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | namespace Qt3DExtras { |
14 | |
15 | class Q_3DEXTRASSHARED_EXPORT QCylinderMesh : public Qt3DRender::QGeometryRenderer |
16 | { |
17 | Q_OBJECT |
18 | Q_PROPERTY(int rings READ rings WRITE setRings NOTIFY ringsChanged) |
19 | Q_PROPERTY(int slices READ slices WRITE setSlices NOTIFY slicesChanged) |
20 | Q_PROPERTY(float radius READ radius WRITE setRadius NOTIFY radiusChanged) |
21 | Q_PROPERTY(float length READ length WRITE setLength NOTIFY lengthChanged) |
22 | public: |
23 | explicit QCylinderMesh(Qt3DCore::QNode *parent = nullptr); |
24 | ~QCylinderMesh(); |
25 | |
26 | int rings() const; |
27 | int slices() const; |
28 | float radius() const; |
29 | float length() const; |
30 | |
31 | public Q_SLOTS: |
32 | void setRings(int rings); |
33 | void setSlices(int slices); |
34 | void setRadius(float radius); |
35 | void setLength(float length); |
36 | |
37 | Q_SIGNALS: |
38 | void radiusChanged(float radius); |
39 | void ringsChanged(int rings); |
40 | void slicesChanged(int slices); |
41 | void lengthChanged(float length); |
42 | |
43 | private: |
44 | // As this is a default provided geometry renderer, no one should be able |
45 | // to modify the QGeometryRenderer's properties |
46 | |
47 | void setInstanceCount(int instanceCount); |
48 | void setVertexCount(int vertexCount); |
49 | void setIndexOffset(int indexOffset); |
50 | void setFirstInstance(int firstInstance); |
51 | void setRestartIndexValue(int index); |
52 | void setPrimitiveRestartEnabled(bool enabled); |
53 | void setGeometry(Qt3DCore::QGeometry *geometry); |
54 | void setPrimitiveType(PrimitiveType primitiveType); |
55 | }; |
56 | |
57 | } // namespace Qt3DExtras |
58 | |
59 | QT_END_NAMESPACE |
60 | |
61 | #endif // QT3DEXTRAS_QCYLINDERMESH_H |
62 |
Definitions
Learn Advanced QML with KDAB
Find out more