85 {
X = x_position;
return *
this;}
100 {
Y = y_position;
return *
this;}
110 std::ostream&
operator<< (std::ostream& stream,
const Point_2D& point);
148 Size_2D (
const unsigned int& side);
199 inline unsigned long area ()
const
210 std::ostream&
operator<< (std::ostream& stream,
const Size_2D& size);
257 const unsigned int width = 0,
258 const unsigned int height = 0
349 const unsigned int width,
379 std::ostream&
operator<< (std::ostream& stream,
const Rectangle& rectangle);
std::ostream & operator<<(std::ostream &stream, const Point_2D &point)
Print a Point_2D description to an output stream.
Definition: Dimensions.cc:80
Definition: Dimensions.cc:30
A Point_2D holds 2-dimensional position information.
Definition: Dimensions.hh:40
int x() const
Get the horizontal (x-axis) position.
Definition: Dimensions.hh:76
Point_2D()
Constructs a point at position 0,0.
Definition: Dimensions.cc:39
Point_2D & y(const int &y_position)
Set the vertical (y-axis) position.
Definition: Dimensions.hh:99
int y() const
Get the vertical (y-axis) position.
Definition: Dimensions.hh:91
int X
The horizontal (x-axis) position of the point.
Definition: Dimensions.hh:43
Point_2D & x(const int &x_position)
Set the horizontal (x-axis) position.
Definition: Dimensions.hh:84
int Y
The vertical (y-axis) position of the point.
Definition: Dimensions.hh:46
Point_2D & operator=(const Point_2D &point)
Assign the position of another point to this point.
Definition: Dimensions.cc:66
A Rectangle is a position with a size.
Definition: Dimensions.hh:223
Rectangle & operator=(const Rectangle &rectangle)
Assign the position and size of another rectangle to this rectangle.
Definition: Dimensions.cc:205
Rectangle()
Constructs an empty rectangle.
Definition: Dimensions.cc:159
Point_2D position() const
Get the rectangle position.
Definition: Dimensions.hh:283
Rectangle & size(const unsigned int width, const unsigned int height)
Set the width,height of the rectangle.
Definition: Dimensions.hh:348
Size_2D size() const
Get the rectangle size.
Definition: Dimensions.hh:323
Rectangle & operator&=(const Rectangle &rectangle)
Take the intersection with another rectangle.
Definition: Dimensions.cc:222
Rectangle & position(const Point_2D &point)
Set the position of the rectangle.
Definition: Dimensions.hh:292
Rectangle & position(const int x, const int y)
Set the x,y position of the rectangle.
Definition: Dimensions.hh:308
Rectangle & size(const Size_2D &size)
Set the size of the rectangle.
Definition: Dimensions.hh:332
A Size_2D holds 2-dimensional size information.
Definition: Dimensions.hh:119
Size_2D & width(const unsigned int &width)
Set the width of the size.
Definition: Dimensions.hh:177
Size_2D & height(const unsigned int &height)
Set the height of the size.
Definition: Dimensions.hh:192
unsigned long area() const
Get the area of this size.
Definition: Dimensions.hh:199
Size_2D & operator=(const Size_2D &size)
Assign the size of another size to this size.
Definition: Dimensions.cc:130
Size_2D()
Constructs an empty 2D size.
Definition: Dimensions.cc:95
unsigned int width() const
Get the width of the size.
Definition: Dimensions.hh:169
unsigned int Height
The height of the 2D size.
Definition: Dimensions.hh:125
unsigned int Width
The width of the 2D size.
Definition: Dimensions.hh:122
unsigned int height() const
Get the height of the size.
Definition: Dimensions.hh:184