Go to the documentation of this file.00001 #ifndef WIT_GEOMETRY_H
00002 #define WIT_GEOMETRY_H
00003
00004 namespace wit {
00005
00006 class Point {
00007 public:
00008 Point();
00009 Point(const Point& other);
00010 Point(float x, float y);
00011
00012 Point& operator=(const Point& other);
00013 float x, y;
00014 };
00015
00016 class Rect {
00017 public:
00018 Rect();
00019 Rect(const Rect& other);
00020 Rect(float x1, float y1, float x2, float y2);
00021
00022 Rect& operator=(const Rect& other);
00023 float x1, y1, x2, y2;
00024
00025 bool contains(float x, float y);
00026 bool intersects(const Rect& other);
00027 float width() const;
00028 float height() const;
00029 };
00030
00031 class PolygonPrivate;
00032 class Polygon {
00033 public:
00034 Polygon();
00035 Polygon(const Polygon& other);
00036 ~Polygon();
00037
00038 Polygon& operator=(const Polygon& other);
00039
00040 void addPoint(float x, float y);
00041 void addPoint(const Point& p);
00042 int count() const;
00043 Point* points() const;
00044
00045 Rect boundingBox() const;
00046
00047 bool contains(float x, float y) const;
00048
00049 private:
00050 PolygonPrivate* d;
00051 };
00052
00053 }
00054
00055 #endif