42 :
AbstractLineIterator(), x0_(x0), y0_(y0), x1_(x1), y1_(y1), include_last_index_(include_last_index)
44 dx_ = std::abs(x1 - x0);
45 dy_ = std::abs(y1 - y0);
46 index_.
x =
static_cast<int>(floor(x0));
47 index_.
y =
static_cast<int>(floor(y0));
52 error_ = std::numeric_limits<double>::max();
68 error_ -= std::numeric_limits<double>::max();
85 if (!include_last_index && x1 < x0 && y1 - floor(y1) == 0.0)
100 double x0,
double y0,
double x1,
double y1,
bool include_last_index,
101 double dx,
double dy,
double initial_error,
int loop_inc_x,
int loop_inc_y)
116 int x_diff = abs(static_cast<int>(
x0_) - static_cast<int>(
x1_));
117 int y_diff = abs(static_cast<int>(
y0_) - static_cast<int>(
y1_));
Abstract class for iterating over lines.
nav_grid::SignedIndex getFinalIndex() const override
Line Iterator with Ray Tracing (subpixel accuracy)
RayTrace begin() const
Helper function for range-style iteration.
RayTrace(double x0, double y0, double x1, double y1, bool include_last_index=true)
Public constructor.
nav_grid::SignedIndex index_
void increment() override
Increase the iterator to the next element.
RayTrace end() const
Helper function for range-style iteration.