| 1 | // Copyright (C) 2024 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTGRAPHS_Q3DSURFACEWIDGETITEM_H |
| 5 | #define QTGRAPHS_Q3DSURFACEWIDGETITEM_H |
| 6 | |
| 7 | #include <QtGraphs/qsurface3dseries.h> |
| 8 | #include <QtGraphs/qvalue3daxis.h> |
| 9 | #include <QtGraphsWidgets/q3dgraphswidgetitem.h> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QQuickGraphsSurface; |
| 14 | class Q3DSurfaceWidgetItemPrivate; |
| 15 | |
| 16 | class Q_GRAPHSWIDGETS_EXPORT Q3DSurfaceWidgetItem : public Q3DGraphsWidgetItem |
| 17 | { |
| 18 | Q_OBJECT |
| 19 | Q_PROPERTY(QValue3DAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged) |
| 20 | Q_PROPERTY(QValue3DAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged) |
| 21 | Q_PROPERTY(QValue3DAxis *axisZ READ axisZ WRITE setAxisZ NOTIFY axisZChanged) |
| 22 | Q_PROPERTY(QSurface3DSeries *selectedSeries READ selectedSeries NOTIFY selectedSeriesChanged) |
| 23 | Q_PROPERTY(bool flipHorizontalGrid READ flipHorizontalGrid WRITE setFlipHorizontalGrid NOTIFY |
| 24 | flipHorizontalGridChanged) |
| 25 | |
| 26 | public: |
| 27 | explicit Q3DSurfaceWidgetItem(QObject *parent = nullptr); |
| 28 | ~Q3DSurfaceWidgetItem() override; |
| 29 | |
| 30 | void addSeries(QSurface3DSeries *series); |
| 31 | void removeSeries(QSurface3DSeries *series); |
| 32 | QList<QSurface3DSeries *> seriesList() const; |
| 33 | |
| 34 | // Axes |
| 35 | void setAxisX(QValue3DAxis *axis); |
| 36 | QValue3DAxis *axisX() const; |
| 37 | void setAxisY(QValue3DAxis *axis); |
| 38 | QValue3DAxis *axisY() const; |
| 39 | void setAxisZ(QValue3DAxis *axis); |
| 40 | QValue3DAxis *axisZ() const; |
| 41 | void addAxis(QValue3DAxis *axis); |
| 42 | void releaseAxis(QValue3DAxis *axis); |
| 43 | QList<QValue3DAxis *> axes() const; |
| 44 | |
| 45 | QSurface3DSeries *selectedSeries() const; |
| 46 | void setFlipHorizontalGrid(bool flip); |
| 47 | bool flipHorizontalGrid() const; |
| 48 | |
| 49 | protected: |
| 50 | bool event(QEvent *event) override; |
| 51 | |
| 52 | Q_SIGNALS: |
| 53 | void axisXChanged(QValue3DAxis *axis); |
| 54 | void axisYChanged(QValue3DAxis *axis); |
| 55 | void axisZChanged(QValue3DAxis *axis); |
| 56 | void selectedSeriesChanged(QSurface3DSeries *series); |
| 57 | void flipHorizontalGridChanged(bool flip); |
| 58 | |
| 59 | private: |
| 60 | Q_DECLARE_PRIVATE(Q3DSurfaceWidgetItem) |
| 61 | QQuickGraphsSurface *graphSurface(); |
| 62 | const QQuickGraphsSurface *graphSurface() const; |
| 63 | }; |
| 64 | |
| 65 | QT_END_NAMESPACE |
| 66 | |
| 67 | #endif |
| 68 |
