![]() |
ULIS
dev4.0.7
Utility Library for Imaging Systems
|
The TRectangle class provides a simple 2D rectangle class for box geometry applications. More...
Public Member Functions | |
TRectangle () | |
template<typename U > | |
TRectangle (const TRectangle< U > &iOther) | |
TRectangle (T iX, T iY, T iW, T iH) | |
T | Area () const |
void | Exclusion (const TRectangle< T > &iOther, TArray< TRectangle< T > > *oResult) const |
bool | HitTest (const TVector2< T > &iV) const |
bool | InHorizontalRange (T iV) const |
bool | InVerticalRange (T iV) const |
bool | operator!= (const TRectangle< T > &iOther) const |
TRectangle< T > | operator& (const TRectangle< T > &iOther) const |
TRectangle< T > | operator- (const TRectangle< T > &iOther) const |
bool | operator== (const TRectangle< T > &iOther) const |
TRectangle< T > | operator| (const TRectangle< T > &iOther) const |
TVector2< T > | Position () const |
void | Sanitize () |
TRectangle< T > | Sanitized () const |
TRectangle< T > & | Shift (const TVector2< T > &iVec) |
TVector2< T > | Size () const |
void | TransformAffine (const FMat3F &iTransform) |
TRectangle< T > | TransformedAffine (const FMat3F &iTransform) const |
TRectangle< T > | TransformedPerspective (const FMat3F &iTransform) const |
void | TransformPerspective (const FMat3F &iTransform) |
TRectangle< T > | UnionLeaveEmpty (const TRectangle< T > &iOther) const |
Static Public Member Functions | |
static TRectangle< T > | FromMinMax (T iXMin, T iYMin, T iXMax, T iYMax) |
static TRectangle< T > | FromPositionAndSize (const TVector2< T > &iPos, const TVector2< T > &iSize) |
static TRectangle< T > | FromXYWH (T iX, T iY, T iW, T iH) |
Public Attributes | |
T | h |
T | w |
T | x |
T | y |
Static Public Attributes | |
static const TRectangle | Auto = TRectangle< T >( 0, 0, std::numeric_limits< T >::max(), std::numeric_limits< T >::max() ) |
The TRectangle class is a template class that provides basic 2D rectangle functionnalities, it can be used with any numeric types, ranging from integer values to floating point values.
The rectangle representation is stored as x, y, w, h.
|
inline |
Default constructor, initializes values to zero.
|
inline |
Constructor, from input values.
|
inline |
Construct the Rect from input Rect of any convertible type.
|
inline |
Return the area of the rect.
|
inline |
Compute exclude of this Rect with input Rect and return result array.
|
inlinestatic |
Static named maker from min max input values.
|
inlinestatic |
Static named maker from pos and size input values.
|
inlinestatic |
Static named maker from input values.
|
inline |
Collision test with TVector2.
|
inline |
Horizontal collision test with x coordinate value.
|
inline |
Vertical collision test with y coordinate value.
|
inline |
Strict inequality comparison.
|
inline |
Compute intersection of this Rect with input Rect and return result Rect.
|
inline |
Compute exclude of this Rect with input Rect and return result Rect.
|
inline |
Strict equality comparison.
|
inline |
Compute union of this Rect with input Rect and return result Rect.
|
inline |
Get x and y coordinates as vector.
|
inline |
Sanitize the Rect by setting negative sizes to zero.
|
inline |
Return the sanitized version of this rect.
|
inline |
Shift x and y coordinates by input vector.
|
inline |
Get the rectuangle size as vector.
|
inline |
Affine transform this rect by input transform ( AABB ).
|
inline |
Return the affine transformed version of this rect ( AABB ).
|
inline |
Return the perspective transformed version of this rect ( AABB ).
|
inline |
Perspective transform this rect by input transform ( AABB ).
|
inline |
Compute union of this Rect with input Rect and return result Rect, with safeguards for empty rects
|
static |
T TRectangle< T >::h |
The height of the rectangle.
T TRectangle< T >::w |
The width of the rectangle.
T TRectangle< T >::x |
The x coordinate of the rectangle.
T TRectangle< T >::y |
The y coordinate of the rectangle.