1 | // Copyright (C) 2023 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the QtGraphs API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | |
14 | #ifndef Q3DSCENE_P_H |
15 | #define Q3DSCENE_P_H |
16 | |
17 | #include <QtCore/private/qobject_p.h> |
18 | #include <QtGraphs/q3dscene.h> |
19 | #include <private/qgraphsglobal_p.h> |
20 | |
21 | QT_BEGIN_NAMESPACE |
22 | |
23 | struct Q3DSceneChangeBitField |
24 | { |
25 | bool viewportChanged : 1; |
26 | bool primarySubViewportChanged : 1; |
27 | bool secondarySubViewportChanged : 1; |
28 | bool subViewportOrderChanged : 1; |
29 | bool slicingActivatedChanged : 1; |
30 | bool devicePixelRatioChanged : 1; |
31 | bool selectionQueryPositionChanged : 1; |
32 | bool graphPositionQueryPositionChanged : 1; |
33 | bool windowSizeChanged : 1; |
34 | |
35 | Q3DSceneChangeBitField() |
36 | : viewportChanged(true) |
37 | , primarySubViewportChanged(true) |
38 | , secondarySubViewportChanged(true) |
39 | , subViewportOrderChanged(true) |
40 | , slicingActivatedChanged(true) |
41 | , devicePixelRatioChanged(true) |
42 | , selectionQueryPositionChanged(false) |
43 | , graphPositionQueryPositionChanged(false) |
44 | , windowSizeChanged(true) |
45 | {} |
46 | }; |
47 | |
48 | class Q_GRAPHS_EXPORT Q3DScenePrivate : public QObjectPrivate |
49 | { |
50 | Q_DECLARE_PUBLIC(Q3DScene) |
51 | |
52 | public: |
53 | Q3DScenePrivate(); |
54 | ~Q3DScenePrivate(); |
55 | |
56 | void sync(Q3DScenePrivate &other); |
57 | |
58 | void setViewport(const QRect viewport); |
59 | void setViewportSize(int width, int height); |
60 | void setWindowSize(QSize size); |
61 | QSize windowSize() const; |
62 | void updateDefaultViewports(); |
63 | |
64 | void markDirty(); |
65 | |
66 | bool isInArea(const QRect area, int x, int y) const; |
67 | |
68 | public: |
69 | Q3DSceneChangeBitField m_changeTracker; |
70 | |
71 | QRect m_viewport; |
72 | QRect m_primarySubViewport; |
73 | QRect m_secondarySubViewport; |
74 | bool m_isSecondarySubviewOnTop; |
75 | qreal m_devicePixelRatio; |
76 | bool m_isUnderSideCameraEnabled; |
77 | bool m_isSlicingActive; |
78 | QPoint m_selectionQueryPosition; |
79 | QPoint m_graphPositionQueryPosition; |
80 | QSize m_windowSize; |
81 | bool m_sceneDirty; |
82 | QRect m_defaultSmallViewport; |
83 | QRect m_defaultLargeViewport; |
84 | }; |
85 | |
86 | QT_END_NAMESPACE |
87 | |
88 | #endif |
89 | |