210 inline bool isNull()
const;
220Rect
operator||(
const Rect & rectA,
const Rect & rectB);
229Rect
operator&&(
const Rect & rectA,
const Rect & rectB);
The Point structure. @copyright This source code is part of the Board project, a C++ library whose pu...
std::ostream & operator<<(std::ostream &out, const LibBoard::Rect &rect)
Definition Rect.cpp:142
Rect operator&&(const Rect &rectA, const Rect &rectB)
Definition Rect.cpp:57
Rect operator||(const Rect &rectA, const Rect &rectB)
Definition Rect.cpp:32
Struct representing a 2D point.
Definition Point.h:42
Struct representing a rectangle on the plane.
Definition Rect.h:40
Rect(Point topLeft, Point bottomRight)
Definition Rect.h:71
Point topLeft() const
topLeft Top-left point of the rectangle
Definition Rect.h:77
bool contains(Point p) const
Check whether or not a point is contained in the rectangle (including its border)
Definition Rect.cpp:104
Point bottomLeft() const
bottomLeft Bottom-left point of the rectangle
Definition Rect.h:89
bool strictlyIntersects(const Rect &other) const
Check whether the rectangle strictly intersects another rectangle.
Definition Rect.cpp:120
double diameter() const
diameter
Definition Rect.h:143
bool isNull() const
Check if a rectangle is null (i.e., zero sized)
Definition Rect.h:248
double bottom() const
The y coordinate of the bottom of the rectangle.
Definition Rect.h:131
double height
Definition Rect.h:44
Rect(double left=0.0, double top=0.0, double width=0.0, double height=0.0)
Definition Rect.h:54
Point centerRight() const
centerRight The center of the right border of the rectangle
Definition Rect.h:113
Rect & grow(double margin)
Grow the rectangle by a given distance (margin) in each direction.
Definition Rect.cpp:126
Point centerTop() const
centerTop The center of the top border of the rectangle
Definition Rect.h:119
double right() const
The x coordinate of the right side of the rectangle.
Definition Rect.h:137
bool intersects(const Rect &other) const
Check whether the rectangle intersects another rectangle.
Definition Rect.cpp:114
Point centerLeft() const
centerLeft The center of the left border of the rectangle
Definition Rect.h:107
Point bottomRight() const
bottomRight Bottom-right point of the rectangle
Definition Rect.h:95
double width
Definition Rect.h:43
Rect(Point topLeft, double width=0.0, double height=0.0)
Definition Rect.h:63
Point centerBottom() const
centerBottom The center of the bottom border of the rectangle
Definition Rect.h:125
double left
Definition Rect.h:41
void clear()
Set to a rectangle with zero width and height at position (0,0)
Definition Rect.h:148
double top
Definition Rect.h:42
bool strictlyContains(Point p) const
Check whether or not a point is strictly contained in the rectangle.
Definition Rect.cpp:109
Point topRight() const
topRight Top-right point of the rectangle
Definition Rect.h:83
Rect growed(double margin)
Return the rectangle growed by a given distance (margin) in each direction.
Definition Rect.cpp:135
Point center() const
center The center of the rectangle
Definition Rect.h:101
Rect & growToContain(const Point &p)
Grow the rectangle so that it contains the point p.
Definition Rect.cpp:77