rectangle.h 441 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _rectangle_h_
  2. #define _rectangle_h_
  3. #include "point.h"
  4. class Rect
  5. {
  6. public:
  7. Rect( int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0 );
  8. Rect( const Point& p1, const Point& p2 );
  9. Rect( const Rect& other );
  10. virtual ~Rect();
  11. Point TopLeft();
  12. Point BottomRight();
  13. Point CenterPoint();
  14. int Width();
  15. int Height();
  16. int left;
  17. int top;
  18. int right;
  19. int bottom;
  20. };
  21. #endif