1 #ifndef __blip_Rectangle_hpp 2 #define __blip_Rectangle_hpp 28 Rectangle(
int x,
int y,
int width,
int height)
throw();
40 void reshape(
int x,
int y,
int width,
int height)
throw();
61 {
return((_width == 0) || (_height == 0)); }
64 inline int getX()
const throw()
68 inline int getY()
const throw()
91 #endif // __blip_Rectangle_hpp int getHeight() const
Get the rectangle's height.
Definition: Rectangle.hpp:76
~Rectangle()
Destructor.
Definition: Rectangle.cpp:36
Rectangle()
Construct a new Rectangle of zero size and upper-left corner located at the origin.
Definition: Rectangle.cpp:10
bool isEmpty() const
Test if the rectangle is empty, i.e., has zero width and/or height.
Definition: Rectangle.hpp:60
void merge(const Rectangle &other)
Reshape this rectangle such that it contains both its original shape and the shape of another rectang...
Definition: Rectangle.cpp:56
void reshape(int x, int y, int width, int height)
Change the shape of the rectangle.
Definition: Rectangle.cpp:43
int getY() const
Get the Y-coordinate of the rectangle's upper-left corner.
Definition: Rectangle.hpp:68
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
A rectangle in cartesian space.
Definition: Rectangle.hpp:12
int getX() const
Get the X-coordinate of the rectangle's upper-left corner.
Definition: Rectangle.hpp:64
bool intersects(const Rectangle &other) const
Test if this rectangle intersects another rectangle.
Definition: Rectangle.cpp:73
int getWidth() const
Get the rectangle's width.
Definition: Rectangle.hpp:72
void clip(const Rectangle &other)
If this rectangle intersects another, reshape it such that it consists only of the intersection of th...
Definition: Rectangle.cpp:82
bool contains(const Rectangle &other) const
Test if this rectangle completely contains another rectangle.
Definition: Rectangle.cpp:99