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. More... | |
Line (const Line &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. More... | |
Line & | operator= (const Line &other) |
Assignment Operator Required to ensure unique_ptr is set properly. More... | |
Standard BaseIterator Interface | |
Line | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. More... | |
Line | end () const override |
Helper function for range-style iteration. More... | |
void | increment () override |
Increase the iterator to the next element. More... | |
bool | fieldsEqual (const Line &other) override |
Additional check for whether fields of derived iterators are equal. More... | |
Public Member Functions inherited from nav_grid_iterators::BaseIterator< Line > | |
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 Line &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... | |
Line & | operator++ () |
Increase the iterator to the next element. More... | |
bool | operator== (const Line &other) |
Test if two iterators are equivalent. More... | |
virtual | ~BaseIterator ()=default |
Destructor. More... | |
Protected Member Functions | |
void | constructIterator () |
bool | inBounds (const nav_grid::SignedIndex &sindex) |
Check if a SignedIndex is within the bounds of the NavGrid. More... | |
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. More... | |
Protected Member Functions inherited from nav_grid_iterators::BaseIterator< Line > | |
BaseIterator (const nav_grid::NavGridInfo *info, const nav_grid::Index &index) | |
Protected constructor that takes in an arbitrary index. More... | |
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_ |
Protected Attributes inherited from nav_grid_iterators::BaseIterator< Line > | |
nav_grid::Index | index_ |
const nav_grid::NavGridInfo * | info_ |
Additional Inherited Members | |
Public Types inherited from nav_grid_iterators::BaseIterator< Line > | |
using | difference_type = int |
using | iterator_category = std::input_iterator_tag |
using | pointer = nav_grid::Index * |
using | reference = nav_grid::Index & |
using | self_type = Line |
using | value_type = nav_grid::Index |
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 | ) |
|
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 |
|
overridevirtual |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< Line >.
|
protected |
|
overridevirtual |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< Line >.
|
overridevirtual |
Additional check for whether fields of derived iterators are equal.
Helps make overriding the == operator easy.
Reimplemented from nav_grid_iterators::BaseIterator< Line >.
|
protected |
|
overridevirtual |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< Line >.
|
protected |
|
protected |
|
protected |