Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Member Functions | Public Attributes | Friends | List of all members
hdi::core::TransformMatrix Class Reference

Allows for 2-dimensional transformations in a single application via matrix math. More...

#include <hdicoreTransformMatrix.h>

Public Member Functions

 TransformMatrix ()
 Constructs a TransformMatrix and sets its entries to that of an identity matrix. More...
 
 TransformMatrix (const double a_, const double b_, const double c_, const double d_, const double tx_, const double ty_)
 Constructs a TransformMatrix and sets its entries to the arguments provided. More...
 
 TransformMatrix (const TransformMatrix &m_)
 TransformMatrix copy constructor. More...
 
virtual ~TransformMatrix ()
 TransformMatrix destructor. More...
 
virtual void setIdentity ()
 Sets a TransformMatrix object's entries to that of an identity matrix. More...
 
virtual bool isIdentity () const
 Gets whether a TransformMatrix currently has its entries set to that of an identity matrix. More...
 
virtual void setTranslate (const double tx_, const double ty_)
 Sets the translation values of a matrix. More...
 
virtual void setRotate (const Angle &angle_)
 Sets the rotation values, about the origin, of a matrix. More...
 
virtual void setScale (const double sx_, const double sy_)
 Sets the scale values, from the origin, of a matrix. More...
 
virtual void concatTranslate (const double tx_, const double ty_)
 Concatenates translation values to an existing matrix. More...
 
virtual void concatRotate (const Angle &angle_)
 Concatenates rotation values to an existing matrix. More...
 
virtual void concatScale (const double sx_, const double sy_)
 Concatenates scale values to an existing matrix. More...
 
virtual void concat (const TransformMatrix &matrix2_)
 Concatenates one matrix with another. More...
 
virtual double determinant () const
 Gets the determinant of the target matrix. More...
 
virtual bool degenerate () const
 Gets whether the target matrix is degenerate. More...
 
virtual bool invert (TransformMatrix &inverse__) const
 Inverts a target matrix. More...
 
virtual bool operator== (const TransformMatrix &rhs_) const
 Compares two matrices for equality. More...
 
virtual bool operator!= (const TransformMatrix &rhs_) const
 Compares two matrices for inequality. More...
 
virtual TransformMatrixoperator= (const TransformMatrix &rhs_)
 Sets a target matrix to have the same values as another. More...
 
virtual TransformMatrix operator* (const TransformMatrix &rhs_) const
 Multiplies two matrices together. More...
 
virtual TransformMatrixoperator*= (const TransformMatrix &rhs_)
 Multiplies and assigns (concatenates) one matrix with another. More...
 

Public Attributes

double a
 Row 0, column 0 of the transformation matrix.
 
double b
 Row 0, column 1 of the transformation matrix.
 
double c
 Row 1, column 0 of the transformation matrix.
 
double d
 Row 1, column 1 of the transformation matrix.
 
double tx
 Stores the x-axis translation (offset) value.
 
double ty
 Stores the y-axis translation (offset) value.
 

Friends

plugin::TransformMatrix * __accessImpl (const TransformMatrix &)
 
TransformMatrix __accessCtor (const plugin::TransformMatrix &)
 

Detailed Description

Allows for 2-dimensional transformations in a single application via matrix math.

Constructor & Destructor Documentation

hdi::core::TransformMatrix::TransformMatrix ( )

Constructs a TransformMatrix and sets its entries to that of an identity matrix.

Author
GW
Date
08/2013
hdi::core::TransformMatrix::TransformMatrix ( const double  a_,
const double  b_,
const double  c_,
const double  d_,
const double  tx_,
const double  ty_ 
)

Constructs a TransformMatrix and sets its entries to the arguments provided.

Author
GW
Date
08/2013
Parameters
a_Value for entry at row 0, column 0
b_Value for entry at row 0, column 1
c_Value for entry at row 1, column 0
d_Value for entry at row 1, column 1
tx_x-axis translation (offset) value
ty_y-axis translation (offset) value
hdi::core::TransformMatrix::TransformMatrix ( const TransformMatrix m_)

TransformMatrix copy constructor.

Author
GW
Date
08/2013
Parameters
m_Existing TransformMatrix to copy
virtual hdi::core::TransformMatrix::~TransformMatrix ( )
virtual

TransformMatrix destructor.

Author
GW
Date
08/2013

Member Function Documentation

virtual void hdi::core::TransformMatrix::concat ( const TransformMatrix matrix2_)
virtual

Concatenates one matrix with another.

Author
GW
Date
08/2013
Parameters
matrix2_Second matrix to concatenate with the target matrix
virtual void hdi::core::TransformMatrix::concatRotate ( const Angle angle_)
virtual

Concatenates rotation values to an existing matrix.

Author
GW
Date
08/2013
Parameters
angle_Amount to rotate about the origin
virtual void hdi::core::TransformMatrix::concatScale ( const double  sx_,
const double  sy_ 
)
virtual

Concatenates scale values to an existing matrix.

Author
GW
Date
08/2013
Parameters
sx_Amount to scale in the x-direction (1.0 being the current size)
sy_Amount to scale in the y-direction (1.0 being the current size)
virtual void hdi::core::TransformMatrix::concatTranslate ( const double  tx_,
const double  ty_ 
)
virtual

Concatenates translation values to an existing matrix.

Author
GW
Date
08/2013
Parameters
tx_Amount to offset along the x-axis
ty_Amount to offset along the y-axis
Note
Negative values go toward 0.0 if the object to be transformed has a positive x and/or y value; positive values go away from 0.0
virtual bool hdi::core::TransformMatrix::degenerate ( ) const
virtual

Gets whether the target matrix is degenerate.

Author
GW
Date
08/2013
Returns
true for a degenerate matrix (has a determinant of 0), or false otherwise
virtual double hdi::core::TransformMatrix::determinant ( ) const
virtual

Gets the determinant of the target matrix.

Author
GW
Date
08/2013
Returns
Determinant value of the matrix
virtual bool hdi::core::TransformMatrix::invert ( TransformMatrix inverse__) const
virtual

Inverts a target matrix.

If the inverse of the target matrix were concatenated with the target itself, the result would be an identity matrix

Author
GW
Date
08/2013
Parameters
inverse__Return-by-reference variable for the inverted matrix
Returns
true if inversion is possible and was successfully performed, false otherwise
Note
Inversion cannot be peformed when the target matrix is degenerate. In that case, the inverse__ argument will be set to an identity matrix and false is returned.
virtual bool hdi::core::TransformMatrix::isIdentity ( ) const
virtual

Gets whether a TransformMatrix currently has its entries set to that of an identity matrix.

Author
GW
Date
08/2013
Returns
true if the matrix values are those of an identity matrix, or false otherwise
virtual bool hdi::core::TransformMatrix::operator!= ( const TransformMatrix rhs_) const
virtual

Compares two matrices for inequality.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the != operator; the matrix to compare against
Returns
true if any fields of both matrices are unequal to each other, or false otherwise
virtual TransformMatrix hdi::core::TransformMatrix::operator* ( const TransformMatrix rhs_) const
virtual

Multiplies two matrices together.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the * operator; the matrix to multiply with
Returns
A new TransformMatrix object containing the values of the fields from this and rhs_ multiplied together.
virtual TransformMatrix& hdi::core::TransformMatrix::operator*= ( const TransformMatrix rhs_)
virtual

Multiplies and assigns (concatenates) one matrix with another.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the *= operator; the matrix to multiply with
Returns
The target TransformMatrix object, but updated with the values of the fields from this and rhs_ multiplied together.
virtual TransformMatrix& hdi::core::TransformMatrix::operator= ( const TransformMatrix rhs_)
virtual

Sets a target matrix to have the same values as another.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the = operator; the matrix to pull values from
Returns
The target matrix, but with its values equaling those from rhs_
virtual bool hdi::core::TransformMatrix::operator== ( const TransformMatrix rhs_) const
virtual

Compares two matrices for equality.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the == operator; the matrix to compare against
Returns
true if all fields of both matrices are binary equal to each other, or false otherwise
virtual void hdi::core::TransformMatrix::setIdentity ( )
virtual

Sets a TransformMatrix object's entries to that of an identity matrix.

Author
GW
Date
08/2013
virtual void hdi::core::TransformMatrix::setRotate ( const Angle angle_)
virtual

Sets the rotation values, about the origin, of a matrix.

Author
GW
Date
08/2013
Parameters
angle_Amount to rotate about the origin
virtual void hdi::core::TransformMatrix::setScale ( const double  sx_,
const double  sy_ 
)
virtual

Sets the scale values, from the origin, of a matrix.

Author
GW
Date
08/2013
Parameters
sx_Amount to scale in the x-direction (1.0 being the current size)
sy_Amount to scale in the y-direction (1.0 being the current size)
virtual void hdi::core::TransformMatrix::setTranslate ( const double  tx_,
const double  ty_ 
)
virtual

Sets the translation values of a matrix.

Author
GW
Date
08/2013
Parameters
tx_Amount to offset along the x-axis
ty_Amount to offset along the y-axis
Note
Negative values go toward 0.0 if the object to be transformed has a positive x and/or y value; positive values go away from 0.0