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