Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
heightfieldgeometry_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef HEIGHTFIELDGEOMETRY_H
16#define HEIGHTFIELDGEOMETRY_H
17
18#include <QtQuick3DHelpers/qtquick3dhelpersexports.h>
19#include <QtQuick3D/private/qquick3dgeometry_p.h>
20
22
23class Q_QUICK3DHELPERS_EXPORT HeightFieldGeometry : public QQuick3DGeometry
24{
25 Q_OBJECT
26 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged REVISION(6, 5))
27 Q_PROPERTY(bool smoothShading READ smoothShading WRITE setSmoothShading NOTIFY smoothShadingChanged)
28 Q_PROPERTY(QVector3D extents READ extents WRITE setExtents NOTIFY extentsChanged)
29 QML_NAMED_ELEMENT(HeightFieldGeometry)
30public:
31 HeightFieldGeometry();
32
33 const QUrl &source() const;
34 void setSource(const QUrl &newSource);
35
36 bool smoothShading() const;
37 void setSmoothShading(bool smooth);
38 const QVector3D &extents() const;
39 void setExtents(const QVector3D &newExtents);
40
41signals:
42 void sourceChanged();
43 void smoothShadingChanged();
44 void extentsChanged();
45
46private:
47 void updateData();
48 QVector3D m_extents = { 100, 100, 100 };
49 QUrl m_heightMapSource;
50 bool m_smoothShading = true;
51 bool m_extentsSetExplicitly = false;
52
53#if QT_DEPRECATED_SINCE(6, 5)
54 Q_PROPERTY(QUrl heightMap READ source WRITE setSource NOTIFY sourceChanged)
55#endif
56};
57
58QT_END_NAMESPACE
59
60#endif