olp-cpp-sdk  1.23.1
Classes | Static Public Member Functions | List of all members
olp::geo::detail::LineEvaluator Class Reference

Implements Bresenham's line algorithm with a square sliding window. More...

#include <PathTiling.h>

Classes

struct  State
 Holds the state of the line traversal. More...
 

Static Public Member Functions

static TileKey Value (const State &state)
 Evaluates the current tile key from the given state. More...
 
static bool Iterate (State &state)
 Iterates the state towards the end of the line. More...
 
static State Init (const TileKey start_tile, const TileKey end_tile, const int32_t sliding_window_half_size)
 Initializes the line state between two tiles. More...
 

Detailed Description

Implements Bresenham's line algorithm with a square sliding window.

This class provides a way to iterate over a line while considering a sliding window to enable line width.

Member Function Documentation

◆ Init()

static State olp::geo::detail::LineEvaluator::Init ( const TileKey  start_tile,
const TileKey  end_tile,
const int32_t  sliding_window_half_size 
)
inlinestatic

Initializes the line state between two tiles.

Parameters
start_tileThe starting tile.
end_tileThe ending tile.
sliding_window_half_sizeThe half-size of the sliding window.
Returns
The initialized line state.

◆ Iterate()

static bool olp::geo::detail::LineEvaluator::Iterate ( State state)
inlinestatic

Iterates the state towards the end of the line.

Parameters
stateThe current state of the line traversal.
Returns
True if the iteration continues, false if it ends.

◆ Value()

static TileKey olp::geo::detail::LineEvaluator::Value ( const State state)
inlinestatic

Evaluates the current tile key from the given state.

Parameters
stateThe current state of the line traversal.
Returns
The tile key corresponding to the current position.

The documentation for this class was generated from the following file: