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. More... | |
PolygonOutline (const nav_grid::NavGridInfo *info, nav_2d_msgs::Polygon2D polygon, bool bresenham=true) | |
Public Constructor. More... | |
PolygonOutline (const PolygonOutline &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. More... | |
Standard BaseIterator Interface | |
PolygonOutline | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. More... | |
PolygonOutline | end () const override |
Helper function for range-style iteration. More... | |
void | increment () override |
Increase the iterator to the next element. More... | |
bool | fieldsEqual (const PolygonOutline &other) override |
Additional check for whether fields of derived iterators are equal. More... | |
Public Member Functions inherited from nav_grid_iterators::BaseIterator< PolygonOutline > | |
BaseIterator (const nav_grid::NavGridInfo *info) | |
Public Constructor. Takes in a pointer to the info and starts at the minimum index. More... | |
BaseIterator (const nav_grid::NavGridInfo &info) | |
Public Constructor. Takes in a reference to the info and starts at the minimum index. More... | |
bool | operator!= (const PolygonOutline &other) |
Test if two iterators are not equivalent - required for testing if iterator is at the end. More... | |
const nav_grid::Index & | operator* () const |
Dereference the iterator. More... | |
PolygonOutline & | operator++ () |
Increase the iterator to the next element. More... | |
bool | operator== (const PolygonOutline &other) |
Test if two iterators are equivalent. More... | |
virtual | ~BaseIterator ()=default |
Destructor. More... | |
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. More... | |
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. More... | |
Protected Member Functions inherited from nav_grid_iterators::BaseIterator< PolygonOutline > | |
BaseIterator (const nav_grid::NavGridInfo *info, const nav_grid::Index &index) | |
Protected constructor that takes in an arbitrary index. More... | |
Protected Attributes | |
bool | bresenham_ |
std::unique_ptr< Line > | internal_iterator_ |
nav_2d_msgs::Polygon2D | polygon_ |
unsigned int | side_index_ |
nav_grid::Index | start_index_ |
Protected Attributes inherited from nav_grid_iterators::BaseIterator< PolygonOutline > | |
nav_grid::Index | index_ |
const nav_grid::NavGridInfo * | info_ |
Additional Inherited Members | |
Public Types inherited from nav_grid_iterators::BaseIterator< PolygonOutline > | |
using | difference_type = int |
using | iterator_category = std::input_iterator_tag |
using | pointer = nav_grid::Index * |
using | reference = nav_grid::Index & |
using | self_type = PolygonOutline |
using | value_type = nav_grid::Index |
Iterates over all of the valid indexes on the outline of a polygon.
Definition at line 49 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.
|
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.
|
overridevirtual |
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.
|
overridevirtual |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< PolygonOutline >.
Definition at line 106 of file polygon_outline.cpp.
|
overridevirtual |
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.
|
overridevirtual |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< PolygonOutline >.
Definition at line 113 of file polygon_outline.cpp.
|
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.
|
protected |
Definition at line 99 of file polygon_outline.h.
|
protected |
Definition at line 96 of file polygon_outline.h.
|
protected |
Definition at line 97 of file polygon_outline.h.
|
protected |
Definition at line 100 of file polygon_outline.h.
|
protected |
Definition at line 98 of file polygon_outline.h.