File: datasource.h

package info (click to toggle)
qt6-datavis3d 6.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,436 kB
  • sloc: cpp: 51,846; makefile: 20
file content (38 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef DATASOURCE_H
#define DATASOURCE_H

#include <QtDataVisualization/qsurface3dseries.h>
#include <QtQml/qqmlregistration.h>

//! [0]
//! [2]
class DataSource : public QObject
{
    Q_OBJECT
    //! [0]
    QML_ELEMENT
    //! [2]
public:
    explicit DataSource(QObject *parent = nullptr);
    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 = -1;
    QSurfaceDataArray *m_resetArray = nullptr;
};

#endif