| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTDATAVIS3D_QHEIGHTMAPSURFACEDATAPROXY_H |
| 5 | #define QTDATAVIS3D_QHEIGHTMAPSURFACEDATAPROXY_H |
| 6 | |
| 7 | #include <QtDataVisualization/qsurfacedataproxy.h> |
| 8 | #include <QtGui/QImage> |
| 9 | #include <QtCore/QString> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QHeightMapSurfaceDataProxyPrivate; |
| 14 | |
| 15 | class Q_DATAVISUALIZATION_EXPORT QHeightMapSurfaceDataProxy : public QSurfaceDataProxy |
| 16 | { |
| 17 | Q_OBJECT |
| 18 | |
| 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 REVISION(6, 3)) |
| 26 | Q_PROPERTY(float maxYValue READ maxYValue WRITE setMaxYValue NOTIFY maxYValueChanged REVISION(6, 3)) |
| 27 | Q_PROPERTY(bool autoScaleY READ autoScaleY WRITE setAutoScaleY NOTIFY autoScaleYChanged REVISION(6, 3)) |
| 28 | |
| 29 | public: |
| 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 | |
| 56 | Q_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 | Q_REVISION(6, 3) void minYValueChanged(float value); |
| 64 | Q_REVISION(6, 3) void maxYValueChanged(float value); |
| 65 | Q_REVISION(6, 3) void autoScaleYChanged(bool enabled); |
| 66 | |
| 67 | protected: |
| 68 | explicit QHeightMapSurfaceDataProxy(QHeightMapSurfaceDataProxyPrivate *d, QObject *parent = nullptr); |
| 69 | QHeightMapSurfaceDataProxyPrivate *dptr(); |
| 70 | const QHeightMapSurfaceDataProxyPrivate *dptrc() const; |
| 71 | |
| 72 | private: |
| 73 | Q_DISABLE_COPY(QHeightMapSurfaceDataProxy) |
| 74 | |
| 75 | friend class Surface3DController; |
| 76 | }; |
| 77 | |
| 78 | QT_END_NAMESPACE |
| 79 | |
| 80 | #endif |
| 81 | |