00001
00008 #ifndef BOUNDINGBOX_H
00009 #define BOUNDINGBOX_H
00010
00011 #include<ostream>
00012 #include<istream>
00013
00021 class BoundingBox
00022 {
00023 public :
00027 BoundingBox();
00036 BoundingBox(int x, int y, int lg, int ht);
00037
00041 ~BoundingBox();
00042 protected :
00046 int m_x1;
00050 int m_y1;
00054 int m_x2;
00058 int m_y2;
00059
00060 public :
00065 int GetOrigineX() const;
00070 int GetOrigineY() const;
00075 int GetFinX() const;
00080 int GetFinY() const;
00081
00086 int GetLargeur() const;
00091 int GetHauteur() const;
00092
00096 void SetOrigineX(int pos);
00100 void SetOrigineY(int pos);
00104 void SetFinX(int pos);
00108 void SetFinY(int pos);
00109
00113 void RendCarre();
00114
00118 void Affiche() const;
00119
00125 void SetCoord(int x1, int y1, int x2, int y2);
00126
00134 void SetBoundingBox(int x1, int y1, int w, int h);
00141 bool Contient(int x, int y, bool border=true) const;
00142
00148 bool Contient(const BoundingBox& bb) const;
00149
00155 void Deplace(int dx, int dy);
00156
00161 bool IsVide() const;
00162
00166 void Valider();
00167
00173 BoundingBox operator|(const BoundingBox &bb) const;
00174
00181 BoundingBox& operator|=(const BoundingBox &bb);
00182
00188 bool operator==(const BoundingBox& bb);
00189
00195 BoundingBox& operator=(const BoundingBox& bb);
00196 };
00197
00198 #endif