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 QCUSTOM3DVOLUME_P_H
15#define QCUSTOM3DVOLUME_P_H
16
17#include "qcustom3dvolume.h"
18#include "qcustom3ditem_p.h"
19
20QT_BEGIN_NAMESPACE
21
22struct QCustomVolumeDirtyBitField {
23 bool textureDimensionsDirty : 1;
24 bool slicesDirty : 1;
25 bool colorTableDirty : 1;
26 bool textureDataDirty : 1;
27 bool textureFormatDirty : 1;
28 bool alphaDirty : 1;
29 bool shaderDirty : 1;
30
31 QCustomVolumeDirtyBitField()
32 : textureDimensionsDirty(false),
33 slicesDirty(false),
34 colorTableDirty(false),
35 textureDataDirty(false),
36 textureFormatDirty(false),
37 alphaDirty(false),
38 shaderDirty(false)
39 {
40 }
41};
42
43class QCustom3DVolumePrivate : public QCustom3DItemPrivate
44{
45 Q_OBJECT
46
47public:
48 QCustom3DVolumePrivate(QCustom3DVolume *q);
49 QCustom3DVolumePrivate(QCustom3DVolume *q, const QVector3D &position, const QVector3D &scaling,
50 const QQuaternion &rotation, int textureWidth, int textureHeight,
51 int textureDepth, QList<uchar> *textureData,
52 QImage::Format textureFormat, const QList<QRgb> &colorTable);
53 virtual ~QCustom3DVolumePrivate();
54
55 void resetDirtyBits();
56 QImage renderSlice(Qt::Axis axis, int index);
57
58 QCustom3DVolume *qptr();
59
60public:
61 int m_textureWidth;
62 int m_textureHeight;
63 int m_textureDepth;
64 int m_sliceIndexX;
65 int m_sliceIndexY;
66 int m_sliceIndexZ;
67
68 QImage::Format m_textureFormat;
69 QList<QRgb> m_colorTable;
70 QList<uchar> *m_textureData;
71
72 float m_alphaMultiplier;
73 bool m_preserveOpacity;
74 bool m_useHighDefShader;
75
76 bool m_drawSlices;
77 bool m_drawSliceFrames;
78 QColor m_sliceFrameColor;
79 QVector3D m_sliceFrameWidths;
80 QVector3D m_sliceFrameGaps;
81 QVector3D m_sliceFrameThicknesses;
82
83 QCustomVolumeDirtyBitField m_dirtyBitsVolume;
84
85private:
86 int multipliedAlphaValue(int alpha);
87
88 friend class QCustom3DVolume;
89};
90
91QT_END_NAMESPACE
92
93#endif
94

source code of qtdatavis3d/src/datavisualization/data/qcustom3dvolume_p.h