@kitware/vtk.js 25.4.0 → 25.7.0

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 (98) hide show
  1. package/Common/Core/CellArray.d.ts +20 -8
  2. package/Common/Core/CellArray.js +25 -6
  3. package/Common/Core/DataArray.d.ts +159 -15
  4. package/Common/Core/DataArray.js +181 -26
  5. package/Common/Core/Math/index.js +1 -1
  6. package/Common/Core/Math.js +1 -1
  7. package/Common/Core/Points.d.ts +6 -5
  8. package/Common/Core/Points.js +8 -4
  9. package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
  10. package/Common/DataModel/AbstractPointLocator.js +40 -0
  11. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +33 -22
  12. package/Common/DataModel/DataSetAttributes/FieldData.js +91 -9
  13. package/Common/DataModel/DataSetAttributes.d.ts +44 -0
  14. package/Common/DataModel/DataSetAttributes.js +11 -0
  15. package/Common/DataModel/IncrementalOctreeNode.d.ts +282 -0
  16. package/Common/DataModel/IncrementalOctreeNode.js +621 -0
  17. package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
  18. package/Common/DataModel/IncrementalOctreePointLocator.js +342 -0
  19. package/Common/DataModel/Line.js +1 -1
  20. package/Common/DataModel/Locator.d.ts +43 -0
  21. package/Common/DataModel/Locator.js +37 -0
  22. package/Common/DataModel/Plane.js +1 -1
  23. package/Common/DataModel/Polygon/Constants.js +12 -0
  24. package/Common/DataModel/Polygon.d.ts +38 -4
  25. package/Common/DataModel/Polygon.js +210 -6
  26. package/Common/DataModel/Quad/Constants.js +9 -0
  27. package/Common/DataModel/Quad.d.ts +91 -0
  28. package/Common/DataModel/Quad.js +235 -0
  29. package/Common/DataModel/Triangle.d.ts +106 -81
  30. package/Common/DataModel/Triangle.js +1 -1
  31. package/Common/Transform/LandmarkTransform.js +1 -1
  32. package/Filters/Core/PolyDataNormals.js +1 -1
  33. package/Filters/General/ClipClosedSurface/Constants.js +10 -0
  34. package/Filters/General/ClipClosedSurface/ccsEdgeLocator.js +40 -0
  35. package/Filters/General/ClipClosedSurface.d.ts +95 -0
  36. package/Filters/General/ClipClosedSurface.js +970 -0
  37. package/Filters/General/ContourTriangulator/Constants.js +6 -0
  38. package/Filters/General/ContourTriangulator/helper.js +1951 -0
  39. package/Filters/General/ContourTriangulator.d.ts +122 -0
  40. package/Filters/General/ContourTriangulator.js +200 -0
  41. package/Filters/General/ImageMarchingCubes.js +1 -1
  42. package/Filters/General/MoleculeToRepresentation.js +1 -1
  43. package/Filters/General/OBBTree.js +1 -1
  44. package/Filters/General/TubeFilter.js +1 -1
  45. package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
  46. package/Filters/Sources/PlaneSource.js +1 -1
  47. package/Filters/Texture/TextureMapToPlane.js +1 -1
  48. package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.js +4 -8
  49. package/IO/Core/DataAccessHelper/HttpDataAccessHelper.js +6 -14
  50. package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.js +60 -57
  51. package/IO/Core/ZipMultiDataSetReader.js +19 -29
  52. package/IO/Core/ZipMultiDataSetWriter.js +7 -23
  53. package/IO/Misc/SkyboxReader.js +67 -75
  54. package/IO/XML/XMLReader.js +2 -2
  55. package/IO/XML/XMLWriter.js +2 -2
  56. package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
  57. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
  58. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
  59. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  60. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  61. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  62. package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
  63. package/Interaction/Style/InteractorStyleTrackballCamera.js +16 -0
  64. package/Proxy/Core/View2DProxy.js +1 -1
  65. package/Rendering/Core/Actor2D.d.ts +12 -6
  66. package/Rendering/Core/Camera.js +1 -1
  67. package/Rendering/Core/CellPicker.js +3 -2
  68. package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
  69. package/Rendering/Core/Light.js +1 -1
  70. package/Rendering/Core/Picker.js +1 -1
  71. package/Rendering/Core/Property2D.d.ts +1 -1
  72. package/Rendering/Core/VolumeProperty.d.ts +4 -4
  73. package/Rendering/Core/VolumeProperty.js +1 -1
  74. package/Rendering/OpenGL/PolyDataMapper.js +1 -1
  75. package/Rendering/OpenGL/RenderWindow/ContextProxy.js +65 -0
  76. package/Rendering/OpenGL/RenderWindow.js +3 -1
  77. package/Rendering/WebGPU/BufferManager.js +1 -1
  78. package/Rendering/WebGPU/ForwardPass.js +93 -15
  79. package/Rendering/WebGPU/OpaquePass.js +1 -1
  80. package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
  81. package/Rendering/WebGPU/RenderEncoder.js +9 -5
  82. package/Rendering/WebGPU/RenderWindow.js +15 -13
  83. package/Rendering/WebGPU/TextureView.js +15 -2
  84. package/Rendering/WebGPU/VolumePass.js +1 -1
  85. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
  86. package/Widgets/Manipulators/LineManipulator.js +1 -1
  87. package/Widgets/Manipulators/TrackballManipulator.js +1 -1
  88. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  89. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
  90. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  91. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  92. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  93. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  94. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  95. package/index.d.ts +8 -0
  96. package/index.js +0 -2
  97. package/package.json +3 -4
  98. package/ThirdParty/index.js +0 -9
@@ -3,84 +3,94 @@ import vtkCell, { ICellInitialValues } from './Cell';
3
3
 
4
4
  export interface ITriangleInitialValues extends ICellInitialValues {}
5
5
 
6
- interface IIntersectWithLine {
7
- intersect: number;
8
- t: number;
9
- subId: number;
10
- evaluation?: number;
11
- betweenPoints?: boolean;
6
+ export interface IIntersectWithLine {
7
+ intersect: number;
8
+ t: number;
9
+ subId: number;
10
+ evaluation?: number;
11
+ betweenPoints?: boolean;
12
12
  }
13
13
 
14
14
  export interface vtkTriangle extends vtkCell {
15
+ /**
16
+ * Get the topological dimensional of the cell (0, 1, 2 or 3).
17
+ */
18
+ getCellDimension(): number;
15
19
 
16
- /**
17
- * Get the topological dimensional of the cell (0, 1, 2 or 3).
18
- */
19
- getCellDimension(): number;
20
+ /**
21
+ * Compute the intersection point of the intersection between triangle and
22
+ * line defined by p1 and p2. tol Tolerance use for the position evaluation
23
+ * x is the point which intersect triangle (computed in function) pcoords
24
+ * parametric coordinates (computed in function) A javascript object is
25
+ * returned :
26
+ *
27
+ * ```js
28
+ * {
29
+ * evaluation: define if the triangle has been intersected or not
30
+ * subId: always set to 0
31
+ * t: parametric coordinate along the line.
32
+ * betweenPoints: Define if the intersection is between input points
33
+ * }
34
+ * ```
35
+ *
36
+ * @param {Vector3} p1 The first point coordinate.
37
+ * @param {Vector3} p2 The second point coordinate.
38
+ * @param {Number} tol The tolerance to use.
39
+ * @param {Vector3} x The point which intersect triangle.
40
+ * @param {Vector3} pcoords The parametric coordinates.
41
+ */
42
+ intersectWithLine(
43
+ p1: Vector3,
44
+ p2: Vector3,
45
+ tol: number,
46
+ x: Vector3,
47
+ pcoords: Vector3
48
+ ): IIntersectWithLine;
20
49
 
21
- /**
22
- * Compute the intersection point of the intersection between triangle and
23
- * line defined by p1 and p2. tol Tolerance use for the position evaluation
24
- * x is the point which intersect triangle (computed in function) pcoords
25
- * parametric coordinates (computed in function) A javascript object is
26
- * returned :
27
- *
28
- * ```js
29
- * {
30
- * evaluation: define if the triangle has been intersected or not
31
- * subId: always set to 0
32
- * t: parametric coordinate along the line.
33
- * betweenPoints: Define if the intersection is between input points
34
- * }
35
- * ```
36
- *
37
- * @param {Vector3} p1 The first point coordinate.
38
- * @param {Vector3} p2 The second point coordinate.
39
- * @param {Number} tol The tolerance to use.
40
- * @param {Vector3} x The point which intersect triangle.
41
- * @param {Vector3} pcoords The parametric coordinates.
42
- */
43
- intersectWithLine(p1: Vector3, p2: Vector3, tol: number, x: Vector3, pcoords: Vector3): IIntersectWithLine;
50
+ /**
51
+ * Evaluate the position of x in relation with triangle.
52
+ *
53
+ * Compute the closest point in the cell.
54
+ * - pccords parametric coordinate (computed in function)
55
+ * - weights Interpolation weights in cell.
56
+ * - the number of weights is equal to the number of points defining the
57
+ * cell (computed in function).
58
+ *
59
+ * A javascript object is returned :
60
+ *
61
+ * ```js
62
+ * {
63
+ * evaluation: 1 = inside 0 = outside -1 = problem during execution
64
+ * subId: always set to 0
65
+ * dist2: squared distance from x to cell
66
+ * }
67
+ * ```
68
+ *
69
+ * @param {Vector3} x The x point coordinate.
70
+ * @param {Vector3} closestPoint The closest point coordinate.
71
+ * @param {Vector3} pcoords The parametric coordinates.
72
+ * @param {Number[]} weights The number of weights.
73
+ */
74
+ evaluatePosition(
75
+ x: Vector3,
76
+ closestPoint: Vector3,
77
+ pcoords: Vector3,
78
+ weights: number[]
79
+ ): IIntersectWithLine;
44
80
 
45
- /**
46
- * Evaluate the position of x in relation with triangle.
47
- *
48
- * Compute the closest point in the cell.
49
- * - pccords parametric coordinate (computed in function)
50
- * - weights Interpolation weights in cell.
51
- * - the number of weights is equal to the number of points defining the
52
- * cell (computed in function).
53
- *
54
- * A javascript object is returned :
55
- *
56
- * ```js
57
- * {
58
- * evaluation: 1 = inside 0 = outside -1 = problem during execution
59
- * subId: always set to 0
60
- * dist2: squared distance from x to cell
61
- * }
62
- * ```
63
- *
64
- * @param {Vector3} x The x point coordinate.
65
- * @param {Vector3} closestPoint The closest point coordinate.
66
- * @param {Vector3} pcoords The parametric coordinates.
67
- * @param {Number[]} weights The number of weights.
68
- */
69
- evaluatePosition(x: Vector3, closestPoint: Vector3, pcoords: Vector3, weights: number[]): IIntersectWithLine
81
+ /**
82
+ * Determine global coordinate (x]) from subId and parametric coordinates.
83
+ * @param {Vector3} pcoords The parametric coordinates.
84
+ * @param {Vector3} x The x point coordinate.
85
+ * @param {Number[]} weights The number of weights.
86
+ */
87
+ evaluateLocation(pcoords: Vector3, x: Vector3, weights: number[]): void;
70
88
 
71
- /**
72
- * Determine global coordinate (x]) from subId and parametric coordinates.
73
- * @param {Vector3} pcoords The parametric coordinates.
74
- * @param {Vector3} x The x point coordinate.
75
- * @param {Number[]} weights The number of weights.
76
- */
77
- evaluateLocation(pcoords: Vector3, x: Vector3, weights: number[]): void;
78
-
79
- /**
80
- * Get the distance of the parametric coordinate provided to the cell.
81
- * @param {Vector3} pcoords The parametric coordinates.
82
- */
83
- getParametricDistance(pcoords: Vector3): number;
89
+ /**
90
+ * Get the distance of the parametric coordinate provided to the cell.
91
+ * @param {Vector3} pcoords The parametric coordinates.
92
+ */
93
+ getParametricDistance(pcoords: Vector3): number;
84
94
  }
85
95
 
86
96
  /**
@@ -90,14 +100,19 @@ export interface vtkTriangle extends vtkCell {
90
100
  * @param model object on which data structure will be bounds (protected)
91
101
  * @param {ITriangleInitialValues} [initialValues] (default: {})
92
102
  */
93
- export function extend(publicAPI: object, model: object, initialValues?: ITriangleInitialValues): void;
103
+ export function extend(
104
+ publicAPI: object,
105
+ model: object,
106
+ initialValues?: ITriangleInitialValues
107
+ ): void;
94
108
 
95
109
  /**
96
110
  * Method used to create a new instance of vtkTriangle.
97
111
  * @param {ITriangleInitialValues} [initialValues] for pre-setting some of its content
98
112
  */
99
- export function newInstance(initialValues?: ITriangleInitialValues): vtkTriangle;
100
-
113
+ export function newInstance(
114
+ initialValues?: ITriangleInitialValues
115
+ ): vtkTriangle;
101
116
 
102
117
  /**
103
118
  * Compute the normal direction according to the three vertex which composed a
@@ -107,7 +122,12 @@ export function newInstance(initialValues?: ITriangleInitialValues): vtkTriangle
107
122
  * @param {Vector3} v3 The third point coordinate.
108
123
  * @param {Vector3} n The normal coordinate.
109
124
  */
110
- export function computeNormalDirection(v1: Vector3, v2: Vector3, v3: Vector3, n: Vector3): void;
125
+ export function computeNormalDirection(
126
+ v1: Vector3,
127
+ v2: Vector3,
128
+ v3: Vector3,
129
+ n: Vector3
130
+ ): void;
111
131
 
112
132
  /**
113
133
  * Compute the normalized normal of a triangle composed of three points. The
@@ -117,18 +137,23 @@ export function computeNormalDirection(v1: Vector3, v2: Vector3, v3: Vector3, n:
117
137
  * @param {Vector3} v3 The third point coordinate.
118
138
  * @param {Vector3} n The normal coordinate.
119
139
  */
120
- export function computeNormal(v1: Vector3, v2: Vector3, v3: Vector3, n: Vector3): void;
140
+ export function computeNormal(
141
+ v1: Vector3,
142
+ v2: Vector3,
143
+ v3: Vector3,
144
+ n: Vector3
145
+ ): void;
121
146
 
122
147
  /**
123
148
  * vtkTriangle is a cell which representant a triangle. It contains static
124
149
  * method to make some computations directly link to triangle.
125
- *
150
+ *
126
151
  * @see vtkCell
127
152
  */
128
153
  export declare const vtkTriangle: {
129
- newInstance: typeof newInstance,
130
- extend: typeof extend;
131
- computeNormalDirection: typeof computeNormalDirection;
132
- computeNormal: typeof computeNormal;
154
+ newInstance: typeof newInstance;
155
+ extend: typeof extend;
156
+ computeNormalDirection: typeof computeNormalDirection;
157
+ computeNormal: typeof computeNormal;
133
158
  };
134
159
  export default vtkTriangle;
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkCell from './Cell.js';
4
- import { d as dot, j as cross, l as normalize, m as multiplyAccumulate, f as distance2BetweenPoints, o as determinant2x2 } from '../Core/Math/index.js';
4
+ import { d as dot, k as cross, m as normalize, o as multiplyAccumulate, f as distance2BetweenPoints, p as determinant2x2 } from '../Core/Math/index.js';
5
5
  import vtkLine from './Line.js';
6
6
  import vtkPlane from './Plane.js';
7
7
 
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import { mat4, mat3 } from 'gl-matrix';
3
3
  import Constants from './LandmarkTransform/Constants.js';
4
4
  import macro from '../../macros.js';
5
- import { p as jacobiN, q as perpendiculars } from '../Core/Math/index.js';
5
+ import { q as jacobiN, t as perpendiculars } from '../Core/Math/index.js';
6
6
 
7
7
  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; }
8
8
 
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import macro from '../../macros.js';
3
3
  import vtkDataArray from '../../Common/Core/DataArray.js';
4
- import { t as vtkMath } from '../../Common/Core/Math/index.js';
4
+ import { g as vtkMath } from '../../Common/Core/Math/index.js';
5
5
  import vtkPolyData from '../../Common/DataModel/PolyData.js';
6
6
  import vtkTriangle from '../../Common/DataModel/Triangle.js';
7
7
 
@@ -0,0 +1,10 @@
1
+ var ScalarMode = {
2
+ NONE: 0,
3
+ COLORS: 1,
4
+ LABELS: 2
5
+ };
6
+ var Constants = {
7
+ ScalarMode: ScalarMode
8
+ };
9
+
10
+ export { ScalarMode, Constants as default };
@@ -0,0 +1,40 @@
1
+ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
2
+ import _createClass from '@babel/runtime/helpers/createClass';
3
+
4
+ var CCSEdgeLocator = /*#__PURE__*/function () {
5
+ function CCSEdgeLocator() {
6
+ _classCallCheck(this, CCSEdgeLocator);
7
+
8
+ this._edgeMap = new Map();
9
+ }
10
+
11
+ _createClass(CCSEdgeLocator, [{
12
+ key: "initialize",
13
+ value: function initialize() {
14
+ this._edgeMap.clear();
15
+ }
16
+ }, {
17
+ key: "insertUniqueEdge",
18
+ value: function insertUniqueEdge(i0, i1) {
19
+ // Generate key, which is unique, since we order the edges
20
+ var key = i1 < i0 ? "".concat(i1, "-").concat(i0) : "".concat(i0, "-").concat(i1);
21
+
22
+ var node = this._edgeMap.get(key);
23
+
24
+ if (!node) {
25
+ // Didn't find key, so add a new edge entry
26
+ node = {
27
+ edgeId: -1
28
+ };
29
+
30
+ this._edgeMap.set(key, node);
31
+ }
32
+
33
+ return node;
34
+ }
35
+ }]);
36
+
37
+ return CCSEdgeLocator;
38
+ }();
39
+
40
+ export { CCSEdgeLocator as default };
@@ -0,0 +1,95 @@
1
+ import { vtkAlgorithm, vtkObject } from './../../interfaces';
2
+ import { Vector3 } from './../../types';
3
+ import vtkPlane from './../../Common/DataModel/Plane';
4
+
5
+ /**
6
+ *
7
+ */
8
+ export enum ScalarMode {
9
+ NONE,
10
+ COLORS,
11
+ LABELS,
12
+ }
13
+
14
+ /**
15
+ *
16
+ */
17
+ export interface IClipClosedSurfaceInitialValues {
18
+ clippingPlanes?: vtkPlane[];
19
+ tolerance?: number;
20
+ passPointData?: boolean;
21
+ triangulatePolys?: boolean;
22
+ scalarMode?: ScalarMode;
23
+ generateOutline?: boolean;
24
+ generateFaces?: boolean;
25
+ activePlaneId?: number;
26
+ baseColor?: Vector3;
27
+ clipColor?: Vector3;
28
+ activePlaneColor?: Vector3;
29
+ triangulationErrorDisplay?: boolean;
30
+ }
31
+
32
+ type vtkClipClosedSurfaceBase = vtkObject & vtkAlgorithm;
33
+
34
+ export interface vtkClipClosedSurface extends vtkClipClosedSurfaceBase {
35
+ /**
36
+ *
37
+ * @param {any} inData
38
+ * @param {any} outData
39
+ */
40
+ requestData(inData: any, outData: any): void;
41
+
42
+ /**
43
+ * Set scalarMode to NONE.
44
+ */
45
+ setScalarModeToNone(): void;
46
+
47
+ /**
48
+ * Set scalarMode to COLOR.
49
+ */
50
+ setScalarModeToColor(): void;
51
+
52
+ /**
53
+ * Set scalarMode to LABEL.
54
+ */
55
+ setScalarModeToLabel(): void;
56
+ }
57
+
58
+ // ----------------------------------------------------------------------------
59
+ // Static API
60
+ // ----------------------------------------------------------------------------
61
+
62
+ /**
63
+ * Method use to decorate a given object (publicAPI+model) with vtkClipClosedSurface characteristics.
64
+ *
65
+ * @param publicAPI object on which methods will be bounds (public)
66
+ * @param model object on which data structure will be bounds (protected)
67
+ * @param {object} [initialValues] (default: {})
68
+ */
69
+ export function extend(
70
+ publicAPI: object,
71
+ model: object,
72
+ initialValues?: IClipClosedSurfaceInitialValues
73
+ ): void;
74
+
75
+ // ----------------------------------------------------------------------------
76
+
77
+ /**
78
+ * Method use to create a new instance of vtkClipClosedSurface
79
+ * @param {IClipClosedSurfaceInitialValues} [initialValues] for pre-setting some of its content
80
+ */
81
+ export function newInstance(
82
+ initialValues?: IClipClosedSurfaceInitialValues
83
+ ): vtkClipClosedSurface;
84
+
85
+ /**
86
+ * vtkClipClosedSurface
87
+ */
88
+ export declare const vtkClipClosedSurface: {
89
+ newInstance: typeof newInstance;
90
+ extend: typeof extend;
91
+ // constants
92
+ ScalarMode: typeof ScalarMode;
93
+ };
94
+
95
+ export default vtkClipClosedSurface;