| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QTDATAVIS3D_QBAR3DSERIES_H |
| 5 | #define QTDATAVIS3D_QBAR3DSERIES_H |
| 6 | |
| 7 | #include <QtDataVisualization/qabstract3dseries.h> |
| 8 | #include <QtDataVisualization/qbardataproxy.h> |
| 9 | #include <QtCore/QPoint> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | class QBar3DSeriesPrivate; |
| 14 | |
| 15 | class Q_DATAVISUALIZATION_EXPORT QBar3DSeries : public QAbstract3DSeries |
| 16 | { |
| 17 | Q_OBJECT |
| 18 | Q_PROPERTY(QBarDataProxy *dataProxy READ dataProxy WRITE setDataProxy NOTIFY dataProxyChanged) |
| 19 | Q_PROPERTY(QPoint selectedBar READ selectedBar WRITE setSelectedBar NOTIFY selectedBarChanged) |
| 20 | Q_PROPERTY(float meshAngle READ meshAngle WRITE setMeshAngle NOTIFY meshAngleChanged) |
| 21 | Q_PROPERTY(QList<QColor> rowColors READ rowColors WRITE setRowColors NOTIFY rowColorsChanged REVISION(6, 3)) |
| 22 | |
| 23 | public: |
| 24 | explicit QBar3DSeries(QObject *parent = nullptr); |
| 25 | explicit QBar3DSeries(QBarDataProxy *dataProxy, QObject *parent = nullptr); |
| 26 | virtual ~QBar3DSeries(); |
| 27 | |
| 28 | void setDataProxy(QBarDataProxy *proxy); |
| 29 | QBarDataProxy *dataProxy() const; |
| 30 | |
| 31 | void setSelectedBar(const QPoint &position); |
| 32 | QPoint selectedBar() const; |
| 33 | static QPoint invalidSelectionPosition(); |
| 34 | |
| 35 | void setMeshAngle(float angle); |
| 36 | float meshAngle() const; |
| 37 | |
| 38 | QList<QColor> rowColors() const; |
| 39 | void setRowColors(const QList<QColor> &colors); |
| 40 | |
| 41 | Q_SIGNALS: |
| 42 | void dataProxyChanged(QBarDataProxy *proxy); |
| 43 | void selectedBarChanged(const QPoint &position); |
| 44 | void meshAngleChanged(float angle); |
| 45 | Q_REVISION(6, 3) void rowColorsChanged(const QList<QColor> &rowcolors); |
| 46 | |
| 47 | protected: |
| 48 | QBar3DSeriesPrivate *dptr(); |
| 49 | const QBar3DSeriesPrivate *dptrc() const; |
| 50 | |
| 51 | private: |
| 52 | Q_DISABLE_COPY(QBar3DSeries) |
| 53 | |
| 54 | friend class Bars3DController; |
| 55 | }; |
| 56 | |
| 57 | QT_END_NAMESPACE |
| 58 | |
| 59 | #endif |
| 60 | |