Go to the documentation of this file.
15 #ifndef BELUGA_ALGORITHM_RAYCASTING_BRESENHAM_HPP
16 #define BELUGA_ALGORITHM_RAYCASTING_BRESENHAM_HPP
21 #include <range/v3/view/all.hpp>
22 #include <range/v3/view/take_while.hpp>
50 template <
class Vector2,
typename Integer =
typename Vector2::Scalar>
51 class Line :
public ranges::view_interface<Line<Vector2, Integer>> {
257 template <
class Vector2i = Eigen::Vector2i>
iterator & operator++()
Prefix operator overload.
const Vector2 * operator->() const
Arrow operator overload (only const).
constexpr void swap(CircularArray< T, N, F > &a, CircularArray< T, N, G > &b)
Swaps arrays a and b.
auto end() const
Returns a sentinel as past-of-end iterator.
Line(Vector2 p0, Vector2 p1, Variant variant)
Constructs a Bresenham's 2D line drawing.
bool operator!=(const sentinel &other) const
Sentinel inequality operator overload.
Vector2 * pointer
Pointer to iterated value type.
Bresenham's 2D line drawing as a range.
@ kStandard
Standard Bresenham's algorithm.
bool operator!=(const iterator &other) const
Inequality operator overload, for symmetry (as required by ranges::sentinel_for).
bool operator==(const iterator &other) const
Equality operator overload, for symmetry (as required by ranges::sentinel_for).
std::ptrdiff_t difference_type
Iterator difference type (as required by ranges::view_).
Vector< Scalar, 2, Options > Vector2
Bresenham2i() noexcept=default
Constructs standard Bresenham 2D line drawing algorithm.
void step_to(Integer x, Integer y)
auto begin() const
Returns an iterator pointing to the first point in the line.
iterator operator++(int)
Post-fix operator overload.
iterator(const Line *line)
Constructs a Bresenham's 2D line iterator.
Variant
Bresenham's 2D line drawing algorithm variants.
std::forward_iterator_tag iterator_category
Iterator category tag.
const Vector2 & operator*() const
Dereference operator overload (only const).
auto operator()(Vector2i p0, Vector2i p1) const
Computes 2D line from p0 to p1.
bool operator!=(const iterator &other) const
Inequality operator overload (as required by std::forward_iterator).
bool operator==(const sentinel &) const
Sentinel equality operator overload.
iterator()=default
Default constructor.
Bresenham's 2D line drawing algorithm, optimized for integer arithmetic.
bool operator==(const iterator &other) const
Equality operator overload (as required by std::forward_iterator).
Line()=default
Constructs point line.
Vector2 & reference
Reference to iterated value type.
Bresenham's 2D line drawing iterator, one cell at a time.
Vector2 value_type
Iterated value type.
Past-of-end iterator sentinel.
The main Beluga namespace.
beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:53