@kitware/vtk.js 25.5.0 → 25.7.1

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 (85) 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 +971 -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/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
  49. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
  50. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
  51. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  52. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  53. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  54. package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
  55. package/Proxy/Core/View2DProxy.js +1 -1
  56. package/Rendering/Core/Actor2D.d.ts +12 -6
  57. package/Rendering/Core/Camera.js +1 -1
  58. package/Rendering/Core/CellPicker.js +3 -2
  59. package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
  60. package/Rendering/Core/Light.js +1 -1
  61. package/Rendering/Core/Picker.js +1 -1
  62. package/Rendering/Core/Property2D.d.ts +1 -1
  63. package/Rendering/Core/VolumeProperty.d.ts +4 -4
  64. package/Rendering/Core/VolumeProperty.js +1 -1
  65. package/Rendering/OpenGL/PolyDataMapper.js +1 -1
  66. package/Rendering/WebGPU/BufferManager.js +1 -1
  67. package/Rendering/WebGPU/ForwardPass.js +93 -15
  68. package/Rendering/WebGPU/OpaquePass.js +1 -1
  69. package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
  70. package/Rendering/WebGPU/RenderEncoder.js +9 -5
  71. package/Rendering/WebGPU/RenderWindow.js +15 -13
  72. package/Rendering/WebGPU/TextureView.js +15 -2
  73. package/Rendering/WebGPU/VolumePass.js +1 -1
  74. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
  75. package/Widgets/Manipulators/LineManipulator.js +1 -1
  76. package/Widgets/Manipulators/TrackballManipulator.js +1 -1
  77. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  78. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
  79. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  80. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  81. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  82. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  83. package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
  84. package/index.d.ts +8 -0
  85. package/package.json +1 -1
@@ -0,0 +1,282 @@
1
+ import { vtkObject } from './../../interfaces';
2
+ import { Bounds, Vector3 } from './../../types';
3
+ import vtkPoints from './../Core/Points';
4
+ /**
5
+ *
6
+ */
7
+ export interface IIncrementalOctreeNodeInitialValues {
8
+ pointIdSet?: number[];
9
+ minBounds?: Bounds;
10
+ maxBounds?: Bounds;
11
+ minDataBounds?: Bounds;
12
+ maxDataBounds?: Bounds;
13
+ parent?: vtkIncrementalOctreeNode;
14
+ children?: vtkIncrementalOctreeNode[];
15
+ }
16
+
17
+ export interface vtkIncrementalOctreeNode extends vtkObject {
18
+ /**
19
+ * Create a list object for storing point indices.
20
+ */
21
+ createPointIdSet(): void;
22
+
23
+ /**
24
+ * Set the spatial bounding box of the node. This function sets a default
25
+ * data bounding box.
26
+ *
27
+ * @param {Number} x1
28
+ * @param {Number} x2
29
+ * @param {Number} y1
30
+ * @param {Number} y2
31
+ * @param {Number} z1
32
+ * @param {Number} z2
33
+ */
34
+ setBounds(
35
+ x1: number,
36
+ x2: number,
37
+ y1: number,
38
+ y2: number,
39
+ z1: number,
40
+ z2: number
41
+ ): void;
42
+
43
+ /**
44
+ * Get the spatial bounding box of the node. The values are returned via
45
+ * an array in order of: x_min, x_max, y_min, y_max, z_min, z_max.
46
+ *
47
+ * @param {Bounds} bounds
48
+ */
49
+ getBounds(bounds: Bounds): void;
50
+
51
+ /**
52
+ * Given a point inserted to either this node (a leaf node) or a descendant
53
+ * leaf (of this node --- when this node is a non-leaf node), update the
54
+ * counter and the data bounding box for this node only. The data bounding box
55
+ * is considered only if updateData is non-zero. The returned value indicates
56
+ * whether (1) or not (0) the data bounding box is actually updated. Note that
57
+ * argument nHits must be 1 unless this node is updated with a number (nHits)
58
+ * of exactly duplicate points as a whole via a single call to this function.
59
+ *
60
+ * @param {Vector3} point
61
+ * @param {Number} nHits
62
+ * @param {Boolean} updateData
63
+ */
64
+ updateCounterAndDataBounds(
65
+ point: Vector3,
66
+ nHits: number,
67
+ updateData: boolean
68
+ ): boolean;
69
+
70
+ /**
71
+ * Given a point inserted to either this node (a leaf node) or a descendant
72
+ * leaf (of this node --- when this node is a non-leaf node), update the
73
+ * counter and the data bounding box recursively bottom-up until a specified
74
+ * node. The data bounding box is considered only if updateData is non-zero.
75
+ * The returned value indicates whether (true) or not (false) the data bounding box
76
+ * is actually updated. Note that argument nHits must be 1 unless this node
77
+ * is updated with a number (nHits) of exactly duplicate points as a whole
78
+ * via a single call to this function.
79
+ *
80
+ * @param {Vector3} point
81
+ * @param {Number} nHits
82
+ * @param {Boolean} updateData
83
+ * @param {vtkIncrementalOctreeNode} endNode
84
+ */
85
+ updateCounterAndDataBoundsRecursively(
86
+ point: Vector3,
87
+ nHits: number,
88
+ updateData: boolean,
89
+ endNode: vtkIncrementalOctreeNode
90
+ ): boolean;
91
+
92
+ /**
93
+ * Given a point, determine whether (true) or not (false) it is an exact duplicate
94
+ * of all the points, if any, maintained in this node. In other words, to
95
+ * check if this given point and all existing points, if any, of this node
96
+ * are exactly duplicate with one another.
97
+ *
98
+ * @param {Vector3} point
99
+ */
100
+ containsDuplicatePointsOnly(point: Vector3): boolean;
101
+
102
+ /**
103
+ * Determine whether or not this node is a leaf.
104
+ */
105
+ isLeaf(): boolean;
106
+
107
+ /**
108
+ * Get the child at the given index i.
109
+ * i must be an int between 0 and 7.
110
+ *
111
+ * @param {Number} i
112
+ */
113
+ getChild(i: number): vtkIncrementalOctreeNode;
114
+
115
+ /**
116
+ * Given a number (>= threshold) of all exactly duplicate points (accessible
117
+ * via points and pntIds, but with exactly the same 3D coordinate) maintained
118
+ * in this leaf node and a point (absolutely not a duplicate any more, with
119
+ * pntIdx storing the index in points)) to be inserted to this node, separate
120
+ * all the duplicate points from this new point by means of usually recursive
121
+ * node sub-division such that the former points are inserted to a descendant
122
+ * leaf while the new point is inserted to a sibling of this descendant leaf.
123
+ * Argument ptMode specifies whether the point is not inserted at all but only
124
+ * the point index is provided upon 0, the point is inserted via vtkPoints::
125
+ * InsertPoint() upon 1, or this point is instead inserted through vtkPoints::
126
+ * InsertNextPoint() upon 2.
127
+ *
128
+ * @param {vtkPoints} points
129
+ * @param {Number[]} pntIds
130
+ * @param {Vector3} newPnt
131
+ * @param {Number} pntIdx
132
+ * @param {Number} maxPts
133
+ * @param {Number} ptMode
134
+ */
135
+ separateExactlyDuplicatePointsFromNewInsertion(
136
+ points: vtkPoints,
137
+ pntIds: number[],
138
+ newPnt: Vector3,
139
+ pntIdx: number,
140
+ maxPts: number,
141
+ ptMode: number
142
+ ): void;
143
+
144
+ /**
145
+ * Divide this LEAF node into eight child nodes as the number of points
146
+ * maintained by this leaf node has reached the threshold maxPts while
147
+ * another point newPnt is just going to be inserted to it. The available
148
+ * point-indices pntIds are distributed to the child nodes based on the
149
+ * point coordinates (available through points). Note that this function
150
+ * can incur recursive node-division to determine the specific leaf node
151
+ * for accepting the new point (with pntIdx storing the index in points)
152
+ * because the existing maxPts points may fall within only one of the eight
153
+ * child nodes to make a radically imbalanced layout within the node (to
154
+ * be divided). Argument ptMode specifies whether the point is not inserted
155
+ * at all but instead only the point index is provided upon 0, the point is
156
+ * inserted via vtkPoints.InsertPoint() upon 1, or the point is inserted by
157
+ * vtkPoints.InsertNextPoint() upon 2. The returned value of this function
158
+ * indicates whether pntIds needs to be destroyed (1) or just unregistered
159
+ * from this node as it has been attached to another node (0).
160
+ * numberOfNodes in the tree is updated with new created nodes
161
+ *
162
+ * @param {vtkPoints} points
163
+ * @param {Number[]} pntIds
164
+ * @param {Vector3} newPnt
165
+ * @param {Number} pntIdx
166
+ * @param {Number} maxPts
167
+ * @param {Number} ptMode
168
+ * @param {Number} numberOfNodes
169
+ */
170
+ createChildNodes(
171
+ points: vtkPoints,
172
+ pntIds: number[],
173
+ newPnt: Vector3,
174
+ pntIdx: number,
175
+ maxPts: number,
176
+ ptMode: number,
177
+ numberOfNodes: number
178
+ ): { success: boolean; numberOfNodes: number; pointIdx: number };
179
+
180
+ /**
181
+ * This function is called after a successful point-insertion check and
182
+ * only applies to a leaf node. Prior to a call to this function, the
183
+ * octree should have been retrieved top-down to find the specific leaf
184
+ * node in which this new point (newPt) will be inserted. The actual index
185
+ * of the new point (to be inserted to points) is stored in pntId. Argument
186
+ * ptMode specifies whether the point is not inserted at all but instead only
187
+ * the point index is provided upon 0, the point is inserted via vtkPoints.
188
+ * insertPoint() upon 1, or it is inserted via vtkPoints.insertNextPoint()
189
+ * upon 2. For case 0, pntId needs to be specified. For cases 1 and 2, the
190
+ * actual point index is returned via pntId. Note that this function always
191
+ * returns 1 to indicate the success of point insertion.
192
+ * numberOfNodes is the number of nodes present in the tree at this time.
193
+ * it is used to assign an ID to each node which can be used to associate
194
+ * application specific information with each node. It is updated if new nodes
195
+ * are added to the tree.
196
+ *
197
+ * @param {Number} points
198
+ * @param {Number} newPnt
199
+ * @param {Number} maxPts
200
+ * @param {Number} pntId
201
+ * @param {Number} ptMode
202
+ * @param {Number} numberOfNodes
203
+ */
204
+ insertPoint(
205
+ points: number,
206
+ newPnt: number,
207
+ maxPts: number,
208
+ pntId: number,
209
+ ptMode: number,
210
+ numberOfNodes: number
211
+ ): { numberOfNodes: number; pointIdx: number };
212
+
213
+ /**
214
+ * Compute the minimum squared distance from a point to this node, with all
215
+ * six boundaries considered. The data bounding box is checked if checkData
216
+ * is non-zero. The closest on-boundary point is returned via closest.
217
+ *
218
+ * @param {Vector3} point
219
+ * @param {Vector3} closest
220
+ * @param {Boolean} innerOnly
221
+ * @param {vtkIncrementalOctreeNode} rootNode
222
+ * @param {Boolean} checkData
223
+ * @returns {Number}
224
+ */
225
+ getDistance2ToBoundary(
226
+ point: Vector3,
227
+ closest: Vector3,
228
+ innerOnly: boolean,
229
+ rootNode: vtkIncrementalOctreeNode,
230
+ checkData: boolean
231
+ ): number;
232
+
233
+ /**
234
+ * Given a point inside this node, get the minimum squared distance to all
235
+ * inner boundaries. An inner boundary is a node's face that is shared by
236
+ * another non-root node.
237
+ *
238
+ * @param {Vector3} point
239
+ * @param {vtkIncrementalOctreeNode} rootNode
240
+ */
241
+ getDistance2ToInnerBoundary(
242
+ point: Vector3,
243
+ rootNode: vtkIncrementalOctreeNode
244
+ ): number;
245
+ }
246
+
247
+ // ----------------------------------------------------------------------------
248
+ // Static API
249
+ // ----------------------------------------------------------------------------
250
+
251
+ /**
252
+ * Method use to decorate a given object (publicAPI+model) with vtkIncrementalOctreeNode characteristics.
253
+ *
254
+ * @param publicAPI object on which methods will be bounds (public)
255
+ * @param model object on which data structure will be bounds (protected)
256
+ * @param {object} [initialValues] (default: {})
257
+ */
258
+ export function extend(
259
+ publicAPI: object,
260
+ model: object,
261
+ initialValues?: object
262
+ ): void;
263
+
264
+ // ----------------------------------------------------------------------------
265
+
266
+ /**
267
+ * Method use to create a new instance of vtkIncrementalOctreeNode
268
+ * @param {IIncrementalOctreeNodeInitialValues} [initialValues] for pre-setting some of its content
269
+ */
270
+ export function newInstance(
271
+ initialValues?: IIncrementalOctreeNodeInitialValues
272
+ ): vtkIncrementalOctreeNode;
273
+
274
+ /**
275
+ * vtkIncrementalOctreeNode
276
+ */
277
+ export declare const vtkIncrementalOctreeNode: {
278
+ newInstance: typeof newInstance;
279
+ extend: typeof extend;
280
+ };
281
+
282
+ export default vtkIncrementalOctreeNode;