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

Iterates over all of the valid indexes that lie within a circle in row major order. More...

#include <circle_fill.h>

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

List of all members.

Public Member Functions

 CircleFill (const nav_grid::NavGridInfo *info, double center_x, double center_y, double radius)
 Public Constructor.
 CircleFill (const CircleFill &other)
 Copy Constructor Required to ensure unique_ptr is set properly.
CircleFilloperator= (const CircleFill &other)
 Assignment Operator Required to ensure unique_ptr is set properly.
Standard BaseIterator Interface
CircleFill begin () const override
 Helper function for range-style iteration Equivalent to the above constructor.
CircleFill end () const override
 Helper function for range-style iteration.
void increment () override
 Increase the iterator to the next element.
bool fieldsEqual (const CircleFill &other) override
 Additional check for whether fields of derived iterators are equal.

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.
bool isInside (unsigned int x, unsigned int y) const
 Check if coordinates are inside the circle.

Protected Attributes

double center_x_
double center_y_
unsigned int height_
std::unique_ptr< SubGridinternal_iterator_
unsigned int min_x_
unsigned int min_y_
double radius_sq_
nav_grid::Index start_index_
unsigned int width_

Detailed Description

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.


Constructor & Destructor Documentation

nav_grid_iterators::CircleFill::CircleFill ( 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_fill.cpp.

Copy Constructor Required to ensure unique_ptr is set properly.

Definition at line 71 of file circle_fill.cpp.

nav_grid_iterators::CircleFill::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]

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

Parameters:
infoNavGridInfo for the grid to iterate over
indexInitial index
center_xCenter of the circle (x coordinate)
center_yCenter of the circle (y coordinate)
radius_sqSquare of the size of the circle
min_xMinimum valid index that is within the circle (x coordinate)
min_yMinimum valid index that is within the circle (y coordinate)
widthMaximum number of valid indexes in a row of the circle
heightMaximum number of of valid indexes in a column of the circle
start_indexThe first valid index in the minimum row

Definition at line 77 of file circle_fill.cpp.


Member Function Documentation

CircleFill nav_grid_iterators::CircleFill::begin ( ) const [override, virtual]

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

Returns:
Iterator representing beginning of the iteration

Implements nav_grid_iterators::BaseIterator< CircleFill >.

Definition at line 111 of file circle_fill.cpp.

CircleFill nav_grid_iterators::CircleFill::end ( ) const [override, virtual]

Helper function for range-style iteration.

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

Implements nav_grid_iterators::BaseIterator< CircleFill >.

Definition at line 117 of file circle_fill.cpp.

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

Definition at line 136 of file circle_fill.cpp.

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

Increase the iterator to the next element.

Implements nav_grid_iterators::BaseIterator< CircleFill >.

Definition at line 123 of file circle_fill.cpp.

bool nav_grid_iterators::CircleFill::isInside ( unsigned int  x,
unsigned int  y 
) const [protected]

Check if coordinates are inside the circle.

Returns:
true if inside, false otherwise.

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.


Member Data Documentation

Definition at line 105 of file circle_fill.h.

Definition at line 105 of file circle_fill.h.

unsigned int nav_grid_iterators::CircleFill::height_ [protected]

Definition at line 106 of file circle_fill.h.

Definition at line 108 of file circle_fill.h.

unsigned int nav_grid_iterators::CircleFill::min_x_ [protected]

Definition at line 106 of file circle_fill.h.

unsigned int nav_grid_iterators::CircleFill::min_y_ [protected]

Definition at line 106 of file circle_fill.h.

Definition at line 105 of file circle_fill.h.

nav_grid::Index nav_grid_iterators::CircleFill::start_index_ [protected]

Definition at line 107 of file circle_fill.h.

unsigned int nav_grid_iterators::CircleFill::width_ [protected]

Definition at line 106 of file circle_fill.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