32 std::size_t
const number_of_all_input_pnts(
_data_vec.size());
35 for (std::size_t k(0); k <
_data_vec.size(); ++k)
37 if (
_data_vec[k]->getID() == std::numeric_limits<std::size_t>::max())
43 std::vector<std::size_t> rm_pos;
48 for (std::size_t k(0); k <
_data_vec.size(); ++k)
53 assert(ret_pnt !=
nullptr);
65 auto const data_vec_end =
72 for (std::size_t k(1); k < rm_pos.size(); ++k)
75 for (std::size_t j(rm_pos[k - 1] + 1); j < rm_pos[k]; ++j)
83 for (std::size_t j(rm_pos.back() + 1); j <
_pnt_id_map.size(); ++j)
90 for (std::size_t k(1); k < rm_pos.size(); ++k)
94 cnt < rm_pos.size() &&
_pnt_id_map[rm_pos[k]] > rm_pos[cnt];)
102 for (std::size_t k(0); k <
_data_vec.size(); ++k)
107 if (number_of_all_input_pnts >
_data_vec.size())
109 WARN(
"PointVec::PointVec(): there are {:d} double points.",
110 number_of_all_input_pnts -
_data_vec.size());
128 PointType const type,
double const rel_eps)
149 std::map<std::string, std::size_t>::const_iterator it(
154 WARN(
"PointVec::push_back(): two points share the name {:s}.",
178 if (ret_pnt ==
nullptr)
186 for (std::size_t k(0); k <
_data_vec.size(); ++k)
202 return ret_pnt->
getID();
208 std::vector<std::string> id_names(
_pnt_id_map.size(), std::string(
""));
211 id_names[id_name_pair.second] = id_name_pair.first;
217 const std::size_t id(it->second);
261 auto const [min, max] =
_aabb.getMinMaxPoints();
262 double const rel_eps(
_rel_eps / (max - min).norm());
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the PointVec class.
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.