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. | |
SubGrid (const nav_grid::NavGridInfo *info, const nav_core2::UIntBounds &bounds) | |
Public Constructor using UIntBounds object. | |
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. | |
Standard BaseIterator Interface | |
SubGrid | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. | |
SubGrid | end () const override |
Helper function for range-style iteration. | |
void | increment () override |
Increase the iterator to the next element. | |
bool | fieldsEqual (const SubGrid &other) override |
Additional check for whether fields of derived iterators are equal. | |
Protected Attributes | |
unsigned int | height_ |
unsigned int | min_x_ |
unsigned int | min_y_ |
unsigned int | width_ |
Iterator for looping through every index within an aligned rectangular portion of the grid.
Definition at line 47 of file sub_grid.h.
nav_grid_iterators::SubGrid::SubGrid | ( | const nav_grid::NavGridInfo * | info, |
unsigned int | min_x, | ||
unsigned int | min_y, | ||
unsigned int | width, | ||
unsigned int | height | ||
) | [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 61 of file sub_grid.h.
nav_grid_iterators::SubGrid::SubGrid | ( | const nav_grid::NavGridInfo * | info, |
const nav_core2::UIntBounds & | bounds | ||
) | [inline] |
Public Constructor using UIntBounds object.
info | NavGridInfo for the grid to iterate over |
bounds | UIntBounds |
Definition at line 70 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 | ||
) | [inline] |
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 85 of file sub_grid.h.
SubGrid nav_grid_iterators::SubGrid::begin | ( | ) | const [override, virtual] |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 39 of file sub_grid.cpp.
SubGrid nav_grid_iterators::SubGrid::end | ( | ) | const [override, virtual] |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 44 of file sub_grid.cpp.
bool nav_grid_iterators::SubGrid::fieldsEqual | ( | const SubGrid & | 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< SubGrid >.
Definition at line 59 of file sub_grid.cpp.
void nav_grid_iterators::SubGrid::increment | ( | ) | [override, virtual] |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< SubGrid >.
Definition at line 49 of file sub_grid.cpp.
unsigned int nav_grid_iterators::SubGrid::height_ [protected] |
Definition at line 98 of file sub_grid.h.
unsigned int nav_grid_iterators::SubGrid::min_x_ [protected] |
Definition at line 98 of file sub_grid.h.
unsigned int nav_grid_iterators::SubGrid::min_y_ [protected] |
Definition at line 98 of file sub_grid.h.
unsigned int nav_grid_iterators::SubGrid::width_ [protected] |
Definition at line 98 of file sub_grid.h.