Skip to content

Commit d5cf3e5

Browse files
dakerfloryst
authored andcommitted
feat(TransformPolyDataFilter): add vtkTransformPolyDataFilter
1 parent ccf5ed0 commit d5cf3e5

File tree

6 files changed

+1205
-3
lines changed

6 files changed

+1205
-3
lines changed

Sources/Common/Transform/Transform/index.d.ts

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { mat4, vec3 } from 'gl-matrix';
1+
import { mat3, mat4, vec3 } from 'gl-matrix';
22
import { vtkObject } from '../../../interfaces';
33
import { TypedArray } from '../../../types';
4+
import vtkDataArray from '../../Core/DataArray';
5+
import vtkPoints from '../../Core/Points';
46

57
export interface ITransformInitialValues {
68
preMultiplyFlag?: boolean;
@@ -144,6 +146,115 @@ export interface vtkTransform extends vtkObject {
144146
* @returns A new transform with an inversed internal matrix. Also copy the premultiply flag @see getPreMultiplyFlag.
145147
*/
146148
getInverse(): vtkTransform;
149+
150+
/**
151+
* Create a translation matrix and concatenate it with the current
152+
* transformation according to preMultiply or postMultiply semantics.
153+
* @param {Number} x X component of the translation
154+
* @param {Number} y Y component of the translation
155+
* @param {Number} z Z component of the translation
156+
*/
157+
translate(x: number, y: number, z: number): void;
158+
159+
/**
160+
* Create a rotation matrix and concatenate it with the current transformation
161+
* according to preMultiply or postMultiply semantics.
162+
* The angle is expressed in degrees.
163+
* @param {Number} angle Angle in degrees
164+
* @param {Number} x X component of the rotation axis
165+
* @param {Number} y Y component of the rotation axis
166+
* @param {Number} z Z component of the rotation axis
167+
*/
168+
rotateWXYZ(angle: number, x: number, y: number, z: number): void;
169+
170+
/**
171+
* Create a rotation matrix and concatenate it with the current transformation
172+
* according to preMultiply or postMultiply semantics.
173+
* The angle is expressed in degrees.
174+
* @param {Number} angle Angle in degrees
175+
*/
176+
rotateX(angle: number): void;
177+
178+
/**
179+
* Create a rotation matrix about the X, Y, or Z axis and concatenate it with
180+
* the current transformation according to preMultiply or postMultiply
181+
* semantics.
182+
* @param {Number} angle Angle in degrees
183+
*/
184+
rotateY(angle: number): void;
185+
186+
/**
187+
* Create a rotation matrix about the X, Y, or Z axis and concatenate it with
188+
* the current transformation according to preMultiply or postMultiply
189+
* semantics.
190+
* @param {Number} angle Angle in degrees
191+
*/
192+
rotateZ(angle: number): void;
193+
194+
/**
195+
* Create a scale matrix (i.e. set the diagonal elements to x, y, z) and
196+
* concatenate it with the current transformation according to preMultiply or
197+
* postMultiply semantics.
198+
* @param {Number} x Diagonal element for X axis
199+
* @param {Number} y Diagonal element for Y axis
200+
* @param {Number} z Diagonal element for Z axis
201+
*/
202+
scale(x: number, y: number, z: number): void;
203+
204+
/**
205+
* Apply the transformation to a normal.
206+
* @param {vec3} inNormal The normal vector to transform
207+
* @param {vec3} outNormal The output vector
208+
* @returns {vec3} The transformed normal vector
209+
*/
210+
transformNormal(inNormal: vec3, outNormal?: vec3): vec3;
211+
212+
/**
213+
* Apply the transformation to a series of normals, and append the results to
214+
* outNormals.
215+
* @param {vtkDataArray} inNormals The normal vectors to transform
216+
* @param {vtkDataArray} outNormals The output array
217+
*/
218+
transformNormals(inNormals: vtkDataArray, outNormals: vtkDataArray): void;
219+
220+
/**
221+
* Transform points, normals, and vectors simultaneously.
222+
* @param {vtkPoints} inPoints Input points
223+
* @param {vtkPoints} outPoints Output points
224+
* @param {vtkDataArray} inNormals Input normals
225+
* @param {vtkDataArray} outNormals Output normals
226+
* @param {vtkDataArray} inVectors Input vectors
227+
* @param {vtkDataArray} outVectors Output vectors
228+
* @param {Array<vtkDataArray>} inVectorsArr Optional input vectors arrays
229+
* @param {Array<vtkDataArray>} outVectorsArr Optional output vectors arrays
230+
*/
231+
transformPointsNormalsVectors(
232+
inPoints: vtkPoints,
233+
outPoints: vtkPoints,
234+
inNormals: vtkDataArray,
235+
outNormals: vtkDataArray,
236+
inVectors: vtkDataArray,
237+
outVectors: vtkDataArray,
238+
inVectorsArr?: Array<vtkDataArray>,
239+
outVectorsArr?: Array<vtkDataArray>
240+
): void;
241+
242+
/**
243+
* Apply the transformation to a vector.
244+
* @param {vec3} inVector The vector to transform
245+
* @param {vec3} outVector The output vector
246+
* @param {mat3} [matrix=null] if null (default), the Transform matrix is being used.
247+
* @returns {vec3} The transformed vector
248+
*/
249+
transformVector(inVector: vec3, outVector?: vec3, matrix?: mat3): vec3;
250+
251+
/**
252+
* Apply the transformation to a series of vectors, and append the results to
253+
* outVectors.
254+
* @param {vtkDataArray} inVectors The vectors to transform
255+
* @param {vtkDataArray} outVectors The output array
256+
*/
257+
transformVectors(inVectors: vtkDataArray, outVectors: vtkDataArray): void;
147258
}
148259

149260
/**

0 commit comments

Comments
 (0)