| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTDATAVIS3D_QSURFACEDATAPROXY_H |
| 5 | #define QTDATAVIS3D_QSURFACEDATAPROXY_H |
| 6 | |
| 7 | #include <QtDataVisualization/qabstractdataproxy.h> |
| 8 | #include <QtDataVisualization/qsurfacedataitem.h> |
| 9 | |
| 10 | Q_MOC_INCLUDE(<QtDataVisualization/qsurface3dseries.h>) |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | class QSurfaceDataProxyPrivate; |
| 15 | class QSurface3DSeries; |
| 16 | |
| 17 | typedef QList<QSurfaceDataItem> QSurfaceDataRow; |
| 18 | typedef QList<QSurfaceDataRow *> QSurfaceDataArray; |
| 19 | |
| 20 | class Q_DATAVISUALIZATION_EXPORT QSurfaceDataProxy : public QAbstractDataProxy |
| 21 | { |
| 22 | Q_OBJECT |
| 23 | |
| 24 | Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) |
| 25 | Q_PROPERTY(int columnCount READ columnCount NOTIFY columnCountChanged) |
| 26 | Q_PROPERTY(QSurface3DSeries *series READ series NOTIFY seriesChanged) |
| 27 | |
| 28 | public: |
| 29 | explicit QSurfaceDataProxy(QObject *parent = nullptr); |
| 30 | virtual ~QSurfaceDataProxy(); |
| 31 | |
| 32 | QSurface3DSeries *series() const; |
| 33 | int rowCount() const; |
| 34 | int columnCount() const; |
| 35 | const QSurfaceDataArray *array() const; |
| 36 | const QSurfaceDataItem *itemAt(int rowIndex, int columnIndex) const; |
| 37 | const QSurfaceDataItem *itemAt(const QPoint &position) const; |
| 38 | |
| 39 | void resetArray(QSurfaceDataArray *newArray); |
| 40 | |
| 41 | void setRow(int rowIndex, QSurfaceDataRow *row); |
| 42 | void setRows(int rowIndex, const QSurfaceDataArray &rows); |
| 43 | |
| 44 | void setItem(int rowIndex, int columnIndex, const QSurfaceDataItem &item); |
| 45 | void setItem(const QPoint &position, const QSurfaceDataItem &item); |
| 46 | |
| 47 | int addRow(QSurfaceDataRow *row); |
| 48 | int addRows(const QSurfaceDataArray &rows); |
| 49 | |
| 50 | void insertRow(int rowIndex, QSurfaceDataRow *row); |
| 51 | void insertRows(int rowIndex, const QSurfaceDataArray &rows); |
| 52 | |
| 53 | void removeRows(int rowIndex, int removeCount); |
| 54 | |
| 55 | Q_SIGNALS: |
| 56 | void arrayReset(); |
| 57 | void rowsAdded(int startIndex, int count); |
| 58 | void rowsChanged(int startIndex, int count); |
| 59 | void rowsRemoved(int startIndex, int count); |
| 60 | void rowsInserted(int startIndex, int count); |
| 61 | void itemChanged(int rowIndex, int columnIndex); |
| 62 | |
| 63 | void rowCountChanged(int count); |
| 64 | void columnCountChanged(int count); |
| 65 | void seriesChanged(QSurface3DSeries *series); |
| 66 | |
| 67 | protected: |
| 68 | explicit QSurfaceDataProxy(QSurfaceDataProxyPrivate *d, QObject *parent = nullptr); |
| 69 | QSurfaceDataProxyPrivate *dptr(); |
| 70 | const QSurfaceDataProxyPrivate *dptrc() const; |
| 71 | |
| 72 | private: |
| 73 | Q_DISABLE_COPY(QSurfaceDataProxy) |
| 74 | |
| 75 | friend class Surface3DController; |
| 76 | }; |
| 77 | |
| 78 | QT_END_NAMESPACE |
| 79 | |
| 80 | #endif |
| 81 | |