| Class TMatrix2D (unit Matrix2D) |
TObject
****** * * Module: Matrix2D * Author: Joe Kessler * IntegrationWare - A New Generation of Extraordinary PC Solutions * www.integrationware.com * * Purpose: * * This module encapsulates scaling, rotation, and movement of vertices * using 2-dimensional matrix math. * ******
| Constructors |
constructor Create;| Functions |
function bAppearanceChanged: Boolean;
function bTransformChanged: Boolean;
function bTranslateChanged: Boolean;
procedure ConstructMatrix;
procedure RecordMatrixState;
procedure Reset;
procedure SetTranslation(iX, iY: Real);
procedure TransformVertex(fInputX, fInputY: Real; var fOutputX, fOutputY: Real);
procedure TranslateVertex(fInputX, fInputY: Real; var fOutputX, fOutputY: Real);
function fGetTranslationX: Real;
function fGetTranslationY: Real;
procedure SetOrientation(fRadians: Real);
procedure SetScale(fScale: Real);
procedure SetTranslationX(iX: Real);
procedure SetTranslationY(iY: Real);| Properties |
property fOrientation : Real
property fScale : Real
property fTranslationX : Real
property fTranslationY : Real| Events |
| Variables |
m_afMasterMatrix : array[0..2, 0..2] of Real;
m_afRotationMatrix : array[0..2, 0..2] of Real;
m_afScalingMatrix : array[0..2, 0..2] of Real;
m_bMatrixInitialized : Boolean;
m_fLastOrientation : Real;
m_fLastScale : Real;
m_fLastTranslationX : Real;
m_fLastTranslationY : Real;
m_fOrientation : Real;
m_fScale : Real;
m_fTranslationX : Real;
m_fTranslationY : Real;| Constructors |
constructor Create;| Functions |
function bAppearanceChanged: Boolean;Check if the position has changed.
function bTransformChanged: Boolean;Method to determine if the matrix has changed.
The matrix has now been constructed at least once.
function bTranslateChanged: Boolean;Check if the orientation of scaling has changed.
procedure ConstructMatrix;Method for refreshing the matrix with current values.
procedure RecordMatrixState;Check if the position, orientation, or scaling has changed.
procedure Reset;Methods for operating upon the matrix.
Initially, the matrix has not been initialized.
procedure SetTranslation(iX, iY: Real);Reset master matrix to an identity state.
procedure TransformVertex(fInputX, fInputY: Real; var fOutputX, fOutputY: Real);Method for transforming a single vertex through the matrix.
procedure TranslateVertex(fInputX, fInputY: Real; var fOutputX, fOutputY: Real);Method for translating a local vertex to a new scaling system.
function fGetTranslationX: Real;Initialize the scaling matrix.
function fGetTranslationY: Real;
procedure SetOrientation(fRadians: Real);Methods for getting/setting property values.
Record the new translation values.
procedure SetScale(fScale: Real);Initialize the rotation matrix.
procedure SetTranslationX(iX: Real);Record the new translation values.
procedure SetTranslationY(iY: Real);Record the new translation values.
| Properties |
property fOrientation : RealExposed properties.
property fScale : Real
property fTranslationX : Real
property fTranslationY : Real| Events |
| Variables |
m_afMasterMatrix : array[0..2, 0..2] of Real;Master tranformation matrix.
m_afRotationMatrix : array[0..2, 0..2] of Real;
m_afScalingMatrix : array[0..2, 0..2] of Real;Scaling and rotation matrices.
m_bMatrixInitialized : Boolean;TRUE when the matrix has been initialized.
m_fLastOrientation : Real;
m_fLastScale : Real;
m_fLastTranslationX : Real;Previous transformation values.
m_fLastTranslationY : Real;
m_fOrientation : Real;
m_fScale : Real;
m_fTranslationX : Real;Current Transformation Values.
m_fTranslationY : Real;