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_QPLANEMESH_H
5#define QT3DEXTRAS_QPLANEMESH_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DRender/qgeometryrenderer.h>
9#include <QtCore/QSize>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DExtras {
14
15class Q_3DEXTRASSHARED_EXPORT QPlaneMesh : public Qt3DRender::QGeometryRenderer
16{
17 Q_OBJECT
18 Q_PROPERTY(float width READ width WRITE setWidth NOTIFY widthChanged)
19 Q_PROPERTY(float height READ height WRITE setHeight NOTIFY heightChanged)
20 Q_PROPERTY(QSize meshResolution READ meshResolution WRITE setMeshResolution NOTIFY meshResolutionChanged)
21 Q_PROPERTY(bool mirrored READ mirrored WRITE setMirrored NOTIFY mirroredChanged REVISION 9)
22
23public:
24 explicit QPlaneMesh(Qt3DCore::QNode *parent = nullptr);
25 ~QPlaneMesh();
26
27 float width() const;
28 float height() const;
29 QSize meshResolution() const;
30 bool mirrored() const;
31
32public Q_SLOTS:
33 void setWidth(float width);
34 void setHeight(float height);
35 void setMeshResolution(const QSize &resolution);
36 void setMirrored(bool mirrored);
37
38Q_SIGNALS:
39 void meshResolutionChanged(const QSize &meshResolution);
40 void widthChanged(float width);
41 void heightChanged(float height);
42 void mirroredChanged(bool mirrored);
43
44private:
45 // As this is a default provided geometry renderer, no one should be able
46 // to modify the QGeometryRenderer's properties
47
48 void setInstanceCount(int instanceCount);
49 void setVertexCount(int vertexCount);
50 void setIndexOffset(int indexOffset);
51 void setFirstInstance(int firstInstance);
52 void setRestartIndexValue(int index);
53 void setPrimitiveRestartEnabled(bool enabled);
54 void setGeometry(Qt3DCore::QGeometry *geometry);
55 void setPrimitiveType(PrimitiveType primitiveType);
56};
57
58} // namespace Qt3DExtras
59
60QT_END_NAMESPACE
61
62#endif // QT3DEXTRAS_QPLANEMESH_H
63

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