2D (left,top,right,bottom) rectangle structure. More...
#include <line.h>
Public Member Functions | |
template<> | |
Rectx (const Rectx< float > &rect) | |
template<> | |
Rectx (const Rectx< double > &rect) | |
Construction | |
Rectx () | |
Constructs an rectangle. More... | |
Rectx (const Sizex< Type > &s) | |
Constructs an rectangle. More... | |
Rectx (Type new_left, Type new_top, Type new_right, Type new_bottom) | |
Constructs an rectangle. More... | |
Rectx (const Pointx< Type > &p, const Sizex< Type > &size) | |
Constructs an rectangle. More... | |
Rectx (Type new_left, Type new_top, const Sizex< Type > &size) | |
Constructs an rectangle. More... | |
Rectx (const Rectx< int > &rect) | |
Constructs an rectangle. More... | |
Rectx (const Rectx< float > &rect) | |
Constructs an rectangle. More... | |
Rectx (const Rectx< double > &rect) | |
Constructs an rectangle. More... | |
bool | operator== (const Rectx< Type > &r) const |
Rect == Rect operator. More... | |
bool | operator!= (const Rectx< Type > &r) const |
Rect != Rect operator. More... | |
Operations | |
Rectx< Type > & | set_top_left (const Vec2< Type > &p) |
Sets the top-left point of the rectangle. More... | |
Rectx< Type > & | set_width (Type width) |
Sets the width of the rectangle. More... | |
Rectx< Type > & | set_height (Type height) |
Sets the height of the rectangle. More... | |
Rectx< Type > & | shrink (const Type &left, const Type &top, const Type &right, const Type &bottom) |
Shrink the rectangle. More... | |
Rectx< Type > & | shrink (const Type &left_right, const Type &top_bottom) |
Shrink the rectangle. More... | |
Rectx< Type > & | shrink (const Type &shrink) |
Shrink the rectangle. More... | |
Rectx< Type > & | expand (const Type &left, const Type &top, const Type &right, const Type &bottom) |
Expand the rectangle. More... | |
Rectx< Type > & | expand (const Type &left_and_right, const Type &top_and_bottom) |
Expand the rectangle. More... | |
Rectx< Type > & | expand (const Type &expand) |
Expand the rectangle. More... | |
Rectx< Type > & | translate (const Vec2< Type > &p) |
Translate the rect. More... | |
Rectx< Type > & | translate (const Sizex< Type > &p) |
Translate the rect. More... | |
Rectx< Type > & | translate (const Rectx< Type > &p) |
Translate the rect by another rect (only uses the left and top coords). More... | |
Rectx< Type > & | translate (Type x, Type y) |
Translate the rect. More... | |
Rectx< Type > & | set_size (const Sizex< Type > &size) |
Sets the size of the rectangle, maintaining top/left position. More... | |
Rectx< Type > & | overlap (const Rectx< Type > &rect) |
Calculates the intersection of two rectangles. More... | |
Rectx< Type > & | bounding_rect (const Rectx< Type > &rect) |
Calculates the bounding rectangle of the rectangles. More... | |
Rectx< Type > & | normalize () |
Normalize rectangle. More... | |
Rectx< Type > & | apply_alignment (Origin origin, Type x, Type y) |
Applies an origin and offset pair to this rectangle. More... | |
Rectx< Type > & | clip (const Rectx< Type > &cr) |
Clip according to the specified clip rectangle. More... | |
Attributes | |
Type | left |
X1-coordinate (left point inside the rectangle) More... | |
Type | top |
Y1-coordinate (top point inside the rectangle) More... | |
Type | right |
X2-coordinate (point outside the rectangle) More... | |
Type | bottom |
Y2-coordinate (point outside the rectange) More... | |
Type | get_width () const |
Returns the width of the rectangle. More... | |
Type | get_height () const |
Returns the height of the rectangle. More... | |
Sizex< Type > | get_size () const |
Returns the size of the rectangle. More... | |
bool | contains (const Vec2< Type > &p) const |
Returns true if the rectangle contains the point. More... | |
Pointx< Type > | get_top_left () const |
Returns the top-left point inside the rectangle. More... | |
Pointx< Type > | get_top_right () const |
Returns the top-right point outside the rectangle. More... | |
Pointx< Type > | get_bottom_right () const |
Returns the bottom-right point outside the rectangle. More... | |
Pointx< Type > | get_bottom_left () const |
Returns the bottom-left point outside the rectangle. More... | |
bool | is_overlapped (const Rectx< Type > &r) const |
Returns true if rectangle passed is overlapping or inside this rectangle. More... | |
bool | is_inside (const Rectx< Type > &r) const |
Returns true if rectangle passed is inside this rectangle. More... | |
Rectx< Type > | get_rot_bounds (const Vec2< Type > &hotspot, const Angle &angle) const |
Returns another Rectx<Type> containing a rotated version of this one. More... | |
Rectx< Type > | get_rot_bounds (Origin origin, Type x, Type y, const Angle &angle) const |
Returns another Rectx<Type> containing a rotated version of this one. More... | |
Pointx< Type > | get_center () const |
Returns the center point of the rectangle. More... | |
2D (left,top,right,bottom) rectangle structure.
These line templates are defined for: int (Rect), float (Rectf), double (Rectd)
|
inline |
|
inline |