fork download
  1. #ifndef _RECTANGLE_HPP_
  2. #define _RECTANGLE_HPP_
  3.  
  4. /*****************************************************************************/
  5.  
  6. #include "point.hpp"
  7. /*****************************************************************************/
  8. class Rectangle
  9. {
  10. public:
  11. Rectangle(Point TopLeft, Point BottomRight);
  12. Rectangle(Point TopLeft, double Width, double Height);
  13. double getPerimeter();
  14. double getArea();
  15. bool contains(Point _p);
  16. bool contains(Point _p1, Point _p2);
  17. bool intersects(const Rectangle & _r);
  18. bool covers(const Rectangle & _r);
  19. private:
  20. Point TopLeft, TopRight, BottomLeft, BottomRight;
  21. double Width, Height;
  22. };
  23. inline Point getTopLeft() const
  24. {
  25. return TopLeft;
  26. }
  27. inline Point getTopRight() const
  28. {
  29. return TopRight;
  30. }
  31. inline Point getBottomLeft() const
  32. {
  33. return BottomLeft;
  34. }
  35. inline Point getBottomRight() const
  36. {
  37. return BottomRight;
  38. }
  39. inline double getWidth() const
  40. {
  41. return Width;
  42. }
  43. inline double getHeight() const
  44. {
  45. return Height;
  46. }
  47.  
  48. // ... TODO
  49.  
  50. /*------------------------------------------------------------------*/
  51. bool operator == (Rectangle const& _p) const;
  52. bool operator != (Rectangle const& _p) const;
  53. /*****************************************************************************/
  54.  
  55. #endif // _RECTANGLE_HPP_
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:21: fatal error: point.hpp: No such file or directory
compilation terminated.
stdout
Standard output is empty