2D quad structure - Integer More...

#include <quad.h>

+ Inheritance diagram for clan::Quad:

Public Member Functions

 Quad ()
 
 Quad (const Vec2< int > &new_p, const Vec2< int > &new_q, const Vec2< int > &new_r, const Vec2< int > &new_s)
 
 Quad (const Rect &rect)
 
 Quad (const Quadx< int > &quad)
 
Construction
Quadx< int > & operator+= (const Quadx< int > &quad)
 Quad += Quad operator. More...
 
Quadx< int > & operator+= (const Vec2< int > &point)
 Quad += Point operator. More...
 
Quadx< int > & operator-= (const Quadx< int > &quad)
 Quad -= Quad operator. More...
 
Quadx< int > & operator-= (const Vec2< int > &point)
 Quad -= Point operator. More...
 
Quadx< int > operator+ (const Quadx< int > &quad) const
 Quad + Quad operator. More...
 
Quadx< int > operator+ (const Vec2< int > &point) const
 Quad + Point operator. More...
 
Quadx< int > operator- (const Quadx< int > &quad) const
 Quad - Quad operator. More...
 
Quadx< int > operator- (const Vec2< int > &point) const
 Quad - Point operator. More...
 
bool operator== (const Quadx< int > &quad) const
 Quad == Quad operator. More...
 
bool operator!= (const Quadx< int > &quad) const
 Quad != Quad operator. More...
 
Operations
Quadx< int > & rotate (const Vec2< int > &hotspot, const Angle &angle)
 Rotates the Quad. More...
 
Quadx< int > & scale (float sx, float sy)
 Scale the Quad. More...
 
Quadx< int > & scale (const Vec2< int > &hotspot, float sx, float sy)
 Scale the Quad. More...
 
Vec2< int > center () const
 Returns the center point of the quad. More...
 
Quadx< int > & apply_alignment (Origin origin, intx, inty)
 Applies an origin and offset pair to this rectangle. More...
 
bool is_inside (const Vec2< int > &point) const
 Check if a point is inside or outside the quad. More...
 

Attributes

int get_width () const
 Returns the width of the quad. More...
 
int get_height () const
 Returns the height of the quad. More...
 
Sizex< int > get_size () const
 Returns the size of the rectangle. More...
 
Rect get_bounds () const
 Returns the bounding box of the quad as a Rect. More...
 
Vec2< int > p
 First Point. More...
 
Vec2< int > q
 Second Point. More...
 
Vec2< int > r
 Third Point. More...
 
Vec2< int > s
 Fourth Point. More...
 

Detailed Description

2D quad structure - Integer

Member Function Documentation

Quadx<int >& clan::Quadx< int >::apply_alignment ( Origin  origin,
int  x,
int  y 
)
inherited

Applies an origin and offset pair to this rectangle.

Parameters
originThe new origin to adjust to from default upper-left position
x,yOffsets applied negatively to each corner of the rectangle
Returns
reference to this object
Vec2<int > clan::Quadx< int >::center ( ) const
inherited

Returns the center point of the quad.

Rect clan::Quadx< int >::get_bounds ( ) const
inherited

Returns the bounding box of the quad as a Rect.

int clan::Quadx< int >::get_height ( ) const
inherited

Returns the height of the quad.

Sizex<int > clan::Quadx< int >::get_size ( ) const
inlineinherited

Returns the size of the rectangle.

int clan::Quadx< int >::get_width ( ) const
inherited

Returns the width of the quad.

bool clan::Quadx< int >::is_inside ( const Vec2< int > &  point) const
inherited

Check if a point is inside or outside the quad.

bool clan::Quadx< int >::operator!= ( const Quadx< int > &  quad) const
inlineinherited
Quadx<int > clan::Quadx< int >::operator+ ( const Quadx< int > &  quad) const
inlineinherited
Quadx<int > clan::Quadx< int >::operator+ ( const Vec2< int > &  point) const
inlineinherited

Quad + Point operator.

Quadx<int >& clan::Quadx< int >::operator+= ( const Quadx< int > &  quad)
inlineinherited
Quadx<int >& clan::Quadx< int >::operator+= ( const Vec2< int > &  point)
inlineinherited

Quad += Point operator.

Quadx<int > clan::Quadx< int >::operator- ( const Quadx< int > &  quad) const
inlineinherited
Quadx<int > clan::Quadx< int >::operator- ( const Vec2< int > &  point) const
inlineinherited

Quad - Point operator.

Quadx<int >& clan::Quadx< int >::operator-= ( const Quadx< int > &  quad)
inlineinherited
Quadx<int >& clan::Quadx< int >::operator-= ( const Vec2< int > &  point)
inlineinherited

Quad -= Point operator.

bool clan::Quadx< int >::operator== ( const Quadx< int > &  quad) const
inlineinherited
Quadx<int >& clan::Quadx< int >::rotate ( const Vec2< int > &  hotspot,
const Angle angle 
)
inherited

Rotates the Quad.

Parameters
hotspotPoint to rotate around.
angleAngle to rotate in degrees.
Returns
reference to this object
Quadx<int >& clan::Quadx< int >::scale ( float  sx,
float  sy 
)
inherited

Scale the Quad.

Parameters
sx= Scale value in x-axis
sy= Scale value in y-axis
Returns
reference to this object
Quadx<int >& clan::Quadx< int >::scale ( const Vec2< int > &  hotspot,
float  sx,
float  sy 
)
inherited

Scale the Quad.

Parameters
sx= Scale value in x-axis
sy= Scale value in y-axis
hotspot= Point to scale around.
Returns
reference to this object

Member Data Documentation

Vec2<int > clan::Quadx< int >::p
inherited

First Point.

Vec2<int > clan::Quadx< int >::q
inherited

Second Point.

Vec2<int > clan::Quadx< int >::r
inherited

Third Point.

Vec2<int > clan::Quadx< int >::s
inherited

Fourth Point.


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