Public Member Functions | Protected Member Functions | Protected Attributes
nav_grid_iterators::CircleOutline Class Reference

Iterates over the valid indexes that lie on the outline of a circle. More...

#include <circle_outline.h>

Inheritance diagram for nav_grid_iterators::CircleOutline:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CircleOutline (const nav_grid::NavGridInfo *info, double center_x, double center_y, double radius)
 Public Constructor.
 CircleOutline (const nav_grid::NavGridInfo *info, double center_x, double center_y, unsigned int radius)
 Public Constructor with integer radius.
Standard BaseIterator Interface
CircleOutline begin () const override
 Helper function for range-style iteration Equivalent to the above constructor.
CircleOutline end () const override
 Helper function for range-style iteration.
void increment () override
 Increase the iterator to the next element.
bool fieldsEqual (const CircleOutline &other) override
 Additional check for whether fields of derived iterators are equal.

Protected Member Functions

 CircleOutline (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, int center_index_x, int center_index_y, unsigned int distance, bool init, const nav_grid::Index &start_index)
 Protected constructor that takes in an arbitrary index and other internal parameters.
bool isOnOutline (int dx, int dy) const
 Check if a cell with the given distance from the center of the circle is on the outline of the circle.
bool isValidIndex (int x, int y) const
 Check if arbitrary coordinates are within the grid.

Protected Attributes

int center_index_x_
int center_index_y_
unsigned int distance_
bool init_
int point_x_
int point_y_
int signed_height_
int signed_width_
nav_grid::Index start_index_

Detailed Description

Iterates over the valid indexes that lie on the outline of a circle.

Definition at line 57 of file circle_outline.h.


Constructor & Destructor Documentation

nav_grid_iterators::CircleOutline::CircleOutline ( const nav_grid::NavGridInfo info,
double  center_x,
double  center_y,
double  radius 
)

Public Constructor.

Parameters:
infoNavGridInfo for the grid to iterate over
center_xCenter of the circle (x coordinate)
center_yCenter of the circle (y coordinate)
radiusSize of the circle

Definition at line 40 of file circle_outline.cpp.

nav_grid_iterators::CircleOutline::CircleOutline ( const nav_grid::NavGridInfo info,
double  center_x,
double  center_y,
unsigned int  radius 
)

Public Constructor with integer radius.

Parameters:
infoNavGridInfo for the grid to iterate over
center_xCenter of the circle (x coordinate)
center_yCenter of the circle (y coordinate)
radiusSize of the circle

Definition at line 45 of file circle_outline.cpp.

nav_grid_iterators::CircleOutline::CircleOutline ( const nav_grid::NavGridInfo info,
const nav_grid::Index &  index,
int  center_index_x,
int  center_index_y,
unsigned int  distance,
bool  init,
const nav_grid::Index &  start_index 
) [protected]

Protected constructor that takes in an arbitrary index and other internal parameters.

Parameters:
infoNavGridInfo for the grid to iterate over
indexInitial index
center_index_xIndex of the center of the circle (x coordinate)
center_index_yIndex of the center of the circle (y coordinate)
distanceThe number of cells in the radius of the circle
initWhether the first cell has been visited or not
start_indexThe first valid index in the minimum row

Definition at line 67 of file circle_outline.cpp.


Member Function Documentation

Helper function for range-style iteration Equivalent to the above constructor.

Returns:
Iterator representing beginning of the iteration

Implements nav_grid_iterators::BaseIterator< CircleOutline >.

Definition at line 80 of file circle_outline.cpp.

Helper function for range-style iteration.

Returns:
Iterator representing end of the iteration, with an invalid index

Implements nav_grid_iterators::BaseIterator< CircleOutline >.

Definition at line 86 of file circle_outline.cpp.

bool nav_grid_iterators::CircleOutline::fieldsEqual ( const CircleOutline 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< CircleOutline >.

Definition at line 127 of file circle_outline.cpp.

void nav_grid_iterators::CircleOutline::increment ( ) [override, virtual]

Increase the iterator to the next element.

Implements nav_grid_iterators::BaseIterator< CircleOutline >.

Definition at line 92 of file circle_outline.cpp.

bool nav_grid_iterators::CircleOutline::isOnOutline ( int  dx,
int  dy 
) const [protected]

Check if a cell with the given distance from the center of the circle is on the outline of the circle.

Returns:
true if the distance to the cell when rounded to an integer is equal to the distance_

Definition at line 138 of file circle_outline.cpp.

bool nav_grid_iterators::CircleOutline::isValidIndex ( int  x,
int  y 
) const [protected]

Check if arbitrary coordinates are within the grid.

Returns:
true if inside grid, false otherwise.

Definition at line 133 of file circle_outline.cpp.


Member Data Documentation

Definition at line 114 of file circle_outline.h.

Definition at line 114 of file circle_outline.h.

Definition at line 115 of file circle_outline.h.

Definition at line 116 of file circle_outline.h.

Definition at line 118 of file circle_outline.h.

Definition at line 118 of file circle_outline.h.

Definition at line 117 of file circle_outline.h.

Definition at line 117 of file circle_outline.h.

Definition at line 119 of file circle_outline.h.


The documentation for this class was generated from the following files:


nav_grid_iterators
Author(s):
autogenerated on Wed Jun 26 2019 20:09:45