2023-03-02 13:45:23 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2023-05-09 07:38:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
#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);
|
2023-11-21 14:00:09 +00:00
|
|
|
~DataSource() override;
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
//! [1]
|
2023-10-12 06:37:46 +00:00
|
|
|
Q_INVOKABLE void generateData(int cacheCount,
|
|
|
|
|
int rowCount,
|
|
|
|
|
int columnCount,
|
|
|
|
|
float xMin,
|
|
|
|
|
float xMax,
|
|
|
|
|
float yMin,
|
|
|
|
|
float yMax,
|
|
|
|
|
float zMin,
|
|
|
|
|
float zMax);
|
2023-03-02 13:45:23 +00:00
|
|
|
|
|
|
|
|
Q_INVOKABLE void update(QSurface3DSeries *series);
|
|
|
|
|
//! [1]
|
|
|
|
|
private:
|
|
|
|
|
void clearData();
|
|
|
|
|
|
|
|
|
|
QList<QSurfaceDataArray> m_data;
|
|
|
|
|
int m_index;
|
2023-09-08 11:39:55 +00:00
|
|
|
QSurfaceDataArray m_resetArray;
|
2023-03-02 13:45:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|