1 #ifndef SLAM_CTOR_CORE_GRID_RASTERIZATION_H 2 #define SLAM_CTOR_CORE_GRID_RASTERIZATION_H 6 #include "../geometry_utils.h" 28 bool include_border =
true) {
29 double offset = include_border ? 0 : 1e-9;
31 area_is_empty = r.
area() == 0;
32 double scale = grid.
scale();
33 if (!area_is_empty && !area_is_infin) {
36 }
else if (area_is_empty) {
40 }
else if (area_is_infin) {
44 assert(
"BUG: rectangle area is both empty and infinite");
67 auto result = std::vector<RegularSquaresGrid::Coord>{};
static constexpr double Dbl_Inf
Coord world_to_cell(const Point2D &pt) const
RegularSquaresGrid::Coord _lb
RegularSquaresGrid::Coord next()
Coord internal2external(const Coord &coord) const
virtual int height() const
RegularSquaresGrid::Coord _rt
virtual double scale() const
virtual int width() const
GridRasterizedRectangle(const RegularSquaresGrid &grid, const LightWeightRectangle &r, bool include_border=true)