/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file Bresenham.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date Mon, 17 Dec 200117///18// A class to realise a uniform n:m - relationship using the19/****************************************************************************/20#pragma once21#include <config.h>222324// ===========================================================================25// class definitions26// ===========================================================================27/**28* The class' only static method "execute" obtains a callback object and29* performs the computation of the n:m - relationship30*/31class Bresenham {32public:33/**34* BresenhamCallBack35* This class is the base interface-describing class for a callback class36* for the bresenham-function.37* Derived classes must implement the execute-method which is called38* on every bresenham-step39*/40class BresenhamCallBack {41public:42/** constuctor */43BresenhamCallBack() { }4445/** destructor */46virtual ~BresenhamCallBack() { }4748/** called when a bresenham step has been computed */49virtual void execute(const int val1, const int val2) = 0;50};5152public:53/** compute the bresenham - interpolation between both values54the higher number is increased by one for each step while the smaller55is increased by smaller/higher.56In each step, the callback is executed. */57static void compute(BresenhamCallBack* callBack, const int val1, const int val2);58};596061