|
|
T | area () const |
| | Returns the surface area of the rectangle. |
| |
|
template<typename S > |
| RectT< S > | cast () const |
| | Cast the rectangle to different basic type. |
| |
|
Vector2T< T > | center () const |
| | Returns the center of the rectangle. |
| |
|
Vector2T< T > | clamp (const Vector2T< T > &) const |
| | Clamps the argument vector to be inside this rectangle. |
| |
|
RectT | clamp (const RectT &) const |
| | Clamps the argument rectangle to be inside this rectangle. |
| |
|
void | clear () |
| | Resets both low and high point to origin. |
| |
|
void | clear (const Vector2T< T > &v) |
| | Resets both low and high point to the given argument point. |
| |
|
bool | contains (T x, T y) const |
| | Check if the rectangle contains the given point. |
| |
|
bool | contains (Vector2T< T > v) const |
| | Check if the rectangle contains the given point. |
| |
|
bool | contains (const RectT &b) const |
| | Check if the rectangle contains the given rectangle. |
| |
| const T * | data () const |
| | Returns a pointer to the rectangle corner data. More... |
| |
| T * | data () |
| | Returns a pointer to the rectangle corner data. More... |
| |
|
T | distance (const RectT &b) const |
| | Compute the X or Y distance to the other rectangle. |
| |
|
T | distance (const Vector2T< T > &p) const |
| | Compute the X or Y distance to the given point. |
| |
|
void | expand (const Vector2T< T > &v) |
| | Expands this rectangle to include the argument point. |
| |
|
void | expand (const Vector2T< T > &v, T radius) |
| | Expands this rectangle to include the argument circle. |
| |
|
void | expand (const RectT &b) |
| | Expands this rectangle to include the argument rectangle. |
| |
| RectT | fitContent (float aspectRatio) const |
| | Fit calculate space for pictures or video to be place inside this rectangle. More... |
| |
| void | grow (T v) |
| | Increases the size of the rectangle uniformly. More... |
| |
|
void | grow (const Frame4f &b) |
| | Increases the size of the rectangle with the argument frame. |
| |
|
T | height () const |
| | Returns the height of the rectangle. |
| |
|
Vector2T< T > & | high () |
| | Returns the high X/Y vector. |
| |
|
const Vector2T< T > & | high () const |
| | Returns the high X/Y vector. |
| |
| Vector2T< T > | highLow () const |
| | Returns the high x value combined with low y value. More... |
| |
|
RectT | intersection (const RectT &) const |
| | Calculates the intersection area of two rectangles. |
| |
|
bool | intersects (const RectT &) const |
| | Check if two rectangles intersect. |
| |
|
bool | isEmpty () const |
| | Returns true if the rectangle is empty. |
| |
|
Vector2T< T > & | low () |
| | Returns the low X/Y vector. |
| |
|
const Vector2T< T > & | low () const |
| | Returns the low X/Y vector. |
| |
| Vector2T< T > | lowHigh () const |
| | Returns the low x value combined with high y value. More... |
| |
|
void | move (const Vector2T< T > &v) |
| | Translate the rectangle by v. |
| |
|
void | moveHighClamped (const Vector2T< T > &v) |
| | Translate the higher corner by v but make sure it never goes below the lower corner. |
| |
| bool | operator!= (const RectT< T > &o) const |
| | Check if two rects are not equal. More... |
| |
| bool | operator== (const RectT< T > &o) const |
| | Check if two rectangles are identical. More... |
| |
| RectT | quarter (int row, int col) const |
| | Returns one quarter of the rectangle. More... |
| |
|
| RectT (const QRectF &qrect) |
| | Convert QRectF to Nimble::RectT. |
| |
|
| RectT (const QRect &qrect) |
| | Convert QRect to Nimble::RectT. |
| |
|
| RectT (const Vector2T< T > &low, const Vector2T< T > &high) |
| | Constructs a rectangle and initializes it to the given points. |
| |
|
| RectT (const Vector2T< T > &low, const SizeT< T > &size) |
| | Constructs a rectangle and initializes it with the low point and a size. |
| |
|
| RectT (T xlow, T ylow, T xhigh, T yhigh) |
| | Constructs a rectangle and initializes it to the given points. |
| |
|
void | scale (T v) |
| | Scales the rectangle uniformly. |
| |
|
void | scale (const Vector2T< T > &v) |
| | Scales the rectangle. |
| |
|
void | set (T lx, T ly, T hx, T hy) |
| | Sets the corner to given values. |
| |
|
void | set (const Vector2T< T > &low, const Vector2T< T > &high) |
| | Sets the corner to given values. |
| |
|
void | set (const Vector2T< T > &point) |
| | Sets both corners to the given value. |
| |
|
void | setHigh (const Vector2T< T > &high) |
| | Sets the high corner. |
| |
|
void | setHighX (const T highX) |
| | Sets the x of the high corner. |
| |
|
void | setHighY (const T highY) |
| | Sets the y of the high corner. |
| |
|
void | setLow (const Vector2T< T > &low) |
| | Sets the low corner. |
| |
|
void | setLowX (const T lowX) |
| | Sets the x of the low corner. |
| |
|
void | setLowY (const T lowY) |
| | Sets the y of the low corner. |
| |
| void | shrink (T v) |
| | Uniformly shrinks the rectangle by the specified amount. More... |
| |
|
void | shrinkRelative (float xs, float ys) |
| | Scales the rectangle. |
| |
|
SizeT< T > | size () const |
| | Returns the size of the rectangle (= high - low) |
| |
|
Vector2T< T > | span () const |
| | Returns the vector between low and high corners. |
| |
| Vector2T< T > | topCenter () const |
| | Returns the top-center point of the rectangle. More... |
| |
| QRect | toQRect () const |
| | Convert the rect to QRect. More... |
| |
| QRectF | toQRectF () const |
| | Convert the rect to floating-point precision. More... |
| |
|
void | transform (const Matrix3T< T > &m) |
| | Transforms the rectangle with the given matrix. |
| |
|
T | width () const |
| | Returns the width of the rectangle. |
| |
template<typename T>
class Nimble::RectT< T >
An axis-aligned rectangle.
The ractangle is stored as a pair of 2D vectors. The vectors represent the corner points of the rectangle. The "low" vector contains the lower X/Y values while the "high" vector contains the higher X/Y values.
RectT does not really care how the coordinates are orginized (which way is up and so on). Some rare functions assume that one is using normal GUI coordinates (Y increases from top to bottom).
- Template Parameters
-
| T | Template parameter for the vectors used to describe the rectangle. |