Iterates over all of the valid indexes that lie within an arbitrary polygon in row major order. More...
#include <polygon_fill.h>
Public Member Functions | |
PolygonFill & | operator= (const PolygonFill &other) |
Assignment Operator Required to ensure unique_ptr is set properly. | |
PolygonFill (const nav_grid::NavGridInfo *info, nav_2d_msgs::Polygon2D polygon) | |
Public Constructor. | |
PolygonFill (const PolygonFill &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. | |
Standard BaseIterator Interface | |
PolygonFill | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. | |
PolygonFill | end () const override |
Helper function for range-style iteration. | |
void | increment () override |
Increase the iterator to the next element. | |
bool | fieldsEqual (const PolygonFill &other) override |
Additional check for whether fields of derived iterators are equal. | |
Protected Member Functions | |
bool | isInside (unsigned int x, unsigned int y) const |
Check if given index is inside the polygon. | |
PolygonFill (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, nav_2d_msgs::Polygon2D polygon, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height, const nav_grid::Index &start_index) | |
Protected constructor that takes in an arbitrary index and other internal parameters. | |
Protected Attributes | |
unsigned int | height_ |
std::unique_ptr< SubGrid > | internal_iterator_ |
unsigned int | min_x_ |
unsigned int | min_y_ |
nav_2d_msgs::Polygon2D | polygon_ |
nav_grid::Index | start_index_ |
unsigned int | width_ |
Iterates over all of the valid indexes that lie within an arbitrary polygon in row major order.
Definition at line 48 of file polygon_fill.h.
nav_grid_iterators::PolygonFill::PolygonFill | ( | const nav_grid::NavGridInfo * | info, |
nav_2d_msgs::Polygon2D | polygon | ||
) |
Public Constructor.
info | NavGridInfo for the grid to iterate over |
polygon | Polygon to iterate over |
Definition at line 42 of file polygon_fill.cpp.
nav_grid_iterators::PolygonFill::PolygonFill | ( | const PolygonFill & | other | ) |
Copy Constructor Required to ensure unique_ptr is set properly.
Definition at line 86 of file polygon_fill.cpp.
nav_grid_iterators::PolygonFill::PolygonFill | ( | const nav_grid::NavGridInfo * | info, |
const nav_grid::Index & | index, | ||
nav_2d_msgs::Polygon2D | polygon, | ||
unsigned int | min_x, | ||
unsigned int | min_y, | ||
unsigned int | width, | ||
unsigned int | height, | ||
const nav_grid::Index & | start_index | ||
) | [protected] |
Protected constructor that takes in an arbitrary index and other internal parameters.
info | NavGridInfo for the grid to iterate over |
index | Initial index |
polygon | Polygon to iterate over |
min_x | Minimum valid index that is within the polygon (x coordinate) |
min_y | Minimum valid index that is within the polygon (y coordinate) |
width | Maximum number of valid indexes in a row of the polygon |
height | Maximum number of of valid indexes in a column of the polygon |
start_index | The first valid index in the minimum row |
Definition at line 92 of file polygon_fill.cpp.
PolygonFill nav_grid_iterators::PolygonFill::begin | ( | ) | const [override, virtual] |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< PolygonFill >.
Definition at line 124 of file polygon_fill.cpp.
PolygonFill nav_grid_iterators::PolygonFill::end | ( | ) | const [override, virtual] |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< PolygonFill >.
Definition at line 129 of file polygon_fill.cpp.
bool nav_grid_iterators::PolygonFill::fieldsEqual | ( | const PolygonFill & | other | ) | [override, virtual] |
Additional check for whether fields of derived iterators are equal.
Helps make overriding the == operator easy.
Reimplemented from nav_grid_iterators::BaseIterator< PolygonFill >.
Definition at line 148 of file polygon_fill.cpp.
void nav_grid_iterators::PolygonFill::increment | ( | ) | [override, virtual] |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< PolygonFill >.
Definition at line 135 of file polygon_fill.cpp.
bool nav_grid_iterators::PolygonFill::isInside | ( | unsigned int | x, |
unsigned int | y | ||
) | const [protected] |
Check if given index is inside the polygon.
Definition at line 116 of file polygon_fill.cpp.
PolygonFill & nav_grid_iterators::PolygonFill::operator= | ( | const PolygonFill & | other | ) |
Assignment Operator Required to ensure unique_ptr is set properly.
Definition at line 102 of file polygon_fill.cpp.
unsigned int nav_grid_iterators::PolygonFill::height_ [protected] |
Definition at line 102 of file polygon_fill.h.
std::unique_ptr<SubGrid> nav_grid_iterators::PolygonFill::internal_iterator_ [protected] |
Definition at line 104 of file polygon_fill.h.
unsigned int nav_grid_iterators::PolygonFill::min_x_ [protected] |
Definition at line 102 of file polygon_fill.h.
unsigned int nav_grid_iterators::PolygonFill::min_y_ [protected] |
Definition at line 102 of file polygon_fill.h.
nav_2d_msgs::Polygon2D nav_grid_iterators::PolygonFill::polygon_ [protected] |
Definition at line 101 of file polygon_fill.h.
nav_grid::Index nav_grid_iterators::PolygonFill::start_index_ [protected] |
Definition at line 103 of file polygon_fill.h.
unsigned int nav_grid_iterators::PolygonFill::width_ [protected] |
Definition at line 102 of file polygon_fill.h.