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_QCYLINDERGEOMETRYVIEW_H
5#define QT3DEXTRAS_QCYLINDERGEOMETRYVIEW_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DCore/qgeometryview.h>
9
10QT_BEGIN_NAMESPACE
11
12
13namespace Qt3DExtras {
14
15class Q_3DEXTRASSHARED_EXPORT QCylinderGeometryView : public Qt3DCore::QGeometryView
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)
22public:
23 explicit QCylinderGeometryView(Qt3DCore::QNode *parent = nullptr);
24 ~QCylinderGeometryView();
25
26 int rings() const;
27 int slices() const;
28 float radius() const;
29 float length() const;
30
31public Q_SLOTS:
32 void setRings(int rings);
33 void setSlices(int slices);
34 void setRadius(float radius);
35 void setLength(float length);
36
37Q_SIGNALS:
38 void radiusChanged(float radius);
39 void ringsChanged(int rings);
40 void slicesChanged(int slices);
41 void lengthChanged(float length);
42
43private:
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
59QT_END_NAMESPACE
60
61#endif // QT3DEXTRAS_QCYLINDERGEOMETRYVIEW_H
62

source code of qt3d/src/extras/geometries/qcylindergeometryview.h