|
| GfRect2i () |
| Constructs an empty rectangle.
|
|
| GfRect2i (const GfVec2i &min, const GfVec2i &max) |
| Constructs a rectangle with min and max corners.
|
|
| GfRect2i (const GfVec2i &min, int width, int height) |
| Constructs a rectangle with min corner and the indicated width and height .
|
|
bool | IsNull () const |
| Returns true if the rectangle is a null rectangle.
|
|
bool | IsEmpty () const |
| Returns true if the rectangle is empty.
|
|
bool | IsValid () const |
| Return true if the rectangle is valid (equivalently, not empty).
|
|
GF_API GfRect2i | GetNormalized () const |
| Returns a normalized rectangle, i.e.
|
|
const GfVec2i & | GetMin () const |
| Returns the min corner of the rectangle.
|
|
const GfVec2i & | GetMax () const |
| Returns the max corner of the rectangle.
|
|
int | GetMinX () const |
| Return the X value of min corner.
|
|
void | SetMinX (int x) |
| Set the X value of the min corner.
|
|
int | GetMaxX () const |
| Return the X value of the max corner.
|
|
void | SetMaxX (int x) |
| Set the X value of the max corner.
|
|
int | GetMinY () const |
| Return the Y value of the min corner.
|
|
void | SetMinY (int y) |
| Set the Y value of the min corner.
|
|
int | GetMaxY () const |
| Return the Y value of the max corner.
|
|
void | SetMaxY (int y) |
| Set the Y value of the max corner.
|
|
void | SetMin (const GfVec2i &min) |
| Sets the min corner of the rectangle.
|
|
void | SetMax (const GfVec2i &max) |
| Sets the max corner of the rectangle.
|
|
GfVec2i | GetCenter () const |
| Returns the center point of the rectangle.
|
|
void | Translate (const GfVec2i &displacement) |
| Move the rectangle by displ .
|
|
unsigned long | GetArea () const |
| Return the area of the rectangle.
|
|
GfVec2i | GetSize () const |
| Returns the size of the rectangle as a vector (width,height).
|
|
int | GetWidth () const |
| Returns the width of the rectangle.
|
|
int | GetHeight () const |
| Returns the height of the rectangle.
|
|
GfRect2i | GetIntersection (const GfRect2i &that) const |
| Computes the intersection of two rectangles.
|
|
GfRect2i | Intersect (const GfRect2i &that) const |
| Computes the intersection of two rectangles.
|
|
GfRect2i | GetUnion (const GfRect2i &that) const |
| Computes the union of two rectangles.
|
|
GfRect2i | Union (const GfRect2i &that) const |
| Computes the union of two rectangles.
|
|
bool | Contains (const GfVec2i &p) const |
| Returns true if the specified point in the rectangle.
|
|
GfRect2i | operator+= (const GfRect2i &that) |
| Computes the union of two rectangles.
|
|
A 2D rectangle with integer coordinates.
A rectangle is internally represented as two corners. We refer to these as the min and max corner where the min's x-coordinate and y-coordinate are assumed to be less than or equal to the max's corresponding coordinates. Normally, it is expressed as a min corner and a size.
Note that the max corner is included when computing the size (width and height) of a rectangle as the number of integral points in the x- and y-direction. In particular, if the min corner and max corner are the same, then the width and the height of the rectangle will both be one since we have exactly one integral point with coordinates greater or equal to the min corner and less or equal to the max corner.
Specifically, width = maxX - minX + 1 and height = maxY - minY + 1.
Definition at line 60 of file rect2i.h.
Returns true if the rectangle is a null rectangle.
A null rectangle has both the width and the height set to 0, that is
int GetMinX() const
Return the X value of min corner.
int GetMaxX() const
Return the X value of the max corner.
and
int GetMinY() const
Return the Y value of the min corner.
int GetMaxY() const
Return the Y value of the max corner.
Remember that if GetMinX()
and GetMaxX()
return the same value then the rectangle has width 1, and similarly for the height.
A null rectangle is both empty, and not valid.
Definition at line 94 of file rect2i.h.