Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
cinder::MatrixAffine2< T > Class Template Reference

Represents a two dimensional affine transformation. More...

#include <MatrixAffine2.h>

Public Types

typedef T TYPE
 
typedef T value_type
 

Public Member Functions

 MatrixAffine2 ()
 
 MatrixAffine2 (T s)
 
 MatrixAffine2 (const T *dt)
 
 MatrixAffine2 (T d0, T d1, T d2, T d3, T d4, T d5)
 
 MatrixAffine2 (const Vec2< T > &vx, const Vec2< T > &vy, const Vec2< T > &vz)
 
template<typename FromT >
 MatrixAffine2 (const MatrixAffine2< FromT > &src)
 
 MatrixAffine2 (const MatrixAffine2< T > &src)
 
MatrixAffine2< T > & operator= (const MatrixAffine2< T > &rhs)
 
MatrixAffine2< T > & operator= (T rhs)
 
template<typename FromT >
MatrixAffine2< T > & operator= (const MatrixAffine2< FromT > &rhs)
 
bool equalCompare (const MatrixAffine2< T > &rhs, T epsilon) const
 
bool operator== (const MatrixAffine2< T > &rhs) const
 
bool operator!= (const MatrixAffine2< T > &rhs) const
 
MatrixAffine2< T > & operator*= (const MatrixAffine2< T > &rhs)
 
MatrixAffine2< T > & operator+= (const MatrixAffine2< T > &rhs)
 
MatrixAffine2< T > & operator-= (const MatrixAffine2< T > &rhs)
 
MatrixAffine2< T > & operator*= (T s)
 
MatrixAffine2< T > & operator/= (T s)
 
MatrixAffine2< T > & operator+= (T s)
 
MatrixAffine2< T > & operator-= (T s)
 
const MatrixAffine2< T > operator* (const MatrixAffine2< T > &rhs) const
 
const MatrixAffine2< T > operator+ (const MatrixAffine2< T > &rhs) const
 
const MatrixAffine2< T > operator- (const MatrixAffine2< T > &rhs) const
 
Vec2< T > transformPoint (const Vec2< T > &rhs) const
 post-multiplies column vector [rhs.x rhs.y 1] More...
 
const Vec2< T > operator* (const Vec2< T > &rhs) const
 post-multiplies column vector [rhs.x rhs.y 1] More...
 
Vec2< T > transformVec (const Vec2< T > &v) const
 post-multiplies column vector [rhs.x rhs.y 0] More...
 
const MatrixAffine2< T > operator* (T rhs) const
 
const MatrixAffine2< T > operator/ (T rhs) const
 
const MatrixAffine2< T > operator+ (T rhs) const
 
const MatrixAffine2< T > operator- (T rhs) const
 
T & at (int row, int col)
 
const T & at (int row, int col) const
 
T & operator[] (int idx)
 
const T & operator[] (int idx) const
 
void set (const T *dt)
 
void set (T d0, T d1, T d2, T d3, T d4, T d5)
 
Vec2< T > getColumn (int col) const
 
void setColumn (int col, const Vec2< T > &v)
 
Vec3< T > getRow (int row) const
 
void setRow (int row, const Vec3< T > &v)
 
void getColumns (Vec2< T > *c0, Vec2< T > *c1, Vec2< T > *c2) const
 
void setColumns (const Vec2< T > &c0, const Vec2< T > &c1, const Vec2< T > &c2)
 
void getRows (Vec3< T > *r0, Vec3< T > *r1, Vec3< T > *r2) const
 
void setRows (const Vec3< T > &r0, const Vec3< T > &r1, const Vec3< T > &r2)
 
void setToNull ()
 Sets the matrix to all zeros. More...
 
void setToIdentity ()
 Sets the matrix to the identity matrix. More...
 
bool isSingular () const
 Returns whether the matrix is singular (and consequently not invertible) or not. More...
 
void invert (T epsilon=EPSILON)
 Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity. More...
 
MatrixAffine2< T > invertCopy (T epsilon=EPSILON) const
 Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity. More...
 
void translate (const Vec2< T > &v)
 concatenate translation by v (conceptually, translate is before 'this') More...
 
MatrixAffine2 translateCopy (const Vec2< T > &v) const
 Returns a copy of the matrix translated by v. More...
 
void rotate (T radians)
 concatenate rotation by radians (conceptually, rotate is before 'this') More...
 
void rotate (T radians, const Vec2< T > &pt)
 concatenate rotation by radians around the point pt (conceptually, rotate is before 'this') More...
 
MatrixAffine2 rotateCopy (T radians) const
 Returns a copy of the matrix rotate by radians. More...
 
MatrixAffine2 rotateCopy (T radians, const Vec2< T > &pt) const
 Returns a copy of the matrix rotate by radians around the point pt. More...
 
void scale (T s)
 concatenate scale (conceptually, scale is before 'this') More...
 
void scale (const Vec2< T > &v)
 concatenate scale (conceptually, scale is before 'this') More...
 
MatrixAffine2 scaleCopy (T s) const
 Returns a copy of the matrix scaled by s. More...
 
MatrixAffine2 scaleCopy (const Vec2< T > &v) const
 Returns a copy of the matrix scaled by v. More...
 

Static Public Member Functions

static MatrixAffine2< T > identity ()
 
static MatrixAffine2< T > one ()
 
static MatrixAffine2< T > zero ()
 
static MatrixAffine2< T > makeTranslate (const Vec2< T > &v)
 
static MatrixAffine2< T > makeRotate (T radians)
 
static MatrixAffine2< T > makeRotate (T radians, const Vec2< T > &pt)
 
static MatrixAffine2< T > makeScale (T s)
 
static MatrixAffine2< T > makeScale (const Vec2< T > &v)
 
static MatrixAffine2< T > makeSkewX (T radians)
 
static MatrixAffine2< T > makeSkewY (T radians)
 

Public Attributes

union {
   T   m [6]
 
   struct {
      T   m00
 
      T   m10
 
      T   m01
 
      T   m11
 
      T   m02
 
      T   m12
 
   } 
 
   T   mcols [3][2]
 
}; 
 

Static Public Attributes

static const size_t MEM_LEN = sizeof(T)*6
 

Friends

std::ostream & operator<< (std::ostream &lhs, const MatrixAffine2< T > &rhs)
 

Detailed Description

template<typename T>
class cinder::MatrixAffine2< T >

Represents a two dimensional affine transformation.

Member Typedef Documentation

template<typename T>
typedef T cinder::MatrixAffine2< T >::TYPE
template<typename T>
typedef T cinder::MatrixAffine2< T >::value_type

Constructor & Destructor Documentation

template<typename T >
cinder::MatrixAffine2< T >::MatrixAffine2 ( )
template<typename T>
cinder::MatrixAffine2< T >::MatrixAffine2 ( s)
template<typename T>
cinder::MatrixAffine2< T >::MatrixAffine2 ( const T *  dt)
template<typename T>
cinder::MatrixAffine2< T >::MatrixAffine2 ( d0,
d1,
d2,
d3,
d4,
d5 
)
template<typename T>
cinder::MatrixAffine2< T >::MatrixAffine2 ( const Vec2< T > &  vx,
const Vec2< T > &  vy,
const Vec2< T > &  vz 
)
template<typename T >
template<typename FromT >
cinder::MatrixAffine2< T >::MatrixAffine2 ( const MatrixAffine2< FromT > &  src)
template<typename T>
cinder::MatrixAffine2< T >::MatrixAffine2 ( const MatrixAffine2< T > &  src)

Member Function Documentation

template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= ( const MatrixAffine2< T > &  rhs)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= ( rhs)
template<typename T >
template<typename FromT >
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= ( const MatrixAffine2< FromT > &  rhs)
template<typename T>
bool cinder::MatrixAffine2< T >::equalCompare ( const MatrixAffine2< T > &  rhs,
epsilon 
) const
template<typename T>
bool cinder::MatrixAffine2< T >::operator== ( const MatrixAffine2< T > &  rhs) const
template<typename T>
bool cinder::MatrixAffine2< T >::operator!= ( const MatrixAffine2< T > &  rhs) const
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator*= ( const MatrixAffine2< T > &  rhs)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator+= ( const MatrixAffine2< T > &  rhs)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator-= ( const MatrixAffine2< T > &  rhs)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator*= ( s)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator/= ( s)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator+= ( s)
template<typename T>
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator-= ( s)
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator* ( const MatrixAffine2< T > &  rhs) const
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator+ ( const MatrixAffine2< T > &  rhs) const
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator- ( const MatrixAffine2< T > &  rhs) const
template<typename T>
Vec2< T > cinder::MatrixAffine2< T >::transformPoint ( const Vec2< T > &  rhs) const

post-multiplies column vector [rhs.x rhs.y 1]

template<typename T>
const Vec2< T > cinder::MatrixAffine2< T >::operator* ( const Vec2< T > &  rhs) const

post-multiplies column vector [rhs.x rhs.y 1]

template<typename T>
Vec2< T > cinder::MatrixAffine2< T >::transformVec ( const Vec2< T > &  v) const

post-multiplies column vector [rhs.x rhs.y 0]

template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator* ( rhs) const
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator/ ( rhs) const
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator+ ( rhs) const
template<typename T>
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator- ( rhs) const
template<typename T >
T & cinder::MatrixAffine2< T >::at ( int  row,
int  col 
)
template<typename T >
const T & cinder::MatrixAffine2< T >::at ( int  row,
int  col 
) const
template<typename T>
T& cinder::MatrixAffine2< T >::operator[] ( int  idx)
template<typename T>
const T& cinder::MatrixAffine2< T >::operator[] ( int  idx) const
template<typename T>
void cinder::MatrixAffine2< T >::set ( const T *  dt)
template<typename T>
void cinder::MatrixAffine2< T >::set ( d0,
d1,
d2,
d3,
d4,
d5 
)
template<typename T >
Vec2< T > cinder::MatrixAffine2< T >::getColumn ( int  col) const
template<typename T>
void cinder::MatrixAffine2< T >::setColumn ( int  col,
const Vec2< T > &  v 
)
template<typename T >
Vec3< T > cinder::MatrixAffine2< T >::getRow ( int  row) const
template<typename T>
void cinder::MatrixAffine2< T >::setRow ( int  row,
const Vec3< T > &  v 
)
template<typename T>
void cinder::MatrixAffine2< T >::getColumns ( Vec2< T > *  c0,
Vec2< T > *  c1,
Vec2< T > *  c2 
) const
template<typename T>
void cinder::MatrixAffine2< T >::setColumns ( const Vec2< T > &  c0,
const Vec2< T > &  c1,
const Vec2< T > &  c2 
)
template<typename T>
void cinder::MatrixAffine2< T >::getRows ( Vec3< T > *  r0,
Vec3< T > *  r1,
Vec3< T > *  r2 
) const
template<typename T>
void cinder::MatrixAffine2< T >::setRows ( const Vec3< T > &  r0,
const Vec3< T > &  r1,
const Vec3< T > &  r2 
)
template<typename T >
void cinder::MatrixAffine2< T >::setToNull ( )

Sets the matrix to all zeros.

template<typename T >
void cinder::MatrixAffine2< T >::setToIdentity ( )

Sets the matrix to the identity matrix.

template<typename T >
bool cinder::MatrixAffine2< T >::isSingular ( ) const

Returns whether the matrix is singular (and consequently not invertible) or not.

template<typename T>
void cinder::MatrixAffine2< T >::invert ( epsilon = EPSILON)

Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity.

template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::invertCopy ( epsilon = EPSILON) const

Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity.

template<typename T>
void cinder::MatrixAffine2< T >::translate ( const Vec2< T > &  v)

concatenate translation by v (conceptually, translate is before 'this')

template<typename T>
MatrixAffine2 cinder::MatrixAffine2< T >::translateCopy ( const Vec2< T > &  v) const

Returns a copy of the matrix translated by v.

template<typename T>
void cinder::MatrixAffine2< T >::rotate ( radians)

concatenate rotation by radians (conceptually, rotate is before 'this')

template<typename T>
void cinder::MatrixAffine2< T >::rotate ( radians,
const Vec2< T > &  pt 
)

concatenate rotation by radians around the point pt (conceptually, rotate is before 'this')

template<typename T>
MatrixAffine2 cinder::MatrixAffine2< T >::rotateCopy ( radians) const

Returns a copy of the matrix rotate by radians.

template<typename T>
MatrixAffine2 cinder::MatrixAffine2< T >::rotateCopy ( radians,
const Vec2< T > &  pt 
) const

Returns a copy of the matrix rotate by radians around the point pt.

template<typename T>
void cinder::MatrixAffine2< T >::scale ( s)

concatenate scale (conceptually, scale is before 'this')

template<typename T>
void cinder::MatrixAffine2< T >::scale ( const Vec2< T > &  v)

concatenate scale (conceptually, scale is before 'this')

template<typename T>
MatrixAffine2 cinder::MatrixAffine2< T >::scaleCopy ( s) const

Returns a copy of the matrix scaled by s.

template<typename T>
MatrixAffine2 cinder::MatrixAffine2< T >::scaleCopy ( const Vec2< T > &  v) const

Returns a copy of the matrix scaled by v.

template<typename T>
static MatrixAffine2<T> cinder::MatrixAffine2< T >::identity ( )
static
template<typename T>
static MatrixAffine2<T> cinder::MatrixAffine2< T >::one ( )
static
template<typename T>
static MatrixAffine2<T> cinder::MatrixAffine2< T >::zero ( )
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeTranslate ( const Vec2< T > &  v)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeRotate ( radians)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeRotate ( radians,
const Vec2< T > &  pt 
)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeScale ( s)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeScale ( const Vec2< T > &  v)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeSkewX ( radians)
static
template<typename T>
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeSkewY ( radians)
static

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  lhs,
const MatrixAffine2< T > &  rhs 
)
friend

Member Data Documentation

template<typename T>
const size_t cinder::MatrixAffine2< T >::MEM_LEN = sizeof(T)*6
static
template<typename T>
T cinder::MatrixAffine2< T >::m[6]
template<typename T>
T cinder::MatrixAffine2< T >::m00
template<typename T>
T cinder::MatrixAffine2< T >::m10
template<typename T>
T cinder::MatrixAffine2< T >::m01
template<typename T>
T cinder::MatrixAffine2< T >::m11
template<typename T>
T cinder::MatrixAffine2< T >::m02
template<typename T>
T cinder::MatrixAffine2< T >::m12
template<typename T>
T cinder::MatrixAffine2< T >::mcols[3][2]
union { ... }

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