Iterates over all of the valid indexes that lie within a circle in row major order. More...
#include <circle_fill.h>
Public Member Functions | |
CircleFill (const nav_grid::NavGridInfo *info, double center_x, double center_y, double radius) | |
Public Constructor. More... | |
CircleFill (const CircleFill &other) | |
Copy Constructor Required to ensure unique_ptr is set properly. More... | |
CircleFill & | operator= (const CircleFill &other) |
Assignment Operator Required to ensure unique_ptr is set properly. More... | |
Standard BaseIterator Interface | |
CircleFill | begin () const override |
Helper function for range-style iteration Equivalent to the above constructor. More... | |
CircleFill | end () const override |
Helper function for range-style iteration. More... | |
void | increment () override |
Increase the iterator to the next element. More... | |
bool | fieldsEqual (const CircleFill &other) override |
Additional check for whether fields of derived iterators are equal. More... | |
Public Member Functions inherited from nav_grid_iterators::BaseIterator< CircleFill > | |
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 CircleFill &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... | |
CircleFill & | operator++ () |
Increase the iterator to the next element. More... | |
bool | operator== (const CircleFill &other) |
Test if two iterators are equivalent. More... | |
virtual | ~BaseIterator ()=default |
Destructor. More... | |
Protected Member Functions | |
CircleFill (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, double center_x, double center_y, double radius_sq, unsigned int min_x, unsigned int min_y, unsigned int width, unsigned int height, const nav_grid::Index &start_index) | |
Protected constructor that takes in an arbitrary index and other internal parameters. More... | |
bool | isInside (unsigned int x, unsigned int y) const |
Check if coordinates are inside the circle. More... | |
Protected Member Functions inherited from nav_grid_iterators::BaseIterator< CircleFill > | |
BaseIterator (const nav_grid::NavGridInfo *info, const nav_grid::Index &index) | |
Protected constructor that takes in an arbitrary index. More... | |
Protected Attributes | |
double | center_x_ |
double | center_y_ |
unsigned int | height_ |
std::unique_ptr< SubGrid > | internal_iterator_ |
unsigned int | min_x_ |
unsigned int | min_y_ |
double | radius_sq_ |
nav_grid::Index | start_index_ |
unsigned int | width_ |
Protected Attributes inherited from nav_grid_iterators::BaseIterator< CircleFill > | |
nav_grid::Index | index_ |
const nav_grid::NavGridInfo * | info_ |
Additional Inherited Members | |
Public Types inherited from nav_grid_iterators::BaseIterator< CircleFill > | |
using | difference_type = int |
using | iterator_category = std::input_iterator_tag |
using | pointer = nav_grid::Index * |
using | reference = nav_grid::Index & |
using | self_type = CircleFill |
using | value_type = nav_grid::Index |
Iterates over all of the valid indexes that lie within a circle in row major order.
Definition at line 48 of file circle_fill.h.
nav_grid_iterators::CircleFill::CircleFill | ( | const nav_grid::NavGridInfo * | info, |
double | center_x, | ||
double | center_y, | ||
double | radius | ||
) |
Public Constructor.
info | NavGridInfo for the grid to iterate over |
center_x | Center of the circle (x coordinate) |
center_y | Center of the circle (y coordinate) |
radius | Size of the circle |
Definition at line 40 of file circle_fill.cpp.
nav_grid_iterators::CircleFill::CircleFill | ( | const CircleFill & | other | ) |
Copy Constructor Required to ensure unique_ptr is set properly.
Definition at line 71 of file circle_fill.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 |
center_x | Center of the circle (x coordinate) |
center_y | Center of the circle (y coordinate) |
radius_sq | Square of the size of the circle |
min_x | Minimum valid index that is within the circle (x coordinate) |
min_y | Minimum valid index that is within the circle (y coordinate) |
width | Maximum number of valid indexes in a row of the circle |
height | Maximum number of of valid indexes in a column of the circle |
start_index | The first valid index in the minimum row |
Definition at line 77 of file circle_fill.cpp.
|
overridevirtual |
Helper function for range-style iteration Equivalent to the above constructor.
Implements nav_grid_iterators::BaseIterator< CircleFill >.
Definition at line 111 of file circle_fill.cpp.
|
overridevirtual |
Helper function for range-style iteration.
Implements nav_grid_iterators::BaseIterator< CircleFill >.
Definition at line 117 of file circle_fill.cpp.
|
overridevirtual |
Additional check for whether fields of derived iterators are equal.
Helps make overriding the == operator easy.
Reimplemented from nav_grid_iterators::BaseIterator< CircleFill >.
Definition at line 136 of file circle_fill.cpp.
|
overridevirtual |
Increase the iterator to the next element.
Implements nav_grid_iterators::BaseIterator< CircleFill >.
Definition at line 123 of file circle_fill.cpp.
|
protected |
Check if coordinates are inside the circle.
Definition at line 102 of file circle_fill.cpp.
CircleFill & nav_grid_iterators::CircleFill::operator= | ( | const CircleFill & | other | ) |
Assignment Operator Required to ensure unique_ptr is set properly.
Definition at line 86 of file circle_fill.cpp.
|
protected |
Definition at line 105 of file circle_fill.h.
|
protected |
Definition at line 105 of file circle_fill.h.
|
protected |
Definition at line 106 of file circle_fill.h.
|
protected |
Definition at line 108 of file circle_fill.h.
|
protected |
Definition at line 106 of file circle_fill.h.
|
protected |
Definition at line 106 of file circle_fill.h.
|
protected |
Definition at line 105 of file circle_fill.h.
|
protected |
Definition at line 107 of file circle_fill.h.
|
protected |
Definition at line 106 of file circle_fill.h.