mirror of https://github.com/qt/qtgraphs.git
39 lines
888 B
C
39 lines
888 B
C
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
||
|
|
|
||
|
|
#ifndef DATASOURCE_H
|
||
|
|
#define DATASOURCE_H
|
||
|
|
|
||
|
|
#include <QtGraphs/qsurface3dseries.h>
|
||
|
|
#include <QtQml/qqmlregistration.h>
|
||
|
|
|
||
|
|
//! [0]
|
||
|
|
//! [2]
|
||
|
|
class DataSource : public QObject
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
//! [0]
|
||
|
|
QML_ELEMENT
|
||
|
|
//! [2]
|
||
|
|
public:
|
||
|
|
explicit DataSource(QObject *parent = 0);
|
||
|
|
virtual ~DataSource();
|
||
|
|
|
||
|
|
//! [1]
|
||
|
|
Q_INVOKABLE void generateData(int cacheCount, int rowCount, int columnCount,
|
||
|
|
float xMin, float xMax,
|
||
|
|
float yMin, float yMax,
|
||
|
|
float zMin, float zMax);
|
||
|
|
|
||
|
|
Q_INVOKABLE void update(QSurface3DSeries *series);
|
||
|
|
//! [1]
|
||
|
|
private:
|
||
|
|
void clearData();
|
||
|
|
|
||
|
|
QList<QSurfaceDataArray> m_data;
|
||
|
|
int m_index;
|
||
|
|
QSurfaceDataArray *m_resetArray;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|