1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QHEIGHTMAPSURFACEDATAPROXY_H
5#define QHEIGHTMAPSURFACEDATAPROXY_H
6
7#include <QtGraphs/qsurfacedataproxy.h>
8#include <QtGui/QImage>
9#include <QtCore/QString>
10
11QT_BEGIN_NAMESPACE
12
13class QHeightMapSurfaceDataProxyPrivate;
14
15class Q_GRAPHS_EXPORT QHeightMapSurfaceDataProxy : public QSurfaceDataProxy
16{
17 Q_OBJECT
18 Q_DECLARE_PRIVATE(QHeightMapSurfaceDataProxy)
19 Q_PROPERTY(QImage heightMap READ heightMap WRITE setHeightMap NOTIFY heightMapChanged)
20 Q_PROPERTY(QString heightMapFile READ heightMapFile WRITE setHeightMapFile NOTIFY heightMapFileChanged)
21 Q_PROPERTY(float minXValue READ minXValue WRITE setMinXValue NOTIFY minXValueChanged)
22 Q_PROPERTY(float maxXValue READ maxXValue WRITE setMaxXValue NOTIFY maxXValueChanged)
23 Q_PROPERTY(float minZValue READ minZValue WRITE setMinZValue NOTIFY minZValueChanged)
24 Q_PROPERTY(float maxZValue READ maxZValue WRITE setMaxZValue NOTIFY maxZValueChanged)
25 Q_PROPERTY(float minYValue READ minYValue WRITE setMinYValue NOTIFY minYValueChanged)
26 Q_PROPERTY(float maxYValue READ maxYValue WRITE setMaxYValue NOTIFY maxYValueChanged)
27 Q_PROPERTY(bool autoScaleY READ autoScaleY WRITE setAutoScaleY NOTIFY autoScaleYChanged)
28
29public:
30 explicit QHeightMapSurfaceDataProxy(QObject *parent = nullptr);
31 explicit QHeightMapSurfaceDataProxy(const QImage &image, QObject *parent = nullptr);
32 explicit QHeightMapSurfaceDataProxy(const QString &filename, QObject *parent = nullptr);
33 virtual ~QHeightMapSurfaceDataProxy();
34
35 void setHeightMap(const QImage &image);
36 QImage heightMap() const;
37 void setHeightMapFile(const QString &filename);
38 QString heightMapFile() const;
39
40 void setValueRanges(float minX, float maxX, float minZ, float maxZ);
41 void setMinXValue(float min);
42 float minXValue() const;
43 void setMaxXValue(float max);
44 float maxXValue() const;
45 void setMinZValue(float min);
46 float minZValue() const;
47 void setMaxZValue(float max);
48 float maxZValue() const;
49 void setMinYValue(float min);
50 float minYValue() const;
51 void setMaxYValue(float max);
52 float maxYValue() const;
53 void setAutoScaleY(bool enabled);
54 bool autoScaleY() const;
55
56Q_SIGNALS:
57 void heightMapChanged(const QImage &image);
58 void heightMapFileChanged(const QString &filename);
59 void minXValueChanged(float value);
60 void maxXValueChanged(float value);
61 void minZValueChanged(float value);
62 void maxZValueChanged(float value);
63 void minYValueChanged(float value);
64 void maxYValueChanged(float value);
65 void autoScaleYChanged(bool enabled);
66
67protected:
68 explicit QHeightMapSurfaceDataProxy(QHeightMapSurfaceDataProxyPrivate *d, QObject *parent = nullptr);
69 void handlePendingResolve();
70
71private:
72 Q_DISABLE_COPY(QHeightMapSurfaceDataProxy)
73};
74
75QT_END_NAMESPACE
76
77#endif
78

source code of qtgraphs/src/graphs/data/qheightmapsurfacedataproxy.h