Class LineIterator

Class Documentation

class LineIterator

An iterator implementing Bresenham Ray-Tracing.

Public Functions

inline LineIterator(int x0, int y0, int x1, int y1)

A constructor for LineIterator.

Parameters:
  • x0 – Starting x

  • y0 – Starting y

  • x1 – Ending x

  • y1 – Ending y

inline bool isValid() const

If the iterator is valid.

Returns:

bool If valid

inline void advance()

Advance iteration along the line.

inline int getX() const

Get current X value.

Returns:

X

inline int getY() const

Get current Y value.

Returns:

Y

inline int getX0() const

Get initial X value.

Returns:

X

inline int getY0() const

Get initial Y value.

Returns:

Y

inline int getX1() const

Get terminal X value.

Returns:

X

inline int getY1() const

Get terminal Y value.

Returns:

Y