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 QCUSTOM3DITEM_P_H |
15 | #define QCUSTOM3DITEM_P_H |
16 | |
17 | #include <QtCore/private/qobject_p.h> |
18 | #include "qcustom3ditem.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | struct QCustomItemDirtyBitField |
23 | { |
24 | bool textureDirty : 1; |
25 | bool meshDirty : 1; |
26 | bool positionDirty : 1; |
27 | bool scalingDirty : 1; |
28 | bool rotationDirty : 1; |
29 | bool visibleDirty : 1; |
30 | bool shadowCastingDirty : 1; |
31 | |
32 | QCustomItemDirtyBitField() |
33 | : textureDirty(false) |
34 | , meshDirty(false) |
35 | , positionDirty(false) |
36 | , scalingDirty(false) |
37 | , rotationDirty(false) |
38 | , visibleDirty(false) |
39 | , shadowCastingDirty(false) |
40 | {} |
41 | }; |
42 | |
43 | class QCustom3DItemPrivate : public QObjectPrivate |
44 | { |
45 | Q_DECLARE_PUBLIC(QCustom3DItem) |
46 | |
47 | public: |
48 | QCustom3DItemPrivate(); |
49 | QCustom3DItemPrivate(const QString &meshFile, |
50 | QVector3D position, |
51 | QVector3D scaling, |
52 | const QQuaternion &rotation); |
53 | ~QCustom3DItemPrivate() override; |
54 | |
55 | QImage textureImage(); |
56 | void clearTextureImage(); |
57 | void resetDirtyBits(); |
58 | |
59 | public: |
60 | QImage m_textureImage; |
61 | QString m_textureFile; |
62 | QString m_meshFile; |
63 | QVector3D m_position; |
64 | bool m_positionAbsolute; |
65 | QVector3D m_scaling; |
66 | bool m_scalingAbsolute; |
67 | QQuaternion m_rotation; |
68 | bool m_visible; |
69 | bool m_shadowCasting; |
70 | |
71 | bool m_isLabelItem; |
72 | bool m_isVolumeItem; |
73 | |
74 | QCustomItemDirtyBitField m_dirtyBits; |
75 | |
76 | private: |
77 | QCustom3DItemPrivate(QCustom3DItemPrivate *d); |
78 | }; |
79 | |
80 | QT_END_NAMESPACE |
81 | |
82 | #endif |
83 |