@kitware/vtk.js 24.19.1 → 25.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/BREAKING_CHANGES.md +5 -0
  2. package/Common/Core/DataArray.d.ts +1 -1
  3. package/Common/Core/Math/index.js +360 -337
  4. package/Common/Core/Math.d.ts +70 -8
  5. package/Common/Core/Math.js +2 -1
  6. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
  7. package/Common/DataModel/Line.js +1 -3
  8. package/Common/Transform/LandmarkTransform.js +11 -24
  9. package/Filters/General/OBBTree.js +21 -23
  10. package/Filters/Texture/TextureMapToPlane.js +6 -15
  11. package/IO/Core/HttpSceneLoader.d.ts +11 -2
  12. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.js +1 -1
  13. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  14. package/Interaction/Style/InteractorStyleTrackballCamera.js +1 -1
  15. package/Interaction/Widgets/PiecewiseGaussianWidget.js +1 -1
  16. package/Proxy/Core/View2DProxy.js +1 -1
  17. package/Rendering/Core/Camera.d.ts +12 -1
  18. package/Rendering/Core/CellPicker.d.ts +3 -3
  19. package/Rendering/Core/ColorTransferFunction.js +1 -1
  20. package/Rendering/Core/Coordinate.d.ts +7 -7
  21. package/Rendering/Core/Coordinate.js +1 -1
  22. package/Rendering/Core/CubeAxesActor.js +1 -1
  23. package/Rendering/Core/Glyph3DMapper.js +1 -1
  24. package/Rendering/Core/ImageMapper.d.ts +1 -1
  25. package/Rendering/Core/ImageMapper.js +2 -3
  26. package/Rendering/Core/ImageSlice.d.ts +4 -4
  27. package/Rendering/Core/InteractorObserver.d.ts +2 -2
  28. package/Rendering/Core/Mapper.js +1 -1
  29. package/Rendering/Core/Picker.d.ts +1 -1
  30. package/Rendering/Core/Prop3D.js +1 -1
  31. package/Rendering/Core/RenderWindow.d.ts +6 -6
  32. package/Rendering/Core/RenderWindowInteractor.js +1 -1
  33. package/Rendering/Core/Renderer.d.ts +8 -9
  34. package/Rendering/Core/Renderer.js +1 -1
  35. package/Rendering/Core/ScalarBarActor.js +1 -1
  36. package/Rendering/Core/VolumeMapper.js +1 -1
  37. package/Rendering/Core/VolumeProperty.d.ts +2 -2
  38. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +1 -1
  39. package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
  40. package/Rendering/OpenGL/RenderWindow.d.ts +7 -7
  41. package/Rendering/OpenGL/Texture.js +1 -1
  42. package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
  43. package/Widgets/Core/WidgetManager.d.ts +1 -1
  44. package/Widgets/Representations/HandleRepresentation.js +2 -1
  45. package/Widgets/Representations/PolyLineRepresentation.js +1 -1
  46. package/Widgets/Widgets3D/AngleWidget/state.js +2 -2
  47. package/Widgets/Widgets3D/AngleWidget.js +2 -2
  48. package/Widgets/Widgets3D/DistanceWidget/state.js +2 -2
  49. package/Widgets/Widgets3D/DistanceWidget.js +1 -1
  50. package/Widgets/Widgets3D/EllipseWidget.js +1 -4
  51. package/Widgets/Widgets3D/ImageCroppingWidget/state.js +1 -1
  52. package/Widgets/Widgets3D/ImageCroppingWidget.js +2 -1
  53. package/Widgets/Widgets3D/LabelWidget/state.js +1 -1
  54. package/Widgets/Widgets3D/LabelWidget.js +1 -1
  55. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  56. package/Widgets/Widgets3D/LineWidget/state.js +3 -3
  57. package/Widgets/Widgets3D/LineWidget.js +1 -8
  58. package/Widgets/Widgets3D/PolyLineWidget.js +2 -8
  59. package/Widgets/Widgets3D/RectangleWidget.js +1 -4
  60. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  61. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  62. package/Widgets/Widgets3D/SphereWidget.js +4 -12
  63. package/Widgets/Widgets3D/SplineWidget/state.js +2 -2
  64. package/Widgets/Widgets3D/SplineWidget.js +2 -5
  65. package/package.json +1 -1
  66. package/types.d.ts +23 -13
@@ -6,6 +6,24 @@ import { Bounds, Extent, HSVColor, RGBAColor, RGBColor, Matrix, Matrix3x3, Range
6
6
  */
7
7
  export function createArray(size?: number): number[];
8
8
 
9
+ /**
10
+ * Given two rows indices, swap the two rows of a nxn matrix
11
+ * @param {Number[]} matrix The n by n matrix in wich we want to swap the vectors.
12
+ * @param {Number} n size of the matrix.
13
+ * @param {Number} row1 index of first row to swap with the other.
14
+ * @param {Number} row2 index of second row to swap with the other.
15
+ */
16
+ export function swapRowsMatrix_nxn(matrix: number[], n: number, row1: number, row2: number): void;
17
+
18
+ /**
19
+ * Given two columns indices, swap the two columns of a nxn matrix
20
+ * @param {Number[]} matrix The n by n matrix in wich we want to swap the vectors.
21
+ * @param {Number} n size of the matrix.
22
+ * @param {Number} column1 index of first col to swap with the other.
23
+ * @param {Number} column2 index of second col to swap with the other.
24
+ */
25
+ export function swapColumnsMatrix_nxn(matrix: number[], n: number, column1: number, column2: number): void;
26
+
9
27
  /**
10
28
  * Get the number π.
11
29
  */
@@ -364,9 +382,47 @@ export function normalize2D(x: Vector2): number;
364
382
 
365
383
  /**
366
384
  *
367
- * @param {Number[][]|Number[]} args
385
+ * @param {Number[]} args
386
+ */
387
+ export function determinant2x2(args: number[]): number;
388
+
389
+ /**
390
+ * Fill a 4x4 matrix with the given row vectors
391
+ * @param {Vector4} row0
392
+ * @param {Vector4} row1
393
+ * @param {Vector4} row2
394
+ * @param {Vector4} row3
395
+ * @param {Matrix} mat
396
+ */
397
+ export function rowsToMat4(row0: Vector4, row1: Vector4, row2: Vector4, row3: Vector4, mat: Matrix): Matrix;
398
+
399
+ /**
400
+ * Fill a 4x4 matrix with the given column vectors
401
+ * @param {Vector4} column0
402
+ * @param {Vector4} column1
403
+ * @param {Vector4} column2
404
+ * @param {Vector4} column3
405
+ * @param {Matrix} mat
406
+ */
407
+ export function columnsToMat4(column0: Vector4, column1: Vector4, column2: Vector4, column3: Vector4, mat: Matrix): Matrix;
408
+
409
+ /**
410
+ * Fill a 3x3 matrix with the given row vectors
411
+ * @param {Vector3} row0
412
+ * @param {Vector3} row1
413
+ * @param {Vector3} row2
414
+ * @param {Matrix} mat
368
415
  */
369
- export function determinant2x2(args: number[][]|number[]): number;
416
+ export function rowsToMat3(row0: Vector3, row1: Vector3, row2: Vector3, mat: Matrix): Matrix;
417
+
418
+ /**
419
+ * Fill a 3x3 matrix with the given column vectors
420
+ * @param {Vector3} column0
421
+ * @param {Vector3} column1
422
+ * @param {Vector3} column2
423
+ * @param {Matrix} mat
424
+ */
425
+ export function columnsToMat3(column0: Vector3, column1: Vector3, column2: Vector3, mat: Matrix): Matrix;
370
426
 
371
427
  /**
372
428
  * LU Factorization of a 3x3 matrix.
@@ -476,12 +532,12 @@ export function roundNumber(num: number, digits?: number): number;
476
532
  export function roundVector(vector: Vector3, out?: Vector3, digits?: number): Vector3;
477
533
 
478
534
  /**
479
- *
480
- * @param {Matrix} a
481
- * @param {Number} n
482
- * @param {Number[]} w
483
- * @param {Number[]} v
484
- */
535
+ * Jacobi iteration for the solution of eigenvectors/eigenvalues. Input matrix a is modified (the upper triangle is filled with zeros)
536
+ * @param {Matrix} a real symetric nxn matrix
537
+ * @param {Number} n matrix size
538
+ * @param {Number[]} w vector of size n to store eigenvalues (stored in decreasing order)
539
+ * @param {Number[]} v matrix of size nxn to store eigenvectors (stored in decreasing order, normalized)
540
+ */
485
541
  export function jacobiN(a: Matrix, n: number, w: number[], v: number[]): number;
486
542
 
487
543
  /**
@@ -837,6 +893,8 @@ export function isFinite(value: any): boolean;
837
893
  */
838
894
  export declare const vtkMath: {
839
895
  createArray: typeof createArray;
896
+ swapRowsMatrix_nxn: typeof swapRowsMatrix_nxn;
897
+ swapColumnsMatrix_nxn: typeof swapColumnsMatrix_nxn;
840
898
  Pi: typeof Pi;
841
899
  radiansFromDegrees: typeof radiansFromDegrees;
842
900
  degreesFromRadians: typeof degreesFromRadians;
@@ -882,6 +940,10 @@ export declare const vtkMath: {
882
940
  norm2D: typeof norm2D;
883
941
  normalize2D: typeof normalize2D;
884
942
  determinant2x2: typeof determinant2x2;
943
+ rowsToMat4: typeof rowsToMat4;
944
+ columnsToMat4: typeof columnsToMat4;
945
+ rowsToMat3: typeof rowsToMat3;
946
+ columnsToMat3: typeof columnsToMat3;
885
947
  LUFactor3x3: typeof LUFactor3x3;
886
948
  LUSolve3x3: typeof LUSolve3x3;
887
949
  linearSolve3x3: typeof linearSolve3x3;
@@ -1,4 +1,5 @@
1
1
  import '@babel/runtime/helpers/slicedToArray';
2
+ import '@babel/runtime/helpers/toConsumableArray';
2
3
  import 'seedrandom';
3
4
  import '../../macros.js';
4
- export { af as LUFactor3x3, ag as LUSolve3x3, T as Pi, k as add, R as angleBetweenVectors, P as areBoundsInitialized, B as areEquals, a as areMatricesEqual, Y as arrayMax, X as arrayMin, D as arrayRange, a0 as beginCombination, $ as binomial, aJ as boundsIsWithinOtherBounds, U as ceil, Z as ceilLog2, aF as clampAndNormalizeValue, C as clampValue, e as clampVector, c as computeBoundsFromPoints, N as createUninitializedBounds, j as cross, t as default, A as degreesFromRadians, o as determinant2x2, z as determinant3x3, as as diagonalize3x3, f as distance2BetweenPoints, d as dot, a9 as dot2D, ax as estimateMatrixCondition, aI as extentIsWithinOtherExtent, _ as factorial, aS as float2CssRGBA, aR as floatRGB2HexCode, aQ as floatToHex2, J as floor, a4 as gaussian, ab as gaussianAmplitude, ac as gaussianWeight, aH as getAdjustedScalarRange, E as getMajorAxisIndex, aG as getScalarTypeFittingRange, a3 as getSeed, aA as hex2float, h as hsv2rgb, am as identity3x3, aM as inf, al as invert3x3, aw as invertMatrix, aO as isFinite, F as isInf, aP as isNaN, i as isNan, Q as isPowerOfTwo, w as jacobi, p as jacobiN, I as lab2rgb, aB as lab2xyz, ah as linearSolve3x3, au as luFactorLinearSystem, av as luSolveLinearSystem, ap as matrix3x3ToQuaternion, W as max, V as min, ai as multiply3x3_mat3, O as multiply3x3_vect3, m as multiplyAccumulate, a6 as multiplyAccumulate2D, aj as multiplyMatrix, aq as multiplyQuaternion, x as multiplyScalar, a5 as multiplyScalar2D, M as nearestPowerOfTwo, aN as negInf, a1 as nextCombination, n as norm, ae as norm2D, l as normalize, L as normalize2D, ar as orthogonalize3x3, a7 as outer, ad as outer2D, q as perpendiculars, aK as pointIsWithinBounds, a8 as projectVector, aa as projectVector2D, an as quaternionToMatrix3x3, r as radiansFromDegrees, y as random, a2 as randomSeed, G as rgb2hsv, H as rgb2lab, aE as rgb2xyz, K as round, ao as roundNumber, b as roundVector, S as signedAngleBetweenVectors, at as singularValueDecomposition3x3, aL as solve3PointCircle, ay as solveHomogeneousLeastSquares, az as solveLeastSquares, g as solveLinearSystem, s as subtract, ak as transpose3x3, u as uninitializeBounds, aC as xyz2lab, aD as xyz2rgb } from './Math/index.js';
5
+ export { ak as LUFactor3x3, al as LUSolve3x3, V as Pi, k as add, S as angleBetweenVectors, Q as areBoundsInitialized, C as areEquals, a as areMatricesEqual, _ as arrayMax, Z as arrayMin, E as arrayRange, a2 as beginCombination, a1 as binomial, aP as boundsIsWithinOtherBounds, W as ceil, $ as ceilLog2, aL as clampAndNormalizeValue, D as clampValue, e as clampVector, aj as columnsToMat3, ai as columnsToMat4, c as computeBoundsFromPoints, U as createArray, O as createUninitializedBounds, j as cross, t as default, B as degreesFromRadians, o as determinant2x2, z as determinant3x3, ay as diagonalize3x3, f as distance2BetweenPoints, d as dot, ab as dot2D, aD as estimateMatrixCondition, aO as extentIsWithinOtherExtent, a0 as factorial, aY as float2CssRGBA, aX as floatRGB2HexCode, aW as floatToHex2, K as floor, a6 as gaussian, ad as gaussianAmplitude, ae as gaussianWeight, aN as getAdjustedScalarRange, F as getMajorAxisIndex, aM as getScalarTypeFittingRange, a5 as getSeed, aG as hex2float, h as hsv2rgb, as as identity, ar as identity3x3, aS as inf, aq as invert3x3, aC as invertMatrix, aU as isFinite, G as isInf, aV as isNaN, i as isNan, R as isPowerOfTwo, w as jacobi, p as jacobiN, J as lab2rgb, aH as lab2xyz, am as linearSolve3x3, aA as luFactorLinearSystem, aB as luSolveLinearSystem, av as matrix3x3ToQuaternion, Y as max, X as min, an as multiply3x3_mat3, P as multiply3x3_vect3, m as multiplyAccumulate, a8 as multiplyAccumulate2D, ao as multiplyMatrix, aw as multiplyQuaternion, x as multiplyScalar, a7 as multiplyScalar2D, N as nearestPowerOfTwo, aT as negInf, a3 as nextCombination, n as norm, ag as norm2D, l as normalize, M as normalize2D, ax as orthogonalize3x3, a9 as outer, af as outer2D, q as perpendiculars, aQ as pointIsWithinBounds, aa as projectVector, ac as projectVector2D, at as quaternionToMatrix3x3, r as radiansFromDegrees, y as random, a4 as randomSeed, H as rgb2hsv, I as rgb2lab, aK as rgb2xyz, L as round, au as roundNumber, b as roundVector, A as rowsToMat3, ah as rowsToMat4, T as signedAngleBetweenVectors, az as singularValueDecomposition3x3, aR as solve3PointCircle, aE as solveHomogeneousLeastSquares, aF as solveLeastSquares, g as solveLinearSystem, s as subtract, ap as transpose3x3, u as uninitializeBounds, aI as xyz2lab, aJ as xyz2rgb } from './Math/index.js';
@@ -98,7 +98,7 @@ export interface vtkFieldData extends vtkObject {
98
98
  *
99
99
  * @param {Number} idx The index of the array.
100
100
  */
101
- getArrayByIndex(idx: number): any | null;
101
+ getArrayByIndex(idx: number): Nullable<any>;
102
102
 
103
103
  /**
104
104
  *
@@ -73,9 +73,7 @@ function intersection(a1, a2, b1, b2, u, v) {
73
73
  subtract(b2, b1, b21);
74
74
  subtract(b1, a1, b1a1); // Compute the system (least squares) matrix.
75
75
 
76
- var A = [];
77
- A[0] = [dot(a21, a21), -dot(a21, b21)];
78
- A[1] = [A[0][1], dot(b21, b21)]; // Compute the least squares system constant term.
76
+ var A = [dot(a21, a21), -dot(a21, b21), -dot(a21, b21), dot(b21, b21)]; // Compute the least squares system constant term.
79
77
 
80
78
  var c = [];
81
79
  c[0] = dot(a21, b1a1);
@@ -13,20 +13,7 @@ var Mode = Constants.Mode; // --------------------------------------------------
13
13
 
14
14
  function vtkLandmarkTransform(publicAPI, model) {
15
15
  // Set our className
16
- model.classHierarchy.push('vtkLandmarkTransform'); // Convert a mat4 matrix to a Matrix 2 dimensions
17
-
18
- function mat4To2DArray(mat) {
19
- var output = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]];
20
- var cpt = 0;
21
-
22
- for (var c = 0; c < 4; c++) {
23
- for (var r = 0; r < 4; r++) {
24
- output[r][c] = mat[cpt++];
25
- }
26
- }
27
-
28
- return output;
29
- }
16
+ model.classHierarchy.push('vtkLandmarkTransform');
30
17
 
31
18
  function update() {
32
19
  mat4.identity(model.matrix);
@@ -62,9 +49,9 @@ function vtkLandmarkTransform(publicAPI, model) {
62
49
 
63
50
  if (N_PTS === 1) {
64
51
  mat4.identity(model.matrix);
65
- model.matrix.elem[12] = targetCentroid[0] - sourceCentroid[0];
66
- model.matrix.elem[13] = targetCentroid[1] - sourceCentroid[1];
67
- model.matrix.elem[14] = targetCentroid[2] - sourceCentroid[2];
52
+ model.matrix[12] = targetCentroid[0] - sourceCentroid[0];
53
+ model.matrix[13] = targetCentroid[1] - sourceCentroid[1];
54
+ model.matrix[14] = targetCentroid[2] - sourceCentroid[2];
68
55
  return model.matrix;
69
56
  } // -- build the 3x3 matrix M --
70
57
 
@@ -137,11 +124,11 @@ function vtkLandmarkTransform(publicAPI, model) {
137
124
  N[14] = N[11] = M[7] + M[5];
138
125
  /* eslint-enable no-multi-assign */
139
126
  // -- eigen-decompose N (is symmetric) --
127
+ // prettier-ignore
140
128
 
141
- var eigenVectors = [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]];
129
+ var eigenVectors = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0];
142
130
  var eigenValues = [0.0, 0.0, 0.0, 0.0];
143
- var NMatrix = mat4To2DArray(N);
144
- jacobiN(NMatrix, 4, eigenValues, eigenVectors); // The eigenvector with the largest eigenvalue is the quaternion we want
131
+ jacobiN(N, 4, eigenValues, eigenVectors); // The eigenvector with the largest eigenvalue is the quaternion we want
145
132
  // (they are sorted in decreasing order for us by JacobiN)
146
133
 
147
134
  var w;
@@ -207,10 +194,10 @@ function vtkLandmarkTransform(publicAPI, model) {
207
194
  }
208
195
  } else {
209
196
  // points are not collinear
210
- w = eigenVectors[0][0];
211
- x = eigenVectors[1][0];
212
- y = eigenVectors[2][0];
213
- z = eigenVectors[3][0];
197
+ w = eigenVectors[0];
198
+ x = eigenVectors[4];
199
+ y = eigenVectors[8];
200
+ z = eigenVectors[12];
214
201
  } // convert quaternion to a rotation matrix
215
202
 
216
203
 
@@ -44,7 +44,7 @@ function vtkOBBTree(publicAPI, model) {
44
44
  var a0 = [0, 0, 0];
45
45
  var a1 = [0, 0, 0];
46
46
  var a2 = [0, 0, 0];
47
- var a = [a0, a1, a2];
47
+ var a = [0, 0, 0, 0, 0, 0, 0, 0, 0];
48
48
  var dp0 = [0, 0, 0];
49
49
  var dp1 = [0, 0, 0];
50
50
  var c = [0, 0, 0];
@@ -128,36 +128,34 @@ function vtkOBBTree(publicAPI, model) {
128
128
 
129
129
  a1[0] = a0[1];
130
130
  a2[0] = a0[2];
131
- a2[1] = a1[2]; // get covariance from moments
131
+ a2[1] = a1[2];
132
+ a = [a0[0], a0[1], a0[2], a1[0], a1[1], a1[2], a2[0], a2[1], a2[2]]; // get covariance from moments
132
133
 
133
134
  for (var _i2 = 0; _i2 < 3; _i2++) {
134
135
  for (var _j2 = 0; _j2 < 3; _j2++) {
135
- a[_i2][_j2] = a[_i2][_j2] / totMass - mean[_i2] * mean[_j2];
136
+ a[_i2 * 3 + _j2] = a[_i2 * 3 + _j2] / totMass - mean[_i2] * mean[_j2];
136
137
  }
137
138
  } //
138
139
  // Extract axes (i.e., eigenvectors) from covariance matrix.
139
140
  //
140
141
 
141
142
 
142
- var v0 = [0, 0, 0];
143
- var v1 = [0, 0, 0];
144
- var v2 = [0, 0, 0];
145
- var v = [v0, v1, v2];
143
+ var v = [0, 0, 0, 0, 0, 0, 0, 0, 0];
146
144
  jacobi(a, size, v);
147
- max[0] = v[0][0];
148
- max[1] = v[1][0];
149
- max[2] = v[2][0];
150
- mid[0] = v[0][1];
151
- mid[1] = v[1][1];
152
- mid[2] = v[2][1];
153
- min[0] = v[0][2];
154
- min[1] = v[1][2];
155
- min[2] = v[2][2];
145
+ max[0] = v[0];
146
+ max[1] = v[3];
147
+ max[2] = v[6];
148
+ mid[0] = v[1];
149
+ mid[1] = v[4];
150
+ mid[2] = v[7];
151
+ min[0] = v[2];
152
+ min[1] = v[5];
153
+ min[2] = v[8];
156
154
 
157
155
  for (var _i3 = 0; _i3 < 3; _i3++) {
158
- a[0][_i3] = mean[_i3] + max[_i3];
159
- a[1][_i3] = mean[_i3] + mid[_i3];
160
- a[2][_i3] = mean[_i3] + min[_i3];
156
+ a[_i3] = mean[_i3] + max[_i3];
157
+ a[3 + _i3] = mean[_i3] + mid[_i3];
158
+ a[6 + _i3] = mean[_i3] + min[_i3];
161
159
  } //
162
160
  // Create oriented bounding box by projecting points onto eigenvectors.
163
161
  //
@@ -171,7 +169,7 @@ function vtkOBBTree(publicAPI, model) {
171
169
  var _p = model.pointsList[ptId];
172
170
 
173
171
  for (var _i4 = 0; _i4 < 3; _i4++) {
174
- var out = vtkLine.distanceToLine(_p, mean, a[_i4], []);
172
+ var out = vtkLine.distanceToLine(_p, mean, a.slice(3 * _i4, 3 * (_i4 + 1)), []);
175
173
 
176
174
  if (out.t < tMin[_i4]) {
177
175
  tMin[_i4] = out.t;
@@ -513,7 +511,7 @@ function vtkOBBTree(publicAPI, model) {
513
511
  var eps = model.tolerance;
514
512
  var pA = nodeA;
515
513
  var pB = vtkOBBNode.newInstance();
516
- var dotAB = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
514
+ var dotAB = [0, 0, 0, 0, 0, 0, 0, 0, 0];
517
515
 
518
516
  if (XformBtoA) {
519
517
  // Here we assume that XformBtoA is an orthogonal matrix
@@ -606,7 +604,7 @@ function vtkOBBTree(publicAPI, model) {
606
604
  for (var jj = 0; jj < 3; jj++) {
607
605
  // (note: we are saving all 9 dotproducts for future use)
608
606
  dotA = dot(pB.getAxis(_ii5), pA.getAxis(jj));
609
- dotAB[_ii5][jj] = dotA;
607
+ dotAB[_ii5 * 3 + jj] = dotA;
610
608
 
611
609
  if (dotA > 0) {
612
610
  rangeAmax += dotA;
@@ -633,7 +631,7 @@ function vtkOBBTree(publicAPI, model) {
633
631
 
634
632
  for (var _jj = 0; _jj < 3; _jj++) {
635
633
  // (note: we are using the 9 dotproducts computed earlier)
636
- dotB = dotAB[_jj][_ii6];
634
+ dotB = dotAB[_jj * 3 + _ii6];
637
635
 
638
636
  if (dotB > 0) {
639
637
  rangeBmax += dotB;
@@ -1,6 +1,6 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkDataArray from '../../Common/Core/DataArray.js';
3
- import { l as normalize, d as dot, j as cross, f as distance2BetweenPoints, z as determinant3x3 } from '../../Common/Core/Math/index.js';
3
+ import { l as normalize, d as dot, j as cross, f as distance2BetweenPoints, z as determinant3x3, A as rowsToMat3 } from '../../Common/Core/Math/index.js';
4
4
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
5
5
 
6
6
  var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
@@ -56,10 +56,6 @@ function vtkTextureMapToPlane(publicAPI, model) {
56
56
  v[1] = 0.0;
57
57
  v[2] = 0.0;
58
58
 
59
- for (i = 0; i < 9; i++) {
60
- m[i] = 0.0;
61
- }
62
-
63
59
  for (var ptId = 0; ptId < nbPoints; ptId++) {
64
60
  output.getPoints().getPoint(ptId, x);
65
61
  v[0] += x[0] * x[2];
@@ -80,21 +76,16 @@ function vtkTextureMapToPlane(publicAPI, model) {
80
76
  var c1 = [m[0], m[1], m[2]];
81
77
  var c2 = [m[3], m[4], m[5]];
82
78
  var c3 = [m[6], m[7], m[8]];
83
- var matrix = [c1, c2, c3];
84
- var det = determinant3x3(matrix);
79
+ var det = determinant3x3(m);
85
80
 
86
81
  if (det <= VTK_TOLERANCE) {
87
82
  return;
88
83
  }
89
84
 
90
- matrix[0] = v;
91
- matrix[1] = c2;
92
- matrix[2] = c3;
93
- model.normal[0] = determinant3x3(matrix) / det;
94
- matrix[0] = c1;
95
- matrix[1] = v;
96
- matrix[2] = c3;
97
- model.normal[1] = determinant3x3(matrix) / det; // because of the formulation
85
+ m = rowsToMat3(v, c2, c3, []);
86
+ model.normal[0] = determinant3x3(m) / det;
87
+ m = rowsToMat3(c1, v, c3, []);
88
+ model.normal[1] = determinant3x3(m) / det; // because of the formulation
98
89
 
99
90
  model.normal[2] = -1.0;
100
91
  }
@@ -29,7 +29,7 @@ export interface vtkHttpSceneLoader extends vtkObject {
29
29
 
30
30
  /**
31
31
  *
32
- * @param fetchGzip
32
+ * @param {Boolean} fetchGzip
33
33
  */
34
34
  getFetchGzip(fetchGzip: boolean): boolean;
35
35
 
@@ -70,10 +70,19 @@ export interface vtkHttpSceneLoader extends vtkObject {
70
70
 
71
71
  /**
72
72
  *
73
- * @param renderer
73
+ * @param {vtkRenderer} renderer The vtkRenderer instance.
74
74
  */
75
75
  setRenderer(renderer: vtkRenderer): boolean;
76
+
77
+ /**
78
+ *
79
+ * @param {String} url
80
+ */
76
81
  setUrl(url: string): void;
82
+
83
+ /**
84
+ *
85
+ */
77
86
  update(): void;
78
87
  }
79
88
 
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
2
2
  import macro from '../../macros.js';
3
3
  import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
4
4
  import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
5
- import { r as radiansFromDegrees, A as degreesFromRadians } from '../../Common/Core/Math/index.js';
5
+ import { r as radiansFromDegrees, B as degreesFromRadians } from '../../Common/Core/Math/index.js';
6
6
 
7
7
  // vtkMouseCameraTrackballRollManipulator methods
8
8
  // ----------------------------------------------------------------------------
@@ -10,7 +10,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
10
10
  import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
11
11
  import { mat4, vec3 } from 'gl-matrix';
12
12
  import macro from '../../macros.js';
13
- import { B as areEquals, l as normalize, d as dot, C as clampValue, s as subtract, j as cross, x as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
13
+ import { C as areEquals, l as normalize, d as dot, D as clampValue, s as subtract, j as cross, x as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
14
14
 
15
15
  var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
16
16
  // vtkMouseCameraUnicamRotateManipulator methods
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkInteractorStyle from '../../Rendering/Core/InteractorStyle.js';
3
3
  import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
4
- import { A as degreesFromRadians } from '../../Common/Core/Math/index.js';
4
+ import { B as degreesFromRadians } from '../../Common/Core/Math/index.js';
5
5
  import { Device, Input } from '../../Rendering/Core/RenderWindowInteractor/Constants.js';
6
6
 
7
7
  var States = vtkInteractorStyleConstants.States;
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
4
4
  import macro from '../../macros.js';
5
- import { D as arrayRange } from '../../Common/Core/Math/index.js';
5
+ import { E as arrayRange } from '../../Common/Core/Math/index.js';
6
6
  import WebworkerPromise from 'webworker-promise';
7
7
  import { W as WorkerFactory } from '../../_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import macro from '../../macros.js';
2
2
  import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
3
3
  import vtkViewProxy from './ViewProxy.js';
4
- import { j as cross, E as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
4
+ import { j as cross, F as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  var DEFAULT_STEP_WIDTH = 512;
7
7
 
@@ -55,6 +55,11 @@ export interface vtkCamera extends vtkObject {
55
55
  */
56
56
  computeDistance(): void;
57
57
 
58
+ /**
59
+ *
60
+ */
61
+ computeCameraLightTransform(): void;
62
+
58
63
  /**
59
64
  * the provided matrix should include translation and orientation only mat
60
65
  * is physical to view
@@ -439,6 +444,12 @@ export interface vtkCamera extends vtkObject {
439
444
  */
440
445
  setFocalPointFrom(focalPoint: Vector3): boolean;
441
446
 
447
+ /**
448
+ * Set the value of the FreezeDolly instance variable.
449
+ * @param {Boolean} freezeFocalPoint
450
+ */
451
+ setFreezeFocalPoint(freezeFocalPoint: boolean): boolean;
452
+
442
453
  /**
443
454
  * Not implement yet
444
455
  * Set the oblique viewing angles.
@@ -633,7 +644,7 @@ export interface vtkCamera extends vtkObject {
633
644
  * @param {Boolean} useHorizontalViewAngle The value of the useHorizontalViewAngle.
634
645
  */
635
646
  setUseHorizontalViewAngle(useHorizontalViewAngle: boolean): boolean;
636
-
647
+
637
648
  /**
638
649
  * Set use offaxis frustum.
639
650
  *
@@ -69,7 +69,7 @@ export interface vtkCellPicker extends vtkPicker {
69
69
  /**
70
70
  *
71
71
  * @param selection
72
- * @param {vtkRenderer} renderer
72
+ * @param {vtkRenderer} renderer The vtkRenderer instance.
73
73
  */
74
74
  pick(selection: any, renderer: vtkRenderer): void;
75
75
 
@@ -78,7 +78,7 @@ export interface vtkCellPicker extends vtkPicker {
78
78
  * @param {Vector3} p1
79
79
  * @param {Vector3} p2
80
80
  * @param {Number} tol
81
- * @param {vtkMapper} mapper
81
+ * @param {vtkMapper} mapper The vtkMapper instance.
82
82
  */
83
83
  intersectWithLine(p1: Vector3, p2: Vector3, tol: number, mapper: vtkMapper): number;
84
84
 
@@ -89,7 +89,7 @@ export interface vtkCellPicker extends vtkPicker {
89
89
  * @param {Number} t1
90
90
  * @param {Number} t2
91
91
  * @param {Number} tol
92
- * @param {vtkMapper} mapper
92
+ * @param {vtkMapper} mapper The vtkMapper instance.
93
93
  */
94
94
  intersectActorWithLine(p1: Vector3, p2: Vector3, t1: number, t2: number, tol: number, mapper: vtkMapper): number;
95
95
  }
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
- import { h as hsv2rgb, i as isNan, F as isInf, G as rgb2hsv, H as rgb2lab, I as lab2rgb, J as floor } from '../../Common/Core/Math/index.js';
3
+ import { h as hsv2rgb, i as isNan, G as isInf, H as rgb2hsv, I as rgb2lab, J as lab2rgb, K as floor } from '../../Common/Core/Math/index.js';
4
4
  import vtkScalarsToColors from '../../Common/Core/ScalarsToColors.js';
5
5
  import Constants from './ColorTransferFunction/Constants.js';
6
6
 
@@ -20,43 +20,43 @@ export interface vtkCoordinate extends vtkObject {
20
20
 
21
21
  /**
22
22
  *
23
- * @param {vtkRenderer} ren
23
+ * @param {vtkRenderer} ren The vtkRenderer instance.
24
24
  */
25
25
  getComputedWorldValue(ren: vtkRenderer): number[];
26
26
 
27
27
  /**
28
28
  *
29
- * @param {vtkRenderer} ren
29
+ * @param {vtkRenderer} ren The vtkRenderer instance.
30
30
  */
31
31
  getComputedViewportValue(ren: vtkRenderer): number[];
32
32
 
33
33
  /**
34
34
  *
35
- * @param {vtkRenderer} ren
35
+ * @param {vtkRenderer} ren The vtkRenderer instance.
36
36
  */
37
37
  getComputedDisplayValue(ren: vtkRenderer): number[];
38
38
 
39
39
  /**
40
40
  *
41
- * @param {vtkRenderer} ren
41
+ * @param {vtkRenderer} ren The vtkRenderer instance.
42
42
  */
43
43
  getComputedLocalDisplayValue(ren: vtkRenderer): number[];
44
44
 
45
45
  /**
46
46
  *
47
- * @param {vtkRenderer} ren
47
+ * @param {vtkRenderer} ren The vtkRenderer instance.
48
48
  */
49
49
  getComputedValue(ren: vtkRenderer): number[];
50
50
 
51
51
  /**
52
52
  *
53
- * @param {vtkRenderer} ren
53
+ * @param {vtkRenderer} ren The vtkRenderer instance.
54
54
  */
55
55
  getComputedDoubleViewportValue(ren: vtkRenderer): number[];
56
56
 
57
57
  /**
58
58
  *
59
- * @param {vtkRenderer} ren
59
+ * @param {vtkRenderer} ren The vtkRenderer instance.
60
60
  */
61
61
  getComputedDoubleDisplayValue(ren: vtkRenderer): number[];
62
62
 
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import Constants from './Coordinate/Constants.js';
4
- import { K as round, J as floor } from '../../Common/Core/Math/index.js';
4
+ import { L as round, K as floor } from '../../Common/Core/Math/index.js';
5
5
 
6
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
7
 
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import { vec3, mat4 } from 'gl-matrix';
4
4
  import * as d3 from 'd3-scale';
5
- import { L as normalize2D, M as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
5
+ import { M as normalize2D, N as nearestPowerOfTwo } from '../../Common/Core/Math/index.js';
6
6
  import macro from '../../macros.js';
7
7
  import vtkActor from './Actor.js';
8
8
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
@@ -4,7 +4,7 @@ import { mat4, vec3, mat3 } from 'gl-matrix';
4
4
  import Constants from './Glyph3DMapper/Constants.js';
5
5
  import macro from '../../macros.js';
6
6
  import vtkMapper from './Mapper.js';
7
- import { N as createUninitializedBounds, n as norm } from '../../Common/Core/Math/index.js';
7
+ import { O as createUninitializedBounds, n as norm } from '../../Common/Core/Math/index.js';
8
8
  import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
9
9
 
10
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -198,7 +198,7 @@ export interface vtkImageMapper extends vtkAbstractMapper {
198
198
  * @param {Number} factor
199
199
  * @param {Number} offset
200
200
  */
201
- setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number)
201
+ setResolveCoincidentTopologyPolygonOffsetParameters(factor: number, offset: number): boolean;
202
202
 
203
203
  /**
204
204
  *
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import Constants from './ImageMapper/Constants.js';
3
3
  import macro from '../../macros.js';
4
4
  import vtkAbstractMapper from './AbstractMapper.js';
5
- import { C as clampValue, O as multiply3x3_vect3, N as createUninitializedBounds } from '../../Common/Core/Math/index.js';
5
+ import { D as clampValue, P as multiply3x3_vect3, O as createUninitializedBounds } from '../../Common/Core/Math/index.js';
6
6
  import vtkPlane from '../../Common/DataModel/Plane.js';
7
7
  import CoincidentTopologyHelper from './Mapper/CoincidentTopologyHelper.js';
8
8
  import { vec3 } from 'gl-matrix';
@@ -201,8 +201,7 @@ function vtkImageMapper(publicAPI, model) {
201
201
  // transpositions resulting in a no-op.
202
202
 
203
203
  var a = publicAPI.getInputData().getDirection();
204
- var mat3 = [[a[0], a[1], a[2]], [a[3], a[4], a[5]], [a[6], a[7], a[8]]];
205
- multiply3x3_vect3(mat3, inVec3, out);
204
+ multiply3x3_vect3(a, inVec3, out);
206
205
  var maxAbs = 0.0;
207
206
  var ijkMode = -1;
208
207
  var flip = false;
@@ -1,10 +1,10 @@
1
1
  import { Bounds } from './../../types';
2
2
  import vtkImageProperty from './ImageProperty';
3
- import vtkMapper from './Mapper';
3
+ import vtkImageMapper from './ImageMapper';
4
4
  import vtkProp3D, { IProp3DInitialValues } from './Prop3D';
5
5
 
6
- interface IImageSliceInitialValues extends IProp3DInitialValues{
7
- mapper?: vtkMapper;
6
+ export interface IImageSliceInitialValues extends IProp3DInitialValues{
7
+ mapper?: vtkImageMapper;
8
8
  property?: vtkImageProperty;
9
9
  bounds?: Bounds;
10
10
  }
@@ -49,7 +49,7 @@ export interface vtkImageSlice extends vtkProp3D {
49
49
  /**
50
50
  *
51
51
  */
52
- getMapper(): vtkMapper;
52
+ getMapper(): vtkImageMapper;
53
53
 
54
54
  /**
55
55
  * Get the minimum X bound