Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef NAV_GRID_ITERATORS_POLYGON_FILL_H
00036 #define NAV_GRID_ITERATORS_POLYGON_FILL_H
00037
00038 #include <nav_grid_iterators/base_iterator.h>
00039 #include <nav_grid_iterators/sub_grid.h>
00040 #include <nav_2d_msgs/Polygon2D.h>
00041
00042 namespace nav_grid_iterators
00043 {
00048 class PolygonFill : public BaseIterator<PolygonFill>
00049 {
00050 public:
00056 PolygonFill(const nav_grid::NavGridInfo* info, nav_2d_msgs::Polygon2D polygon);
00057
00062 PolygonFill(const PolygonFill& other);
00063
00068 PolygonFill& operator=(const PolygonFill& other);
00069
00072 PolygonFill begin() const override;
00073 PolygonFill end() const override;
00074 void increment() override;
00075 bool fieldsEqual(const PolygonFill& other) override;
00078 protected:
00090 PolygonFill(const nav_grid::NavGridInfo* info, const nav_grid::Index& index, nav_2d_msgs::Polygon2D polygon,
00091 unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height,
00092 const nav_grid::Index& start_index);
00093
00094
00099 bool isInside(unsigned int x, unsigned int y) const;
00100
00101 nav_2d_msgs::Polygon2D polygon_;
00102 unsigned int min_x_, min_y_, width_, height_;
00103 nav_grid::Index start_index_;
00104 std::unique_ptr<SubGrid> internal_iterator_;
00105 };
00106 }
00107
00108 #endif // NAV_GRID_ITERATORS_POLYGON_FILL_H