Skip to content

Commit

Permalink
Add level_crossing in label
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrzeczkowicz committed Oct 27, 2024
1 parent 38def65 commit a263d3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}
}
Expand All @@ -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;
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions label.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Label, 45> LABELS {
static std::array<Label, 46> LABELS {
Label(0, "other", 255, 255, 255),
Label(1, "construction_site", 140, 90, 100),
Label(2, "bare_ground", 71, 58, 17),
Expand Down Expand Up @@ -60,13 +60,15 @@ static std::array<Label, 45> 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_ */

0 comments on commit a263d3c

Please sign in to comment.