| Version: 3.3.1

Public Member Functions | List of all members
wxAffineMatrix2D Class Reference
Class List by Category » Miscellaneous

`#include <wx/affinematrix2d.h>`

Inheritance diagram for wxAffineMatrix2D:
[legend]

## Detailed Description

A 3x2 matrix representing an affine 2D transformation.

##

Library: wxCore
Category: Miscellaneous

Since
  2.9.2

## Public Member Functions
| wxAffineMatrix2D ()
| Default constructor. More...
void | Get (wxMatrix2D *mat2D, wxPoint2DDouble *tr) const
| Get the component values of the matrix. More...
void | Set (const wxMatrix2D &mat2D, const wxPoint2DDouble &tr)
| Set all elements of this matrix. More...
void | Concat (const wxAffineMatrix2DBase &t)
| Concatenate this matrix with another one. More...
bool | Invert ()
| Invert this matrix. More...
bool | IsIdentity () const
| Check if this is the identity matrix. More...
bool | operator!= (const wxAffineMatrix2DBase &t) const
| Check that this matrix differs from t. More...
void | Translate (wxDouble dx, wxDouble dy)
| Add the translation to this matrix. More...
void | Scale (wxDouble xScale, wxDouble yScale)
| Add scaling to this matrix. More...
void | Mirror (int direction=wxHORIZONTAL)
| Add mirroring to this matrix. More...
void | Rotate (wxDouble cRadians)
| Add clockwise rotation to this matrix. More...
wxPoint2DDouble | TransformPoint (const wxPoint2DDouble &p) const
| Applies this matrix to the point. More...
void | TransformPoint (wxDouble *x, wxDouble *y) const
wxPoint2DDouble | TransformDistance (const wxPoint2DDouble &p) const
| Applies the linear part of this matrix, i.e. without translation. More...
void | TransformDistance (wxDouble *dx, wxDouble *dy) const
void | IsEqual (const wxAffineMatrix2DBase &t)
| Check that this matrix is identical with t. More...
bool | operator== (const wxAffineMatrix2DBase &t) const
| Check that this matrix is identical with t. More...
Public Member Functions inherited from wxAffineMatrix2DBase
| wxAffineMatrix2DBase ()
| Default constructor. More...
virtual | ~wxAffineMatrix2DBase ()
bool | operator!= (const wxAffineMatrix2DBase &t) const
| Check that this matrix differs from t. More...
void | Mirror (int direction=wxHORIZONTAL)
| Add mirroring to this matrix. More...
wxPoint2DDouble | TransformPoint (const wxPoint2DDouble &p) const
| Applies this matrix to the point. More...
void | TransformPoint (wxDouble *x, wxDouble *y) const
wxPoint2DDouble | TransformDistance (const wxPoint2DDouble &p) const
| Applies the linear part of this matrix, i.e. without translation. More...
void | TransformDistance (wxDouble *dx, wxDouble *dy) const
virtual bool | IsEqual (const wxAffineMatrix2DBase &t) const =0
| Check that this matrix is identical with t. More...
bool | operator== (const wxAffineMatrix2DBase &t) const
| Check that this matrix is identical with t. More...

## Constructor & Destructor Documentation

## ◆ wxAffineMatrix2D()

wxAffineMatrix2D::wxAffineMatrix2D | ( |  | ) |

Default constructor.

The matrix elements are initialize to the identity matrix.

## Member Function Documentation

## ◆ Concat()

void wxAffineMatrix2D::Concat | ( | const wxAffineMatrix2DBase & | t | ) |
| virtual

Concatenate this matrix with another one.

The parameter matrix is the multiplicand.

Parameters

  t | The multiplicand.

// | t.m_11 t.m_12 0 | | m_11 m_12 0 |
// matrix' = | t.m_21 t.m_22 0 | x | m_21 m_22 0 |
// | t.m_tx t.m_ty 1 | | m_tx m_ty 1 |

Implements wxAffineMatrix2DBase.

## ◆ Get()

void wxAffineMatrix2D::Get | ( | wxMatrix2D * | mat2D,
|  | wxPoint2DDouble * | tr
| ) |  | const
| virtual

Get the component values of the matrix.

Parameters

  mat2D | The rotational components of the matrix (upper 2 x 2), must be non-null.
  tr | The translational components of the matrix, may be nullptr.

Implements wxAffineMatrix2DBase.

## ◆ Invert()

bool wxAffineMatrix2D::Invert | ( |  | ) |
| virtual

Invert this matrix.

If the matrix is not invertible, i.e. if its determinant is 0, returns false and doesn't modify it.

// | m_11 m_12 0 |
// Invert | m_21 m_22 0 |
// | m_tx m_ty 1 |

Implements wxAffineMatrix2DBase.

## ◆ IsEqual()

void wxAffineMatrix2D::IsEqual | ( | const wxAffineMatrix2DBase & | t | ) |

Check that this matrix is identical with t.

Parameters

  t | The matrix compared with this.

## ◆ IsIdentity()

bool wxAffineMatrix2D::IsIdentity | ( |  | ) | const
| virtual

Check if this is the identity matrix.

Implements wxAffineMatrix2DBase.

## ◆ Mirror()

void wxAffineMatrix2D::Mirror | ( | int | direction = `wxHORIZONTAL` | ) |

Add mirroring to this matrix.

Parameters

  direction | The direction(s) used for mirroring. One of wxHORIZONTAL, wxVERTICAL or their combination wxBOTH.

## ◆ operator!=()

bool wxAffineMatrix2D::operator!= | ( | const wxAffineMatrix2DBase & | t | ) | const

Check that this matrix differs from t.

Parameters

  t | The matrix compared with this.

## ◆ operator==()

bool wxAffineMatrix2D::operator== | ( | const wxAffineMatrix2DBase & | t | ) | const

Check that this matrix is identical with t.

Parameters

  t | The matrix compared with this.

## ◆ Rotate()

void wxAffineMatrix2D::Rotate | ( | wxDouble | cRadians | ) |
| virtual

Add clockwise rotation to this matrix.

Parameters

  cRadians | Rotation angle in radians, clockwise.

// | cos sin 0 | | m_11 m_12 0 |
// matrix' = | -sin cos 0 | x | m_21 m_22 0 |
// | 0 0 1 | | m_tx m_ty 1 |

Implements wxAffineMatrix2DBase.

## ◆ Scale()

void wxAffineMatrix2D::Scale | ( | wxDouble | xScale,
|  | wxDouble | yScale
| ) |  |
| virtual

Add scaling to this matrix.

Parameters

  xScale | Scaling in x direction.
  yScale | Scaling in y direction.

// | xScale 0 0 | | m_11 m_12 0 |
// matrix' = | 0 yScale 0 | x | m_21 m_22 0 |
// | 0 0 1 | | m_tx m_ty 1 |

Implements wxAffineMatrix2DBase.

## ◆ Set()

void wxAffineMatrix2D::Set | ( | const wxMatrix2D & | mat2D,
|  | const wxPoint2DDouble & | tr
| ) |  |
| virtual

Set all elements of this matrix.

Parameters

  mat2D | The rotational components of the matrix (upper 2 x 2).
  tr | The translational components of the matrix.

Implements wxAffineMatrix2DBase.

## ◆ TransformDistance() [1/2]

wxPoint2DDouble wxAffineMatrix2D::TransformDistance | ( | const wxPoint2DDouble & | p | ) | const

Applies the linear part of this matrix, i.e. without translation.

Parameters

  p | The source receiving the transformations.

Returns
  The source with the transformations applied.

// | m_11 m_12 0 |
// dist' = | src.m_x src._my 0 | x | m_21 m_22 0 |
// | m_tx m_ty 1 |

## ◆ TransformDistance() [2/2]

void wxAffineMatrix2D::TransformDistance | ( | wxDouble * | dx,
|  | wxDouble * | dy
| ) |  | const

## ◆ TransformPoint() [1/2]

wxPoint2DDouble wxAffineMatrix2D::TransformPoint | ( | const wxPoint2DDouble & | p | ) | const

Applies this matrix to the point.

Parameters

  p | The point receiving the transformations.

Returns
  The point with the transformations applied.

// | m_11 m_12 0 |
// point' = | src.m_x src._my 1 | x | m_21 m_22 0 |
// | m_tx m_ty 1 |

## ◆ TransformPoint() [2/2]

void wxAffineMatrix2D::TransformPoint | ( | wxDouble * | x,
|  | wxDouble * | y
| ) |  | const

## ◆ Translate()

void wxAffineMatrix2D::Translate | ( | wxDouble | dx,
|  | wxDouble | dy
| ) |  |
| virtual

Add the translation to this matrix.

Parameters

  dx | The translation in x direction.
  dy | The translation in y direction.

// | 1 0 0 | | m_11 m_12 0 |
// matrix' = | 0 1 0 | x | m_21 m_22 0 |
// | dx dy 1 | | m_tx m_ty 1 |

Implements wxAffineMatrix2DBase.