From a263d3cc0a789d68ad741837ae4e4370eed19ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Grzeczkowicz?= Date: Sun, 27 Oct 2024 21:10:47 +0000 Subject: [PATCH] Add level_crossing in label --- bridge.cpp | 6 +++--- label.hpp | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bridge.cpp b/bridge.cpp index 318f9fe..e705d36 100644 --- a/bridge.cpp +++ b/bridge.cpp @@ -1822,7 +1822,7 @@ void add_bridge_to_mesh(Surface_mesh &mesh, Point_set &point_cloud, const std::v auto location_top = PMP::locate_with_AABB_tree(ray_top, mesh_tree, r_b); auto location_bottom = PMP::locate_with_AABB_tree(ray_bottom, mesh_tree, r_b); - if (location_top.first != r_b.null_face() || location_bottom.first != r_b.null_face()) point_cloud_label[ph] = 11; + if (location_top.first != r_b.null_face() || location_bottom.first != r_b.null_face()) point_cloud_label[ph] = LABEL_LEVEL_CROSSING; } } @@ -1918,7 +1918,7 @@ void add_bridge_to_mesh(Surface_mesh &mesh, Point_set &point_cloud, const std::v if (location.first != support_meshes[i].null_face()) { auto m_p = PMP::construct_point(location, support_meshes[i]); if (CGAL::squared_distance(p.second, m_p) - 1 < 1) { - point_cloud_label[p.first] = 11; + point_cloud_label[p.first] = LABEL_LEVEL_CROSSING; } } } @@ -1943,7 +1943,7 @@ void add_bridge_to_mesh(Surface_mesh &mesh, Point_set &point_cloud, const std::v if ((mesh_copy_label[location.first] == LABEL_RAIL || mesh_copy_label[location.first] == LABEL_ROAD) && mesh_copy_label[location.first] != point_cloud_label[p.first]) { auto m_p = PMP::construct_point(location, mesh_copy); if (CGAL::squared_distance(p.second, m_p) - 1 < 1) { - point_cloud_label[p.first] = 11; + point_cloud_label[p.first] = LABEL_LEVEL_CROSSING; } } } diff --git a/label.hpp b/label.hpp index 99fb569..cc39ee1 100644 --- a/label.hpp +++ b/label.hpp @@ -15,7 +15,7 @@ struct Label { Label(unsigned char value, std::string label, unsigned char red, unsigned char green, unsigned char blue): value(value), label(label), red(red), green(green), blue(blue) {} }; -static std::array LABELS { +static std::array LABELS { Label(0, "other", 255, 255, 255), Label(1, "construction_site", 140, 90, 100), Label(2, "bare_ground", 71, 58, 17), @@ -60,13 +60,15 @@ static std::array LABELS { Label(41, "building", 240, 0, 0), Label(42, "high_building", 127, 1, 0), Label(43, "pipeline", 35, 85, 85), - Label(44, "unknown", 250, 250, 150) + Label(44, "level_crossing", 108, 56, 171), + Label(45, "unknown", 250, 250, 150) }; -const unsigned char LABEL_OTHER = 44; +const unsigned char LABEL_OTHER = 45; const unsigned char LABEL_RAIL = 27; const unsigned char LABEL_WATER = 21; const unsigned char LABEL_ROAD = 28; +const unsigned char LABEL_LEVEL_CROSSING = 44; #endif /* !LABEL_H_ */