Line Iterator using Bresenham's algorithm (no subpixel precision) More...
#include <bresenham.h>

Public Member Functions | |
| Bresenham | begin () const |
| Helper function for range-style iteration. | |
| Bresenham (int x0, int y0, int x1, int y1, bool include_last_index=true) | |
| Public constructor. | |
| Bresenham | end () const |
| Helper function for range-style iteration. | |
| nav_grid::SignedIndex | getFinalIndex () const override |
| void | increment () override |
| Increase the iterator to the next element. | |
| bool | operator!= (const Bresenham &other) |
| Test if two iterators are not equivalent - required for testing if iterator is at the end. | |
| Bresenham & | operator++ () |
| Increase the iterator to the next element. | |
| bool | operator== (const Bresenham &other) |
| Test if two iterators are equivalent. | |
Protected Member Functions | |
| Bresenham (const nav_grid::SignedIndex &index, int x0, int y0, int x1, int y1, bool include_last_index, int error_inc_x, int loop_inc_x, int error_inc_y, int loop_inc_y, int denominator, int numerator, int numerator_inc) | |
| Protected constructor that takes in an arbitrary index and other internal parameters. | |
Protected Attributes | |
| int | denominator_ |
| int | error_inc_x_ |
| int | error_inc_y_ |
| bool | include_last_index_ |
| int | loop_inc_x_ |
| int | loop_inc_y_ |
| int | numerator_ |
| int | numerator_inc_ |
| int | x0_ |
| int | x1_ |
| int | y0_ |
| int | y1_ |
Line Iterator using Bresenham's algorithm (no subpixel precision)
Definition at line 46 of file bresenham.h.
| nav_grid_iterators::Bresenham::Bresenham | ( | int | x0, |
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| bool | include_last_index = true |
||
| ) |
Public constructor.
| x0 | Start x coordinate |
| y0 | Start y coordinate |
| x1 | End x coordinate |
| y1 | End y coordinate |
| include_last_index | If true, will include the end coordinates. |
Definition at line 41 of file bresenham.cpp.
| nav_grid_iterators::Bresenham::Bresenham | ( | const nav_grid::SignedIndex & | index, |
| int | x0, | ||
| int | y0, | ||
| int | x1, | ||
| int | y1, | ||
| bool | include_last_index, | ||
| int | error_inc_x, | ||
| int | loop_inc_x, | ||
| int | error_inc_y, | ||
| int | loop_inc_y, | ||
| int | denominator, | ||
| int | numerator, | ||
| int | numerator_inc | ||
| ) | [protected] |
Protected constructor that takes in an arbitrary index and other internal parameters.
| index | Initial index |
| x0 | Start x coordinate |
| y0 | Start y coordinate |
| x1 | End x coordinate |
| y1 | End y coordinate |
| include_last_index | If true, will include the end coordinates. |
| error_inc_x | |
| loop_inc_x | |
| error_inc_y | |
| loop_inc_y | |
| denominator | |
| numerator | |
| numerator_inc |
Definition at line 74 of file bresenham.cpp.
Helper function for range-style iteration.
Definition at line 84 of file bresenham.cpp.
| Bresenham nav_grid_iterators::Bresenham::end | ( | ) | const |
Helper function for range-style iteration.
Definition at line 91 of file bresenham.cpp.
| nav_grid::SignedIndex nav_grid_iterators::Bresenham::getFinalIndex | ( | ) | const [override, virtual] |
Implements nav_grid_iterators::AbstractLineIterator.
Definition at line 116 of file bresenham.cpp.
| void nav_grid_iterators::Bresenham::increment | ( | ) | [override, virtual] |
Increase the iterator to the next element.
Implements nav_grid_iterators::AbstractLineIterator.
Definition at line 103 of file bresenham.cpp.
| bool nav_grid_iterators::Bresenham::operator!= | ( | const Bresenham & | other | ) | [inline] |
Test if two iterators are not equivalent - required for testing if iterator is at the end.
Definition at line 70 of file bresenham.h.
| Bresenham& nav_grid_iterators::Bresenham::operator++ | ( | ) | [inline] |
Increase the iterator to the next element.
Definition at line 91 of file bresenham.h.
| bool nav_grid_iterators::Bresenham::operator== | ( | const Bresenham & | other | ) | [inline] |
Test if two iterators are equivalent.
Definition at line 62 of file bresenham.h.
int nav_grid_iterators::Bresenham::denominator_ [protected] |
Definition at line 130 of file bresenham.h.
int nav_grid_iterators::Bresenham::error_inc_x_ [protected] |
Definition at line 129 of file bresenham.h.
int nav_grid_iterators::Bresenham::error_inc_y_ [protected] |
Definition at line 129 of file bresenham.h.
bool nav_grid_iterators::Bresenham::include_last_index_ [protected] |
Definition at line 128 of file bresenham.h.
int nav_grid_iterators::Bresenham::loop_inc_x_ [protected] |
Definition at line 129 of file bresenham.h.
int nav_grid_iterators::Bresenham::loop_inc_y_ [protected] |
Definition at line 129 of file bresenham.h.
int nav_grid_iterators::Bresenham::numerator_ [protected] |
Definition at line 130 of file bresenham.h.
int nav_grid_iterators::Bresenham::numerator_inc_ [protected] |
Definition at line 130 of file bresenham.h.
int nav_grid_iterators::Bresenham::x0_ [protected] |
Definition at line 127 of file bresenham.h.
int nav_grid_iterators::Bresenham::x1_ [protected] |
Definition at line 127 of file bresenham.h.
int nav_grid_iterators::Bresenham::y0_ [protected] |
Definition at line 127 of file bresenham.h.
int nav_grid_iterators::Bresenham::y1_ [protected] |
Definition at line 127 of file bresenham.h.