Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
gridgeometry_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#ifndef GRID_GEOMETRY_H
18#define GRID_GEOMETRY_H
19
20#include <QtQuick3DHelpers/qtquick3dhelpersexports.h>
21#include <QtQuick3D/private/qquick3dgeometry_p.h>
22
24
25class Q_QUICK3DHELPERS_EXPORT GridGeometry : public QQuick3DGeometry
26{
27 Q_OBJECT
28 Q_PROPERTY(int horizontalLines READ horizontalLines WRITE setHorizontalLines NOTIFY horizontalLinesChanged)
29 Q_PROPERTY(int verticalLines READ verticalLines WRITE setVerticalLines NOTIFY verticalLinesChanged)
30 Q_PROPERTY(float horizontalStep READ horizontalStep WRITE setHorizontalStep NOTIFY horizontalStepChanged)
31 Q_PROPERTY(float verticalStep READ verticalStep WRITE setVerticalStep NOTIFY verticalStepChanged)
32 QML_NAMED_ELEMENT(GridGeometry)
33
34public:
35 GridGeometry();
36 ~GridGeometry() override;
37
38 int horizontalLines() const;
39 int verticalLines() const;
40 float horizontalStep() const;
41 float verticalStep() const;
42
43public Q_SLOTS:
44 void setHorizontalLines(int count);
45 void setVerticalLines(int count);
46 void setHorizontalStep(float step);
47 void setVerticalStep(float step);
48
49Q_SIGNALS:
50 void horizontalLinesChanged();
51 void verticalLinesChanged();
52 void horizontalStepChanged();
53 void verticalStepChanged();
54
55private:
56 void updateData();
57
58 int m_horLines = 1000;
59 int m_vertLines = 1000;
60 float m_horStep = .1f;
61 float m_vertStep = .1f;
62};
63
64QT_END_NAMESPACE
65
66#endif
static void fillVertexData(QByteArray &vertexData, int horLines, float horStep, int vertLines, float vertStep)