#ifndef _RECT_H_
#define _RECT_H_


#define DEBUG_RECT	0

class Point2D
{
public:
#if DEBUG_RECT
	static int ctr;
#endif
	int iptX;
	int iptY;

	// constructeurs usuels
	Point2D();
	Point2D(int x,int y);
	// constructeur par recopie
	Point2D(const Point2D &pt);
	// destructeur
	virtual ~Point2D();
};


class Rect2D
{
public:
#if DEBUG_RECT
	static int ctr;
#endif
	Point2D RctHG;
	Point2D RctBD;
	
	// constructeurs usuels
	Rect2D();
	Rect2D(int hgx,int hgy,int bdx,int bdy);
	Rect2D(Point2D HG,Point2D BD);
	
	// constructeur par recopie
	Rect2D(const Rect2D &rect);
	// destructeur
	virtual ~Rect2D();

	int IsRectEmpty();
	void Print();
};

// renvoie 1 si le poinr est dans le rectangle 0 sinon
int IsPointInRectangle(Point2D pt,Rect2D rc);

// Calcul la taille du rectangle
void SizeRectangle(Rect2D Rec,int *w,int *h);

// Calcul l'intersection entre les deux rectangles Rect1 et Rect2
Rect2D IntersectionRectangle(Rect2D Rect1,Rect2D Rect2);

// deplace le rectangle au point specifié
Rect2D MoveRectangleToPoint(Rect2D rect,Point2D pt);

// deplace le rectangle selon un vecteur
Rect2D MoveRectangleByVecteur(Rect2D rect,Point2D vect);

#endif //_RECT_H_