1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtDataVisualization API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef DECLARATIVESURFACE_P_H
15#define DECLARATIVESURFACE_P_H
16
17#include "abstractdeclarative_p.h"
18#include "qsurface3dseries.h"
19
20#include <private/datavisualizationglobal_p.h>
21#include <private/surface3dcontroller_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class DeclarativeSurface : public AbstractDeclarative
26{
27 Q_OBJECT
28 Q_PROPERTY(QValue3DAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
29 Q_PROPERTY(QValue3DAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
30 Q_PROPERTY(QValue3DAxis *axisZ READ axisZ WRITE setAxisZ NOTIFY axisZChanged)
31 Q_PROPERTY(QSurface3DSeries *selectedSeries READ selectedSeries NOTIFY selectedSeriesChanged)
32 Q_PROPERTY(QQmlListProperty<QSurface3DSeries> seriesList READ seriesList)
33 Q_PROPERTY(bool flipHorizontalGrid READ flipHorizontalGrid WRITE setFlipHorizontalGrid NOTIFY flipHorizontalGridChanged REVISION(1, 2))
34 Q_CLASSINFO("DefaultProperty", "seriesList")
35
36 QML_NAMED_ELEMENT(Surface3D)
37 QML_ADDED_IN_VERSION(1, 0)
38
39public:
40 explicit DeclarativeSurface(QQuickItem *parent = 0);
41 ~DeclarativeSurface();
42
43 QValue3DAxis *axisX() const;
44 void setAxisX(QValue3DAxis *axis);
45 QValue3DAxis *axisY() const;
46 void setAxisY(QValue3DAxis *axis);
47 QValue3DAxis *axisZ() const;
48 void setAxisZ(QValue3DAxis *axis);
49
50 QQmlListProperty<QSurface3DSeries> seriesList();
51 static void appendSeriesFunc(QQmlListProperty<QSurface3DSeries> *list, QSurface3DSeries *series);
52 static qsizetype countSeriesFunc(QQmlListProperty<QSurface3DSeries> *list);
53 static QSurface3DSeries *atSeriesFunc(QQmlListProperty<QSurface3DSeries> *list, qsizetype index);
54 static void clearSeriesFunc(QQmlListProperty<QSurface3DSeries> *list);
55 Q_INVOKABLE void addSeries(QSurface3DSeries *series);
56 Q_INVOKABLE void removeSeries(QSurface3DSeries *series);
57
58 QSurface3DSeries *selectedSeries() const;
59 void setFlipHorizontalGrid(bool flip);
60 bool flipHorizontalGrid() const;
61
62public Q_SLOTS:
63 void handleAxisXChanged(QAbstract3DAxis *axis) override;
64 void handleAxisYChanged(QAbstract3DAxis *axis) override;
65 void handleAxisZChanged(QAbstract3DAxis *axis) override;
66
67Q_SIGNALS:
68 void axisXChanged(QValue3DAxis *axis);
69 void axisYChanged(QValue3DAxis *axis);
70 void axisZChanged(QValue3DAxis *axis);
71 void selectedSeriesChanged(QSurface3DSeries *series);
72 Q_REVISION(1, 2) void flipHorizontalGridChanged(bool flip);
73
74private:
75 Surface3DController *m_surfaceController;
76};
77
78QT_END_NAMESPACE
79
80#endif
81

source code of qtdatavis3d/src/datavisualizationqml/declarativesurface_p.h