@kitware/vtk.js 23.4.2 → 23.4.4

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 (180) hide show
  1. package/Common/Core/Math/Constants.js +12 -0
  2. package/Common/Core/Math/index.js +1 -1
  3. package/Common/Core/Math.js +1 -1
  4. package/Common/Core/ScalarsToColors/Constants.d.ts +18 -0
  5. package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
  6. package/Common/DataModel/AbstractPointLocator.js +40 -0
  7. package/Common/DataModel/BoundingBox.d.ts +659 -0
  8. package/Common/DataModel/Collection.d.ts +118 -0
  9. package/Common/DataModel/Collection.js +113 -0
  10. package/Common/DataModel/DataSet/Constants.d.ts +27 -0
  11. package/Common/DataModel/EdgeLocator.d.ts +79 -0
  12. package/Common/DataModel/EdgeLocator.js +85 -0
  13. package/Common/DataModel/ITKHelper.d.ts +54 -0
  14. package/Common/DataModel/IncrementalOctreeNode.d.ts +297 -0
  15. package/Common/DataModel/IncrementalOctreeNode.js +640 -0
  16. package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
  17. package/Common/DataModel/IncrementalOctreePointLocator.js +398 -0
  18. package/Common/DataModel/Locator.d.ts +43 -0
  19. package/Common/DataModel/Locator.js +37 -0
  20. package/Common/DataModel/Plane.js +1 -1
  21. package/Common/DataModel/PolyData/Constants.d.ts +6 -0
  22. package/Common/DataModel/PolyLine.d.ts +63 -0
  23. package/Common/DataModel/PolyLine.js +77 -0
  24. package/Common/DataModel/Polygon/Constants.js +12 -0
  25. package/Common/DataModel/Polygon.js +1 -1
  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/SelectionNode/Constants.d.ts +27 -0
  30. package/Common/DataModel/Spline1D/Constants.js +17 -0
  31. package/Common/DataModel/Spline3D/Constants.d.ts +9 -0
  32. package/Common/Transform/Transform.js +51 -0
  33. package/Filters/Core/PolyDataNormals.js +124 -0
  34. package/Filters/General/ClipClosedSurface/Constants.js +10 -0
  35. package/Filters/General/ClipClosedSurface.d.ts +95 -0
  36. package/Filters/General/ClipClosedSurface.js +972 -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 +136 -0
  40. package/Filters/General/ContourTriangulator.js +202 -0
  41. package/Filters/General/ImageMarchingCubes.js +1 -1
  42. package/Filters/General/MoleculeToRepresentation.js +1 -1
  43. package/Filters/General/OBBTree/OBBNode.js +82 -0
  44. package/Filters/General/OBBTree/helper.js +92 -0
  45. package/Filters/General/OBBTree.js +1243 -0
  46. package/Filters/General/TubeFilter.js +1 -1
  47. package/Filters/Sources/LineSource.js +1 -1
  48. package/Filters/Sources/PlaneSource.js +1 -1
  49. package/Filters/Texture/TextureMapToPlane.js +1 -1
  50. package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +68 -0
  51. package/Interaction/Manipulators/CompositeGestureManipulator.d.ts +168 -0
  52. package/Interaction/Manipulators/CompositeKeyboardManipulator.d.ts +48 -0
  53. package/Interaction/Manipulators/CompositeMouseManipulator.d.ts +149 -0
  54. package/Interaction/Manipulators/CompositeVRManipulator.d.ts +44 -0
  55. package/Interaction/Manipulators/GestureCameraManipulator.d.ts +34 -0
  56. package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
  57. package/Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts +88 -0
  58. package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
  59. package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
  60. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
  61. package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
  62. package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
  63. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
  64. package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
  65. package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
  66. package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
  67. package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
  68. package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
  69. package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
  70. package/Interaction/Style/InteractorStyleImage.d.ts +107 -0
  71. package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
  72. package/Interaction/Style/InteractorStyleManipulator.d.ts +348 -0
  73. package/Interaction/Style/InteractorStyleTrackballCamera.d.ts +170 -0
  74. package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
  75. package/Interaction/Widgets/LabelRepresentation.js +1 -1
  76. package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +11 -0
  77. package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
  78. package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
  79. package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
  80. package/Proxy/Core/AbstractRepresentationProxy.d.ts +24 -0
  81. package/Proxy/Core/LookupTableProxy.d.ts +45 -0
  82. package/Proxy/Core/PiecewiseFunctionProxy.d.ts +62 -0
  83. package/Proxy/Core/ProxyManager.d.ts +115 -0
  84. package/Proxy/Core/SourceProxy.d.ts +22 -0
  85. package/Proxy/Core/View2DProxy.d.ts +7 -0
  86. package/Proxy/Core/View2DProxy.js +1 -1
  87. package/Proxy/Core/ViewProxy.d.ts +86 -0
  88. package/Proxy/Representations/SliceRepresentationProxy.d.ts +27 -0
  89. package/Proxy/Representations/VolumeRepresentationProxy.d.ts +44 -0
  90. package/README.md +2 -2
  91. package/Rendering/Core/AbstractImageMapper/helper.js +127 -0
  92. package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
  93. package/Rendering/Core/AbstractImageMapper.js +44 -0
  94. package/Rendering/Core/Camera.js +1 -1
  95. package/Rendering/Core/CellPicker.js +1 -1
  96. package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
  97. package/Rendering/Core/ColorTransferFunction/Constants.d.ts +17 -0
  98. package/Rendering/Core/ColorTransferFunction.js +1 -1
  99. package/Rendering/Core/Coordinate/Constants.d.ts +14 -0
  100. package/Rendering/Core/Coordinate.js +1 -1
  101. package/Rendering/Core/Glyph3DMapper/Constants.d.ts +17 -0
  102. package/Rendering/Core/Glyph3DMapper.js +1 -1
  103. package/Rendering/Core/HardwareSelector.d.ts +84 -0
  104. package/Rendering/Core/ImageArrayMapper.d.ts +253 -0
  105. package/Rendering/Core/ImageArrayMapper.js +242 -0
  106. package/Rendering/Core/ImageMapper/Constants.d.ts +14 -0
  107. package/Rendering/Core/ImageMapper.js +1 -1
  108. package/Rendering/Core/ImageProperty/Constants.d.ts +9 -0
  109. package/Rendering/Core/ImageResliceMapper/Constants.d.ts +11 -0
  110. package/Rendering/Core/ImageResliceMapper/Constants.js +11 -0
  111. package/Rendering/Core/ImageResliceMapper.d.ts +245 -0
  112. package/Rendering/Core/ImageResliceMapper.js +70 -0
  113. package/Rendering/Core/InteractorObserver.d.ts +132 -0
  114. package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
  115. package/Rendering/Core/InteractorStyle.d.ts +229 -0
  116. package/Rendering/Core/Light.js +1 -1
  117. package/Rendering/Core/Mapper/Constants.d.ts +26 -0
  118. package/Rendering/Core/Mapper.js +1 -1
  119. package/Rendering/Core/Picker.js +1 -1
  120. package/Rendering/Core/Prop/Constants.d.ts +9 -0
  121. package/Rendering/Core/Prop/Constants.js +9 -0
  122. package/Rendering/Core/Property/Constants.d.ts +24 -0
  123. package/Rendering/Core/Property2D/Constants.d.ts +9 -0
  124. package/Rendering/Core/RenderWindow.js +1 -1
  125. package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +31 -0
  126. package/Rendering/Core/Renderer.js +1 -1
  127. package/Rendering/Core/VolumeMapper/Constants.d.ts +20 -0
  128. package/Rendering/Core/VolumeMapper.js +1 -1
  129. package/Rendering/Core/VolumeProperty/Constants.d.ts +16 -0
  130. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +129 -0
  131. package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +131 -0
  132. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +80 -0
  133. package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +763 -0
  134. package/Rendering/OpenGL/HardwareSelector/Constants.d.ts +8 -0
  135. package/Rendering/OpenGL/HardwareSelector.d.ts +339 -0
  136. package/Rendering/OpenGL/ImageResliceMapper.js +996 -0
  137. package/Rendering/OpenGL/PolyDataMapper.js +1 -1
  138. package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
  139. package/Rendering/OpenGL/RenderWindow/Constants.d.ts +10 -0
  140. package/Rendering/OpenGL/RenderWindow/Constants.js +13 -0
  141. package/Rendering/OpenGL/RenderWindow/ContextProxy.js +70 -0
  142. package/Rendering/OpenGL/RenderWindow.d.ts +9 -2
  143. package/Rendering/OpenGL/RenderWindow.js +2 -1
  144. package/Rendering/OpenGL/glsl/vtkImageResliceMapperFS.glsl.js +3 -0
  145. package/Rendering/OpenGL/glsl/vtkImageResliceMapperVS.glsl.js +3 -0
  146. package/Rendering/WebGPU/Actor2D.js +151 -0
  147. package/Rendering/WebGPU/BufferManager.js +1 -1
  148. package/Rendering/WebGPU/CellArrayMapper.js +853 -0
  149. package/Rendering/WebGPU/IndexBuffer.js +397 -0
  150. package/Rendering/WebGPU/PolyDataMapper2D.js +99 -0
  151. package/Rendering/WebGPU/RenderWindow.js +3 -1
  152. package/Rendering/WebGPU/SimpleMapper.js +290 -0
  153. package/Widgets/Core/AbstractWidget.d.ts +187 -0
  154. package/Widgets/Core/AbstractWidgetFactory.d.ts +131 -0
  155. package/Widgets/Core/StateBuilder/color3Mixin.js +24 -0
  156. package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
  157. package/Widgets/Core/StateBuilder.d.ts +29 -0
  158. package/Widgets/Core/WidgetManager/Constants.d.ts +27 -0
  159. package/Widgets/Core/WidgetManager.d.ts +231 -0
  160. package/Widgets/Core/WidgetState.d.ts +81 -0
  161. package/Widgets/Manipulators/AbstractManipulator.d.ts +221 -0
  162. package/Widgets/Manipulators/AbstractManipulator.js +57 -0
  163. package/Widgets/Manipulators/LineManipulator.js +1 -1
  164. package/Widgets/Manipulators/TrackballManipulator.js +1 -1
  165. package/Widgets/Representations/GlyphRepresentation.js +325 -0
  166. package/Widgets/Representations/LineHandleRepresentation.js +116 -0
  167. package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
  168. package/Widgets/Representations/WidgetRepresentation.js +1 -1
  169. package/Widgets/Widgets3D/AngleWidget.js +1 -1
  170. package/Widgets/Widgets3D/InteractiveOrientationWidget.d.ts +40 -0
  171. package/Widgets/Widgets3D/LabelWidget/behavior.js +157 -0
  172. package/Widgets/Widgets3D/LabelWidget/state.js +22 -0
  173. package/Widgets/Widgets3D/LabelWidget.js +78 -0
  174. package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
  175. package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
  176. package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
  177. package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
  178. package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
  179. package/index.d.ts +133 -74
  180. package/package.json +1 -1
@@ -0,0 +1,659 @@
1
+ import { mat4 } from 'gl-matrix';
2
+ import { Bounds, Vector2, Vector3 } from './../../types';
3
+ import vtkPoints from './../Core/Points';
4
+
5
+ /**
6
+ * Tests whether two bounds equal.
7
+ * @param {Bounds} a
8
+ * @param {Bounds} b
9
+ */
10
+ export function equals(a: Bounds, b: Bounds): boolean;
11
+
12
+ /**
13
+ * Tests whether a given bounds is valid.
14
+ * @param {Bounds} bounds
15
+ */
16
+ export function isValid(bounds: Bounds): boolean;
17
+
18
+ /**
19
+ * Sets a bounding box from another bounding box.
20
+ * @param {Bounds} bounds
21
+ * @param {Bounds} other
22
+ */
23
+ export function setBounds(bounds: Bounds, other: Bounds): Bounds;
24
+
25
+ /**
26
+ * Resets a bounds to infinity.
27
+ * @param {Bounds} bounds
28
+ */
29
+ export function reset(bounds: Bounds): Bounds;
30
+
31
+ /**
32
+ * Adds points to a bounding box.
33
+ * @param {Bounds} bounds
34
+ * @param {number} x
35
+ * @param {number} y
36
+ * @param {number} z
37
+ */
38
+ export function addPoint(
39
+ bounds: Bounds,
40
+ x: number,
41
+ y: number,
42
+ z: number
43
+ ): Bounds;
44
+
45
+ /**
46
+ * Adds points to a bounding box.
47
+ * @param {Bounds} bounds
48
+ * @param {number[]} points A flattened array of 3D coordinates.
49
+ */
50
+ export function addPoints(bounds: Bounds, points: number[]): Bounds;
51
+
52
+ /**
53
+ * Adds two bounding boxes together.
54
+ * @param {Bounds} bounds
55
+ * @param {number} xMin
56
+ * @param {number} xMax
57
+ * @param {number} yMin
58
+ * @param {number} yMax
59
+ * @param {number} zMin
60
+ * @param {number} zMax
61
+ */
62
+ export function addBounds(
63
+ bounds: Bounds,
64
+ xMin: number,
65
+ xMax: number,
66
+ yMin: number,
67
+ yMax: number,
68
+ zMin: number,
69
+ zMax: number
70
+ ): Bounds;
71
+
72
+ /**
73
+ * Sets the min point of a bounding box.
74
+ * @param {Bounds} bounds
75
+ * @param {number} x
76
+ * @param {number} y
77
+ * @param {number} z
78
+ */
79
+ export function setMinPoint(
80
+ bounds: Bounds,
81
+ x: number,
82
+ y: number,
83
+ z: number
84
+ ): boolean;
85
+
86
+ /**
87
+ * Sets the max point of a bounding box.
88
+ * @param {Bounds} bounds
89
+ * @param {number} x
90
+ * @param {number} y
91
+ * @param {number} z
92
+ */
93
+ export function setMaxPoint(
94
+ bounds: Bounds,
95
+ x: number,
96
+ y: number,
97
+ z: number
98
+ ): boolean;
99
+
100
+ /**
101
+ * Inflates a bounding box.
102
+ * @param {Bounds} bounds
103
+ * @param {number} delta
104
+ */
105
+ export function inflate(bounds: Bounds, delta: number): Bounds;
106
+
107
+ /**
108
+ * Scales a bounding box.
109
+ * @param {Bounds} bounds
110
+ * @param {number} sx
111
+ * @param {number} sy
112
+ * @param {number} sz
113
+ */
114
+ export function scale(
115
+ bounds: Bounds,
116
+ sx: number,
117
+ sy: number,
118
+ sz: number
119
+ ): boolean;
120
+
121
+ /**
122
+ * Gets the center of a bounding box.
123
+ * @param {Bounds} bounds
124
+ */
125
+ export function getCenter(bounds: Bounds): Vector3;
126
+
127
+ /**
128
+ * Scales a bounding box around its center.
129
+ * @param {Bounds} bounds
130
+ * @param {number} sx
131
+ * @param {number} sy
132
+ * @param {number} sz
133
+ */
134
+ export function scaleAboutCenter(
135
+ bounds: Bounds,
136
+ sx: number,
137
+ sy: number,
138
+ sz: number
139
+ ): boolean;
140
+
141
+ /**
142
+ * Gets the bounding box side length.
143
+ * @param {Bounds} bounds
144
+ * @param {number} index
145
+ */
146
+ export function getLength(bounds: Bounds, index: number): number;
147
+
148
+ /**
149
+ * Gets the lengths of all sides.
150
+ * @param {Bounds} bounds
151
+ */
152
+ export function getLengths(bounds: Bounds): Vector3;
153
+
154
+ /**
155
+ * Gets the x range of a bounding box.
156
+ * @param {Bounds} bounds
157
+ */
158
+ export function getXRange(bounds: Bounds): Vector2;
159
+
160
+ /**
161
+ * Gets the y range of a bounding box.
162
+ * @param {Bounds} bounds
163
+ */
164
+ export function getYRange(bounds: Bounds): Vector2;
165
+
166
+ /**
167
+ * Gets the z range of a bounding box.
168
+ * @param {Bounds} bounds
169
+ */
170
+ export function getZRange(bounds: Bounds): Vector2;
171
+
172
+ /**
173
+ * Gets the maximum side length of the bounding box.
174
+ * @param {Bounds} bounds
175
+ */
176
+ export function getMaxLength(bounds: Bounds): number;
177
+
178
+ /**
179
+ * Gets the diagonal of the bounding box.
180
+ * @param {Bounds} bounds
181
+ */
182
+ export function getDiagonalLength(bounds: Bounds): number;
183
+
184
+ /**
185
+ * Gets the min point.
186
+ * @param {Bounds} bounds
187
+ */
188
+
189
+ export function getMinPoint(bounds: Bounds): Vector3;
190
+
191
+ /**
192
+ * Gets the max point.
193
+ * @param {Bounds} bounds
194
+ */
195
+ export function getMaxPoint(bounds: Bounds): Vector3;
196
+
197
+ /**
198
+ * Gets the corners of a bounding box.
199
+ * @param {Bounds} bounds
200
+ * @param {Vector3[]} corners
201
+ */
202
+ export function getCorners(bounds: Bounds, corners: Vector3[]): Vector3[];
203
+
204
+ /**
205
+ * Computes the two corner poitns with min and max coords.
206
+ * @param {Bounds} bounds
207
+ * @param {Vector3} point1
208
+ * @param {Vector3} point2
209
+ */
210
+ export function computeCornerPoints(
211
+ bounds: Bounds,
212
+ point1: Vector3,
213
+ point2: Vector3
214
+ ): Vector3;
215
+
216
+ /**
217
+ * Transforms a bounding box.
218
+ * @param {Bounds} bounds
219
+ * @param {mat4} transform
220
+ * @param {Bounds} out
221
+ */
222
+ export function transformBounds(
223
+ bounds: Bounds,
224
+ transform: mat4,
225
+ out: Bounds
226
+ ): ReturnType<typeof addPoints>;
227
+
228
+ export function computeScale3(bounds: Bounds, scale3: Vector3): Vector3;
229
+
230
+ /**
231
+ * Compute local bounds.
232
+ * Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.
233
+ * @param {vtkPoints} points
234
+ * @param {array} u first vector
235
+ * @param {array} v second vector
236
+ * @param {array} w third vector
237
+ */
238
+
239
+ export function computeLocalBounds(
240
+ points: vtkPoints,
241
+ u: Vector3,
242
+ v: Vector3,
243
+ w: Vector3
244
+ ): Bounds;
245
+
246
+ /**
247
+ * The method returns a non-zero value if the bounding box is hit.
248
+ * Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z
249
+ * directions, coord[3] is the location of hit, and t is the parametric
250
+ * coordinate along line. (Notes: the intersection ray dir[3] is NOT
251
+ * normalized. Valid intersections will only occur between 0<=t<=1.)
252
+ * @param {Bounds} bounds
253
+ * @param {Vector3} origin
254
+ * @param {Vector3} dir
255
+ * @param {Vector3} coord
256
+ * @param {number} tolerance
257
+ */
258
+ export function intersectBox(
259
+ bounds: Bounds,
260
+ origin: Vector3,
261
+ dir: Vector3,
262
+ coord: Vector3,
263
+ tolerance: number
264
+ ): boolean;
265
+
266
+ /**
267
+ * Plane intersection with box
268
+ * The plane is infinite in extent and defined by an origin and normal.The function indicates
269
+ * whether the plane intersects, not the particulars of intersection points and such
270
+ * The function returns non-zero if the plane and box intersect; zero otherwise.
271
+ * @param {Bounds} bounds
272
+ * @param {Vector3} origin
273
+ * @param {Vector3} normal
274
+ */
275
+ export function intersectPlane(
276
+ bounds: Bounds,
277
+ origin: Vector3,
278
+ normal: Vector3
279
+ ): boolean;
280
+
281
+ /**
282
+ * Do two bounding boxes intersect.
283
+ * @param {Bounds} bounds
284
+ * @param bBounds
285
+ */
286
+ export function intersect(bounds: Bounds, bBounds: Bounds): boolean;
287
+
288
+ /**
289
+ * Do two bounding boxes intersect.
290
+ * @param {Bounds} bounds
291
+ * @param {Bounds} bBounds
292
+ */
293
+ export function intersects(bounds: Bounds, bBounds: Bounds): boolean;
294
+
295
+ /**
296
+ * Does the bbox contain a given point.
297
+ * @param {Bounds} bounds
298
+ * @param {number} x
299
+ * @param {number} y
300
+ * @param {number} z
301
+ */
302
+ export function containsPoint(
303
+ bounds: Bounds,
304
+ x: number,
305
+ y: number,
306
+ z: number
307
+ ): boolean;
308
+
309
+ /**
310
+ * Is a bbox contained in another bbox.
311
+ * @param {Bounds} bounds
312
+ * @param {Bounds} other
313
+ */
314
+ export function contains(bounds: Bounds, other: Bounds): boolean;
315
+
316
+ /**
317
+ * Does a plane intersect a boox.
318
+ * @param {Bounds} bounds
319
+ * @param {Vector3} origin
320
+ * @param {Vector3} normal
321
+ */
322
+ export function cutWithPlane(
323
+ bounds: Bounds,
324
+ origin: Vector3,
325
+ normal: Vector3
326
+ ): boolean;
327
+
328
+ declare class BoundingBox {
329
+ getBounds(): Bounds;
330
+ /**
331
+ * Tests whether two bounds equal.
332
+ * @param {Bounds} a
333
+ * @param {Bounds} b
334
+ */
335
+ equals(a: Bounds, b: Bounds): boolean;
336
+
337
+ /**
338
+ * Tests whether a given bounds is valid.
339
+ * @param {Bounds} bounds
340
+ */
341
+ isValid(bounds: Bounds): boolean;
342
+
343
+ /**
344
+ * Sets a bounding box from another bounding box.
345
+ * @param {Bounds} bounds
346
+ * @param {Bounds} other
347
+ */
348
+ setBounds(bounds: Bounds, other: Bounds): Bounds;
349
+
350
+ /**
351
+ * Resets a bounds to infinity.
352
+ * @param {Bounds} bounds
353
+ */
354
+ reset(bounds: Bounds): Bounds;
355
+
356
+ /**
357
+ * Adds points to a bounding box.
358
+ * @param {Bounds} bounds
359
+ * @param {number} x
360
+ * @param {number} y
361
+ * @param {number} z
362
+ */
363
+ addPoint(bounds: Bounds, x: number, y: number, z: number): Bounds;
364
+
365
+ /**
366
+ * Adds points to a bounding box.
367
+ * @param {Bounds} bounds
368
+ * @param {number[]} points A flattened array of 3D coordinates.
369
+ */
370
+ addPoints(bounds: Bounds, points: number[]): Bounds;
371
+
372
+ /**
373
+ * Adds two bounding boxes together.
374
+ * @param {Bounds} bounds
375
+ * @param {number} xMin
376
+ * @param {number} xMax
377
+ * @param {number} yMin
378
+ * @param {number} yMax
379
+ * @param {number} zMin
380
+ * @param {number} zMax
381
+ */
382
+ addBounds(
383
+ bounds: Bounds,
384
+ xMin: number,
385
+ xMax: number,
386
+ yMin: number,
387
+ yMax: number,
388
+ zMin: number,
389
+ zMax: number
390
+ ): Bounds;
391
+
392
+ /**
393
+ * Sets the min point of a bounding box.
394
+ * @param {Bounds} bounds
395
+ * @param {number} x
396
+ * @param {number} y
397
+ * @param {number} z
398
+ */
399
+ setMinPoint(bounds: Bounds, x: number, y: number, z: number): boolean;
400
+
401
+ /**
402
+ * Sets the max point of a bounding box.
403
+ * @param {Bounds} bounds
404
+ * @param {number} x
405
+ * @param {number} y
406
+ * @param {number} z
407
+ */
408
+ setMaxPoint(bounds: Bounds, x: number, y: number, z: number): boolean;
409
+
410
+ /**
411
+ * Inflates a bounding box.
412
+ * @param {Bounds} bounds
413
+ * @param {number} delta
414
+ */
415
+ inflate(bounds: Bounds, delta: number): Bounds;
416
+
417
+ /**
418
+ * Scales a bounding box.
419
+ * @param {Bounds} bounds
420
+ * @param {number} sx
421
+ * @param {number} sy
422
+ * @param {number} sz
423
+ */
424
+ scale(bounds: Bounds, sx: number, sy: number, sz: number): boolean;
425
+
426
+ /**
427
+ * Gets the center of a bounding box.
428
+ * @param {Bounds} bounds
429
+ */
430
+ getCenter(bounds: Bounds): Vector3;
431
+
432
+ /**
433
+ * Scales a bounding box around its center.
434
+ * @param {Bounds} bounds
435
+ * @param {number} sx
436
+ * @param {number} sy
437
+ * @param {number} sz
438
+ */
439
+ scaleAboutCenter(bounds: Bounds, sx: number, sy: number, sz: number): boolean;
440
+
441
+ /**
442
+ * Gets the bounding box side length.
443
+ * @param {Bounds} bounds
444
+ * @param {number} index
445
+ */
446
+ getLength(bounds: Bounds, index: number): number;
447
+
448
+ /**
449
+ * Gets the lengths of all sides.
450
+ * @param {Bounds} bounds
451
+ */
452
+ getLengths(bounds: Bounds): Vector3;
453
+
454
+ /**
455
+ * Gets the x range of a bounding box.
456
+ * @param {Bounds} bounds
457
+ */
458
+ getXRange(bounds: Bounds): Vector2;
459
+
460
+ /**
461
+ * Gets the y range of a bounding box.
462
+ * @param {Bounds} bounds
463
+ */
464
+ getYRange(bounds: Bounds): Vector2;
465
+
466
+ /**
467
+ * Gets the z range of a bounding box.
468
+ * @param {Bounds} bounds
469
+ */
470
+ getZRange(bounds: Bounds): Vector2;
471
+
472
+ /**
473
+ * Gets the maximum side length of the bounding box.
474
+ * @param {Bounds} bounds
475
+ */
476
+ getMaxLength(bounds: Bounds): number;
477
+
478
+ /**
479
+ * Gets the diagonal of the bounding box.
480
+ * @param {Bounds} bounds
481
+ */
482
+ getDiagonalLength(bounds: Bounds): number;
483
+
484
+ /**
485
+ * Gets the min point.
486
+ * @param {Bounds} bounds
487
+ */
488
+
489
+ getMinPoint(bounds: Bounds): Vector3;
490
+
491
+ /**
492
+ * Gets the max point.
493
+ * @param {Bounds} bounds
494
+ */
495
+ getMaxPoint(bounds: Bounds): Vector3;
496
+
497
+ /**
498
+ * Gets the corners of a bounding box.
499
+ * @param {Bounds} bounds
500
+ * @param {Vector3[]} corners
501
+ */
502
+ getCorners(bounds: Bounds, corners: Vector3[]): Vector3[];
503
+
504
+ /**
505
+ * Computes the two corner poitns with min and max coords.
506
+ * @param {Bounds} bounds
507
+ * @param {Vector3} point1
508
+ * @param {Vector3} point2
509
+ */
510
+ computeCornerPoints(
511
+ bounds: Bounds,
512
+ point1: Vector3,
513
+ point2: Vector3
514
+ ): Vector3;
515
+
516
+ /**
517
+ * Transforms a bounding box.
518
+ * @param {Bounds} bounds
519
+ * @param {mat4} transform
520
+ * @param {Bounds} out
521
+ */
522
+ transformBounds(
523
+ bounds: Bounds,
524
+ transform: mat4,
525
+ out: Bounds
526
+ ): ReturnType<typeof addPoints>;
527
+
528
+ computeScale3(bounds: Bounds, scale3: Vector3): Vector3;
529
+
530
+ /**
531
+ * Compute local bounds.
532
+ * Not as fast as vtkPoints.getBounds() if u, v, w form a natural basis.
533
+ * @param {vtkPoints} points
534
+ * @param {array} u first vector
535
+ * @param {array} v second vector
536
+ * @param {array} w third vector
537
+ */
538
+
539
+ computeLocalBounds(
540
+ points: vtkPoints,
541
+ u: Vector3,
542
+ v: Vector3,
543
+ w: Vector3
544
+ ): Bounds;
545
+
546
+ /**
547
+ * The method returns a non-zero value if the bounding box is hit.
548
+ * Origin[3] starts the ray, dir[3] is the vector components of the ray in the x-y-z
549
+ * directions, coord[3] is the location of hit, and t is the parametric
550
+ * coordinate along line. (Notes: the intersection ray dir[3] is NOT
551
+ * normalized. Valid intersections will only occur between 0<=t<=1.)
552
+ * @param {Bounds} bounds
553
+ * @param {Vector3} origin
554
+ * @param {Vector3} dir
555
+ * @param {Vector3} coord
556
+ * @param {number} tolerance
557
+ */
558
+ intersectBox(
559
+ bounds: Bounds,
560
+ origin: Vector3,
561
+ dir: Vector3,
562
+ coord: Vector3,
563
+ tolerance: number
564
+ ): boolean;
565
+
566
+ /**
567
+ * Plane intersection with box
568
+ * The plane is infinite in extent and defined by an origin and normal.The function indicates
569
+ * whether the plane intersects, not the particulars of intersection points and such
570
+ * The function returns non-zero if the plane and box intersect; zero otherwise.
571
+ * @param {Bounds} bounds
572
+ * @param {Vector3} origin
573
+ * @param {Vector3} normal
574
+ */
575
+ intersectPlane(bounds: Bounds, origin: Vector3, normal: Vector3): boolean;
576
+
577
+ /**
578
+ * Do two bounding boxes intersect.
579
+ * @param {Bounds} bounds
580
+ * @param bBounds
581
+ */
582
+ intersect(bounds: Bounds, bBounds: Bounds): boolean;
583
+
584
+ /**
585
+ * Do two bounding boxes intersect.
586
+ * @param {Bounds} bounds
587
+ * @param {Bounds} bBounds
588
+ */
589
+ intersects(bounds: Bounds, bBounds: Bounds): boolean;
590
+
591
+ /**
592
+ * Does the bbox contain a given point.
593
+ * @param {Bounds} bounds
594
+ * @param {number} x
595
+ * @param {number} y
596
+ * @param {number} z
597
+ */
598
+ containsPoint(bounds: Bounds, x: number, y: number, z: number): boolean;
599
+
600
+ /**
601
+ * Is a bbox contained in another bbox.
602
+ * @param {Bounds} bounds
603
+ * @param {Bounds} other
604
+ */
605
+ contains(bounds: Bounds, other: Bounds): boolean;
606
+
607
+ /**
608
+ * Does a plane intersect a boox.
609
+ * @param {Bounds} bounds
610
+ * @param {Vector3} origin
611
+ * @param {Vector3} normal
612
+ */
613
+ cutWithPlane(bounds: Bounds, origin: Vector3, normal: Vector3): boolean;
614
+ }
615
+
616
+ export interface IBoundingBoxInitialValues {
617
+ bounds?: Bounds;
618
+ }
619
+
620
+ declare const vtkBoundingBox: {
621
+ newInstance: (initialValues: IBoundingBoxInitialValues) => BoundingBox;
622
+ equals: typeof equals;
623
+ isValid: typeof isValid;
624
+ setBounds: typeof setBounds;
625
+ reset: typeof reset;
626
+ addPoint: typeof addPoint;
627
+ addPoints: typeof addPoints;
628
+ addBounds: typeof addBounds;
629
+ setMinPoint: typeof setMinPoint;
630
+ setMaxPoint: typeof setMaxPoint;
631
+ inflate: typeof inflate;
632
+ scale: typeof scale;
633
+ scaleAboutCenter: typeof scaleAboutCenter;
634
+ getCenter: typeof getCenter;
635
+ getLength: typeof getLength;
636
+ getLengths: typeof getLengths;
637
+ getMaxLength: typeof getMaxLength;
638
+ getDiagonalLength: typeof getDiagonalLength;
639
+ getMinPoint: typeof getMinPoint;
640
+ getMaxPoint: typeof getMaxPoint;
641
+ getXRange: typeof getXRange;
642
+ getYRange: typeof getYRange;
643
+ getZRange: typeof getZRange;
644
+ getCorners: typeof getCorners;
645
+ computeCornerPoints: typeof computeCornerPoints;
646
+ computeLocalBounds: typeof computeLocalBounds;
647
+ transformBounds: typeof transformBounds;
648
+ computeScale3: typeof computeScale3;
649
+ cutWithPlane: typeof cutWithPlane;
650
+ intersectBox: typeof intersectBox;
651
+ intersectPlane: typeof intersectPlane;
652
+ intersect: typeof intersect;
653
+ intersects: typeof intersects;
654
+ containsPoint: typeof containsPoint;
655
+ contains: typeof contains;
656
+ INIT_BOUNDS: Bounds;
657
+ };
658
+
659
+ export default vtkBoundingBox;