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

Iterates over all of the valid indexes of a line. More...

#include <line.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

void constructIterator ()
bool inBounds (const nav_grid::SignedIndex &sindex)
 Check if a SignedIndex is within the bounds of the NavGrid.
 Line (const nav_grid::NavGridInfo *info, const nav_grid::Index &index, double x0, double y0, double x1, double y1, bool include_last_index, bool bresenham, nav_grid::Index start_index, nav_grid::Index end_index)
 Protected constructor that takes in an arbitrary index and other internal parameters.

Protected Attributes

bool bresenham_
nav_grid::Index end_index_
bool include_last_index_
std::unique_ptr
< AbstractLineIterator
internal_iterator_
int signed_height_
int signed_width_
nav_grid::Index start_index_
double x0_
double x1_
double y0_
double y1_

Detailed Description

Iterates over all of the valid indexes of a line.

Definition at line 48 of file line.h.


Constructor & Destructor Documentation

nav_grid_iterators::Line::Line ( const nav_grid::NavGridInfo info,
double  x0,
double  y0,
double  x1,
double  y1,
bool  include_last_index = true,
bool  bresenham = true 
)

Public Constructor.

Parameters:
infoNavGridInfo for the grid to iterate over
x0Start x coordinate
y0Start y coordinate
x1End x coordinate
y1End y coordinate
include_last_indexIf true, will include the end coordinates.

Definition at line 42 of file line.cpp.

Copy Constructor Required to ensure unique_ptr is set properly.

Definition at line 80 of file line.cpp.

nav_grid_iterators::Line::Line ( const nav_grid::NavGridInfo info,
const nav_grid::Index &  index,
double  x0,
double  y0,
double  x1,
double  y1,
bool  include_last_index,
bool  bresenham,
nav_grid::Index  start_index,
nav_grid::Index  end_index 
) [protected]

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

Parameters:
infoNavGridInfo for the grid to iterate over
indexInitial index
x0Start x coordinate
y0Start y coordinate
x1End x coordinate
y1End y coordinate
include_last_indexIf true, will include the end coordinates.
start_indexThe first valid index
end_indexThe first invalid index

Definition at line 86 of file line.cpp.


Member Function Documentation

Line nav_grid_iterators::Line::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< Line >.

Definition at line 136 of file line.cpp.

Definition at line 114 of file line.cpp.

Line nav_grid_iterators::Line::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< Line >.

Definition at line 141 of file line.cpp.

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

Definition at line 161 of file line.cpp.

bool nav_grid_iterators::Line::inBounds ( const nav_grid::SignedIndex &  sindex) [protected]

Check if a SignedIndex is within the bounds of the NavGrid.

Definition at line 131 of file line.cpp.

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

Increase the iterator to the next element.

Implements nav_grid_iterators::BaseIterator< Line >.

Definition at line 146 of file line.cpp.

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

Assignment Operator Required to ensure unique_ptr is set properly.

Definition at line 96 of file line.cpp.


Member Data Documentation

Definition at line 109 of file line.h.

nav_grid::Index nav_grid_iterators::Line::end_index_ [protected]

Definition at line 111 of file line.h.

Definition at line 108 of file line.h.

Definition at line 106 of file line.h.

Definition at line 110 of file line.h.

Definition at line 110 of file line.h.

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

Definition at line 111 of file line.h.

double nav_grid_iterators::Line::x0_ [protected]

Definition at line 107 of file line.h.

double nav_grid_iterators::Line::x1_ [protected]

Definition at line 107 of file line.h.

double nav_grid_iterators::Line::y0_ [protected]

Definition at line 107 of file line.h.

double nav_grid_iterators::Line::y1_ [protected]

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