ClanLib  2.3.7
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
CL_Pointd Class Reference

2D (x,y) point structure - Double More...

#include <point.h>

Inheritance diagram for CL_Pointd:
Inheritance graph
[legend]

Public Types

typedef double datatype
 

Public Member Functions

 CL_Pointd ()
 
 CL_Pointd (double x, double y)
 
 CL_Pointd (const CL_Pointx< double > &p)
 
 CL_Pointd (const CL_Vec2< double > &p)
 
Attributes
CL_Vec2< double > & normalize ()
 Normalizes this vector. More...
 
double dot (const CL_Vec2< double > &vector) const
 Dot products this vector with an other vector. More...
 
CL_Vec2< double > & round ()
 Rounds all components of this vector. More...
 
CL_Vec2< double > & rotate (const CL_Vec2< double > &hotspot, const CL_Angle &angle)
 Rotate this vector around another point. More...
 
double length () const
 Returns the length (magnitude) of this vector. More...
 
CL_Angle angle (const CL_Vec2< double > &vector) const
 Calculate the angle between this vector and an other vector. More...
 
CL_Angle angle_relative (const CL_Vec2< double > &vector) const
 Calculate the angle between this vector relative to another vector. More...
 
double distance (const CL_Vec2< double > &vector) const
 Calculate the distance between this vector and an other vector. More...
 
double round_value (float value) const
 Rounds a value for the datatype. More...
 
Operators
const double & operator[] (unsigned int i) const
 
double & operator[] (unsigned int i)
 
 operator double * ()
 
 operator double *const () const
 
void operator+= (const CL_Vec2< double > &vector)
 += operator. More...
 
void operator+= (doublevalue)
 += operator. More...
 
CL_Vec2< double > operator+ (const CL_Vec2< double > &vector) const
 
  • operator.
More...
 
CL_Vec2< double > operator+ (doublevalue) const
 
  • operator.
More...
 
void operator-= (const CL_Vec2< double > &vector)
 -= operator. More...
 
void operator-= (doublevalue)
 -= operator. More...
 
CL_Vec2< double > operator- (const CL_Vec2< double > &vector) const
 
  • operator.
More...
 
CL_Vec2< double > operator- (doublevalue) const
 
  • operator.
More...
 
CL_Vec2< double > operator- () const
 
  • operator.
More...
 
void operator*= (const CL_Vec2< double > &vector)
 *= operator. More...
 
void operator*= (doublevalue)
 *= operator. More...
 
CL_Vec2< double > operator* (const CL_Vec2< double > &vector) const
 
  • operator.
More...
 
CL_Vec2< double > operator* (doublevalue) const
 
  • operator.
More...
 
void operator/= (const CL_Vec2< double > &vector)
 /= operator. More...
 
void operator/= (doublevalue)
 /= operator. More...
 
CL_Vec2< double > operator/ (const CL_Vec2< double > &vector) const
 / operator. More...
 
CL_Vec2< double > operator/ (doublevalue) const
 / operator. More...
 
bool operator== (const CL_Vec2< double > &vector) const
 == operator. More...
 
bool operator!= (const CL_Vec2< double > &vector) const
 != operator. More...
 

Static Public Member Functions

static CL_Pointx< double > calc_origin (CL_Origin origin, const CL_Sizex< double > &size)
 Returns the anchor point for the origin within the dimensions of the size structure. More...
 
static double dot (const CL_Vec2< double > &vector_1, const CL_Vec2< double > &vector_2)
 Dot products a vector with an other vector. More...
 
static CL_Vec2< double > normalize (const CL_Vec2< double > &vector)
 Normalizes a vector. More...
 
static CL_Vec2< double > rotate (const CL_Vec2< double > &vector, const CL_Vec2< double > &hotspot, const CL_Angle &angle)
 Rotate a vector around another point. More...
 
static CL_Vec2< double > round (const CL_Vec2< double > &vector)
 Rounds all components on a vector. More...
 

Public Attributes

union {
   Type   g
 
   Type   t
 
   Type   y
 
}; 
 
union {
   Type   r
 
   Type   s
 
   Type   x
 
}; 
 
double g
 
double r
 
double s
 
double t
 
double x
 
double y
 

Detailed Description

2D (x,y) point structure - Double

Member Typedef Documentation

typedef double CL_Vec2< double >::datatype
inherited

Constructor & Destructor Documentation

CL_Pointd::CL_Pointd ( )
inline
CL_Pointd::CL_Pointd ( double  x,
double  y 
)
inline
CL_Pointd::CL_Pointd ( const CL_Pointx< double > &  p)
inline
CL_Pointd::CL_Pointd ( const CL_Vec2< double > &  p)
inline

Member Function Documentation

CL_Angle CL_Vec2< double >::angle ( const CL_Vec2< double > &  vector) const
inherited

Calculate the angle between this vector and an other vector.

Parameters
vector= Second vector used to calculate angle.
Returns
The angle between the two vectors (between 0 and PI)
CL_Angle CL_Vec2< double >::angle_relative ( const CL_Vec2< double > &  vector) const
inherited

Calculate the angle between this vector relative to another vector.

Parameters
vector= Second vector used to calculate angle.
Returns
The angle between the two vectors (between -PI and PI)
static CL_Pointx<double > CL_Vec2< double >::calc_origin ( CL_Origin  origin,
const CL_Sizex< double > &  size 
)
staticinherited

Returns the anchor point for the origin within the dimensions of the size structure.

Parameters
origin= The origin
size= The size
Returns
The point
double CL_Vec2< double >::distance ( const CL_Vec2< double > &  vector) const
inherited

Calculate the distance between this vector and an other vector.

Parameters
vector= Second vector used to calculate distance.
Returns
The distance between the two vectors.
static double CL_Vec2< double >::dot ( const CL_Vec2< double > &  vector_1,
const CL_Vec2< double > &  vector_2 
)
inlinestaticinherited

Dot products a vector with an other vector.

Operates in the native datatype

Parameters
vector_1= First vector used for the dot product.
vector_2= Second vector used for the dot product.
Returns
The resulting dot product of the two vectors.
double CL_Vec2< double >::dot ( const CL_Vec2< double > &  vector) const
inlineinherited

Dot products this vector with an other vector.

Operates in the native datatype

Parameters
vectorSecond vector used for the dot product.
Returns
The resulting dot product of the two vectors.
double CL_Vec2< double >::length ( ) const
inherited

Returns the length (magnitude) of this vector.

Operates in the native datatype

Returns
the length of the vector
static CL_Vec2<double > CL_Vec2< double >::normalize ( const CL_Vec2< double > &  vector)
staticinherited

Normalizes a vector.

Operates in the native datatype

Parameters
vector= Vector to use
Returns
normalized vector
CL_Vec2<double >& CL_Vec2< double >::normalize ( )
inherited

Normalizes this vector.

Operates in the native datatype

Returns
reference to this object
CL_Vec2< double >::operator double * ( )
inlineinherited
CL_Vec2< double >::operator double *const ( ) const
inlineinherited
bool CL_Vec2< double >::operator!= ( const CL_Vec2< double > &  vector) const
inlineinherited

!= operator.

CL_Vec2<double > CL_Vec2< double >::operator* ( const CL_Vec2< double > &  vector) const
inlineinherited

  • operator.

CL_Vec2<double > CL_Vec2< double >::operator* ( double  value) const
inlineinherited

  • operator.

void CL_Vec2< double >::operator*= ( const CL_Vec2< double > &  vector)
inlineinherited

*= operator.

void CL_Vec2< double >::operator*= ( double  value)
inlineinherited

*= operator.

CL_Vec2<double > CL_Vec2< double >::operator+ ( const CL_Vec2< double > &  vector) const
inlineinherited

  • operator.

CL_Vec2<double > CL_Vec2< double >::operator+ ( double  value) const
inlineinherited

  • operator.

void CL_Vec2< double >::operator+= ( const CL_Vec2< double > &  vector)
inlineinherited

+= operator.

void CL_Vec2< double >::operator+= ( double  value)
inlineinherited

+= operator.

CL_Vec2<double > CL_Vec2< double >::operator- ( const CL_Vec2< double > &  vector) const
inlineinherited

  • operator.

CL_Vec2<double > CL_Vec2< double >::operator- ( double  value) const
inlineinherited

  • operator.

CL_Vec2<double > CL_Vec2< double >::operator- ( ) const
inlineinherited

  • operator.

void CL_Vec2< double >::operator-= ( const CL_Vec2< double > &  vector)
inlineinherited

-= operator.

void CL_Vec2< double >::operator-= ( double  value)
inlineinherited

-= operator.

CL_Vec2<double > CL_Vec2< double >::operator/ ( const CL_Vec2< double > &  vector) const
inlineinherited

/ operator.

CL_Vec2<double > CL_Vec2< double >::operator/ ( double  value) const
inlineinherited

/ operator.

void CL_Vec2< double >::operator/= ( const CL_Vec2< double > &  vector)
inlineinherited

/= operator.

void CL_Vec2< double >::operator/= ( double  value)
inlineinherited

/= operator.

bool CL_Vec2< double >::operator== ( const CL_Vec2< double > &  vector) const
inlineinherited

== operator.

const double & CL_Vec2< double >::operator[] ( unsigned int  i) const
inlineinherited
double & CL_Vec2< double >::operator[] ( unsigned int  i)
inlineinherited
static CL_Vec2<double > CL_Vec2< double >::rotate ( const CL_Vec2< double > &  vector,
const CL_Vec2< double > &  hotspot,
const CL_Angle angle 
)
staticinherited

Rotate a vector around another point.

Parameters
vector= Vector to use
hotspotThe point around which to rotate.
angle= Angle to rotate.
CL_Vec2<double >& CL_Vec2< double >::rotate ( const CL_Vec2< double > &  hotspot,
const CL_Angle angle 
)
inherited

Rotate this vector around another point.

Parameters
hotspotThe point around which to rotate.
angle= Angle to rotate.
Returns
reference to this object
static CL_Vec2<double > CL_Vec2< double >::round ( const CL_Vec2< double > &  vector)
staticinherited

Rounds all components on a vector.

Uses Asymmetric Arithmetic Rounding

Parameters
vector= Vector to use
Returns
The rounded vector
CL_Vec2<double >& CL_Vec2< double >::round ( )
inherited

Rounds all components of this vector.

Uses Asymmetric Arithmetic Rounding

Returns
reference to this object
double CL_Vec2< double >::round_value ( float  value) const
inherited

Rounds a value for the datatype.

For doubles and floats, this function does not round.

Parameters
value= Value to round
Returns
The rounded value

Member Data Documentation

union { ... }
union { ... }
double CL_Vec2< double >::g
inherited
double CL_Vec2< double >::r
inherited
double CL_Vec2< double >::s
inherited
double CL_Vec2< double >::t
inherited
double CL_Vec2< double >::x
inherited
double CL_Vec2< double >::y
inherited

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