diff --git a/Gui/DataView/MeshLayerEditDialog.cpp b/Gui/DataView/MeshLayerEditDialog.cpp index 91650be0a9b5ed3a51506437c8efbf8211a75488..5e7e3c0cc31b3ec961a5e049e693c4a41ae3879d 100644 --- a/Gui/DataView/MeshLayerEditDialog.cpp +++ b/Gui/DataView/MeshLayerEditDialog.cpp @@ -226,7 +226,7 @@ MeshLib::Mesh* MeshLayerEditDialog::createTetMesh() if (_use_rasters) { std::vector<std::string> raster_paths(nLayers+1); - for (unsigned i=0; i<=nLayers; ++i) + for (int i=nLayers; i>=0; --i) raster_paths[i] = this->_edits[i+1]->text().toStdString(); LayeredVolume lv; lv.createGeoVolumes(*_msh, raster_paths); diff --git a/MeshLib/MeshGenerators/LayeredVolume.cpp b/MeshLib/MeshGenerators/LayeredVolume.cpp index 185df44928111dcbc79a98e9f9544448795a2b7b..409538ad06b7e25e50cbb5b33e2db7e4e759717c 100644 --- a/MeshLib/MeshGenerators/LayeredVolume.cpp +++ b/MeshLib/MeshGenerators/LayeredVolume.cpp @@ -74,7 +74,7 @@ bool LayeredVolume::createGeoVolumes(const MeshLib::Mesh &mesh, const std::vecto const std::size_t nRasters (rasters.size()); for (size_t i=0; i<nRasters; ++i) { - const double replacement_value = (i==0) ? noDataReplacementValue : _invalid_value; + const double replacement_value = (i==(nRasters-1)) ? noDataReplacementValue : _invalid_value; if (!MeshLayerMapper::LayerMapping(*mesh_layer, *rasters[i], 0, 0, replacement_value)) { this->cleanUpOnError(); diff --git a/MeshLib/MeshGenerators/LayeredVolume.h b/MeshLib/MeshGenerators/LayeredVolume.h index ee5ecb011aca5e65426fbf5870784e44cdd69ff1..1801f81c90f2bb4925bfe99c1d66e9c401c5a5da 100644 --- a/MeshLib/MeshGenerators/LayeredVolume.h +++ b/MeshLib/MeshGenerators/LayeredVolume.h @@ -43,7 +43,7 @@ public: /** * Constructs a subsurface representation of a mesh using only 2D elements (i.e. layer boundaries are represented by surfaces) * @param mesh The 2D surface mesh that is used as a basis for the subsurface mesh - * @param rasters Containing all the raster-data for the subsurface layers from top to bottom (starting with the DEM) + * @param rasters Containing all the raster-data for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM) * @param noDataReplacementValue Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0]) * @result true if the subsurface representation has been created, false if there was an error */ @@ -52,7 +52,7 @@ public: /** * Constructs a subsurface representation of a mesh using only 2D elements (i.e. layer boundaries are represented by surfaces) * @param mesh The 2D surface mesh that is used as a basis for the subsurface mesh - * @param raster_paths Containing all the raster-file-names for the subsurface layers from top to bottom (starting with the DEM) + * @param raster_paths Containing all the raster-file-names for the subsurface layers from bottom to top (starting with the bottom of the oldest layer and ending with the DEM) * @param noDataReplacementValue Default z-coordinate if there are mesh nodes not located on the DEM raster (i.e. raster_paths[0]) * @result true if the subsurface representation has been created, false if there was an error */