Iterates over all of the valid indexes on the outline of a polygon. More...
#include <polygon_outline.h>
Public Member Functions | |
PolygonOutline & | operator= (const PolygonOutline &other) |
Assignment Operator Required to ensure unique_ptr is set properly. | |
PolygonOutline (const nav_grid::NavGridInfo *info, nav_2d_msgs::Polygon2D polygon, bool bresenham=true) | |
Public Constructor. | |
PolygonOutline (const PolygonOutline &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. | |
Standard BaseIterator Interface | |
PolygonOutline | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. | |
PolygonOutline | end () const override |
Helper function for range-style iteration. | |
void | increment () override |
Increase the iterator to the next element. | |
bool | fieldsEqual (const PolygonOutline &other) override |
Additional check for whether fields of derived iterators are equal. | |
Protected Member Functions | |
void | loadSide () |
Given a new side index, loads the internal iterator. If there are no valid values in the internal iterator, increases the side index. | |
PolygonOutline (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, nav_2d_msgs::Polygon2D polygon, bool bresenham, unsigned int side_index) | |
Protected constructor that takes in an arbitrary index and other internal parameters. | |
Protected Attributes | |
bool | bresenham_ |
std::unique_ptr< Line > | internal_iterator_ |
nav_2d_msgs::Polygon2D | polygon_ |
unsigned int | side_index_ |
nav_grid::Index | start_index_ |
Iterates over all of the valid indexes on the outline of a polygon.
Definition at line 48 of file polygon_outline.h.
nav_grid_iterators::PolygonOutline::PolygonOutline | ( | const nav_grid::NavGridInfo * | info, |
nav_2d_msgs::Polygon2D | polygon, | ||
bool | bresenham = true |
||
) |
Public Constructor.
info | NavGridInfo for the grid to iterate over |
polygon | Polygon to iterate over |
Definition at line 41 of file polygon_outline.cpp.
nav_grid_iterators::PolygonOutline::PolygonOutline | ( | const PolygonOutline & | other | ) |
Copy Constructor Required to ensure unique_ptr is set properly.
Definition at line 56 of file polygon_outline.cpp.
nav_grid_iterators::PolygonOutline::PolygonOutline | ( | const nav_grid::NavGridInfo * | info, |
const nav_grid::Index & | index, | ||
nav_2d_msgs::Polygon2D | polygon, | ||
bool | bresenham, | ||
unsigned int | side_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 |
side_index | Which side we are currently iterating over |
Definition at line 61 of file polygon_outline.cpp.
PolygonOutline nav_grid_iterators::PolygonOutline::begin | ( | ) | const [override, virtual] |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< PolygonOutline >.
Definition at line 101 of file polygon_outline.cpp.
PolygonOutline nav_grid_iterators::PolygonOutline::end | ( | ) | const [override, virtual] |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< PolygonOutline >.
Definition at line 106 of file polygon_outline.cpp.
bool nav_grid_iterators::PolygonOutline::fieldsEqual | ( | const PolygonOutline & | 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< PolygonOutline >.
Definition at line 129 of file polygon_outline.cpp.
void nav_grid_iterators::PolygonOutline::increment | ( | ) | [override, virtual] |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< PolygonOutline >.
Definition at line 113 of file polygon_outline.cpp.
void nav_grid_iterators::PolygonOutline::loadSide | ( | ) | [protected] |
Given a new side index, loads the internal iterator. If there are no valid values in the internal iterator, increases the side index.
Definition at line 79 of file polygon_outline.cpp.
PolygonOutline & nav_grid_iterators::PolygonOutline::operator= | ( | const PolygonOutline & | other | ) |
Assignment Operator Required to ensure unique_ptr is set properly.
Definition at line 68 of file polygon_outline.cpp.
bool nav_grid_iterators::PolygonOutline::bresenham_ [protected] |
Definition at line 98 of file polygon_outline.h.
std::unique_ptr<Line> nav_grid_iterators::PolygonOutline::internal_iterator_ [protected] |
Definition at line 95 of file polygon_outline.h.
nav_2d_msgs::Polygon2D nav_grid_iterators::PolygonOutline::polygon_ [protected] |
Definition at line 96 of file polygon_outline.h.
unsigned int nav_grid_iterators::PolygonOutline::side_index_ [protected] |
Definition at line 99 of file polygon_outline.h.
nav_grid::Index nav_grid_iterators::PolygonOutline::start_index_ [protected] |
Definition at line 97 of file polygon_outline.h.