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

#include <rect.h>

+ Inheritance diagram for clan::Rectf:

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

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

Constructor & Destructor Documentation

◆ Rectf() [1/9]

clan::Rectf::Rectf ( )
inline

◆ Rectf() [2/9]

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

◆ Rectf() [3/9]

clan::Rectf::Rectf ( const Sizex< float > & s)
inline

◆ Rectf() [4/9]

clan::Rectf::Rectf ( float new_left,
float new_top,
float new_right,
float new_bottom )
inline

◆ Rectf() [5/9]

clan::Rectf::Rectf ( const Pointx< float > & p,
const Sizex< float > & size )
inline

◆ Rectf() [6/9]

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

◆ Rectf() [7/9]

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

◆ Rectf() [8/9]

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

◆ Rectf() [9/9]

clan::Rectf::Rectf ( float new_left,
float new_top,
const Sizex< float > & size )
inline

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