Iterator for looping through every index within an aligned rectangular portion of the grid. More...
#include <sub_grid.h>
Public Member Functions | |
SubGrid (const nav_grid::NavGridInfo *info, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height) | |
Public Constructor. More... | |
SubGrid (const nav_grid::NavGridInfo *info, const nav_core2::UIntBounds &bounds) | |
Public Constructor using UIntBounds object. More... | |
SubGrid (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height) | |
Public constructor that takes in an arbitrary index. More... | |
SubGrid (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, const nav_core2::UIntBounds &bounds) | |
Public constructor using UIntBounds object that takes in an arbitrary index. More... | |
Standard BaseIterator Interface | |
SubGrid | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. More... | |
SubGrid | end () const override |
Helper function for range-style iteration. More... | |
void | increment () override |
Increase the iterator to the next element. More... | |
bool | fieldsEqual (const SubGrid &other) override |
Additional check for whether fields of derived iterators are equal. More... | |
Public Member Functions inherited from nav_grid_iterators::BaseIterator< SubGrid > | |
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 SubGrid &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... | |
SubGrid & | operator++ () |
Increase the iterator to the next element. More... | |
bool | operator== (const SubGrid &other) |
Test if two iterators are equivalent. More... | |
virtual | ~BaseIterator ()=default |
Destructor. More... | |
Protected Attributes | |
unsigned int | height_ |
unsigned int | min_x_ |
unsigned int | min_y_ |
unsigned int | width_ |
Protected Attributes inherited from nav_grid_iterators::BaseIterator< SubGrid > | |
nav_grid::Index | index_ |
const nav_grid::NavGridInfo * | info_ |
Additional Inherited Members | |
Public Types inherited from nav_grid_iterators::BaseIterator< SubGrid > | |
using | difference_type = int |
using | iterator_category = std::input_iterator_tag |
using | pointer = nav_grid::Index * |
using | reference = nav_grid::Index & |
using | self_type = SubGrid |
using | value_type = nav_grid::Index |
Protected Member Functions inherited from nav_grid_iterators::BaseIterator< SubGrid > | |
BaseIterator (const nav_grid::NavGridInfo *info, const nav_grid::Index &index) | |
Protected constructor that takes in an arbitrary index. More... | |
Iterator for looping through every index within an aligned rectangular portion of the grid.
Definition at line 47 of file sub_grid.h.
|
inline |
Public Constructor.
info | NavGridInfo for the grid to iterate over |
min_x | Minimum index (x coordinate) |
min_y | Minimum index (y coordinate) |
width | Number of indexes in the x direction |
height | Number of indexes in the y direction |
Definition at line 58 of file sub_grid.h.
|
inline |
Public Constructor using UIntBounds object.
info | NavGridInfo for the grid to iterate over |
bounds | UIntBounds |
Definition at line 67 of file sub_grid.h.
nav_grid_iterators::SubGrid::SubGrid | ( | const nav_grid::NavGridInfo * | info, |
const nav_grid::Index & | index, | ||
unsigned int | min_x, | ||
unsigned int | min_y, | ||
unsigned int | width, | ||
unsigned int | height | ||
) |
Public constructor that takes in an arbitrary index.
info | NavGridInfo for the grid to iterate over |
index | Initial index |
min_x | Minimum index (x coordinate) |
min_y | Minimum index (y coordinate) |
width | Number of indexes in the x direction |
height | Number of indexes in the y direction |
Definition at line 39 of file sub_grid.cpp.
|
inline |
Public constructor using UIntBounds object that takes in an arbitrary index.
info | NavGridInfo for the grid to iterate over |
index | Initial index |
bounds | UIntBounds |
Definition at line 88 of file sub_grid.h.
|
overridevirtual |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 68 of file sub_grid.cpp.
|
overridevirtual |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 73 of file sub_grid.cpp.
|
overridevirtual |
Additional check for whether fields of derived iterators are equal.
Helps make overriding the == operator easy.
Reimplemented from nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 88 of file sub_grid.cpp.
|
overridevirtual |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 78 of file sub_grid.cpp.
|
protected |
Definition at line 100 of file sub_grid.h.
|
protected |
Definition at line 100 of file sub_grid.h.
|
protected |
Definition at line 100 of file sub_grid.h.
|
protected |
Definition at line 100 of file sub_grid.h.