From c80890d90b06f8f0daa799f58d4fb29295651cfe Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Fri, 25 Jun 2021 12:43:46 +0200
Subject: [PATCH] [GL] Remove enum StationType and Station::_type.

This data isn't required anymore. The type of
station can be obtained via dynamic_cast.
---
 .../DataExplorer/VtkVis/VtkStationSource.h      | 13 -------------
 GeoLib/Station.cpp                              | 10 ++++------
 GeoLib/Station.h                                | 17 ++---------------
 GeoLib/StationBorehole.cpp                      |  4 +---
 4 files changed, 7 insertions(+), 37 deletions(-)

diff --git a/Applications/DataExplorer/VtkVis/VtkStationSource.h b/Applications/DataExplorer/VtkVis/VtkStationSource.h
index 226873c2f8c..04d876f1ebd 100644
--- a/Applications/DataExplorer/VtkVis/VtkStationSource.h
+++ b/Applications/DataExplorer/VtkVis/VtkStationSource.h
@@ -37,19 +37,6 @@ public:
     const std::map<std::string, DataHolderLib::Color>& getColorLookupTable() const
         { return _colorLookupTable; }
 
-    /// Returns the type of observation site represented in this source object
-    GeoLib::Station::StationType getType() const
-    {
-        if (dynamic_cast<GeoLib::StationBorehole*>((*_stations)[0]))
-        {
-            return GeoLib::Station::StationType::STATION;
-        }
-        else
-        {
-            return GeoLib::Station::StationType::BOREHOLE;
-        }
-    };
-
     /// Sets a predefined color lookup table for the colouring of borehole stratigraphies
 //    int setColorLookupTable(const std::string &filename)
 //        { return GeoLib::readColorLookupTable(_colorLookupTable, filename); }
diff --git a/GeoLib/Station.cpp b/GeoLib/Station.cpp
index bf27f494f84..8d2ed2dbabe 100644
--- a/GeoLib/Station.cpp
+++ b/GeoLib/Station.cpp
@@ -22,21 +22,19 @@
 
 namespace GeoLib
 {
-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(double x, double y, double z, std::string name)
+    : Point(x, y, z), _name(std::move(name))
 {
 }
 
-Station::Station(Point* coords, std::string name, Station::StationType type)
-    : Point(*coords), _name(std::move(name)), _type(type)
+Station::Station(Point* coords, std::string name)
+    : Point(*coords), _name(std::move(name))
 {
 }
 
 Station::Station(Station const& src)
     : Point(src),
       _name(src._name),
-      _type(src._type),
       _station_value(src._station_value)
 {
 }
diff --git a/GeoLib/Station.h b/GeoLib/Station.h
index afe1b5b0a66..7a0a35a3352 100644
--- a/GeoLib/Station.h
+++ b/GeoLib/Station.h
@@ -35,14 +35,6 @@ namespace GeoLib
 class Station : public Point
 {
 public:
-    /// Signals if the object is a "simple" Station or a Borehole (i.e. containing borehole-specific information).
-    enum class StationType
-    {
-        INVALID = 0,
-        STATION,
-        BOREHOLE
-    };
-
     /**
      * \brief Constructor
      *
@@ -51,15 +43,11 @@ 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 = "",
-                     Station::StationType type = Station::StationType::STATION);
+                     std::string name = "");
 
-    explicit Station(Point* coords, std::string name = "",
-                     Station::StationType type = Station::StationType::STATION);
+    explicit Station(Point* coords, std::string name = "");
 
     /**
      * Constructor copies the source object
@@ -94,7 +82,6 @@ public:
 
 private:
     std::string _name;
-    StationType _type{Station::StationType::STATION};  // GeoSys Station Type
     double _station_value{0.0};
     SensorData* _sensor_data{nullptr};
 };
diff --git a/GeoLib/StationBorehole.cpp b/GeoLib/StationBorehole.cpp
index 574134e30f0..9e0119f7425 100644
--- a/GeoLib/StationBorehole.cpp
+++ b/GeoLib/StationBorehole.cpp
@@ -32,9 +32,7 @@ namespace GeoLib
 StationBorehole::StationBorehole(double x, double y, double z,
                                  double const depth, const std::string& name,
                                  int date)
-    : Station(x, y, z, name, Station::StationType::BOREHOLE),
-      _depth(depth),
-      _date(date)
+    : Station(x, y, z, name), _depth(depth), _date(date)
 {
     // add first point of borehole
     _profilePntVec.push_back(this);
-- 
GitLab