/** @packageDocumentation * @module OrbitGT */ declare type int32 = number; declare type float64 = number; import { Bounds } from "./Bounds"; import { Coordinate } from "./Coordinate"; /** * Class Transform defines a generic 3D transformation. * * @version 1.0 November 2015 */ /** @internal */ export declare class Transform { /** The 16 elements (row major order) */ private _elements; /** * Create a new (identity) transform. */ constructor(); /** * Create a new (identity) transform. */ static create(): Transform; /** * Create a transformation from elements. * @param elements the 16 matrix elements (row major order). * @return the transformation. */ static fromRowMajor(elements: Float64Array): Transform; /** * Create a transformation from elements. * @param elements the 16 matrix elements (column major order). * @return the transformation. */ static fromColumnMajor(elements: Float64Array): Transform; /** * Create a transformation from elements. * @param elements the 9 matrix elements (row major order). * @return the transformation. */ static fromRotationElements(m00: float64, m01: float64, m02: float64, m10: float64, m11: float64, m12: float64, m20: float64, m21: float64, m22: float64): Transform; /** * Create a transformation from elements. * @param elements the 16 matrix elements (row major order). * @return the transformation. */ static fromElements(m00: float64, m01: float64, m02: float64, m03: float64, m10: float64, m11: float64, m12: float64, m13: float64, m20: float64, m21: float64, m22: float64, m23: float64): Transform; /** * Get an element. * @param index the index of the element. * @return the element. */ get(index: int32): float64; /** * Set an element. * @param index the index of the element. * @param value the value. */ set(index: int32, value: float64): void; /** * Get an element. * @param row the row index. * @param col the column index. * @return the element. */ getElement(row: int32, col: int32): float64; /** * Set an element. * @param row the row index. * @param col the column index. * @param value the value. */ setElement(row: int32, col: int32, value: float64): void; /** * Get the elements. * @return the elements (row major order). */ getElements(): Float64Array; /** * Set the elements. * @param elements the elements (row major order). */ setElements(elements: Float64Array): void; /** * Get the X column. * @return the X column. */ getColumnX(): Coordinate; /** * Get the Y column. * @return the Y column. */ getColumnY(): Coordinate; /** * Get the Z column. * @return the Z column. */ getColumnZ(): Coordinate; /** * Get the translation column. * @return the translation column. */ getTranslation(): Coordinate; /** * Set the translation. * @param tx the x position of the translation. * @param ty the y position of the translation. * @param tz the z position of the translation. * @return the tranformation. */ setTranslation(tx: float64, ty: float64, tz: float64): Transform; /** * Clear the translation. * @return the tranformation. */ clearTranslation(): Transform; /** * Swap two rows. * @param row1 the first row. * @param row2 the second row. */ swapRows(row1: int32, row2: int32): void; /** * Swap two columns. * @param col1 the first column. * @param col2 the second column. */ swapColumns(col1: int32, col2: int32): void; /** * Swap the YZ coordinates. */ swapYZ(): void; /** * Calculate the cosine of an angle. * @param angle the angle (in degrees). * @return the cosine. */ static cos(angle: float64): float64; /** * Calculate the sine of an angle. * @param angle the angle (in degrees). * @return the sine. */ static sin(angle: float64): float64; /** * Rotate around the X axis. * @param angle the rotation angle (degree). */ rotateX(angle: float64): void; /** * Apply a rotation around X axis. * @param point the (mutable) point to rotate. * @param rotation the (Y->Z,counterclockwise) rotation (degrees). */ static rotatePointX(point: Coordinate, rotation: float64): void; /** * Rotate around the Y axis. * @param angle the rotation angle (degree). */ rotateY(angle: float64): void; /** * Apply a rotation around Y axis. * @param point the (mutable) point to rotate. * @param rotation the (Z->X,counterclockwise) rotation (degrees). */ static rotatePointY(point: Coordinate, rotation: float64): void; /** * Rotate around the Z axis. * @param angle the rotation angle (degree). */ rotateZ(angle: float64): void; /** * Apply a rotation around Z axis. * @param point the (mutable) point to rotate. * @param rotation the (X->Y,counterclockwise) rotation (degrees). */ static rotatePointZ(point: Coordinate, rotation: float64): void; /** * Multiply two matrices. * @param a the first transform. * @param b the second transform. * @return the result transform (a x b). */ static multiply2(a: Transform, b: Transform): Transform; /** * Concatenate a transform. * @param transform the transform to concatenate. * @return the combined transformation. */ concat(transform: Transform): Transform; /** * Multiply. * @param transform the transform to multiply with. */ multiply(transform: Transform): void; /** * Translate. * @param tx the x translation. * @param ty the y translation. * @param tz the z translation. */ translate(tx: float64, ty: float64, tz: float64): void; /** * Translate. * @param point the xyz translation. */ translatePoint(point: Coordinate): void; /** * Scale. * @param sx the x scale. * @param sy the y scale. * @param sz the z scale. */ scale(sx: float64, sy: float64, sz: float64): void; /** * Scale XYZ. * @param s the scale. */ scale3(s: float64): void; /** * Create the inverse transform. * @return the inverse transform. */ createInverse(): Transform; /** * Invert. */ invert(): void; /** * Create a copy. * @return a copy. */ copy(): Transform; /** * Create an identity transform. * @return the transform. */ static createIdentity(): Transform; /** * Create a translation transform. * @param tx the x translation. * @param ty the y translation. * @param tz the z translation. * @return the transform. */ static createTranslation(tx: float64, ty: float64, tz: float64): Transform; /** * Create a translation transform. * @param position the translation. * @return the transform. */ static createTranslation2(position: Coordinate): Transform; /** * Create a scale transform. * @param sx the x translation. * @param sy the y translation. * @param sz the z translation. * @return the transform. */ static createScale(sx: float64, sy: float64, sz: float64): Transform; /** * Create a rotation-round-X transform. * @param angle the rotation angle (degree). * @return the transform. */ static createRotationX(angle: float64): Transform; /** * Create a rotation-round-Y transform. * @param angle the rotation angle (degree). * @return the transform. */ static createRotationY(angle: float64): Transform; /** * Create a rotation-round-Z transform. * @param angle the rotation angle (degree). * @return the transform. */ static createRotationZ(angle: float64): Transform; /** * Create a swap YZ transform. * @return the transform. */ static createSwapYZ(): Transform; /** * Create a transformation from elements. * @param elements the elements (row major order) * @return the transformation. */ static createWithElements(elements: Float64Array): Transform; /** * Create a transformation from columns. * @param col0 the first column. * @param col1 the second column. * @param col2 the third column. * @param col3 the fourth column (considered zero if null). * @return the transformation. */ static createWithColumns(col0: Coordinate, col1: Coordinate, col2: Coordinate, col3: Coordinate): Transform; /** * Create an orthogonal rotation from a quaternion. * @param a the first quaternion element (q1). * @param b the second quaternion element (q2). * @param c the third quaternion element (q3). * @param d the fourth quaternion element (q4). * @return the rotation matrix. */ static fromQuaternion(a: float64, b: float64, c: float64, d: float64): Transform; /** * Transform a point. * @param source the source point. * @param target the target point (can be same as source). * @return the target point. */ transformTo(source: Coordinate, target: Coordinate): Coordinate; /** * Transform a point. * @param source the source point. * @return the target point. */ transform(source: Coordinate): Coordinate; /** * Transform bounds. * @param bounds the bounds. * @return the transformed bounds. */ transformBounds(bounds: Bounds): Bounds; /** * Check if the transform matches another transform. * @param other the other transform. * @return true if same. */ same(other: Transform): boolean; /** * The standard toString method. * @see Object#toString */ toString(): string; } export {}; //# sourceMappingURL=Transform.d.ts.map