Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

cIncremental_Bresenham Class Reference

encapsule l'algo de bresenham More...

#include <bresenham.h>

List of all members.

Public Member Functions

 cIncremental_Bresenham ()
 constructeur par defaut

void Reset (cPoint2D &start, cPoint2D &goal)
 initialise les variables interne pour faire le parcours de start vers goal

void Parcourir_Et_Executer (cPoint2D &start, cPoint2D &goal, bool(*Call_Back)(int x, int y))
 parcours la ligne du point 'start' à 'goal' en appelant à chaque point 'Call_Back(x,y)'

bool Step (cPoint2D &position)
 effectue un pas dans l'algo de bresenham

bool Step (int &length, cPoint2D &position)
 effectue un pas, de longueur 'length'


Private Attributes

cPoint2D A
 point de depart

cPoint2D B
 point d'arrivée

int sdx
int sdy
int dx
int dy
int dx2
int dy2
int error
int x_inc
int y_inc
 variables internes for the Bresenham algorithm

int Px
int Py
 position courante de l'algorithme


Detailed Description

encapsule l'algo de bresenham

permet d'initialiser l'algo et ensuite de faire des pas en appellant une fonction membre

Definition at line 31 of file bresenham.h.


Constructor & Destructor Documentation

cIncremental_Bresenham::cIncremental_Bresenham  )  [inline]
 

constructeur par defaut

initiale les valeurs de l'algorithme de bresenham pour aller de (0,0) à (0,0)

Definition at line 37 of file bresenham.h.

References A, and B.


Member Function Documentation

void cIncremental_Bresenham::Parcourir_Et_Executer cPoint2D start,
cPoint2D goal,
bool(*  Call_Back)(int x, int y)
 

parcours la ligne du point 'start' à 'goal' en appelant à chaque point 'Call_Back(x,y)'

la fonction 'Call_Back' prends [x,y] comme parametres entier
elle renvoie un booleen
si elle renvoie true, on continue le parcours
sinon, on stoppe le parcours

void cIncremental_Bresenham::Reset cPoint2D start,
cPoint2D goal
 

initialise les variables interne pour faire le parcours de start vers goal

Definition at line 13 of file bresenham.cpp.

References A, B, dx, dx2, dy, dy2, error, Px, Py, Reset(), sdx, sdy, x_inc, and y_inc.

Referenced by cGame_World::Do_Segment_Intersect_Walls(), cUnit::Follow_Path(), and Reset().

bool cIncremental_Bresenham::Step int &  length,
cPoint2D position
 

effectue un pas, de longueur 'length'

si on atteint le point final avant de parcourir 'length'
en retour 'length' vaut la distance qu'on aurait pu parcourir en plus
'position' contient la position apres le pas

Definition at line 58 of file bresenham.cpp.

References B, dx, dx2, dy, dy2, error, Px, Py, sdx, sdy, Step(), cPoint2D::X, x_inc, cPoint2D::Y, and y_inc.

bool cIncremental_Bresenham::Step cPoint2D position  ) 
 

effectue un pas dans l'algo de bresenham

position contiendra en retour la position courante

Definition at line 117 of file bresenham.cpp.

References B, dx, dx2, dy, dy2, error, Px, Py, sdx, sdy, Step(), cPoint2D::X, x_inc, cPoint2D::Y, and y_inc.

Referenced by cGame_World::Do_Segment_Intersect_Walls(), cUnit::Follow_Path(), and Step().


Member Data Documentation

cPoint2D cIncremental_Bresenham::A [private]
 

point de depart

Definition at line 68 of file bresenham.h.

Referenced by cIncremental_Bresenham(), and Reset().

cPoint2D cIncremental_Bresenham::B [private]
 

point d'arrivée

Definition at line 69 of file bresenham.h.

Referenced by cIncremental_Bresenham(), Reset(), and Step().

int cIncremental_Bresenham::dx [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::dx2 [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::dy [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::dy2 [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::error [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::Px [private]
 

Definition at line 72 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::Py [private]
 

position courante de l'algorithme

Definition at line 72 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::sdx [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::sdy [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::x_inc [private]
 

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().

int cIncremental_Bresenham::y_inc [private]
 

variables internes for the Bresenham algorithm

Definition at line 71 of file bresenham.h.

Referenced by Reset(), and Step().


The documentation for this class was generated from the following files:
Generated on Fri May 21 19:22:37 2004 for LIBELL by doxygen 1.3.7