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