Isle
|
[AI] 2D rectangle class templated on its value type. More...
#include <mxgeometry.h>
Public Member Functions | |
MxRect () | |
[AI] Default constructor, does not initialize rectangle. More... | |
MxRect (const MxRect &p_r) | |
[AI] Copy constructor. More... | |
MxRect (T p_l, T p_t, T p_r, T p_b) | |
[AI] Construct from coordinates. More... | |
MxRect (const MxPoint< T > &p_p, const MxSize< T > &p_s) | |
[AI] Construct from point and size. More... | |
T | GetLeft () const |
[AI] Get the left edge. More... | |
void | SetLeft (T p_left) |
[AI] Set the left edge. More... | |
T | GetTop () const |
[AI] Get the top edge. More... | |
void | SetTop (T p_top) |
[AI] Set the top edge. More... | |
T | GetRight () const |
[AI] Get the right edge. More... | |
void | SetRight (T p_right) |
[AI] Set the right edge. More... | |
T | GetBottom () const |
[AI] Get the bottom edge. More... | |
void | SetBottom (T p_bottom) |
[AI] Set the bottom edge. More... | |
T | GetWidth () const |
[AI] Get the rectangle's width. More... | |
T | GetHeight () const |
[AI] Get the rectangle's height. More... | |
MxPoint< T > | GetLT () const |
[AI] Get the top-left point of the rectangle. More... | |
MxPoint< T > | GetRB () const |
[AI] Get the bottom-right point of the rectangle. More... | |
MxBool | Empty () const |
[AI] Returns whether the rectangle is empty or not. More... | |
MxBool | Contains (const MxPoint< T > &p_p) const |
[AI] Test whether a point is inside the rectangle (inclusive). More... | |
MxBool | Intersects (const MxRect &p_r) const |
[AI] Returns whether this rectangle intersects another. More... | |
void | operator= (const MxRect &p_r) |
[AI] Assignment operator. More... | |
MxBool | operator== (const MxRect &p_r) const |
[AI] Equality operator. More... | |
MxBool | operator!= (const MxRect &p_r) const |
[AI] Inequality operator. More... | |
void | operator+= (const MxPoint< T > &p_p) |
[AI] Translate the rectangle by a point, in-place. More... | |
void | operator-= (const MxPoint< T > &p_p) |
[AI] Translate the rectangle by the negative of a point, in-place. More... | |
void | operator&= (const MxRect &p_r) |
[AI] Intersect rectangle in-place with another. More... | |
void | operator|= (const MxRect &p_r) |
[AI] Unites this rectangle with another in-place. More... | |
MxRect | operator+ (const MxPoint< T > &p_p) const |
[AI] Returns a translated rectangle. More... | |
MxRect | operator- (const MxPoint< T > &p_p) const |
[AI] Returns a translated rectangle (by negative). More... | |
MxRect | operator& (const MxRect &p_r) const |
[AI] Returns the intersection of this rectangle and another. More... | |
MxRect | operator| (const MxRect &p_r) const |
[AI] Returns the bounding rectangle (union) of this and another. More... | |
Protected Attributes | |
T | m_left |
[AI] Left edge (minimum x). More... | |
T | m_top |
[AI] Top edge (minimum y). More... | |
T | m_right |
[AI] Right edge (maximum x). More... | |
T | m_bottom |
[AI] Bottom edge (maximum y). More... | |
[AI] 2D rectangle class templated on its value type.
[AI] Represents a rectangular region using left/top/right/bottom coordinates.
T | [AI] Underlying type for coordinates (e.g., int, float, etc.) |
Definition at line 165 of file mxgeometry.h.
[AI] Default constructor, does not initialize rectangle.
Definition at line 176 of file mxgeometry.h.
[AI] Copy constructor.
p_r | [AI] Rectangle to copy. |
Definition at line 182 of file mxgeometry.h.
[AI] Construct from coordinates.
p_l | [AI] Left. |
p_t | [AI] Top. |
p_r | [AI] Right. |
p_b | [AI] Bottom. |
Definition at line 197 of file mxgeometry.h.
[AI] Construct from point and size.
p_p | [AI] Top-left point. |
p_s | [AI] Size. |
Definition at line 210 of file mxgeometry.h.
[AI] Test whether a point is inside the rectangle (inclusive).
p_p | [AI] Point to check. |
Definition at line 290 of file mxgeometry.h.
[AI] Returns whether the rectangle is empty or not.
[AI] Returns true if left >= right or top >= bottom.
Definition at line 284 of file mxgeometry.h.
|
inline |
[AI] Get the bottom edge.
Definition at line 251 of file mxgeometry.h.
|
inline |
[AI] Get the rectangle's height.
[AI] (bottom - top + 1)
Definition at line 268 of file mxgeometry.h.
|
inline |
[AI] Get the left edge.
Definition at line 221 of file mxgeometry.h.
[AI] Get the top-left point of the rectangle.
Definition at line 273 of file mxgeometry.h.
[AI] Get the bottom-right point of the rectangle.
Definition at line 278 of file mxgeometry.h.
|
inline |
[AI] Get the right edge.
Definition at line 241 of file mxgeometry.h.
|
inline |
[AI] Get the top edge.
Definition at line 231 of file mxgeometry.h.
|
inline |
[AI] Get the rectangle's width.
[AI] (right - left + 1)
Definition at line 262 of file mxgeometry.h.
[AI] Returns whether this rectangle intersects another.
p_r | [AI] Rectangle to test. |
Definition at line 299 of file mxgeometry.h.
[AI] Inequality operator.
p_r | [AI] Rectangle to compare. |
Definition at line 329 of file mxgeometry.h.
[AI] Returns the intersection of this rectangle and another.
p_r | [AI] Rectangle to intersect. |
Definition at line 403 of file mxgeometry.h.
[AI] Intersect rectangle in-place with another.
[AI] Produces the intersection of this rectangle with another (the overlapping area).
p_r | [AI] Rectangle to intersect with. |
Definition at line 360 of file mxgeometry.h.
[AI] Returns a translated rectangle.
p_p | [AI] Amount to translate by. |
Definition at line 385 of file mxgeometry.h.
[AI] Translate the rectangle by a point, in-place.
p_p | [AI] Point to add to corners. |
Definition at line 335 of file mxgeometry.h.
[AI] Returns a translated rectangle (by negative).
p_p | [AI] Amount to translate by. |
Definition at line 394 of file mxgeometry.h.
[AI] Translate the rectangle by the negative of a point, in-place.
p_p | [AI] Point to subtract from corners. |
Definition at line 347 of file mxgeometry.h.
[AI] Assignment operator.
p_r | [AI] Rectangle to copy. |
Definition at line 308 of file mxgeometry.h.
[AI] Equality operator.
p_r | [AI] Rectangle to compare. |
Definition at line 320 of file mxgeometry.h.
[AI] Returns the bounding rectangle (union) of this and another.
p_r | [AI] Rectangle to unite. |
Definition at line 417 of file mxgeometry.h.
[AI] Unites this rectangle with another in-place.
[AI] Produces the bounding rectangle covering both.
p_r | [AI] Rectangle to unite with. |
Definition at line 373 of file mxgeometry.h.
|
inline |
[AI] Set the bottom edge.
p_bottom | [AI] Value to set. |
Definition at line 256 of file mxgeometry.h.
|
inline |
[AI] Set the left edge.
p_left | [AI] Value to set. |
Definition at line 226 of file mxgeometry.h.
|
inline |
[AI] Set the right edge.
p_right | [AI] Value to set. |
Definition at line 246 of file mxgeometry.h.
|
inline |
[AI] Set the top edge.
p_top | [AI] Value to set. |
Definition at line 236 of file mxgeometry.h.
|
protected |
[AI] Bottom edge (maximum y).
Definition at line 170 of file mxgeometry.h.
|
protected |
[AI] Left edge (minimum x).
Definition at line 167 of file mxgeometry.h.
|
protected |
[AI] Right edge (maximum x).
Definition at line 169 of file mxgeometry.h.
|
protected |
[AI] Top edge (minimum y).
Definition at line 168 of file mxgeometry.h.