40 std::vector<Polygon_2> cgal_polygons;
41 cgal_polygons.reserve(polygon_features_.size());
42 for (
auto const &poly : polygon_features_) {
44 for (
auto const &pt : poly.poly) {
45 cgal_poly.push_back(CGAL_Point2(pt.x(), pt.y()));
47 cgal_polygons.push_back(cgal_poly);
49 float max_importance = 0;
50 float res =
static_cast<float>(params_.
pResolution);
59 float importance = ComputeImportanceBND<Point2f, float>(pt1, pt2);
61 CGAL_Point2 mid((x1 + x2) / 2, (y1 + y2) / 2);
62 float importance_poly = 0;
63 for (
size_t k = 0; k < cgal_polygons.size(); ++k) {
64 auto &poly = cgal_polygons[k];
65 if (poly.bounded_side(mid) == CGAL::ON_BOUNDED_SIDE) {
66 importance_poly = std::max(importance_poly, polygon_features_[k].imp);
69 importance += importance_poly;
74 world_map_(i, j) = importance;
75 if (importance > max_importance) {
76 max_importance = importance;
81 if (max_importance <
kEps) {
82 normalization_factor_ =
static_cast<float>(params_.pNorm);
84 normalization_factor_ =
static_cast<float>(params_.pNorm) / max_importance;
87 if (not(normalization_factor_ > 1e-5)) {
92#pragma omp parallel for
95 world_map_(i, j) *= normalization_factor_;