A 2x3 matrix representing an affine 2D
transformation.
This is an abstract base class implemented by wx.AffineMatrix2D only so far, but in the future we also plan to derive wx.GraphicsMatrix from it.
New in version 2.9.2.
Default constructor. |
|
Concatenate this matrix with another one. |
|
Get the component values of the matrix. |
|
Invert this matrix. |
|
Check that this matrix is identical with t. |
|
Check if this is the identity matrix. |
|
Add mirroring to this matrix. |
|
Add clockwise rotation to this matrix. |
|
Add scaling to this matrix. |
|
Set all elements of this matrix. |
|
Applies the linear part of this matrix, i.e. without translation. |
|
Applies this matrix to the point. |
|
Add the translation to this matrix. |
|
Check that this matrix differs from t. |
|
Check that this matrix is identical with t. |
wx.
AffineMatrix2DBase
(object)¶Possible constructors:
AffineMatrix2DBase()
A 2x3 matrix representing an affine 2D
transformation.
__init__
(self)¶Default constructor.
The matrix elements are initialize to the identity matrix.
Concat
(self, t)¶Concatenate this matrix with another one.
The parameter matrix is the multiplicand.
t (wx.AffineMatrix2DBase) – 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 |
Get
(self)¶Get the component values of the matrix.
tuple
( mat2D, tr )
Invert
(self)¶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 |
bool
IsEqual
(self, t)¶Check that this matrix is identical with t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.
bool
IsIdentity
(self)¶Check if this is the identity matrix.
bool
Mirror
(self, direction=HORIZONTAL)¶Add mirroring to this matrix.
direction (int) – The direction(s) used for mirroring. One of wx.HORIZONTAL
, wx.VERTICAL
or their combination wx.BOTH
.
Rotate
(self, cRadians)¶Add clockwise rotation to this matrix.
cRadians (wx.Double) – Rotation angle in radians, clockwise.
Scale
(self, xScale, yScale)¶Add scaling to this matrix.
xScale (wx.Double) – Scaling in x direction.
yScale (wx.Double) – Scaling in y direction.
Set
(self, mat2D, tr)¶Set all elements of this matrix.
mat2D (wx.Matrix2D) – The rotational components of the matrix (upper 2 x 2).
tr (Point2DDouble) – The translational components of the matrix.
TransformDistance
(self, *args, **kw)¶TransformDistance (self, p)
Applies the linear part of this matrix, i.e. without translation.
p (Point2DDouble) – The source receiving the transformations.
Point2DDouble
The source with the transformations applied.
TransformDistance (self, dx, dy)
dx (wx.Double) –
dy (wx.Double) –
tuple
( dx, dy )
TransformPoint
(self, *args, **kw)¶TransformPoint (self, p)
Applies this matrix to the point.
p (Point2DDouble) – The point receiving the transformations.
Point2DDouble
The point with the transformations applied.
TransformPoint (self, x, y)
x (wx.Double) –
y (wx.Double) –
tuple
( x, y )
Translate
(self, dx, dy)¶Add the translation to this matrix.
dx (wx.Double) – The translation in x direction.
dy (wx.Double) – The translation in y direction.
__ne__
(self)¶Check that this matrix differs from t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.
__eq__
(self)¶Check that this matrix is identical with t.
t (wx.AffineMatrix2DBase) – The matrix compared with this.