diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-08-13 15:09:36 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2014-08-18 09:11:30 +0300 |
commit | 169a4d638c6c1b6634ffcfd19c4fe3cb94cf27d5 (patch) | |
tree | 454810f2e9cc418bae9f1c6716c51c3fae38a968 /src/datavisualization/data/customrenderitem_p.h | |
parent | be7bdaa8930caf15fcc58a480d223e0c2b8af6ed (diff) |
Implement volume rendering support
New subclass of QCustom3DItem, QCustom3DVolume is provided.
The documentation for the example will be done in a separate commit.
Change-Id: Idb3fdb0654c6bec7606ca012b75852a5a8412397
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/data/customrenderitem_p.h')
-rw-r--r-- | src/datavisualization/data/customrenderitem_p.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/datavisualization/data/customrenderitem_p.h b/src/datavisualization/data/customrenderitem_p.h index 4fb94276..e21b6f39 100644 --- a/src/datavisualization/data/customrenderitem_p.h +++ b/src/datavisualization/data/customrenderitem_p.h @@ -31,6 +31,8 @@ #include "abstractrenderitem_p.h" #include "objecthelper_p.h" +#include <QtGui/QRgb> +#include <QtGui/QImage> QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -69,6 +71,28 @@ public: inline bool isFacingCamera() const { return m_isFacingCamera; } inline void setRenderer(Abstract3DRenderer *renderer) { m_renderer = renderer; } + // Volume specific + inline void setTextureWidth(int width) { m_textureWidth = width; } + inline int textureWidth() const { return m_textureWidth; } + inline void setTextureHeight(int height) { m_textureHeight = height; } + inline int textureHeight() const { return m_textureHeight; } + inline void setTextureDepth(int depth) { m_textureDepth = depth; } + inline int textureDepth() const { return m_textureDepth; } + inline int textureSize() const { return m_textureWidth * m_textureHeight * m_textureDepth; } + inline void setColorTable(const QVector<QVector4D> &colors) { m_colorTable = colors; } + void setColorTable(const QVector<QRgb> &colors); + inline const QVector<QVector4D> &colorTable() const { return m_colorTable; } + inline void setVolume(bool volume) { m_isVolume = volume; } + inline bool isVolume() const { return m_isVolume; } + inline void setTextureFormat(QImage::Format format) { m_textureFormat = format; } + inline QImage::Format textureFormat() const { return m_textureFormat; } + inline void setSliceIndexX(int index) { m_sliceIndexX = index; } + inline void setSliceIndexY(int index) { m_sliceIndexY = index; } + inline void setSliceIndexZ(int index) { m_sliceIndexZ = index; } + int sliceIndexX() const { return m_sliceIndexX; } + int sliceIndexY() const { return m_sliceIndexY; } + int sliceIndexZ() const { return m_sliceIndexZ; } + private: Q_DISABLE_COPY(CustomRenderItem) @@ -85,6 +109,17 @@ private: bool m_isFacingCamera; QCustom3DItem *m_item; Abstract3DRenderer *m_renderer; + + // Volume specific + int m_textureWidth; + int m_textureHeight; + int m_textureDepth; + QVector<QVector4D> m_colorTable; + bool m_isVolume; + QImage::Format m_textureFormat; + int m_sliceIndexX; + int m_sliceIndexY; + int m_sliceIndexZ; }; typedef QHash<QCustom3DItem *, CustomRenderItem *> CustomRenderItemArray; |