| 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 | #ifndef VOLUMETRICMODIFIER_H |
| 31 | #define VOLUMETRICMODIFIER_H |
| 32 | |
| 33 | #include <QtDataVisualization/qcustom3dvolume.h> |
| 34 | #include <QtDataVisualization/qcustom3ditem.h> |
| 35 | #include <QtDataVisualization/q3dscatter.h> |
| 36 | #include <QtDataVisualization/q3dsurface.h> |
| 37 | #include <QtDataVisualization/q3dbars.h> |
| 38 | #include <QtWidgets/QLabel> |
| 39 | |
| 40 | using namespace QtDataVisualization; |
| 41 | |
| 42 | class VolumetricModifier : public QObject |
| 43 | { |
| 44 | Q_OBJECT |
| 45 | public: |
| 46 | explicit VolumetricModifier(QAbstract3DGraph *scatter); |
| 47 | ~VolumetricModifier(); |
| 48 | |
| 49 | void setFpsLabel(QLabel *fpsLabel); |
| 50 | void setSliceLabels(QLabel *xLabel, QLabel *yLabel, QLabel *zLabel); |
| 51 | |
| 52 | public Q_SLOTS: |
| 53 | void sliceX(int enabled); |
| 54 | void sliceY(int enabled); |
| 55 | void sliceZ(int enabled); |
| 56 | void adjustSliceX(int value); |
| 57 | void adjustSliceY(int value); |
| 58 | void adjustSliceZ(int value); |
| 59 | void handleFpsChange(); |
| 60 | void testSubtextureSetting(); |
| 61 | void adjustRangeX(int value); |
| 62 | void adjustRangeY(int value); |
| 63 | void adjustRangeZ(int value); |
| 64 | void testBoundsSetting(); |
| 65 | |
| 66 | private: |
| 67 | void createVolume(); |
| 68 | void createAnotherVolume(); |
| 69 | void createYetAnotherVolume(); |
| 70 | void checkRenderCase(int id, Qt::Axis axis, int index, const QVector<uchar> &dataBefore, |
| 71 | QCustom3DVolume *volumeItem); |
| 72 | |
| 73 | QAbstract3DGraph *m_graph; |
| 74 | Q3DScatter *m_scatterGraph; |
| 75 | Q3DSurface *m_surfaceGraph; |
| 76 | Q3DBars *m_barGraph; |
| 77 | QCustom3DVolume *m_volumeItem; |
| 78 | QCustom3DVolume *m_volumeItem2; |
| 79 | QCustom3DVolume *m_volumeItem3; |
| 80 | QCustom3DItem *m_plainItem; |
| 81 | int m_sliceIndexX; |
| 82 | int m_sliceIndexY; |
| 83 | int m_sliceIndexZ; |
| 84 | QLabel *m_fpsLabel; |
| 85 | QLabel *m_sliceLabelX; |
| 86 | QLabel *m_sliceLabelY; |
| 87 | QLabel *m_sliceLabelZ; |
| 88 | }; |
| 89 | |
| 90 | #endif |
| 91 |
