import * as em from "./Enums"; import * as ds from "./Types"; import { ObjectManager } from "./ObjectManager"; import { ObjectBase } from "./ObjectBase"; /** * Represents a 3x2 transformation matrix. **/ export declare class Transform extends ObjectBase { /** * Creates an identity transformation. * @returns A new instance of {@link Transform}. **/ static createIdentity(): Transform; /** * Creates an identity transformation. * @param om An object manager that controls the lifetime of the {@link Transform} object. * @returns A new instance of {@link Transform}. **/ static createIdentity(om: ObjectManager): Transform; /** * Creates a transformation based on the specified 3x2 matrix. * @param m11 Scales the drawing horizontally * @param m12 Skew the the drawing horizontally * @param m21 Skew the the drawing vertically * @param m22 Scales the drawing vertically * @param m31 Moves the the drawing horizontally * @param m32 Moves the the drawing vertically * @returns A new instance of {@link Transform}. **/ static createMatrix(m11: number, m12: number, m21: number, m22: number, m31: number, m32: number): Transform; /** * Creates a transformation based on the specified 3x2 matrix. * @param om An object manager that controls the lifetime of the Transform object. * @param m11 Scales the drawing horizontally * @param m12 Skew the the drawing horizontally * @param m21 Skew the the drawing vertically * @param m22 Scales the drawing vertically * @param m31 Moves the the drawing horizontally * @param m32 Moves the the drawing vertically * @returns A new instance of {@link Transform}. **/ static createMatrix(om: ObjectManager, m11: number, m12: number, m21: number, m22: number, m31: number, m32: number): Transform; /** * Creates a translation transformation. * @param offsetX The horizontal offset. * @param offsetY The vertical offset. * @returns A new instance of {@link Transform}. **/ static createTranslation(offsetX: number, offsetY: number): Transform; /** * Creates a translation transformation. * @param om An object manager that controls the lifetime of the Transform object. * @param offsetX The horizontal offset. * @param offsetY The vertical offset. * @returns A new instance of {@link Transform}. **/ static createTranslation(om: ObjectManager, offsetX: number, offsetY: number): Transform; /** * Creates a scaling transformation. * @param scaleFactor The value to scale by on the X and Y axes. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createScale(scaleFactor: number, cx?: number, cy?: number): Transform; /** * Creates a scaling transformation. * @param om An object manager that controls the lifetime of the Transform object. * @param scaleFactor The value to scale by on the X and Y axes. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createScale(om: ObjectManager, scaleFactor: number, cx?: number, cy?: number): Transform; /** * Creates a scaling transformation. * @param scaleX The value to scale by on the X axis. * @param scaleY The value to scale by on the Y axis. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createScaleXY(scaleX: number, scaleY: number, cx?: number, cy?: number): Transform; /** * Creates a scaling transformation. * @param om An object manager that controls the lifetime of the Transform object. * @param scaleX The value to scale by on the X axis. * @param scaleY The value to scale by on the Y axis. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createScaleXY(om: ObjectManager, scaleX: number, scaleY: number, cx?: number, cy?: number): Transform; /** * Creates a rotation transformation. * @param angle The rotation angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createRotation(angle: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): Transform; /** * Creates a rotation transformation. * @param om An object manager that controls the lifetime of the Transform object. * @param angle The rotation angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createRotation(om: ObjectManager, angle: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): Transform; /** * Creates a skew transformation. * @param angleX The X angle. * @param angleY The Y angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createSkew(angleX: number, angleY: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): Transform; /** * Creates a skew transformation. * @param om An object manager that controls the lifetime of the Transform object. * @param angleX The X angle. * @param angleY The Y angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. * @returns A new instance of {@link Transform}. **/ static createSkew(om: ObjectManager, angleX: number, angleY: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): Transform; /** * Creates a copy of the current transformation. * @returns A copy of the current {@link Transform} object. **/ clone(): Transform; /** * Sets the transformation to the current instance. * @param transform The {@link Transform} object to replace the current transformation. **/ setTransform(transform: Transform): void; /** * Applies the transformation to the current instance. * @param transform The {@link Transform} object to be multiplied by the current transformation matrix. **/ applyTransform(transform: Transform): void; /** * Inverts the transformation matrix, if possible. * @returns true on success, false otherwise. **/ tryInvert(): boolean; /** * Saves the current transformation to the stack. **/ push(): void; /** * Restores the previously pushed transformation from the stack. **/ pop(): void; /** * Transforms a {@link Point} by the transformation matrix. * @param point The original {@link Point}. * @returns The transformed {@link Point}. **/ transformPoint(point: ds.Point): ds.Point; /** * Transforms an array of {@link Point}s by the transformation matrix. * @param points The original array of {@link Point}s. * @returns The array of transformed {@link Point}s. **/ transformPoints(points: ds.Point[]): ds.Point[]; /** * Transforms a {@link ds.Quadrilateral} by the transformation matrix. * @param quad The original {@link ds.Quadrilateral}. * @returns The transformed {@link ds.Quadrilateral}. **/ transformQuadrilateral(quad: ds.Quadrilateral): ds.Quadrilateral; /** * Gets or sets the transformation matrix. * The matrix consists of six numbers (their meaning is simplified for clarity): * m11 - scales the drawing horizontally * m12 - skew the the drawing horizontally * m21 - skew the the drawing vertically * m22 - scales the drawing vertically * m31 - moves the the drawing horizontally * m32 - moves the the drawing vertically **/ get matrix(): number[]; /** * Gets or sets the transformation matrix. * The matrix consists of six numbers (their meaning is simplified for clarity): * m11 - scales the drawing horizontally * m12 - skew the the drawing horizontally * m21 - skew the the drawing vertically * m22 - scales the drawing vertically * m31 - moves the the drawing horizontally * m32 - moves the the drawing vertically **/ set matrix(matrix: number[]); /** * Resets the transformation to the identity matrix. **/ reset(): void; /** * Applies the translation transformation. * @param offsetX The horizontal offset. * @param offsetY The vertical offset. **/ translate(offsetX: number, offsetY: number): void; /** * Applies the scaling transformation. * @param scaleFactor The value to scale by on the X and Y axes. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. **/ scale(scaleFactor: number, cx?: number, cy?: number): void; /** * Applies the scaling transformation. * @param scaleX The value to scale by on the X axis. * @param scaleY The value to scale by on the Y axis. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. **/ scaleXY(scaleX: number, scaleY: number, cx?: number, cy?: number): void; /** * Applies the rotation transformation. * @param angle The rotation angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. **/ rotate(angle: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): void; /** * Applies the skew transformation. * @param angleX The X angle. * @param angleY The Y angle. * @param angleUnits The angle units. The default is Radians. * @param cx The optional center point X offset. * @param cy The optional center point Y offset. **/ skew(angleX: number, angleY: number, angleUnits?: em.AngleUnits, cx?: number, cy?: number): void; /** * Applies the skew transformation along the X axis. * @param angle The X angle. * @param angleUnits The angle units. The default is Radians. **/ skewX(angle: number, angleUnits?: em.AngleUnits): void; /** * Applies the skew transformation along the Y axis. * @param angle The Y angle. * @param angleUnits The angle units. The default is Radians. **/ skewY(angle: number, angleUnits?: em.AngleUnits): void; }