summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/data/customrenderitem.cpp
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2014-09-12 11:27:24 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2014-09-12 12:15:02 +0300
commite5f6ab99b413ad9b8481ad923c5a4a5bc6513ff2 (patch)
tree85fd24fe13281b882e989a5f6826bc3cdad41446 /src/datavisualization/data/customrenderitem.cpp
parentddb9be979d93b7e17f1067dc6056de54d9828b29 (diff)
Implement volume slice frames
Change-Id: I409f3c95892b26ca6097dd4509109fc9978b9900 Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'src/datavisualization/data/customrenderitem.cpp')
-rw-r--r--src/datavisualization/data/customrenderitem.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/datavisualization/data/customrenderitem.cpp b/src/datavisualization/data/customrenderitem.cpp
index 64194bac..f56ca86e 100644
--- a/src/datavisualization/data/customrenderitem.cpp
+++ b/src/datavisualization/data/customrenderitem.cpp
@@ -45,7 +45,10 @@ CustomRenderItem::CustomRenderItem()
m_sliceIndexZ(-1),
m_alphaMultiplier(1.0f),
m_preserveOpacity(true),
- m_useHighDefShader(true)
+ m_useHighDefShader(true),
+ m_drawSlices(false),
+ m_drawSliceFrames(false)
+
{
}
@@ -75,4 +78,31 @@ void CustomRenderItem::setColorTable(const QVector<QRgb> &colors)
}
}
+void CustomRenderItem::setMinBounds(const QVector3D &bounds)
+{
+ m_minBounds = bounds;
+ m_minBoundsNormal = m_minBounds;
+ m_minBoundsNormal.setY(-m_minBoundsNormal.y());
+ m_minBoundsNormal.setZ(-m_minBoundsNormal.z());
+ m_minBoundsNormal = 0.5f * (m_minBoundsNormal + oneVector);
+}
+
+void CustomRenderItem::setMaxBounds(const QVector3D &bounds)
+{
+ m_maxBounds = bounds;
+ m_maxBoundsNormal = m_maxBounds;
+ m_maxBoundsNormal.setY(-m_maxBoundsNormal.y());
+ m_maxBoundsNormal.setZ(-m_maxBoundsNormal.z());
+ m_maxBoundsNormal = 0.5f * (m_maxBoundsNormal + oneVector);
+}
+
+void CustomRenderItem::setSliceFrameColor(const QColor &color)
+{
+ const QRgb &rgb = color.rgba();
+ m_sliceFrameColor = QVector4D(float(qRed(rgb)) / 255.0f,
+ float(qGreen(rgb)) / 255.0f,
+ float(qBlue(rgb)) / 255.0f,
+ float(1.0f)); // Alpha not supported for frames
+}
+
QT_END_NAMESPACE_DATAVISUALIZATION