diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index 40301224b46a0d98d87a683dd1c755d15505b686..ea4f79a776ad4a1a8ce9f5b54d5f721be164c940 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -1101,8 +1101,8 @@ void MainWindow::showMeshAnalysisDialog() void MainWindow::convertPointsToStations(std::string const& geo_name) { - std::string const stn_name = geo_name + "Stations"; - int ret = _project.getGEOObjects().geoPointsToStation(geo_name, stn_name); + std::string stn_name = geo_name + " Stations"; + int ret = _project.getGEOObjects().geoPointsToStations(geo_name, stn_name); if (ret == 1) OGSError::box("No points found to convert."); } diff --git a/GeoLib/GEOObjects.cpp b/GeoLib/GEOObjects.cpp index a0ec24745870d5e21232f4846d6c5b938adcd483..1ca37464f2eed20335ee9bef6a0cb132b13e87a6 100644 --- a/GeoLib/GEOObjects.cpp +++ b/GeoLib/GEOObjects.cpp @@ -587,8 +587,8 @@ void GEOObjects::markUnusedPoints(std::string const& geo_name, } } -int GEOObjects::geoPointsToStation(std::string const& geo_name, - std::string const& stn_name, +int GEOObjects::geoPointsToStations(std::string const& geo_name, + std::string& stn_name, bool const only_unused_pnts) { GeoLib::PointVec const* const pnt_obj(getPointVecObj(geo_name)); @@ -618,9 +618,8 @@ int GEOObjects::geoPointsToStation(std::string const& geo_name, name = "Station " + std::to_string(i); stations->push_back(new GeoLib::Station(pnts[i], name)); } - std::string vec_name = geo_name + " stations"; if (!stations->empty()) - addStationVec(std::move(stations), vec_name); + addStationVec(std::move(stations), stn_name); else { WARN("No points found to convert."); diff --git a/GeoLib/GEOObjects.h b/GeoLib/GEOObjects.h index b378a914475a52646830c60446a930398299a1f3..a3a9779bc83df7aca5878208d99a7e50c05399db 100644 --- a/GeoLib/GEOObjects.h +++ b/GeoLib/GEOObjects.h @@ -254,9 +254,9 @@ public: // @param stn_name name of the new station vector // @param only_usused_pnts if true only points not in a line or surface are // transferred, otherwise all points - int geoPointsToStation(std::string const& geo_name, - std::string const& stn_name, - bool const only_unused_pnts = true); + int geoPointsToStations(std::string const& geo_name, + std::string& stn_name, + bool const only_unused_pnts = true); /// Returns the geo object for a geometric item of the given name and type for the associated geometry. const GeoLib::GeoObject* getGeoObject(const std::string &geo_name,