diff --git a/GeoLib/GEOObjects.cpp b/GeoLib/GEOObjects.cpp index 71943c6137441e56fdc4aad56e9cdb4699afaf6f..2bb2520d3a29ff8f3ab2b497e779996b24257b96 100644 --- a/GeoLib/GEOObjects.cpp +++ b/GeoLib/GEOObjects.cpp @@ -364,13 +364,6 @@ const std::string GEOObjects::getElementNameByID(const std::string &geometry_nam break; case GeoLib::GEOTYPE::SURFACE: this->getSurfaceVecObj(geometry_name)->getNameOfElementByID(id, name); - break; - case GeoLib::GEOTYPE::VOLUME: - case GeoLib::GEOTYPE::GEODOMAIN: - case GeoLib::GEOTYPE::INVALID: - default: - WARN("GEOObjects::getElementNameByID() - No valid GEOTYPE given."); - break; } return name; } @@ -556,10 +549,6 @@ const GeoLib::GeoObject* GEOObjects::getGeoObject(const std::string &geo_name, sfc_vec->getElementByName(geo_obj_name))); break; } - case GeoLib::GEOTYPE::GEODOMAIN: { - geo_obj = const_cast<GeoLib::GeoDomain*>(&_geo_domain); - break; - } default: ERR("GEOObjects::getGeoObject(): geometric type not handled.") return nullptr; @@ -586,9 +575,6 @@ GeoLib::GeoObject const* GEOObjects::getGeoObject( if(!geo_obj) geo_obj = getGeoObject(geo_name, GeoLib::GEOTYPE::SURFACE, geo_obj_name); - if(!geo_obj) - geo_obj = getGeoObject(geo_name, GeoLib::GEOTYPE::GEODOMAIN, geo_obj_name); - if (!geo_obj) { DBUG("GEOObjects::getGeoObject(): Could not find \"%s\" in geometry %s.", geo_obj_name.c_str(), geo_name.c_str()); diff --git a/GeoLib/GEOObjects.h b/GeoLib/GEOObjects.h index 56f42fbb93aded6619fde3a8f701c64758d589f8..72d50ab8146f205db8d5e99a0556628a981bafb1 100644 --- a/GeoLib/GEOObjects.h +++ b/GeoLib/GEOObjects.h @@ -25,7 +25,6 @@ #include "PolylineVec.h" #include "Surface.h" #include "SurfaceVec.h" -#include "GeoDomain.h" #include "Station.h" @@ -278,8 +277,6 @@ public: /** vector manages pointers to SurfaceVec objects */ std::vector<SurfaceVec*> _sfc_vecs; - GeoDomain _geo_domain; - std::unique_ptr<Callbacks> _callbacks{new Callbacks}; std::function<void(std::string const&)> addPolylineVecCallback = diff --git a/GeoLib/GeoDomain.h b/GeoLib/GeoDomain.h deleted file mode 100644 index 2236fba2ed2bac6a613f0584563e0bf459abe2af..0000000000000000000000000000000000000000 --- a/GeoLib/GeoDomain.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * \copyright - * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#ifndef GEODOMAIN_H_ -#define GEODOMAIN_H_ - -#include "GeoType.h" -#include "GeoObject.h" - -namespace GeoLib -{ -class GeoDomain : public GeoObject -{ -public: - virtual ~GeoDomain() = default; - /// return a geometry type - virtual GEOTYPE getGeoType() const {return GEOTYPE::GEODOMAIN; } -}; -} // end namespace GeoLib - -#endif /* GEODOMAIN_H_ */ diff --git a/GeoLib/GeoType.cpp b/GeoLib/GeoType.cpp index ea5c7e73f756057dcf24af7138c134abc2927c3e..4162b062e83fc1d7435301619533b462f675e9c8 100644 --- a/GeoLib/GeoType.cpp +++ b/GeoLib/GeoType.cpp @@ -14,27 +14,22 @@ #include "GeoType.h" -namespace GeoLib { +#include <cstdlib> -GEOTYPE convertGeoType (const std::string& geo_type_str) +namespace GeoLib { - if (geo_type_str.compare ("POINT") == 0) return GEOTYPE::POINT; - if (geo_type_str.compare ("POLYLINE") == 0) return GEOTYPE::POLYLINE; - if (geo_type_str.compare ("SURFACE") == 0) return GEOTYPE::SURFACE; - if (geo_type_str.compare ("VOLUME") == 0) return GEOTYPE::VOLUME; - if (geo_type_str.compare ("GEODOMAIN") == 0) return GEOTYPE::GEODOMAIN; - if (geo_type_str.compare ("DOMAIN") == 0) return GEOTYPE::GEODOMAIN; - return GEOTYPE::INVALID; -} std::string convertGeoTypeToString (GEOTYPE geo_type) { - if (geo_type == GEOTYPE::POINT) return "POINT"; - if (geo_type == GEOTYPE::POLYLINE) return "POLYLINE"; - if (geo_type == GEOTYPE::SURFACE) return "SURFACE"; - if (geo_type == GEOTYPE::VOLUME) return "VOLUME"; - if (geo_type == GEOTYPE::GEODOMAIN) return "GEODOMAIN"; - return "INVALID"; + switch (geo_type) + { + case GEOTYPE::POINT: return "POINT"; + case GEOTYPE::POLYLINE: return "POLYLINE"; + case GEOTYPE::SURFACE: return "SURFACE"; + } + + std::abort(); // Cannot happen, because switch covers all cases. + // Used to silence compiler warning. } } // end namespace GeoLib diff --git a/GeoLib/GeoType.h b/GeoLib/GeoType.h index 0c823d35e452534a8e3bc83e1c3e2c6bbdbadab3..31fbf17529e56d8c58eb350d3f1e70c415e7d757 100644 --- a/GeoLib/GeoType.h +++ b/GeoLib/GeoType.h @@ -24,16 +24,11 @@ namespace GeoLib { */ enum class GEOTYPE { - INVALID = 0, - POINT, //!< POINT - POLYLINE, //!< POLYLINE - SURFACE, //!< SURFACE - VOLUME, //!< VOLUME - GEODOMAIN //!< GEODOMAIN + POINT, + POLYLINE, + SURFACE }; -GEOTYPE convertGeoType (const std::string& geo_type_str); - std::string convertGeoTypeToString (GEOTYPE geo_type); } // end namespace GeoLib