@kitware/vtk.js 23.4.3 → 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.
- package/Common/Core/Math/Constants.js +12 -0
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/ScalarsToColors/Constants.d.ts +18 -0
- package/Common/DataModel/AbstractPointLocator.d.ts +54 -0
- package/Common/DataModel/AbstractPointLocator.js +40 -0
- package/Common/DataModel/BoundingBox.d.ts +659 -0
- package/Common/DataModel/Collection.d.ts +118 -0
- package/Common/DataModel/Collection.js +113 -0
- package/Common/DataModel/DataSet/Constants.d.ts +27 -0
- package/Common/DataModel/EdgeLocator.d.ts +79 -0
- package/Common/DataModel/EdgeLocator.js +85 -0
- package/Common/DataModel/ITKHelper.d.ts +54 -0
- package/Common/DataModel/IncrementalOctreeNode.d.ts +297 -0
- package/Common/DataModel/IncrementalOctreeNode.js +640 -0
- package/Common/DataModel/IncrementalOctreePointLocator.d.ts +61 -0
- package/Common/DataModel/IncrementalOctreePointLocator.js +398 -0
- package/Common/DataModel/Locator.d.ts +43 -0
- package/Common/DataModel/Locator.js +37 -0
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/PolyData/Constants.d.ts +6 -0
- package/Common/DataModel/PolyLine.d.ts +63 -0
- package/Common/DataModel/PolyLine.js +77 -0
- package/Common/DataModel/Polygon/Constants.js +12 -0
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Quad/Constants.js +9 -0
- package/Common/DataModel/Quad.d.ts +91 -0
- package/Common/DataModel/Quad.js +235 -0
- package/Common/DataModel/SelectionNode/Constants.d.ts +27 -0
- package/Common/DataModel/Spline1D/Constants.js +17 -0
- package/Common/DataModel/Spline3D/Constants.d.ts +9 -0
- package/Common/Transform/Transform.js +51 -0
- package/Filters/Core/PolyDataNormals.js +124 -0
- package/Filters/General/ClipClosedSurface/Constants.js +10 -0
- package/Filters/General/ClipClosedSurface.d.ts +95 -0
- package/Filters/General/ClipClosedSurface.js +972 -0
- package/Filters/General/ContourTriangulator/Constants.js +6 -0
- package/Filters/General/ContourTriangulator/helper.js +1951 -0
- package/Filters/General/ContourTriangulator.d.ts +136 -0
- package/Filters/General/ContourTriangulator.js +202 -0
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +1 -1
- package/Filters/General/OBBTree/OBBNode.js +82 -0
- package/Filters/General/OBBTree/helper.js +92 -0
- package/Filters/General/OBBTree.js +1243 -0
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/Sources/LineSource.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Interaction/Manipulators/CompositeCameraManipulator.d.ts +68 -0
- package/Interaction/Manipulators/CompositeGestureManipulator.d.ts +168 -0
- package/Interaction/Manipulators/CompositeKeyboardManipulator.d.ts +48 -0
- package/Interaction/Manipulators/CompositeMouseManipulator.d.ts +149 -0
- package/Interaction/Manipulators/CompositeVRManipulator.d.ts +44 -0
- package/Interaction/Manipulators/GestureCameraManipulator.d.ts +34 -0
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.d.ts +88 -0
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballMultiRotateManipulator.d.ts +32 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRollManipulator.d.ts +33 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.d.ts +67 -0
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballZoomManipulator.d.ts +45 -0
- package/Interaction/Manipulators/MouseCameraTrackballZoomToMouseManipulator.d.ts +26 -0
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseRangeManipulator.d.ts +53 -0
- package/Interaction/Style/InteractorStyleImage.d.ts +107 -0
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Interaction/Style/InteractorStyleManipulator.d.ts +348 -0
- package/Interaction/Style/InteractorStyleTrackballCamera.d.ts +170 -0
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
- package/Interaction/Widgets/LabelRepresentation.js +1 -1
- package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +11 -0
- package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
- package/Proxy/Core/AbstractRepresentationProxy.d.ts +24 -0
- package/Proxy/Core/LookupTableProxy.d.ts +45 -0
- package/Proxy/Core/PiecewiseFunctionProxy.d.ts +62 -0
- package/Proxy/Core/ProxyManager.d.ts +115 -0
- package/Proxy/Core/SourceProxy.d.ts +22 -0
- package/Proxy/Core/View2DProxy.d.ts +7 -0
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Proxy/Core/ViewProxy.d.ts +86 -0
- package/Proxy/Representations/SliceRepresentationProxy.d.ts +27 -0
- package/Proxy/Representations/VolumeRepresentationProxy.d.ts +44 -0
- package/README.md +2 -2
- package/Rendering/Core/AbstractImageMapper/helper.js +127 -0
- package/Rendering/Core/AbstractImageMapper.d.ts +82 -0
- package/Rendering/Core/AbstractImageMapper.js +44 -0
- package/Rendering/Core/Camera.js +1 -1
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/ColorTransferFunction/ColorMaps.d.ts +24 -0
- package/Rendering/Core/ColorTransferFunction/Constants.d.ts +17 -0
- package/Rendering/Core/ColorTransferFunction.js +1 -1
- package/Rendering/Core/Coordinate/Constants.d.ts +14 -0
- package/Rendering/Core/Coordinate.js +1 -1
- package/Rendering/Core/Glyph3DMapper/Constants.d.ts +17 -0
- package/Rendering/Core/Glyph3DMapper.js +1 -1
- package/Rendering/Core/HardwareSelector.d.ts +84 -0
- package/Rendering/Core/ImageArrayMapper.d.ts +253 -0
- package/Rendering/Core/ImageArrayMapper.js +242 -0
- package/Rendering/Core/ImageMapper/Constants.d.ts +14 -0
- package/Rendering/Core/ImageMapper.js +1 -1
- package/Rendering/Core/ImageProperty/Constants.d.ts +9 -0
- package/Rendering/Core/ImageResliceMapper/Constants.d.ts +11 -0
- package/Rendering/Core/ImageResliceMapper/Constants.js +11 -0
- package/Rendering/Core/ImageResliceMapper.d.ts +245 -0
- package/Rendering/Core/ImageResliceMapper.js +70 -0
- package/Rendering/Core/InteractorObserver.d.ts +132 -0
- package/Rendering/Core/InteractorStyle/Constants.d.ts +16 -0
- package/Rendering/Core/InteractorStyle.d.ts +229 -0
- package/Rendering/Core/Light.js +1 -1
- package/Rendering/Core/Mapper/Constants.d.ts +26 -0
- package/Rendering/Core/Mapper.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Prop/Constants.d.ts +9 -0
- package/Rendering/Core/Prop/Constants.js +9 -0
- package/Rendering/Core/Property/Constants.d.ts +24 -0
- package/Rendering/Core/Property2D/Constants.d.ts +9 -0
- package/Rendering/Core/RenderWindow.js +1 -1
- package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +31 -0
- package/Rendering/Core/Renderer.js +1 -1
- package/Rendering/Core/VolumeMapper/Constants.d.ts +20 -0
- package/Rendering/Core/VolumeMapper.js +1 -1
- package/Rendering/Core/VolumeProperty/Constants.d.ts +16 -0
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +129 -0
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager.js +131 -0
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.d.ts +80 -0
- package/Rendering/Misc/SynchronizableRenderWindow/ObjectManager.js +763 -0
- package/Rendering/OpenGL/HardwareSelector/Constants.d.ts +8 -0
- package/Rendering/OpenGL/HardwareSelector.d.ts +339 -0
- package/Rendering/OpenGL/ImageResliceMapper.js +996 -0
- package/Rendering/OpenGL/PolyDataMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper2D.js +1 -1
- package/Rendering/OpenGL/RenderWindow/Constants.d.ts +10 -0
- package/Rendering/OpenGL/RenderWindow/Constants.js +13 -0
- package/Rendering/OpenGL/RenderWindow/ContextProxy.js +70 -0
- package/Rendering/OpenGL/glsl/vtkImageResliceMapperFS.glsl.js +3 -0
- package/Rendering/OpenGL/glsl/vtkImageResliceMapperVS.glsl.js +3 -0
- package/Rendering/WebGPU/Actor2D.js +151 -0
- package/Rendering/WebGPU/BufferManager.js +1 -1
- package/Rendering/WebGPU/CellArrayMapper.js +853 -0
- package/Rendering/WebGPU/IndexBuffer.js +397 -0
- package/Rendering/WebGPU/PolyDataMapper2D.js +99 -0
- package/Rendering/WebGPU/SimpleMapper.js +290 -0
- package/Widgets/Core/AbstractWidget.d.ts +187 -0
- package/Widgets/Core/AbstractWidgetFactory.d.ts +131 -0
- package/Widgets/Core/StateBuilder/color3Mixin.js +24 -0
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
- package/Widgets/Core/StateBuilder.d.ts +29 -0
- package/Widgets/Core/WidgetManager/Constants.d.ts +27 -0
- package/Widgets/Core/WidgetManager.d.ts +231 -0
- package/Widgets/Core/WidgetState.d.ts +81 -0
- package/Widgets/Manipulators/AbstractManipulator.d.ts +221 -0
- package/Widgets/Manipulators/AbstractManipulator.js +57 -0
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/TrackballManipulator.js +1 -1
- package/Widgets/Representations/GlyphRepresentation.js +325 -0
- package/Widgets/Representations/LineHandleRepresentation.js +116 -0
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Representations/WidgetRepresentation.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/InteractiveOrientationWidget.d.ts +40 -0
- package/Widgets/Widgets3D/LabelWidget/behavior.js +157 -0
- package/Widgets/Widgets3D/LabelWidget/state.js +22 -0
- package/Widgets/Widgets3D/LabelWidget.js +78 -0
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/index.d.ts +133 -74
- 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;
|