From c1833722a490a4317f364d691ea7b4eecb6dcb94 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 21 Jun 2021 13:31:31 +0200 Subject: [PATCH] [GL/Station] Init station type in constructor. --- GeoLib/Station.cpp | 10 +++++----- GeoLib/Station.h | 12 +++++++----- GeoLib/StationBorehole.cpp | 3 +-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/GeoLib/Station.cpp b/GeoLib/Station.cpp index b32c38e8a49..bf27f494f84 100644 --- a/GeoLib/Station.cpp +++ b/GeoLib/Station.cpp @@ -22,14 +22,14 @@ namespace GeoLib { -Station::Station(double x, double y, double z, std::string name) - : Point(x, y, z), _name(std::move(name)) - +Station::Station(double x, double y, double z, std::string name, + Station::StationType type) + : Point(x, y, z), _name(std::move(name)), _type(type) { } -Station::Station(Point* coords, std::string name) - : Point(*coords), _name(std::move(name)) +Station::Station(Point* coords, std::string name, Station::StationType type) + : Point(*coords), _name(std::move(name)), _type(type) { } diff --git a/GeoLib/Station.h b/GeoLib/Station.h index 675506730c8..d85aace9603 100644 --- a/GeoLib/Station.h +++ b/GeoLib/Station.h @@ -51,13 +51,15 @@ public: * \param y The y-coordinate of the station. * \param z The z-coordinate of the station. * \param name The name of the station. + * \param type The type of the station, see Station::StationType for + * possible values. */ - explicit Station(double x = 0.0, - double y = 0.0, - double z = 0.0, - std::string name = ""); + explicit Station(double x = 0.0, double y = 0.0, double z = 0.0, + std::string name = "", + Station::StationType type = Station::StationType::STATION); - explicit Station(Point* coords, std::string name = ""); + explicit Station(Point* coords, std::string name = "", + Station::StationType type = Station::StationType::STATION); /** * Constructor copies the source object diff --git a/GeoLib/StationBorehole.cpp b/GeoLib/StationBorehole.cpp index ab69083709b..5ed333f808b 100644 --- a/GeoLib/StationBorehole.cpp +++ b/GeoLib/StationBorehole.cpp @@ -33,9 +33,8 @@ StationBorehole::StationBorehole(double x, double y, double z, const std::string& name) - : Station(x, y, z, name) + : Station(x, y, z, name, Station::StationType::BOREHOLE) { - _type = Station::StationType::BOREHOLE; // add first point of borehole _profilePntVec.push_back(this); -- GitLab