ClanLib
2.3.7
|
2D (left,top,right,bottom) rectangle structure - Float More...
#include <rect.h>
Public Member Functions | |
CL_Rectf () | |
CL_Rectf (const CL_Sizex< int > &s) | |
CL_Rectf (const CL_Sizex< float > &s) | |
CL_Rectf (float new_left, float new_top, float new_right, float new_bottom) | |
CL_Rectf (const CL_Pointx< float > &p, const CL_Sizex< float > &size) | |
CL_Rectf (const CL_Rectx< int > &rect) | |
CL_Rectf (const CL_Rectx< float > &rect) | |
CL_Rectf (const CL_Rectx< double > &rect) | |
CL_Rectf (float new_left, float new_top, const CL_Sizex< float > &size) | |
Construction | |
bool | operator== (const CL_Rectx< float > &r) const |
Rect == Rect operator. More... | |
bool | operator!= (const CL_Rectx< float > &r) const |
Rect != Rect operator. More... | |
Operations | |
CL_Rectx< float > & | set_top_left (const CL_Vec2< float > &p) |
Sets the top-left point of the rectangle. More... | |
CL_Rectx< float > & | set_top_right (const CL_Vec2< float > &p) |
Sets the top-right point of the rectangle. More... | |
CL_Rectx< float > & | set_bottom_right (const CL_Vec2< float > &p) |
Sets the bottom-right point of the rectangle. More... | |
CL_Rectx< float > & | set_bottom_left (const CL_Vec2< float > &p) |
Sets the bottom-left point of the rectangle. More... | |
CL_Rectx< float > & | set_width (floatwidth) |
Sets the width of the rectangle. More... | |
CL_Rectx< float > & | set_height (floatheight) |
Sets the height of the rectangle. More... | |
CL_Rectx< float > & | shrink (const float &left, const float &top, const float &right, const float &bottom) |
Shrink the rectangle. More... | |
CL_Rectx< float > & | shrink (const float &left_right, const float &top_bottom) |
Shrink the rectangle. More... | |
CL_Rectx< float > & | shrink (const float &shrink) |
Shrink the rectangle. More... | |
CL_Rectx< float > & | expand (const float &left, const float &top, const float &right, const float &bottom) |
Expand the rectangle. More... | |
CL_Rectx< float > & | expand (const float &left_and_right, const float &top_and_bottom) |
Expand the rectangle. More... | |
CL_Rectx< float > & | expand (const float &expand) |
Expand the rectangle. More... | |
CL_Rectx< float > & | translate (const CL_Vec2< float > &p) |
Translate the rect. More... | |
CL_Rectx< float > & | translate (const CL_Rectx< float > &p) |
Translate the rect by another rect (only uses the left and top coords). More... | |
CL_Rectx< float > & | translate (floatx, floaty) |
Translate the rect. More... | |
CL_Rectx< float > & | set_size (const CL_Sizex< float > &size) |
Sets the size of the rectangle, maintaining top/left position. More... | |
CL_Rectx< float > & | overlap (const CL_Rectx< float > &rect) |
Calculates the intersection of two rectangles. More... | |
CL_Rectx< float > & | bounding_rect (const CL_Rectx< float > &rect) |
Calculates the bounding rectangle of the rectangles. More... | |
CL_Rectx< float > & | normalize () |
Normalize rectangle. Ensures that left is less than right and top is less than bottom. More... | |
CL_Rectx< float > & | apply_alignment (CL_Origin origin, floatx, floaty) |
Applies an origin and offset pair to this rectangle. More... | |
CL_Rectx< float > & | clip (const CL_Rectx< float > &cr) |
Clip according to the specified clip rectangle. More... | |
Attributes | |
float | get_width () const |
Returns the width of the rectangle. More... | |
float | get_height () const |
Returns the height of the rectangle. More... | |
CL_Sizex< float > | get_size () const |
Returns the size of the rectangle. More... | |
bool | contains (const CL_Vec2< float > &p) const |
Returns true if the rectangle contains the point. More... | |
CL_Pointx< float > | get_top_left () const |
Returns the top-left point of the rectangle. More... | |
CL_Pointx< float > | get_top_right () const |
Returns the top-right point of the rectangle. More... | |
CL_Pointx< float > | get_bottom_right () const |
Returns the bottom-right point of the rectangle. More... | |
CL_Pointx< float > | get_bottom_left () const |
Returns the bottom-left point of the rectangle. More... | |
bool | is_overlapped (const CL_Rectx< float > &r) const |
Returns true if rectangle passed is overlapping or inside this rectangle. More... | |
bool | is_inside (const CL_Rectx< float > &r) const |
Returns true if rectangle passed is inside this rectangle. More... | |
CL_Rectx< float > | get_rot_bounds (const CL_Vec2< float > &hotspot, const CL_Angle &angle) const |
Returns another CL_Rectx<Type> containing a rotated version of this one. More... | |
CL_Rectx< float > | get_rot_bounds (CL_Origin origin, floatx, floaty, const CL_Angle &angle) const |
Returns another CL_Rectx<Type> containing a rotated version of this one. More... | |
CL_Pointx< float > | get_center () const |
Returns the center point of the rectangle. More... | |
float | left |
X1-coordinate. More... | |
float | top |
Y1-coordinate. More... | |
float | right |
X2-coordinate. More... | |
float | bottom |
Y2-coordinate. More... | |
2D (left,top,right,bottom) rectangle structure - Float
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
Applies an origin and offset pair to this rectangle.
origin | The new origin to adjust to from default upper-left position |
x,y | Offsets applied negatively to each corner of the rectangle |
|
inlineinherited |
Calculates the bounding rectangle of the rectangles.
Rect values become: min left, min top, max right, max bottom.
Clip according to the specified clip rectangle.
Returns true if the rectangle contains the point.
|
inlineinherited |
Expand the rectangle.
|
inlineinherited |
Expand the rectangle.
Expand the rectangle.
Returns the bottom-left point of the rectangle.
Returns the bottom-right point of the rectangle.
Returns the center point of the rectangle.
|
inlineinherited |
Returns the height of the rectangle.
|
inherited |
Returns another CL_Rectx<Type> containing a rotated version of this one.
hotspot | Point to rotate around. |
angle | Angle to rotate. |
|
inherited |
Returns another CL_Rectx<Type> containing a rotated version of this one.
origin | Determines the hotspot point within the rectangle |
x | Offsets applied negatively to the hotspot point |
y | Offsets applied negatively to the hotspot point |
angle | Angle |
Returns the size of the rectangle.
Returns the top-left point of the rectangle.
Returns the top-right point of the rectangle.
|
inlineinherited |
Returns the width of the rectangle.
Returns true if rectangle passed is inside this rectangle.
Returns true if rectangle passed is overlapping or inside this rectangle.
Normalize rectangle. Ensures that left is less than right and top is less than bottom.
Rect != Rect operator.
Rect == Rect operator.
Calculates the intersection of two rectangles.
Rect values become: max left, max top, min right, min bottom.
Sets the bottom-left point of the rectangle.
Sets the bottom-right point of the rectangle.
Sets the height of the rectangle.
Sets the size of the rectangle, maintaining top/left position.
Sets the top-left point of the rectangle.
Sets the top-right point of the rectangle.
Sets the width of the rectangle.
|
inlineinherited |
Shrink the rectangle.
|
inlineinherited |
Shrink the rectangle.
Shrink the rectangle.
Translate the rect.
Translate the rect by another rect (only uses the left and top coords).
Translate the rect.
|
inherited |
Y2-coordinate.
|
inherited |
X1-coordinate.
|
inherited |
X2-coordinate.
|
inherited |
Y1-coordinate.