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

Iterates over all of the valid indexes on the outline of a polygon. More...

#include <polygon_outline.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

void loadSide ()
 Given a new side index, loads the internal iterator. If there are no valid values in the internal iterator, increases the side index.
 PolygonOutline (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, nav_2d_msgs::Polygon2D polygon, bool bresenham, unsigned int side_index)
 Protected constructor that takes in an arbitrary index and other internal parameters.

Protected Attributes

bool bresenham_
std::unique_ptr< Lineinternal_iterator_
nav_2d_msgs::Polygon2D polygon_
unsigned int side_index_
nav_grid::Index start_index_

Detailed Description

Iterates over all of the valid indexes on the outline of a polygon.

Definition at line 48 of file polygon_outline.h.


Constructor & Destructor Documentation

nav_grid_iterators::PolygonOutline::PolygonOutline ( const nav_grid::NavGridInfo info,
nav_2d_msgs::Polygon2D  polygon,
bool  bresenham = true 
)

Public Constructor.

Parameters:
infoNavGridInfo for the grid to iterate over
polygonPolygon to iterate over

Definition at line 41 of file polygon_outline.cpp.

Copy Constructor Required to ensure unique_ptr is set properly.

Definition at line 56 of file polygon_outline.cpp.

nav_grid_iterators::PolygonOutline::PolygonOutline ( const nav_grid::NavGridInfo info,
const nav_grid::Index &  index,
nav_2d_msgs::Polygon2D  polygon,
bool  bresenham,
unsigned int  side_index 
) [protected]

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

Parameters:
infoNavGridInfo for the grid to iterate over
indexInitial index
polygonPolygon to iterate over
side_indexWhich side we are currently iterating over

Definition at line 61 of file polygon_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< PolygonOutline >.

Definition at line 101 of file polygon_outline.cpp.

Helper function for range-style iteration.

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

Implements nav_grid_iterators::BaseIterator< PolygonOutline >.

Definition at line 106 of file polygon_outline.cpp.

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

Definition at line 129 of file polygon_outline.cpp.

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

Increase the iterator to the next element.

Implements nav_grid_iterators::BaseIterator< PolygonOutline >.

Definition at line 113 of file polygon_outline.cpp.

Given a new side index, loads the internal iterator. If there are no valid values in the internal iterator, increases the side index.

Definition at line 79 of file polygon_outline.cpp.

PolygonOutline & nav_grid_iterators::PolygonOutline::operator= ( const PolygonOutline other)

Assignment Operator Required to ensure unique_ptr is set properly.

Definition at line 68 of file polygon_outline.cpp.


Member Data Documentation

Definition at line 98 of file polygon_outline.h.

Definition at line 95 of file polygon_outline.h.

nav_2d_msgs::Polygon2D nav_grid_iterators::PolygonOutline::polygon_ [protected]

Definition at line 96 of file polygon_outline.h.

Definition at line 99 of file polygon_outline.h.

Definition at line 97 of file polygon_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