MKI_MATRIX (Basic Classes) Changed in Version 2024.1 |
www.CAD6.com |
C++ Syntaxstruct MKI_MATRIX_BASE { double m11, m12, m21, m22, m31, m32; };
class MKI_MATRIX : public MKI_MATRIX_BASE { public:
MKI_MATRIX( void );
MKI_MATRIX( const MKI_MATRIX* f_pThis );
const double f_dM11, const double f_dM12, const double f_dM21, const double f_dM22, const double f_dM31, const double f_dM32 );
double x( const double f_dX, const double f_dY ) const;
double x( const MKI_POINT_BASE& f_rPoint ) const;
double x( const MKI_VECTOR_BASE& f_rVector ) const;
double y( const double f_dX, const double f_dY ) const;
double y( const MKI_POINT_BASE& f_rPoint ) const;
double y( const MKI_VECTOR_BASE& f_rVector ) const;
MKI_POINT Point( const double f_dX, const double f_dY ) const;
MKI_POINT Point( const MKI_POINT_BASE& f_rPoint ) const;
MKI_POINT_REF GetTranslation( void ) const;
void SetTranslation( MKI_CONST_POINT_REF f_rPoint );
void SetTranslation( MKI_CONST_VECTOR_REF f_rVector );
void ApplyPoint( double& f_rdX, double& f_rdY ) const;
void ApplyPoint( MKI_POINT_BASE& f_rPoint ) const;
void ApplyPoint( MKI_MATRIX& f_rMatrix ) const;
MKI_POINT Offset( const double f_dX, const double f_dY ) const;
MKI_POINT Offset( const MKI_POINT_BASE& f_rPoint ) const;
double dx( const double f_dX, const double f_dY ) const;
double dx( const MKI_POINT_BASE& f_rPoint ) const;
double dx( const MKI_VECTOR_BASE& f_rVector ) const;
double dy( const double f_dX, const double f_dY ) const;
double dy( const MKI_POINT_BASE& f_rPoint ) const;
double dy( const MKI_VECTOR_BASE& f_rVector ) const;
MKI_VECTOR Vector( const double f_dX, const double f_dY ) const;
MKI_VECTOR Vector( const MKI_VECTOR_BASE& f_rVector ) const;
void Init( void );
void SetZero( void );
void Rotate( const double f_dAlpha );
void RotateFix( const double f_dAlpha );
void Distort( const double f_dAlpha, const double f_dBeta ); New in Version 2024.1
void DistortX( const double f_dAlpha );
void DistortY( const double f_dBeta );
void Move( const double f_dX, const double f_dY );
void Move( const MKI_VECTOR_BASE& f_rVector );
void Scale( const double f_dX, const double f_dY );
void Scale( const double f_dFactor );
void Scale( const MKI_VECTOR_BASE& f_rVector );
void ScaleFix( const double f_dX, const double f_dY );
void ScaleFix( const double f_dFactor );
void ScaleFix( const MKI_VECTOR_BASE& f_rVector );
void MirrorX( void );
void MirrorY( void );
void const MKI_MATRIX& f_rBase, const MKI_MATRIX& f_rFactor );
void Multiply( const MKI_MATRIX& f_rFactor );
double Determinant( void ) const;
bool SetInvert( const MKI_MATRIX& f_rSource );
bool Invert( void );
bool IsMirrorMatrix( void ) const;
bool IsNonscaleMatrix( void ) const;
bool IsDistortMatrix( void ) const;
double GetScaling( void ) const;
double GetTextHeight( void ) const;
double GetRotation( void ) const;
bool double& f_rdScaleX, double& f_rdScaleY, double& f_rdRotation, double& f_rdDistortion, double& f_rdMoveX, double& f_rdMoveY ) const;
void const double f_dScaleX, const double f_dScaleY, const double f_dRotation, const double f_dDistortion, const double f_dMoveX, const double f_dMoveY );
bool double& f_rdHeight, double& f_rdCompression, double& f_rdRotation, double& f_rdDistortion, double& f_rdMoveX, double& f_rdMoveY ) const;
void const double f_dHeight, const double f_dCompression, const double f_dRotation, const double f_dDistortion, const double f_dMoveX, const double f_dMoveY );
bool IsIdentical( const MKI_MATRIX& f_rMatrix ) const; };
This class contains a simple 3 x 2 matrix for modification purposes and some associated methods.
Element Descriptionm11, m12 [double] First line of a 3 × 2 matrix. m21, m22 [double] Second line of a 3 × 2 matrix. m31, m32 [double] Third line of a 3 × 2 matrix.
The data type MKI_MATRIX is used to store a 3 x 2 matrix.
CommentThe data type MKI_MATRIX is used to store a 3 × 3 matrix. Such matrices are used to store a combination of one or more of the following operations: translation (moving), scaling, rotation, distortion and mirroring. To store all of these operations, a 3 × 3 matrix is required. 3 × 3 matrices use the following representation:
[ m11 m12 m13 ] [ m21 m22 m23 ] [ m31 m32 m33 ]
As the CAD6interface only handles two-dimensional data and therefore only two-dimensional operations, all resulting matrices have the following, simplified form:
[ m11 m12 0.0 ] [ m21 m22 0.0 ] [ m31 m32 1.0 ]
Due to this simplification, only the first two columns of the matrix are stored. The third column is set to [0.0 0.0 1.0]T implicitly.
Example1.0,0.0,0.0,1.0,0.0,0.0
These six values describe the first two columns of the 3 × 3 identity matrix (see Matrices and Vectors). The third column is to be set to [0.0 0.0 1.0]T, so the resulting matrix is:
[ 1.0 0.0 0.0 ] [ 0.0 1.0 0.0 ] [ 0.0 0.0 1.0 ]
MKD Syntaxm11,m12,m21,m22,m31,m32
|
CAD6interface 2024.2 - Copyright 2024 Malz++Kassner® GmbH