summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/texturesurface/topographicseries.cpp
diff options
context:
space:
mode:
authorMika Salmela <mika.salmela@digia.com>2014-08-15 08:55:20 +0300
committerMika Salmela <mika.salmela@digia.com>2014-08-15 09:17:49 +0300
commitbe7bdaa8930caf15fcc58a480d223e0c2b8af6ed (patch)
tree65cf2369a7fabfebfb9141f29281d25cb6067fb5 /examples/datavisualization/texturesurface/topographicseries.cpp
parent744609635867fdb673604b4128e62f7da6406632 (diff)
Documentation for textured surface example
Change-Id: I517b02a31e342dc3ae2c1c80805f811f9d9670ff Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples/datavisualization/texturesurface/topographicseries.cpp')
-rw-r--r--examples/datavisualization/texturesurface/topographicseries.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/datavisualization/texturesurface/topographicseries.cpp b/examples/datavisualization/texturesurface/topographicseries.cpp
index 1d94aead..a1c61f56 100644
--- a/examples/datavisualization/texturesurface/topographicseries.cpp
+++ b/examples/datavisualization/texturesurface/topographicseries.cpp
@@ -22,8 +22,10 @@
using namespace QtDataVisualization;
+//! [0]
// Value used to encode height data as RGB value on PNG file
const float packingFactor = 11983.0f;
+//! [0]
TopographicSeries::TopographicSeries()
{
@@ -37,6 +39,7 @@ TopographicSeries::~TopographicSeries()
void TopographicSeries::setTopographyFile(const QString file, float width, float height)
{
+//! [1]
QImage heightMapImage(file);
uchar *bits = heightMapImage.bits();
int imageHeight = heightMapImage.height();
@@ -62,8 +65,9 @@ void TopographicSeries::setTopographyFile(const QString file, float width, float
*dataArray << newRow;
}
+ dataProxy()->resetArray(dataArray);
+//! [1]
+
m_sampleCountX = float(imageWidth);
m_sampleCountZ = float(imageHeight);
-
- dataProxy()->resetArray(dataArray);
}