Public Member Functions | |
DoubleRect () | |
DoubleRect (double x1, double x2, double y1, double y2) | |
DoubleRect (double x, double y, const DoubleSize &) | |
bool | is_null () const |
bool | is_empty () const |
bool | is_valid () const |
DoubleRect | normalize () const |
double | get_x1 () const |
double | get_x2 () const |
double | get_y1 () const |
double | get_y2 () const |
void | set_x1 (double) |
void | set_x2 (double) |
void | set_y1 (double) |
void | set_y2 (double) |
DoublePoint | center () const |
void | move_x (double x) |
void | move_y (double y) |
void | move (double x, double y) |
void | move_by (double dx, double dy) |
void | move_center (const DoublePoint &) |
void | move_center (double dx, double dy) |
void | set_rect (double x1, double x2, double y1, double y2) |
double | get_width () const |
double | get_height () const |
DoubleSize | size () const |
void | set_width (double w) |
void | set_height (double h) |
void | set_size (const DoubleSize &) |
DoubleRect | operator| (const DoubleRect &r) const |
DoubleRect | operator & (const DoubleRect &r) const |
DoubleRect & | operator|= (const DoubleRect &r) |
DoubleRect & | operator &= (const DoubleRect &r) |
bool | operator== (const DoubleRect &) const |
bool | operator!= (const DoubleRect &) const |
bool | contains (const DoublePoint &p, bool proper=false) const |
bool | contains (double x, double y, bool proper=false) const |
bool | contains (const DoubleRect &r, bool proper=false) const |
DoubleRect | unite (const DoubleRect &) const |
DoubleRect | intersect (const DoubleRect &) const |
bool | intersects (const DoubleRect &) const |
|
Constructs an rectangle with all components set to 0.0.
|
|
Constructs an rectangle with x1 to x2 as x-range and, y1 to y2 as y-range. |
|
Constructs an rectangle with x1 to x1 + size.width() as x-range and, y1 to y1 + size.height() as y-range. |
|
Returns the center point of the rectangle.
|
|
Returns TRUE if the rectangle other is inside this rectangle; otherwise returns FALSE. If proper is TRUE, this function returns TRUE only if other is entirely inside (not on the edge). |
|
Returns TRUE if the point (x, y) is inside or on the edge of the rectangle; otherwise returns FALSE. If proper is TRUE, this function returns TRUE only if p is inside (not on the edge). |
|
Returns TRUE if the point p is inside or on the edge of the rectangle; otherwise returns FALSE. If proper is TRUE, this function returns TRUE only if p is inside (not on the edge). |
|
Returns the height.
|
|
Returns the width.
|
|
Returns x1.
|
|
Returns x2.
|
|
Returns y1.
|
|
Returns y2.
|
|
Returns the intersection of this rectangle and rectangle other. r.intersect(s) is equivalent to r&s. |
|
Returns TRUE if this rectangle intersects with rectangle other; otherwise returns FALSE. |
|
Returns TRUE if the rectangle is a empty rectangle; otherwise returns false. A rect is null when x1() >= x2() && y1() >= y2(). |
|
Returns TRUE if the rectangle is a null rectangle; otherwise returns false. A rect is null when x1() == x2() && y1() == y2(). |
|
Returns TRUE if the rectangle is a valid rectangle; otherwise returns false. A rect is valid when x1() <= x2() && y1() <= y2(). |
|
moves x1() to x and y1() to y, leaving the size unchanged
|
|
moves x1() by dx and y1() by dy. leaving the size unchanged
|
|
moves the center to (x, y), leaving the size unchanged
|
|
moves the center to pos, leaving the size unchanged
|
|
moves x1() to x, leaving the size unchanged
|
|
moves y1() to y, leaving the size unchanged
|
|
Returns a normalized rectangle, i.e. a rectangle that has a non-negative width and height. It swaps x1 and x2 if x1() > x2(), and swaps y1 and y2 if y1() > y2(). |
|
Returns the intersection of this rectangle and rectangle other. Returns an empty rectangle if there is no intersection. |
|
Intersects this rectangle with rectangle other.
|
|
Returns TRUE if this rect and other are different; otherwise returns FALSE.
|
|
Returns TRUE if this rect and other are equal; otherwise returns FALSE.
|
|
Returns the bounding rectangle of this rectangle and rectangle other. The bounding rectangle of a nonempty rectangle and an empty or invalid rectangle is defined to be the nonempty rectangle. |
|
Unites this rectangle with rectangle other.
|
|
Set the height, by y2 = y1 + h;.
|
|
Set the x-range from x1 to x2 and the y-range from y1 to y2. |
|
Sets the size of the rectangle to size. Changes x2 and y2 only. |
|
Set the width, by x2 = x1 + w;.
|
|
Set x1.
|
|
Set x2.
|
|
Set y1.
|
|
Set y2.
|
|
Returns the size.
|
|
Returns the bounding rectangle of this rectangle and rectangle other. r.unite(s) is equivalent to r|s. |