uicore::Rect Class Reference

2D (left,top,right,bottom) rectangle structure - Integer More...

#include <rect.h>

+ Inheritance diagram for uicore::Rect:

Public Member Functions

 Rect ()
 
 Rect (const Sizex< int > &s)
 
 Rect (int new_left, int new_top, int new_right, int new_bottom)
 
 Rect (const Pointx< int > &p, const Sizex< int > &size)
 
 Rect (const Rectx< int > &rect)
 
 Rect (const Rectx< float > &rect)
 
 Rect (const Rectx< double > &rect)
 
 Rect (int new_left, int new_top, const Sizex< int > &size)
 
- Public Member Functions inherited from uicore::Rectx< int >
 Rectx ()
 Constructs an rectangle. More...
 
 Rectx (const Sizex< int > &s)
 Constructs an rectangle. More...
 
 Rectx (int new_left, int new_top, int new_right, int new_bottom)
 Constructs an rectangle. More...
 
 Rectx (const Pointx< int > &p, const Sizex< int > &size)
 Constructs an rectangle. More...
 
 Rectx (int new_left, int new_top, const Sizex< int > &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...
 
Rectx< int > & apply_alignment (Origin origin, int x, int y)
 Applies an origin and offset pair to this rectangle. More...
 
Pointx< int > bottom_left () const
 Returns the bottom-left point outside the rectangle. More...
 
Pointx< int > bottom_right () const
 Returns the bottom-right point outside the rectangle. More...
 
Rectx< int > & bounding_rect (const Rectx< int > &rect)
 Calculates the bounding rectangle of the rectangles. More...
 
Pointx< int > center () const
 Returns the center point of the rectangle. More...
 
Rectx< int > & clip (const Rectx< int > &cr)
 Clip according to the specified clip rectangle. More...
 
bool contains (const Vec2< int > &p) const
 Returns true if the rectangle contains the point. More...
 
Rectx< int > & expand (const int &expand_left, const int &expand_top, const int &expand_right, const int &expand_bottom)
 Expand the rectangle. More...
 
Rectx< int > & expand (const int &left_and_right, const int &top_and_bottom)
 Expand the rectangle. More...
 
Rectx< int > & expand (const int &expand)
 Expand the rectangle. More...
 
int height () const
 Returns the height of the rectangle. More...
 
bool is_inside (const Rectx< int > &r) const
 Returns true if rectangle passed is inside this rectangle. More...
 
bool is_overlapped (const Rectx< int > &r) const
 Returns true if rectangle passed is overlapping or inside this rectangle. More...
 
Rectx< int > & normalize ()
 Normalize rectangle. More...
 
bool operator!= (const Rectx< int > &r) const
 Rect != Rect operator. More...
 
Rectx< int > operator* (const int &s) const
 Rect * operator. More...
 
Rectx< int > & operator*= (const int &s)
 Rect *= operator. More...
 
bool operator== (const Rectx< int > &r) const
 Rect == Rect operator. More...
 
Rectx< int > & overlap (const Rectx< int > &rect)
 Calculates the intersection of two rectangles. More...
 
Pointx< int > position () const
 Returns the position of the rectangle. More...
 
Rectx< int > rot_bounds (const Vec2< int > &hotspot, float angle) const
 Returns another Rectx<Type> containing a rotated version of this one. More...
 
Rectx< int > rot_bounds (Origin origin, int x, int y, float angle) const
 Returns another Rectx<Type> containing a rotated version of this one. More...
 
Rectx< int > & set_height (int height)
 Sets the height of the rectangle. More...
 
Rectx< int > & set_position (const Vec2< int > &p)
 Sets the position of the rectangle. More...
 
Rectx< int > & set_size (const Sizex< int > &size)
 Sets the size of the rectangle, maintaining top/left position. More...
 
Rectx< int > & set_width (int width)
 Sets the width of the rectangle. More...
 
Rectx< int > & shrink (const int &new_left, const int &new_top, const int &new_right, const int &new_bottom)
 Shrink the rectangle. More...
 
Rectx< int > & shrink (const int &left_right, const int &top_bottom)
 Shrink the rectangle. More...
 
Rectx< int > & shrink (const int &shrink)
 Shrink the rectangle. More...
 
Sizex< int > size () const
 Returns the size of the rectangle. More...
 
Pointx< int > top_left () const
 Returns the top-left point inside the rectangle. More...
 
Pointx< int > top_right () const
 Returns the top-right point outside the rectangle. More...
 
Rectx< int > & translate (const Vec2< int > &p)
 Translate the rect. More...
 
Rectx< int > & translate (const Sizex< int > &p)
 Translate the rect. More...
 
Rectx< int > & translate (const Rectx< int > &p)
 Translate the rect by another rect (only uses the left and top coords). More...
 
Rectx< int > & translate (int x, int y)
 Translate the rect. More...
 
int width () const
 Returns the width of the rectangle. More...
 
int x () const
 X position of rectangle. More...
 
int y () const
 Y position of rectangle. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from uicore::Rectx< int >
static Rectx< int > ltrb (int left, int top, int right, int bottom)
 
static Rectx< int > wh (int width, int height)
 
static Rectx< int > wh (const Sizex< int > &size)
 
static Rectx< int > xywh (int x, int y, int width, int height)
 
static Rectx< int > xywh (const Pointx< int > &pos, const Sizex< int > &size)
 
- Public Attributes inherited from uicore::Rectx< int >
int bottom
 Y2-coordinate (point outside the rectange) More...
 
int left
 X1-coordinate (left point inside the rectangle) More...
 
int right
 X2-coordinate (point outside the rectangle) More...
 
int top
 Y1-coordinate (top point inside the rectangle) More...
 

Detailed Description

2D (left,top,right,bottom) rectangle structure - Integer

Constructor & Destructor Documentation

uicore::Rect::Rect ( )
inline
uicore::Rect::Rect ( const Sizex< int > &  s)
inline
uicore::Rect::Rect ( int  new_left,
int  new_top,
int  new_right,
int  new_bottom 
)
inline
uicore::Rect::Rect ( const Pointx< int > &  p,
const Sizex< int > &  size 
)
inline
uicore::Rect::Rect ( const Rectx< int > &  rect)
inline
uicore::Rect::Rect ( const Rectx< float > &  rect)
inline
uicore::Rect::Rect ( const Rectx< double > &  rect)
inline
uicore::Rect::Rect ( int  new_left,
int  new_top,
const Sizex< int > &  size 
)
inline

The documentation for this class was generated from the following file: