From 16842c5577aa8d59a56ffd6799f0fede20bf64e8 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 22 Jul 2016 09:08:27 +0200
Subject: [PATCH] Enable new impl. of GeoMapper::advancedMapOnMesh.

---
 Applications/DataExplorer/mainwindow.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp
index 98d3a6357d7..316f97f1a76 100644
--- a/Applications/DataExplorer/mainwindow.cpp
+++ b/Applications/DataExplorer/mainwindow.cpp
@@ -24,6 +24,7 @@
 // GeoLib
 #include "Raster.h"
 #include "GeoLib/IO/Legacy/OGSIOVer4.h"
+#include "GeoLib/DuplicateGeometry.h"
 
 // MeshGeoLib
 #include "MeshGeoToolsLib/GeoMapper.h"
@@ -857,7 +858,7 @@ void MainWindow::mapGeometry(const std::string &geo_name)
     else // use mesh from ProjectData
         mesh = _project.getMeshObjects()[choice-2].get();
 
-    std::string const& new_geo_name = dlg.getNewGeoName();
+    std::string new_geo_name = dlg.getNewGeoName();
 
     if (new_geo_name.empty())
     {
@@ -866,7 +867,12 @@ void MainWindow::mapGeometry(const std::string &geo_name)
     }
     else
     {
-        geo_mapper.advancedMapOnMesh(mesh, new_geo_name);
+        GeoLib::DuplicateGeometry dup(_project.getGEOObjects(), geo_name,
+                                      new_geo_name);
+        new_geo_name = dup.getFinalizedOutputName();
+        MeshGeoToolsLib::GeoMapper mapper =
+            MeshGeoToolsLib::GeoMapper(_project.getGEOObjects(), new_geo_name);
+        mapper.advancedMapOnMesh(*mesh);
         _geo_model->updateGeometry(new_geo_name);
     }
 }
-- 
GitLab