1- /* +------------------------------------------------------------------------+
2- | Mobile Robot Programming Toolkit (MRPT) |
3- | https://www.mrpt.org/ |
4- | |
5- | Copyright (c) 2005-2024, Individual contributors, see AUTHORS file |
6- | See: https://www.mrpt.org/Authors - All rights reserved. |
7- | Released under BSD License. See: https://www.mrpt.org/License |
8- +------------------------------------------------------------------------+ */
1+ /* _
2+ | | Mobile Robot Programming Toolkit (MRPT)
3+ _ __ ___ _ __ _ __ | |_
4+ | '_ ` _ \| '__| '_ \| __| https://www.mrpt.org/
5+ | | | | | | | | |_) | |_
6+ |_| |_| |_|_| | .__/ \__| https://github.com/MRPT/mrpt/
7+ | |
8+ |_|
9+
10+ Copyright (c) 2005-2025, Individual contributors, see AUTHORS file
11+ See: https://www.mrpt.org/Authors - All rights reserved.
12+ SPDX-License-Identifier: BSD-3-Clause
13+ */
14+
915#pragma once
1016
1117#include < mrpt/core/aligned_std_vector.h>
1420#include < mrpt/opengl/pointcloud_adapters.h>
1521#include < mrpt/serialization/CSerializable.h>
1622
17- #include < map>
23+ #include < string_view>
24+ #include < unordered_map>
1825
1926namespace mrpt ::maps
2027{
@@ -61,12 +68,13 @@ class CGenericPointsMap : public CPointsMap
6168 bool unregisterField (const std::string_view& fieldName);
6269
6370 /* * Returns the map of float fields: map<field_name, vector_of_data> */
64- const std::map <std::string_view, mrpt::aligned_std_vector<float >>& float_fields () const
71+ const std::unordered_map <std::string_view, mrpt::aligned_std_vector<float >>& float_fields () const
6572 {
6673 return m_float_fields;
6774 }
6875 /* * Returns the map of uint16_t fields: map<field_name, vector_of_data> */
69- const std::map<std::string_view, mrpt::aligned_std_vector<uint16_t >>& uint16_fields () const
76+ const std::unordered_map<std::string_view, mrpt::aligned_std_vector<uint16_t >>& uint16_fields ()
77+ const
7078 {
7179 return m_uint16_fields;
7280 }
@@ -80,12 +88,6 @@ class CGenericPointsMap : public CPointsMap
8088 void resize (size_t newLength) override ;
8189 void setSize (size_t newLength) override ;
8290
83- /* * Inserts a new point (X,Y,Z).
84- * You **must** call `insertPointField_float()` or `insertPointField_uint16()`
85- * *after* this for each registered field to keep data vectors synchronized.
86- */
87- void insertPointFast (float x, float y, float z = 0 ) override ;
88-
8991 void getPointAllFieldsFast (size_t index, std::vector<float >& point_data) const override ;
9092 void setPointAllFieldsFast (size_t index, const std::vector<float >& point_data) override ;
9193
@@ -190,9 +192,9 @@ class CGenericPointsMap : public CPointsMap
190192
191193 protected:
192194 /* * Map from field name to data vector */
193- std::map <std::string_view, mrpt::aligned_std_vector<float >> m_float_fields;
195+ std::unordered_map <std::string_view, mrpt::aligned_std_vector<float >> m_float_fields;
194196 /* * Map from field name to data vector */
195- std::map <std::string_view, mrpt::aligned_std_vector<uint16_t >> m_uint16_fields;
197+ std::unordered_map <std::string_view, mrpt::aligned_std_vector<uint16_t >> m_uint16_fields;
196198
197199 /* * Clear the map, erasing all the points and all fields */
198200 void internal_clear () override ;
0 commit comments