2D quad structure - Double More...

#include <quad.h>

+ Inheritance diagram for clan::Quadd:

Public Member Functions

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

Attributes

double get_width () const
 Returns the width of the quad. More...
 
double get_height () const
 Returns the height of the quad. More...
 
Sizex< double > 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< double > p
 First Point. More...
 
Vec2< double > q
 Second Point. More...
 
Vec2< double > r
 Third Point. More...
 
Vec2< double > s
 Fourth Point. More...
 

Detailed Description

2D quad structure - Double

Member Function Documentation

Quadx<double >& clan::Quadx< double >::apply_alignment ( Origin  origin,
double  x,
double  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<double > clan::Quadx< double >::center ( ) const
inherited

Returns the center point of the quad.

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

Returns the bounding box of the quad as a Rect.

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

Returns the height of the quad.

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

Returns the size of the rectangle.

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

Returns the width of the quad.

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

Check if a point is inside or outside the quad.

bool clan::Quadx< double >::operator!= ( const Quadx< double > &  quad) const
inlineinherited

Quad != Quad operator.

Quadx<double > clan::Quadx< double >::operator+ ( const Quadx< double > &  quad) const
inlineinherited

Quad + Quad operator.

Quadx<double > clan::Quadx< double >::operator+ ( const Vec2< double > &  point) const
inlineinherited

Quad + Point operator.

Quadx<double >& clan::Quadx< double >::operator+= ( const Quadx< double > &  quad)
inlineinherited

Quad += Quad operator.

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

Quad += Point operator.

Quadx<double > clan::Quadx< double >::operator- ( const Quadx< double > &  quad) const
inlineinherited

Quad - Quad operator.

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

Quad - Point operator.

Quadx<double >& clan::Quadx< double >::operator-= ( const Quadx< double > &  quad)
inlineinherited

Quad -= Quad operator.

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

Quad -= Point operator.

bool clan::Quadx< double >::operator== ( const Quadx< double > &  quad) const
inlineinherited

Quad == Quad operator.

Quadx<double >& clan::Quadx< double >::rotate ( const Vec2< double > &  hotspot,
const Angle angle 
)
inherited

Rotates the Quad.

Parameters
hotspotPoint to rotate around.
angleAngle to rotate in degrees.
Returns
reference to this object
Quadx<double >& clan::Quadx< double >::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<double >& clan::Quadx< double >::scale ( const Vec2< double > &  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<double > clan::Quadx< double >::p
inherited

First Point.

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

Second Point.

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

Third Point.

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

Fourth Point.


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