Iterates over all of the valid indexes of a line. More...
#include <line.h>
Public Member Functions | |
Line (const nav_grid::NavGridInfo *info, double x0, double y0, double x1, double y1, bool include_last_index=true, bool bresenham=true) | |
Public Constructor. | |
Line (const Line &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. | |
Line & | operator= (const Line &other) |
Assignment Operator Required to ensure unique_ptr is set properly. | |
Standard BaseIterator Interface | |
Line | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. | |
Line | end () const override |
Helper function for range-style iteration. | |
void | increment () override |
Increase the iterator to the next element. | |
bool | fieldsEqual (const Line &other) override |
Additional check for whether fields of derived iterators are equal. | |
Protected Member Functions | |
void | constructIterator () |
bool | inBounds (const nav_grid::SignedIndex &sindex) |
Check if a SignedIndex is within the bounds of the NavGrid. | |
Line (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, double x0, double y0, double x1, double y1, bool include_last_index, bool bresenham, nav_grid::Index start_index, nav_grid::Index end_index) | |
Protected constructor that takes in an arbitrary index and other internal parameters. | |
Protected Attributes | |
bool | bresenham_ |
nav_grid::Index | end_index_ |
bool | include_last_index_ |
std::unique_ptr < AbstractLineIterator > | internal_iterator_ |
int | signed_height_ |
int | signed_width_ |
nav_grid::Index | start_index_ |
double | x0_ |
double | x1_ |
double | y0_ |
double | y1_ |
nav_grid_iterators::Line::Line | ( | const nav_grid::NavGridInfo * | info, |
double | x0, | ||
double | y0, | ||
double | x1, | ||
double | y1, | ||
bool | include_last_index = true , |
||
bool | bresenham = true |
||
) |
nav_grid_iterators::Line::Line | ( | const Line & | other | ) |
nav_grid_iterators::Line::Line | ( | const nav_grid::NavGridInfo * | info, |
const nav_grid::Index & | index, | ||
double | x0, | ||
double | y0, | ||
double | x1, | ||
double | y1, | ||
bool | include_last_index, | ||
bool | bresenham, | ||
nav_grid::Index | start_index, | ||
nav_grid::Index | end_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 |
x0 | Start x coordinate |
y0 | Start y coordinate |
x1 | End x coordinate |
y1 | End y coordinate |
include_last_index | If true, will include the end coordinates. |
start_index | The first valid index |
end_index | The first invalid index |
Line nav_grid_iterators::Line::begin | ( | ) | const [override, virtual] |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< Line >.
void nav_grid_iterators::Line::constructIterator | ( | ) | [protected] |
Line nav_grid_iterators::Line::end | ( | ) | const [override, virtual] |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< Line >.
bool nav_grid_iterators::Line::fieldsEqual | ( | const Line & | 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< Line >.
bool nav_grid_iterators::Line::inBounds | ( | const nav_grid::SignedIndex & | sindex | ) | [protected] |
void nav_grid_iterators::Line::increment | ( | ) | [override, virtual] |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< Line >.
bool nav_grid_iterators::Line::bresenham_ [protected] |
nav_grid::Index nav_grid_iterators::Line::end_index_ [protected] |
bool nav_grid_iterators::Line::include_last_index_ [protected] |
std::unique_ptr<AbstractLineIterator> nav_grid_iterators::Line::internal_iterator_ [protected] |
int nav_grid_iterators::Line::signed_height_ [protected] |
int nav_grid_iterators::Line::signed_width_ [protected] |
nav_grid::Index nav_grid_iterators::Line::start_index_ [protected] |
double nav_grid_iterators::Line::x0_ [protected] |
double nav_grid_iterators::Line::x1_ [protected] |
double nav_grid_iterators::Line::y0_ [protected] |
double nav_grid_iterators::Line::y1_ [protected] |