30 #ifndef _MIRA_TOOLBOXES_MAPPING_INCLUDE_MAPPING_POYLGONTOOLS_H_ 31 #define _MIRA_TOOLBOXES_MAPPING_INCLUDE_MAPPING_POYLGONTOOLS_H_ 37 namespace mira {
namespace maps {
namespace polygon {
47 template<
class Celltype>
53 : mCos_phi(
std::cos(rotation)), mSin_phi(
std::sin(rotation)), mTranslation(translation), mMap(map)
62 return mMap.
world2mapf(shiftPoint(rotatePoint(p)));
68 return Point2f(p.x() * mCos_phi - p.y() * mSin_phi, p.x() * mSin_phi + p.y() * mCos_phi);
73 return p + mTranslation;
91 template<
class Celltype>
95 auto maximum = std::numeric_limits<Celltype>::lowest();
115 template<
class Celltype>
119 auto maximum = std::numeric_limits<Celltype>::lowest();
120 for (
const auto& polygon : polygons) {
135 template<
class Celltype>
142 map(x, y) = fillValue;
156 template<
class Celltype>
160 for (
const auto& polygon : polygons) {
void rasterPolygon(const Polygon2f &polygon, const Rect2i ®ion, TransformationInRegion &&transformation, Visitor &&visitor)
PropertyHint maximum(const T &max)
void fill(maps::GridMap< Celltype > &map, const Polygon2f &polygon, const Pose2 &polygonPose, const Celltype fillValue, uint8 precision=1)
Function for filling cells that overlap with the polygon at the provided pose.
Definition: PolygonTools.h:136
Celltype getMaximum(const maps::GridMap< Celltype > &map, const Polygon2f &polygon, const Pose2 &polygonPose, uint8 precision=1)
Function for finding the maximum value of cells that have an overlap with the rasterization of a poly...
Definition: PolygonTools.h:92
PropertyHint precision(int p)
Point< float, 2 > Point2f
Point2f world2mapf(const Point2f &p) const
Convert a given point to map coordinates.
Definition: GridMap.h:232
boost::geometry::model::ring< Point2f > Polygon2f