summaryrefslogtreecommitdiffstats
path: root/examples/datavisualization/texturesurface/topographicseries.cpp
diff options
context:
space:
mode:
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);
}