diff --git a/GeoLib/PointVec.cpp b/GeoLib/PointVec.cpp index 169a4eb713f8fe023c0b0d52d86dea46d078903c..a7d9d7f5e2b4aee457ce569ef6c16578562c0b52 100644 --- a/GeoLib/PointVec.cpp +++ b/GeoLib/PointVec.cpp @@ -243,4 +243,10 @@ std::string const& PointVec::getItemNameByID(std::size_t id) const return _id_to_name_map[id]; } +void PointVec::setNameForElement(std::size_t id, std::string const& name) +{ + TemplateVec::setNameForElement(id, name); + _id_to_name_map[id] = name; +} + } // end namespace diff --git a/GeoLib/PointVec.h b/GeoLib/PointVec.h index fa359ebe3974e7263c61b90cb7f2e41c55fd4dbc..510114f595210de9561a583c29b85c07c745c452 100644 --- a/GeoLib/PointVec.h +++ b/GeoLib/PointVec.h @@ -101,6 +101,8 @@ public: std::string const& getItemNameByID(std::size_t id) const; + void setNameForElement(std::size_t id, std::string const& name) override; + private: /** * After the point set is modified (for example by makePntsUnique()) the mapping has to be corrected. diff --git a/GeoLib/TemplateVec.h b/GeoLib/TemplateVec.h index 6e9e98a7ddd814f8b1e21c9be518cfaddffe4131..11f50cb835ef1567668062c96cce0370a9a502f4 100644 --- a/GeoLib/TemplateVec.h +++ b/GeoLib/TemplateVec.h @@ -195,7 +195,7 @@ public: } /// Sets the given name for the element of the given ID. - void setNameForElement(std::size_t id, std::string const& name) + virtual void setNameForElement(std::size_t id, std::string const& name) { // Erase id if found in map. auto it = findFirstElementByID(id);