| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Qt Data Visualization module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:GPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU |
| 19 | ** General Public License version 3 or (at your option) any later version |
| 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by |
| 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 |
| 22 | ** included in the packaging of this file. Please review the following |
| 23 | ** information to ensure the GNU General Public License requirements will |
| 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
| 25 | ** |
| 26 | ** $QT_END_LICENSE$ |
| 27 | ** |
| 28 | ****************************************************************************/ |
| 29 | |
| 30 | // |
| 31 | // W A R N I N G |
| 32 | // ------------- |
| 33 | // |
| 34 | // This file is not part of the QtDataVisualization API. It exists purely as an |
| 35 | // implementation detail. This header file may change from version to |
| 36 | // version without notice, or even be removed. |
| 37 | // |
| 38 | // We mean it. |
| 39 | |
| 40 | #ifndef QCUSTOM3DITEM_P_H |
| 41 | #define QCUSTOM3DITEM_P_H |
| 42 | |
| 43 | #include "datavisualizationglobal_p.h" |
| 44 | #include "qcustom3ditem.h" |
| 45 | |
| 46 | QT_BEGIN_NAMESPACE_DATAVISUALIZATION |
| 47 | |
| 48 | struct QCustomItemDirtyBitField { |
| 49 | bool textureDirty : 1; |
| 50 | bool meshDirty : 1; |
| 51 | bool positionDirty : 1; |
| 52 | bool scalingDirty : 1; |
| 53 | bool rotationDirty : 1; |
| 54 | bool visibleDirty : 1; |
| 55 | bool shadowCastingDirty : 1; |
| 56 | |
| 57 | QCustomItemDirtyBitField() |
| 58 | : textureDirty(false), |
| 59 | meshDirty(false), |
| 60 | positionDirty(false), |
| 61 | scalingDirty(false), |
| 62 | rotationDirty(false), |
| 63 | visibleDirty(false), |
| 64 | shadowCastingDirty(false) |
| 65 | { |
| 66 | } |
| 67 | }; |
| 68 | |
| 69 | class QCustom3DItemPrivate : public QObject |
| 70 | { |
| 71 | Q_OBJECT |
| 72 | public: |
| 73 | QCustom3DItemPrivate(QCustom3DItem *q); |
| 74 | QCustom3DItemPrivate(QCustom3DItem *q, const QString &meshFile, const QVector3D &position, |
| 75 | const QVector3D &scaling, const QQuaternion &rotation); |
| 76 | virtual ~QCustom3DItemPrivate(); |
| 77 | |
| 78 | QImage textureImage(); |
| 79 | void clearTextureImage(); |
| 80 | void resetDirtyBits(); |
| 81 | |
| 82 | public: |
| 83 | QCustom3DItem *q_ptr; |
| 84 | QImage m_textureImage; |
| 85 | QString m_textureFile; |
| 86 | QString m_meshFile; |
| 87 | QVector3D m_position; |
| 88 | bool m_positionAbsolute; |
| 89 | QVector3D m_scaling; |
| 90 | bool m_scalingAbsolute; |
| 91 | QQuaternion m_rotation; |
| 92 | bool m_visible; |
| 93 | bool m_shadowCasting; |
| 94 | |
| 95 | bool m_isLabelItem; |
| 96 | bool m_isVolumeItem; |
| 97 | |
| 98 | QCustomItemDirtyBitField m_dirtyBits; |
| 99 | |
| 100 | Q_SIGNALS: |
| 101 | void needUpdate(); |
| 102 | |
| 103 | private: |
| 104 | QCustom3DItemPrivate(QCustom3DItemPrivate *d); |
| 105 | |
| 106 | friend class QCustom3DItem; |
| 107 | }; |
| 108 | |
| 109 | QT_END_NAMESPACE_DATAVISUALIZATION |
| 110 | |
| 111 | #endif |
| 112 | |