From 9d3a50579ccdd561dd11d8e3a99daa9c49a72e55 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 21 Sep 2012 11:46:39 +0200
Subject: [PATCH] VtkMeshConverter::convertImgToMesh(): using given z
 coordinate for mesh generation

---
 Gui/VtkVis/VtkMeshConverter.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Gui/VtkVis/VtkMeshConverter.cpp b/Gui/VtkVis/VtkMeshConverter.cpp
index 59da2da475e..169c0c4353e 100644
--- a/Gui/VtkVis/VtkMeshConverter.cpp
+++ b/Gui/VtkVis/VtkMeshConverter.cpp
@@ -61,7 +61,7 @@ MeshLib::Mesh* VtkMeshConverter::convertImgToMesh(vtkImageData* img,
 	double* pixVal (new double[incHeight * incWidth]);
 	bool* visNodes(new bool[incWidth * incHeight]);
 	int* node_idx_map(new int[incWidth * incHeight]);
-	
+
 	for (size_t j = 0; j < incHeight; j++)
 	{
 		pixVal[j]=0;
@@ -83,7 +83,7 @@ MeshLib::Mesh* VtkMeshConverter::convertImgToMesh(vtkImageData* img,
 			// is current pixel visible
 			if (nTuple == 2 || nTuple == 4)
 				visNodes[index] = (colour[nTuple-1] > 0);
-			else 
+			else
 				visNodes[index] = true;
 
 			node_idx_map[index]=-1;
@@ -189,7 +189,7 @@ MeshLib::Mesh* VtkMeshConverter::constructMesh(const double* pixVal,
 
 			if (set_node)
 			{
-				double zValue = (intensity_type == UseIntensityAs::ELEVATION) ? pixVal[index] : 0.0;
+				double zValue = (intensity_type == UseIntensityAs::ELEVATION) ? pixVal[index] : origin[2];
 				MeshLib::Node* node (new MeshLib::Node(x_offset + (scalingFactor * j), y_offset + (scalingFactor * i), zValue));
 				nodes.push_back(node);
 				node_idx_map[index] = node_idx_count;
-- 
GitLab