23 std::size_t
const number_of_all_input_pnts(
_data_vec.size());
26 for (std::size_t k(0); k <
_data_vec.size(); ++k)
28 if (
_data_vec[k]->getID() == std::numeric_limits<std::size_t>::max())
34 std::vector<std::size_t> rm_pos;
39 for (std::size_t k(0); k <
_data_vec.size(); ++k)
44 assert(ret_pnt !=
nullptr);
56 auto const data_vec_end =
63 for (std::size_t k(1); k < rm_pos.size(); ++k)
66 for (std::size_t j(rm_pos[k - 1] + 1); j < rm_pos[k]; ++j)
74 for (std::size_t j(rm_pos.back() + 1); j <
_pnt_id_map.size(); ++j)
81 for (std::size_t k(1); k < rm_pos.size(); ++k)
85 cnt < rm_pos.size() &&
_pnt_id_map[rm_pos[k]] > rm_pos[cnt];)
93 for (std::size_t k(0); k <
_data_vec.size(); ++k)
98 if (number_of_all_input_pnts >
_data_vec.size())
100 WARN(
"PointVec::PointVec(): there are {:d} double points.",
101 number_of_all_input_pnts -
_data_vec.size());
119 PointType const type,
double const rel_eps)
140 std::map<std::string, std::size_t>::const_iterator it(
145 WARN(
"PointVec::push_back(): two points share the name {:s}.",
169 if (ret_pnt ==
nullptr)
177 for (std::size_t k(0); k <
_data_vec.size(); ++k)
193 return ret_pnt->
getID();
199 std::vector<std::string> id_names(
_pnt_id_map.size(), std::string(
""));
202 id_names[id_name_pair.second] = id_name_pair.first;
208 const std::size_t id(it->second);
252 auto const [min, max] =
_aabb.getMinMaxPoints();
253 double const rel_eps(
_rel_eps / (max - min).norm());
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
static OctTree< POINT, MAX_POINTS > * createOctTree(Eigen::Vector3d ll, Eigen::Vector3d ur, double eps=std::numeric_limits< double >::epsilon())
std::vector< std::string > _id_to_name_map
std::unique_ptr< GeoLib::OctTree< GeoLib::Point, 16 > > _oct_tree
std::vector< std::size_t > _pnt_id_map
std::size_t uniqueInsert(Point *pnt)
void setNameForElement(std::size_t id, std::string const &name) override
Sets the given name for the element of the given ID.
std::size_t push_back(Point *pnt)
std::string const & getItemNameByID(std::size_t id) const
PointVec(std::string const &name, std::vector< Point * > &&points, NameIdMap &&name_id_map, PointType const type=PointVec::PointType::POINT, double const rel_eps=std::numeric_limits< double >::epsilon())
PointType
Signals if the vector contains object of type Point or Station.
void correctNameIDMapping()
void resetInternalDataStructures()
std::map< std::string, std::size_t > NameIdMap
std::vector< Point * > _data_vec
TemplateVec(std::string const &name, std::vector< Point * > &&data_vec, NameIdMap &&elem_name_map)
virtual void setNameForElement(std::size_t id, std::string const &name)
Sets the given name for the element of the given ID.
std::size_t getID() const
void setID(std::size_t id)
Sets the ID of a node to the given value.