clan::Rect Class Reference - ClanLib SDK
Description: clan::Rect Class Reference

Public Member Functions | List of all members
clan::Rect Class Reference
clanCore Math

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

`#include <rect.h>`

Inheritance diagram for clan::Rect:

## Public Member Functions
| Rect ()
| Rect (const Pointx< int > &p, const Sizex< int > &size)
| Rect (const Rectx< double > &rect)
| Rect (const Rectx< float > &rect)
| Rect (const Rectx< int > &rect)
| Rect (const Sizex< int > &s)
| Rect (int new_left, int new_top, const Sizex< int > &size)
| Rect (int new_left, int new_top, int new_right, int new_bottom)
Public Member Functions inherited from clan::Rectx< int >
| Rectx ()
| Constructs an rectangle.
Rectx< int > & | apply_alignment (Origin origin, int x, int y)
| Applies an origin and offset pair to this rectangle.
Rectx< int > & | bounding_rect (const Rectx< int > &rect)
| Calculates the bounding rectangle of the rectangles.
Rectx< int > & | clip (const Rectx< int > &cr)
| Clip according to the specified clip rectangle.
bool | contains (const Vec2< int > &p) const
| Returns true if the rectangle contains the point.
Rectx< int > & | expand (const int &expand_left, const int &expand_top, const int &expand_right, const int &expand_bottom)
| Expand the rectangle.
Pointx< int > | get_bottom_left () const
| Returns the bottom-left point outside the rectangle.
Pointx< int > | get_bottom_right () const
| Returns the bottom-right point outside the rectangle.
Pointx< int > | get_center () const
| Returns the center point of the rectangle.
int | get_height () const
| Returns the height of the rectangle.
Rectx< int > | get_rot_bounds (const Vec2< int > &hotspot, const Angle &angle) const
| Returns another Rectx<Type> containing a rotated version of this one.
Sizex< int > | get_size () const
| Returns the size of the rectangle.
Pointx< int > | get_top_left () const
| Returns the top-left point inside the rectangle.
Pointx< int > | get_top_right () const
| Returns the top-right point outside the rectangle.
int | get_width () const
| Returns the width of the rectangle.
bool | is_inside (const Rectx< int > &r) const
| Returns true if rectangle passed is inside this rectangle.
bool | is_overlapped (const Rectx< int > &r) const
| Returns true if rectangle passed is overlapping or inside this rectangle.
Rectx< int > & | normalize ()
| Normalize rectangle.
bool | operator!= (const Rectx< int > &r) const
| Rect != Rect operator.
Rectx< int > | operator* (const int &s) const
| Rect * operator.
Rectx< int > & | operator*= (const int &s)
| Rect *= operator.
bool | operator== (const Rectx< int > &r) const
| Rect == Rect operator.
Rectx< int > & | overlap (const Rectx< int > &rect)
| Calculates the intersection of two rectangles.
Rectx< int > & | set_bottom_right (const Vec2< int > &p)
| Sets the bottom-right point of the rectangle.
Rectx< int > & | set_height (int height)
| Sets the height of the rectangle.
Rectx< int > & | set_size (const Sizex< int > &size)
| Sets the size of the rectangle, maintaining top/left position.
Rectx< int > & | set_top_left (const Vec2< int > &p)
| Sets the top-left point of the rectangle.
Rectx< int > & | set_width (int width)
| Sets the width of the rectangle.
Rectx< int > & | shrink (const int &new_left, const int &new_top, const int &new_right, const int &new_bottom)
| Shrink the rectangle.
Rectx< int > & | translate (const Vec2< int > &p)
| Translate the rect.

## Additional Inherited Members
Static Public Member Functions inherited from clan::Rectx< int >
static Rectx< int > | ltrb (int left, int top, int right, int bottom)
static Rectx< int > | xywh (int x, int y, int width, int height)
Public Attributes inherited from clan::Rectx< int >
int | bottom
| Y2-coordinate (point outside the rectange).
int | left
| X1-coordinate (left point inside the rectangle).
int | right
| X2-coordinate (point outside the rectangle).
int | top
| Y1-coordinate (top point inside the rectangle).

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ Rect() [1/8]

clan::Rect::Rect | ( |  | ) |
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [2/8]

clan::Rect::Rect | ( | const Sizex< int > & | s | ) |
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [3/8]

clan::Rect::Rect | ( | int | new_left,
|  | int | new_top,
|  | int | new_right,
|  | int | new_bottom )
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [4/8]

clan::Rect::Rect | ( | const Pointx< int > & | p,
|  | const Sizex< int > & | size )
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [5/8]

clan::Rect::Rect | ( | const Rectx< int > & | rect | ) |
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [6/8]

clan::Rect::Rect | ( | const Rectx< float > & | rect | ) |
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [7/8]

clan::Rect::Rect | ( | const Rectx< double > & | rect | ) |
| inline

References clan::Rectx< int >::Rectx().

## ◆ Rect() [8/8]

clan::Rect::Rect | ( | int | new_left,
|  | int | new_top,
|  | const Sizex< int > & | size )
| inline

References clan::Rectx< int >::Rectx().

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

- rect.h