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

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