1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DINFINITEGRID_H
5#define QQUICK3DINFINITEGRID_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QQuick3DObject>
19
20QT_BEGIN_NAMESPACE
21
22class QQuick3DSceneEnvironment;
23
24class QQuick3DInfiniteGrid : public QObject, public QQmlParserStatus
25{
26 Q_OBJECT
27 Q_INTERFACES(QQmlParserStatus)
28
29 QML_NAMED_ELEMENT(InfiniteGrid)
30 Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
31 Q_PROPERTY(float gridInterval READ gridInterval WRITE setGridInterval NOTIFY gridIntervalChanged)
32 Q_PROPERTY(bool gridAxes READ gridAxes WRITE setGridAxes NOTIFY gridAxesChanged)
33
34public:
35 QQuick3DInfiniteGrid();
36 ~QQuick3DInfiniteGrid() override;
37 bool visible() const;
38 void setVisible(bool newVisible);
39 float gridInterval() const;
40 void setGridInterval(float newGridInterval);
41 void componentComplete() override;
42 void classBegin() override;
43
44 bool gridAxes() const;
45 void setGridAxes(bool newGridAxes);
46
47signals:
48 void visibleChanged();
49 void gridIntervalChanged();
50
51 void gridAxesChanged();
52
53private:
54 void updateGridFlags();
55 bool m_visible = true;
56 float m_gridInterval = 1.0f;
57 QQuick3DSceneEnvironment *m_sceneEnv = nullptr;
58 bool m_componentComplete = false;
59 bool m_gridAxes = true;
60};
61
62QT_END_NAMESPACE
63
64#endif // QQUICK3DINFINITEGRID_H
65

source code of qtquick3d/src/helpers/infinitegrid_p.h