@kitware/vtk.js 33.0.0-beta.3 → 33.0.0-beta.5
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/BREAKING_CHANGES.md +2 -0
- package/Common/Core/DataArray.d.ts +17 -0
- package/Common/Core/DataArray.js +36 -0
- package/Rendering/Core/AbstractImageMapper.d.ts +81 -0
- package/Rendering/Core/AbstractImageMapper.js +5 -2
- package/Rendering/Core/AbstractPicker.d.ts +13 -13
- package/Rendering/Core/AbstractPicker.js +1 -1
- package/Rendering/Core/Actor2D.d.ts +22 -0
- package/Rendering/Core/Actor2D.js +1 -1
- package/Rendering/Core/CellPicker.js +4 -1
- package/Rendering/Core/ImageCPRMapper.js +5 -4
- package/Rendering/Core/ImageProperty.d.ts +20 -1
- package/Rendering/Core/ImageProperty.js +7 -5
- package/Rendering/Core/ImageResliceMapper.d.ts +1 -2
- package/Rendering/Core/ImageResliceMapper.js +5 -4
- package/Rendering/Core/Viewport.js +13 -3
- package/Rendering/Core/VolumeMapper.d.ts +70 -0
- package/Rendering/Core/VolumeMapper.js +10 -5
- package/Rendering/Core/VolumeProperty.d.ts +20 -1
- package/Rendering/Core/VolumeProperty.js +7 -5
- package/Rendering/Misc/SynchronizableRenderWindow/BehaviorManager/CameraSynchronizer.js +2 -2
- package/Rendering/OpenGL/Framebuffer.js +7 -1
- package/Rendering/OpenGL/ImageCPRMapper.js +59 -7
- package/Rendering/OpenGL/ImageMapper.js +71 -9
- package/Rendering/OpenGL/ImageResliceMapper.js +60 -9
- package/Rendering/OpenGL/OrderIndependentTranslucentPass.js +20 -3
- package/Rendering/OpenGL/PolyDataMapper.js +7 -1
- package/Rendering/OpenGL/Renderer.js +1 -1
- package/Rendering/OpenGL/SurfaceLIC/LineIntegralConvolution2D/pingpong.js +7 -1
- package/Rendering/OpenGL/SurfaceLIC/SurfaceLICInterface.js +20 -3
- package/Rendering/OpenGL/Texture.d.ts +131 -62
- package/Rendering/OpenGL/Texture.js +287 -48
- package/Rendering/OpenGL/VolumeMapper.js +70 -10
- package/Rendering/SceneGraph/ViewNode.js +12 -2
- package/Rendering/WebXR/RenderWindowHelper.js +9 -0
- package/Widgets/Core/WidgetManager.d.ts +12 -1
- package/Widgets/Representations/WidgetRepresentation.d.ts +1 -7
- package/Widgets/Widgets3D/ResliceCursorWidget.d.ts +1 -8
- package/macros.js +1 -1
- package/macros2.js +7 -2
- package/package.json +11 -11
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Wrap, Filter } from './Texture/Constants';
|
|
2
2
|
import vtkOpenGLRenderWindow from './RenderWindow';
|
|
3
|
-
import { Nullable } from './../../types';
|
|
3
|
+
import { Extent, Nullable } from './../../types';
|
|
4
4
|
import { VtkDataTypes } from './../../Common/Core/DataArray';
|
|
5
5
|
import { vtkViewNode } from './../SceneGraph/ViewNode';
|
|
6
|
-
import { vtkObject } from './../../interfaces';
|
|
6
|
+
import { vtkObject, vtkRange } from './../../interfaces';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Initial values for creating a new instance of vtkOpenGLTexture.
|
|
@@ -199,17 +199,24 @@ export interface vtkOpenGLTexture extends vtkViewNode {
|
|
|
199
199
|
* @param numComps The number of components in the texture.
|
|
200
200
|
* @param dataType The data type of the texture.
|
|
201
201
|
* @param data The raw data for the texture.
|
|
202
|
-
* @param flip Whether to flip the texture vertically.
|
|
202
|
+
* @param flip Whether to flip the texture vertically. Defaults to false.
|
|
203
203
|
* @returns {boolean} True if the texture was successfully created, false otherwise.
|
|
204
204
|
*/
|
|
205
|
-
create2DFromRaw(
|
|
206
|
-
width
|
|
207
|
-
height
|
|
208
|
-
numComps
|
|
209
|
-
dataType
|
|
210
|
-
data
|
|
211
|
-
flip
|
|
212
|
-
|
|
205
|
+
create2DFromRaw({
|
|
206
|
+
width,
|
|
207
|
+
height,
|
|
208
|
+
numComps,
|
|
209
|
+
dataType,
|
|
210
|
+
data,
|
|
211
|
+
flip,
|
|
212
|
+
}: {
|
|
213
|
+
width: number;
|
|
214
|
+
height: number;
|
|
215
|
+
numComps: number;
|
|
216
|
+
dataType: VtkDataTypes;
|
|
217
|
+
data: any;
|
|
218
|
+
flip?: boolean;
|
|
219
|
+
}): boolean;
|
|
213
220
|
|
|
214
221
|
/**
|
|
215
222
|
* Creates a cube texture from raw data.
|
|
@@ -218,17 +225,21 @@ export interface vtkOpenGLTexture extends vtkViewNode {
|
|
|
218
225
|
* @param numComps The number of components in the texture.
|
|
219
226
|
* @param dataType The data type of the texture.
|
|
220
227
|
* @param data The raw data for the texture.
|
|
221
|
-
* @param flip Whether to flip the texture vertically.
|
|
222
228
|
* @returns {boolean} True if the cube texture was successfully created, false otherwise.
|
|
223
229
|
*/
|
|
224
|
-
createCubeFromRaw(
|
|
225
|
-
width
|
|
226
|
-
height
|
|
227
|
-
numComps
|
|
228
|
-
dataType
|
|
229
|
-
data
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
createCubeFromRaw({
|
|
231
|
+
width,
|
|
232
|
+
height,
|
|
233
|
+
numComps,
|
|
234
|
+
dataType,
|
|
235
|
+
data,
|
|
236
|
+
}: {
|
|
237
|
+
width: number;
|
|
238
|
+
height: number;
|
|
239
|
+
numComps: number;
|
|
240
|
+
dataType: VtkDataTypes;
|
|
241
|
+
data: any;
|
|
242
|
+
}): boolean;
|
|
232
243
|
|
|
233
244
|
/**
|
|
234
245
|
* Creates a 2D texture from an image.
|
|
@@ -244,17 +255,27 @@ export interface vtkOpenGLTexture extends vtkViewNode {
|
|
|
244
255
|
* @param numComps The number of components in the texture.
|
|
245
256
|
* @param dataType The data type of the texture.
|
|
246
257
|
* @param data The raw data for the texture.
|
|
247
|
-
* @param preferSizeOverAccuracy Whether to prefer texture size over accuracy.
|
|
258
|
+
* @param [preferSizeOverAccuracy=false] Whether to prefer texture size over accuracy. Defaults to false.
|
|
259
|
+
* @param [ranges] The precomputed ranges of the data (optional). Provided to prevent computation of the data ranges.
|
|
248
260
|
* @returns {boolean} True if the texture was successfully created, false otherwise.
|
|
249
261
|
*/
|
|
250
|
-
create2DFilterableFromRaw(
|
|
251
|
-
width
|
|
252
|
-
height
|
|
253
|
-
numComps
|
|
254
|
-
dataType
|
|
255
|
-
data
|
|
256
|
-
preferSizeOverAccuracy
|
|
257
|
-
|
|
262
|
+
create2DFilterableFromRaw({
|
|
263
|
+
width,
|
|
264
|
+
height,
|
|
265
|
+
numComps,
|
|
266
|
+
dataType,
|
|
267
|
+
data,
|
|
268
|
+
preferSizeOverAccuracy,
|
|
269
|
+
ranges,
|
|
270
|
+
}: {
|
|
271
|
+
width: number;
|
|
272
|
+
height: number;
|
|
273
|
+
numComps: number;
|
|
274
|
+
dataType: VtkDataTypes;
|
|
275
|
+
data: any;
|
|
276
|
+
preferSizeOverAccuracy?: boolean;
|
|
277
|
+
ranges?: vtkRange[];
|
|
278
|
+
}): boolean;
|
|
258
279
|
|
|
259
280
|
/**
|
|
260
281
|
* Creates a 2D filterable texture from a data array, with a preference for size over accuracy if necessary.
|
|
@@ -264,69 +285,117 @@ export interface vtkOpenGLTexture extends vtkViewNode {
|
|
|
264
285
|
* @param preferSizeOverAccuracy Whether to prefer texture size over accuracy.
|
|
265
286
|
* @returns {boolean} True if the texture was successfully created, false otherwise.
|
|
266
287
|
*/
|
|
267
|
-
create2DFilterableFromDataArray(
|
|
268
|
-
width
|
|
269
|
-
height
|
|
270
|
-
dataArray
|
|
271
|
-
preferSizeOverAccuracy
|
|
272
|
-
|
|
288
|
+
create2DFilterableFromDataArray({
|
|
289
|
+
width,
|
|
290
|
+
height,
|
|
291
|
+
dataArray,
|
|
292
|
+
preferSizeOverAccuracy,
|
|
293
|
+
}: {
|
|
294
|
+
width: number;
|
|
295
|
+
height: number;
|
|
296
|
+
dataArray: any;
|
|
297
|
+
preferSizeOverAccuracy?: boolean;
|
|
298
|
+
}): boolean;
|
|
273
299
|
|
|
274
300
|
/**
|
|
275
301
|
* Creates a 3D texture from raw data.
|
|
302
|
+
*
|
|
303
|
+
* updatedExtents is currently incompatible with webgl1, since there's no extent scaling.
|
|
304
|
+
*
|
|
276
305
|
* @param width The width of the texture.
|
|
277
306
|
* @param height The height of the texture.
|
|
278
307
|
* @param depth The depth of the texture.
|
|
279
308
|
* @param numComps The number of components in the texture.
|
|
280
309
|
* @param dataType The data type of the texture.
|
|
281
310
|
* @param data The raw data for the texture.
|
|
311
|
+
* @param updatedExtents Only update the specified extents (default: [])
|
|
282
312
|
* @returns {boolean} True if the texture was successfully created, false otherwise.
|
|
283
313
|
*/
|
|
284
|
-
create3DFromRaw(
|
|
285
|
-
width
|
|
286
|
-
height
|
|
287
|
-
depth
|
|
288
|
-
numComps
|
|
289
|
-
dataType
|
|
290
|
-
data
|
|
291
|
-
|
|
314
|
+
create3DFromRaw({
|
|
315
|
+
width,
|
|
316
|
+
height,
|
|
317
|
+
depth,
|
|
318
|
+
numComps,
|
|
319
|
+
dataType,
|
|
320
|
+
data,
|
|
321
|
+
updatedExtents,
|
|
322
|
+
}: {
|
|
323
|
+
width: number;
|
|
324
|
+
height: number;
|
|
325
|
+
depth: number;
|
|
326
|
+
numComps: number;
|
|
327
|
+
dataType: VtkDataTypes;
|
|
328
|
+
data: any;
|
|
329
|
+
updatedExtents?: Extent[];
|
|
330
|
+
}): boolean;
|
|
292
331
|
|
|
293
332
|
/**
|
|
294
333
|
* Creates a 3D filterable texture from raw data, with a preference for size over accuracy if necessary.
|
|
334
|
+
*
|
|
335
|
+
* updatedExtents is currently incompatible with webgl1, since there's no extent scaling.
|
|
336
|
+
*
|
|
295
337
|
* @param width The width of the texture.
|
|
296
338
|
* @param height The height of the texture.
|
|
297
339
|
* @param depth The depth of the texture.
|
|
298
340
|
* @param numComps The number of components in the texture.
|
|
299
341
|
* @param dataType The data type of the texture.
|
|
300
|
-
* @param
|
|
342
|
+
* @param data The raw data for the texture.
|
|
301
343
|
* @param preferSizeOverAccuracy Whether to prefer texture size over accuracy.
|
|
302
|
-
* @
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
344
|
+
* @param [ranges] The precomputed ranges of the data (optional). Provided to
|
|
345
|
+
* @param updatedExtents Only update the specified extents (default: [])
|
|
346
|
+
* prevent computation of the data ranges.
|
|
347
|
+
* @returns {boolean} True if the texture was successfully created, false
|
|
348
|
+
* otherwise.
|
|
349
|
+
*/
|
|
350
|
+
create3DFilterableFromRaw({
|
|
351
|
+
width,
|
|
352
|
+
height,
|
|
353
|
+
depth,
|
|
354
|
+
numComps,
|
|
355
|
+
dataType,
|
|
356
|
+
data,
|
|
357
|
+
preferSizeOverAccuracy,
|
|
358
|
+
ranges,
|
|
359
|
+
updatedExtents,
|
|
360
|
+
}: {
|
|
361
|
+
width: number;
|
|
362
|
+
height: number;
|
|
363
|
+
depth: number;
|
|
364
|
+
numComps: number;
|
|
365
|
+
dataType: VtkDataTypes;
|
|
366
|
+
data: any;
|
|
367
|
+
preferSizeOverAccuracy?: boolean;
|
|
368
|
+
ranges?: vtkRange[];
|
|
369
|
+
updatedExtents?: Extent[];
|
|
370
|
+
}): boolean;
|
|
313
371
|
|
|
314
372
|
/**
|
|
315
373
|
* Creates a 3D filterable texture from a data array, with a preference for size over accuracy if necessary.
|
|
374
|
+
*
|
|
375
|
+
* updatedExtents is currently incompatible with webgl1, since there's no extent scaling.
|
|
376
|
+
*
|
|
316
377
|
* @param width The width of the texture.
|
|
317
378
|
* @param height The height of the texture.
|
|
318
379
|
* @param depth The depth of the texture.
|
|
319
380
|
* @param dataArray The data array to use for the texture.
|
|
320
381
|
* @param preferSizeOverAccuracy Whether to prefer texture size over accuracy.
|
|
382
|
+
* @param updatedExtents Only update the specified extents (default: [])
|
|
321
383
|
* @returns {boolean} True if the texture was successfully created, false otherwise.
|
|
322
384
|
*/
|
|
323
|
-
create3DFilterableFromDataArray(
|
|
324
|
-
width
|
|
325
|
-
height
|
|
326
|
-
depth
|
|
327
|
-
dataArray
|
|
328
|
-
preferSizeOverAccuracy
|
|
329
|
-
|
|
385
|
+
create3DFilterableFromDataArray({
|
|
386
|
+
width,
|
|
387
|
+
height,
|
|
388
|
+
depth,
|
|
389
|
+
dataArray,
|
|
390
|
+
preferSizeOverAccuracy,
|
|
391
|
+
}: {
|
|
392
|
+
width: number;
|
|
393
|
+
height: number;
|
|
394
|
+
depth: number;
|
|
395
|
+
dataArray: any;
|
|
396
|
+
preferSizeOverAccuracy?: boolean;
|
|
397
|
+
updatedExtents?: Extent[];
|
|
398
|
+
}): boolean;
|
|
330
399
|
|
|
331
400
|
/**
|
|
332
401
|
* Sets the OpenGL render window in which the texture will be used.
|