00001
00002
00008
00009
00010
00011
00012
#ifndef BRESENHAM_H
00013
#define BRESENHAM_H
00014
00015
00016
class cIncremental_Bresenham;
00017
00018
00019
00020
#include "geo_utils.h"
00021
00022
00023
00024
00025
00026
00027
00029
00031 class cIncremental_Bresenham
00032 {
00033
public:
00035
00037 cIncremental_Bresenham()
00038 {
00039
A=
cPoint2D(0,0);
00040
B=cPoint2D(0,0);
00041 };
00042
00044
void Reset(
cPoint2D & start,
cPoint2D & goal );
00045
00047
00051
void Parcourir_Et_Executer(
cPoint2D & start,
cPoint2D & goal ,
bool (*Call_Back)(
int x ,
int y) );
00052
00054
00056
bool Step(
cPoint2D & position );
00057
00059
00063
bool Step(
int &length ,
cPoint2D & position );
00064
00065
00066
private:
00067
00068 cPoint2D A;
00069 cPoint2D B;
00070
00071 int sdx,
sdy,
dx,
dy,
dx2,
dy2,
error,
x_inc,
y_inc;
00072 int Px,
Py;
00073 };
00074
00075
00076
#endif