vtk.js 26.5.3 → 26.5.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @project vtk.js
3
- * @build Mon, Feb 13, 2023 10:15 PM ET
3
+ * @build Wed, Feb 15, 2023 8:54 PM ET
4
4
  * @copyright Copyright (c) 2023 Kitware, Inc.
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @project vtk.js
3
- * @build Mon, Feb 13, 2023 10:15 PM ET
3
+ * @build Wed, Feb 15, 2023 8:54 PM ET
4
4
  * @copyright Copyright (c) 2023 Kitware, Inc.
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @project vtk.js
3
- * @build Mon, Feb 13, 2023 10:15 PM ET
3
+ * @build Wed, Feb 15, 2023 8:54 PM ET
4
4
  * @copyright Copyright (c) 2023 Kitware, Inc.
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * @project vtk.js
3
- * @build Mon, Feb 13, 2023 10:15 PM ET
3
+ * @build Wed, Feb 15, 2023 8:54 PM ET
4
4
  * @copyright Copyright (c) 2023 Kitware, Inc.
5
5
  *
6
6
  */
@@ -308,6 +308,21 @@ export interface vtkInteractorStyleManipulator extends vtkInteractorStyle {
308
308
  getMouseManipulators(): vtkCompositeMouseManipulator[];
309
309
  getMouseManipulators(): vtkCompositeMouseManipulator[];
310
310
  getMouseManipulators(): vtkCompositeMouseManipulator[];
311
+
312
+ /**
313
+ * Sets the center of rotation
314
+ * @param {Number} x
315
+ * @param {Number} y
316
+ * @param {Number} z
317
+ */
318
+ setCenterOfRotation(x: number, y: number, z: number): boolean;
319
+ setCenterOfRotation(xyz: Vector3): boolean;
320
+
321
+ /**
322
+ * Gets the center of rotation.
323
+ * @returns {Vector3}
324
+ */
325
+ getCenterOfRotation(): Vector3;
311
326
  }
312
327
 
313
328
  export interface IInteractorStyleManipulatorInitialValues {
@@ -11,7 +11,7 @@ export interface vtkAbstractRepresentationProxy extends VtkProxy {
11
11
  setColorBy(
12
12
  arrayName: string | null,
13
13
  arrayLocation: string,
14
- componentIndex: number
14
+ componentIndex?: number
15
15
  );
16
16
  setRescaleOnColorBy(rescale: boolean): boolean;
17
17
  getRescaleOnColorBy(): boolean;
@@ -4,7 +4,7 @@ import vtkColorTransferFunction from 'vtk.js/Sources/Rendering/Core/ColorTransfe
4
4
  // [x, r/h, g/s, b/v, m=0.5, s=0.0]
5
5
  export type RGBHSVPoint = [number, number, number, number, number?, number?];
6
6
 
7
- export enum ILookupTableProxyMode {
7
+ export enum Mode {
8
8
  Preset = 0,
9
9
  RGBPoints = 1,
10
10
  HSVPoints = 2,
@@ -39,7 +39,7 @@ export function newInstance(
39
39
 
40
40
  export declare const vtkLookupTableProxy: {
41
41
  newInstance: typeof newInstance;
42
- Mode: ILookupTableProxyMode;
42
+ Mode: Mode;
43
43
  };
44
44
 
45
45
  export default vtkLookupTableProxy;
@@ -161,4 +161,6 @@ export const newInstance = macro.newInstance(extend, 'vtkLookupTableProxy');
161
161
 
162
162
  // ----------------------------------------------------------------------------
163
163
 
164
+ export { Mode };
165
+
164
166
  export default { newInstance, extend, Mode, Defaults };
@@ -24,7 +24,7 @@ export interface vtkViewProxy extends VtkProxy {
24
24
  setContainer(container: HTMLElement | null): void;
25
25
  resize(): void;
26
26
  renderLater(): void;
27
- render(blocking: boolean): void;
27
+ render(blocking?: boolean): void;
28
28
  resetCamera(): void;
29
29
 
30
30
  addRepresentation(representation: vtkAbstractRepresentationProxy): void;
@@ -1,11 +1,20 @@
1
- import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from 'vtk.js/Sources/interfaces';
1
+ import {
2
+ vtkSubscription,
3
+ vtkDebouncedFunction,
4
+ vtkProperty,
5
+ vtkPropertyDomain,
6
+ vtkObject,
7
+ } from 'vtk.js/Sources/interfaces';
2
8
 
3
9
  /**
4
10
  * Allow user to redefine vtkXXXMacro method call.
5
11
  * @param name of the macro type [Log, Info, Debug, Error, Warning]
6
12
  * @param fn function to use when vtkXXXMacro is called.
7
13
  */
8
- export function setLoggerFunction(name: string, fn: (...args: any) => void): void;
14
+ export function setLoggerFunction(
15
+ name: string,
16
+ fn: (...args: any) => void
17
+ ): void;
9
18
 
10
19
  /**
11
20
  * Logging function used for level: Log
@@ -92,7 +101,11 @@ export function uncapitalize(str: string): string;
92
101
  * @param precision (default: 2) how many digit you want behind the unit
93
102
  * @param chunkSize (default: 1000) base 1000 or 1024
94
103
  */
95
- export function formatBytesToProperUnit(size: number, precision?: number, chunkSize?: number): string;
104
+ export function formatBytesToProperUnit(
105
+ size: number,
106
+ precision?: number,
107
+ chunkSize?: number
108
+ ): string;
96
109
 
97
110
  // ----------------------------------------------------------------------------
98
111
  // Convert thousand number with proper separator
@@ -103,7 +116,10 @@ export function formatBytesToProperUnit(size: number, precision?: number, chunkS
103
116
  * @param n number to format
104
117
  * @param separator (default: ' ')
105
118
  */
106
- export function formatNumbersWithThousandSeparator(n: number, separator?: string): string;
119
+ export function formatNumbersWithThousandSeparator(
120
+ n: number,
121
+ separator?: string
122
+ ): string;
107
123
 
108
124
  // ----------------------------------------------------------------------------
109
125
  // Array helper
@@ -136,7 +152,7 @@ declare function getStateArrayMapFunc(item: any): any;
136
152
  *
137
153
  * @param fn function to execute
138
154
  */
139
- export function setImmediateVTK(fn: () => void ): void;
155
+ export function setImmediateVTK(fn: () => void): void;
140
156
 
141
157
  /**
142
158
  * Measures the time it takes for a promise to finish from the time this function is invoked.
@@ -146,7 +162,10 @@ export function setImmediateVTK(fn: () => void ): void;
146
162
  * @param promise promise to measure
147
163
  * @param callback called with the elapsed time for the promise
148
164
  */
149
- export function measurePromiseExecution(promise: Promise<any>, callback: (elapsed: number) => void): void;
165
+ export function measurePromiseExecution(
166
+ promise: Promise<any>,
167
+ callback: (elapsed: number) => void
168
+ ): void;
150
169
 
151
170
  /**
152
171
  * Turns the provided publicAPI into a VtkObject
@@ -164,7 +183,11 @@ export function obj(publicAPI?: object, model?: object): object;
164
183
  * @param model object on which protected fields are stored
165
184
  * @param fieldNames list of fields available in model that we want to expose as get{FieldName} methods on the publicAPI
166
185
  */
167
- export function get(publicAPI: object, model: object, fieldNames: Array<string>): void;
186
+ export function get(
187
+ publicAPI: object,
188
+ model: object,
189
+ fieldNames: Array<string>
190
+ ): void;
168
191
 
169
192
  /**
170
193
  * Add setter methods to the provided publicAPI
@@ -174,7 +197,11 @@ export function get(publicAPI: object, model: object, fieldNames: Array<string>)
174
197
  * @param fieldNames list of fields available in model that we want to expose as set{FieldName} methods on the publicAPI
175
198
  * * Can be a string (the name of the field to expose) or an object (e.g. {type:enum, name: {FieldName}, enum: FieldEnum}).
176
199
  */
177
- export function set(publicAPI: object, model: object, fields: Array<string|object>): void;
200
+ export function set(
201
+ publicAPI: object,
202
+ model: object,
203
+ fields: Array<string | object>
204
+ ): void;
178
205
 
179
206
  /**
180
207
  * Add setter+getter methods to the provided publicAPI
@@ -184,7 +211,11 @@ export function set(publicAPI: object, model: object, fields: Array<string|objec
184
211
  * @param fieldNames list of fields available in model that we want to expose as set{FieldName}+get{FieldName} methods on the publicAPI.
185
212
  * Can be a string (the name of the field to expose) or an object (e.g. {type:enum, name: {FieldName}, enum: FieldEnum}).
186
213
  */
187
- export function setGet(publicAPI: object, model: object, fields: Array<string|object>): void;
214
+ export function setGet(
215
+ publicAPI: object,
216
+ model: object,
217
+ fields: Array<string | object>
218
+ ): void;
188
219
 
189
220
  /**
190
221
  * Add getter methods to the provided publicAPI for arrays.
@@ -200,7 +231,11 @@ export function setGet(publicAPI: object, model: object, fields: Array<string|ob
200
231
  * @param model object on which protected fields are stored
201
232
  * @param fieldNames list of fields available in model that we want to expose as get{FieldName}+get{FieldName}ByReference methods on the publicAPI
202
233
  */
203
- export function getArray(publicAPI: object, model: object, fields: Array<string>): void;
234
+ export function getArray(
235
+ publicAPI: object,
236
+ model: object,
237
+ fields: Array<string>
238
+ ): void;
204
239
 
205
240
  /**
206
241
  * Add setter methods to the provided publicAPI for arrays.
@@ -220,7 +255,13 @@ export function getArray(publicAPI: object, model: object, fields: Array<string>
220
255
  * @param size
221
256
  * @param defaultVal
222
257
  */
223
- export function setArray(publicAPI: object, model: object, fieldNames: Array<string>, size: Number, defaultVal?: any): void;
258
+ export function setArray(
259
+ publicAPI: object,
260
+ model: object,
261
+ fieldNames: Array<string>,
262
+ size: Number,
263
+ defaultVal?: any
264
+ ): void;
224
265
 
225
266
  /**
226
267
  * set/get XXX: add setter and getter for object of type array
@@ -230,7 +271,13 @@ export function setArray(publicAPI: object, model: object, fieldNames: Array<str
230
271
  * @param size
231
272
  * @param defaultVal
232
273
  */
233
- export function setGetArray(publicAPI: object, model: object, fieldNames: Array<string>, size: Number, defaultVal?: any): void;
274
+ export function setGetArray(
275
+ publicAPI: object,
276
+ model: object,
277
+ fieldNames: Array<string>,
278
+ size: Number,
279
+ defaultVal?: any
280
+ ): void;
234
281
 
235
282
  /**
236
283
  * Convert model and publicAPI references to _fieldName into fieldName.
@@ -244,7 +291,11 @@ export function setGetArray(publicAPI: object, model: object, fieldNames: Array<
244
291
  * @see get
245
292
  * @see set
246
293
  */
247
- export function moveToProtected(publicAPI: object, model: object, fieldNames: Array<string>): void;
294
+ export function moveToProtected(
295
+ publicAPI: object,
296
+ model: object,
297
+ fieldNames: Array<string>
298
+ ): void;
248
299
 
249
300
  /**
250
301
  * Add algorithm methods onto the provided publicAPI
@@ -254,7 +305,12 @@ export function moveToProtected(publicAPI: object, model: object, fieldNames: Ar
254
305
  * @param numberOfInputs
255
306
  * @param numberOfOutputs
256
307
  */
257
- export function algo(publicAPI: object, model: object, numberOfInputs: number, numberOfOutputs: number): void;
308
+ export function algo(
309
+ publicAPI: object,
310
+ model: object,
311
+ numberOfInputs: number,
312
+ numberOfOutputs: number
313
+ ): void;
258
314
 
259
315
  /**
260
316
  * Symbols used as return value for callback
@@ -267,7 +323,11 @@ export const VOID: Symbol;
267
323
  */
268
324
  export const EVENT_ABORT: Symbol;
269
325
 
270
- export function event(publicAPI: object, model: object, eventName: string): void;
326
+ export function event(
327
+ publicAPI: object,
328
+ model: object,
329
+ eventName: string
330
+ ): void;
271
331
 
272
332
  /**
273
333
  * Event callback
@@ -290,14 +350,21 @@ export interface VtkChangeEvent {
290
350
  * @param VtkCallback
291
351
  * @param priority (default 0.0)
292
352
  */
293
- onChange(VtkCallback: (...args: any) => void | symbol, priority?: number): vtkSubscription;
353
+ onChange(
354
+ VtkCallback: (...args: any) => void | symbol,
355
+ priority?: number
356
+ ): vtkSubscription;
294
357
  }
295
358
 
296
359
  // ----------------------------------------------------------------------------
297
360
  // newInstance
298
361
  // ----------------------------------------------------------------------------
299
362
 
300
- export type VtkExtend = (publicAPI: object, model: object, initialValues: object) => void;
363
+ export type VtkExtend = (
364
+ publicAPI: object,
365
+ model: object,
366
+ initialValues: object
367
+ ) => void;
301
368
 
302
369
  export function newInstance(extend: VtkExtend, className: string): any;
303
370
 
@@ -345,7 +412,11 @@ export function traverseInstanceTree(
345
412
  * @returns vtkDebouncedFunction A debounced function that can be called.
346
413
  * Use .cancel() to clear any pending debounced call.
347
414
  */
348
- export function debounce(func: (...args: any) => any, wait: number, immediate?: boolean): vtkDebouncedFunction;
415
+ export function debounce(
416
+ func: (...args: any) => any,
417
+ wait: number,
418
+ immediate?: boolean
419
+ ): vtkDebouncedFunction;
349
420
 
350
421
  /**
351
422
  * Creates a throttled function that only invokes `func` at most once per
@@ -354,7 +425,10 @@ export function debounce(func: (...args: any) => any, wait: number, immediate?:
354
425
  * @param callback
355
426
  * @param delay
356
427
  */
357
- export function throttle(callback: (...args: any) => any, delay: number): (...args: any) => any;
428
+ export function throttle(
429
+ callback: (...args: any) => any,
430
+ delay: number
431
+ ): (...args: any) => any;
358
432
 
359
433
  /**
360
434
  * keystore(publicAPI, model, initialKeystore)
@@ -382,7 +456,11 @@ export interface VtkKeyStore {
382
456
  * @param model
383
457
  * @param initialKeystore (default {})
384
458
  */
385
- export function keystore(publicAPI: object, model: object, initialKeystore?: object): void;
459
+ export function keystore(
460
+ publicAPI: object,
461
+ model: object,
462
+ initialKeystore?: object
463
+ ): void;
386
464
 
387
465
  // ----------------------------------------------------------------------------
388
466
  // proxy(publicAPI, model, sectionName, propertyUI)
@@ -397,14 +475,13 @@ export function keystore(publicAPI: object, model: object, initialKeystore?: obj
397
475
  // getProxySection() => List of properties for UI generation
398
476
  // ----------------------------------------------------------------------------
399
477
 
400
- export interface VtkProxyManager {
401
- }
478
+ export interface VtkProxyManager {}
402
479
 
403
480
  export interface VtkProxySection {
404
481
  id: string;
405
482
  name: string;
406
483
  ui: object;
407
- properties: Array<any>,
484
+ properties: Array<any>;
408
485
  }
409
486
 
410
487
  export interface VtkLink {
@@ -420,7 +497,7 @@ export interface VtkLink {
420
497
  persistent: boolean;
421
498
  }
422
499
 
423
- export interface VtkProxy extends VtkKeyStore {
500
+ export interface VtkProxy extends VtkKeyStore, vtkObject {
424
501
  getProxyId(): string;
425
502
  getProxyGroup(): string;
426
503
  getProxyName: () => string;
@@ -451,7 +528,6 @@ export interface VtkProxy extends VtkKeyStore {
451
528
  getPropertyDomainByName: (name: string) => vtkPropertyDomain;
452
529
 
453
530
  getProxySection: () => VtkProxySection;
454
- delete: () => void;
455
531
  }
456
532
 
457
533
  export function proxy(publicAPI: object, model: object): void;
@@ -472,7 +548,11 @@ export function proxy(publicAPI: object, model: object): void;
472
548
  * @param model
473
549
  * @param map
474
550
  */
475
- export function proxyPropertyMapping(publicAPI: object, model: object, map: object): void;
551
+ export function proxyPropertyMapping(
552
+ publicAPI: object,
553
+ model: object,
554
+ map: object
555
+ ): void;
476
556
 
477
557
  /**
478
558
  * proxyPropertyState(publicAPI, model, state, defaults)
@@ -500,7 +580,12 @@ export function proxyPropertyMapping(publicAPI: object, model: object, map: obje
500
580
  * @param state (default: {})
501
581
  * @param defaults (default: {})
502
582
  */
503
- export function proxyPropertyState(publicAPI: object, model: object, state?: object, defaults?: object): void;
583
+ export function proxyPropertyState(
584
+ publicAPI: object,
585
+ model: object,
586
+ state?: object,
587
+ defaults?: object
588
+ ): void;
504
589
 
505
590
  // ----------------------------------------------------------------------------
506
591
  // From : https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js
@@ -628,47 +713,47 @@ export function normalizeWheel(wheelEvent: object): VtkNormalizedWheelEvent;
628
713
  // ----------------------------------------------------------------------------
629
714
 
630
715
  declare const Macro: {
631
- algo: typeof algo,
632
- capitalize: typeof capitalize,
633
- chain: typeof chain,
634
- debounce: typeof debounce,
635
- enumToString: typeof enumToString,
636
- event: typeof event,
637
- EVENT_ABORT: typeof EVENT_ABORT,
638
- formatBytesToProperUnit: typeof formatBytesToProperUnit,
639
- formatNumbersWithThousandSeparator: typeof formatNumbersWithThousandSeparator,
640
- get: typeof get,
641
- getArray: typeof getArray,
716
+ algo: typeof algo;
717
+ capitalize: typeof capitalize;
718
+ chain: typeof chain;
719
+ debounce: typeof debounce;
720
+ enumToString: typeof enumToString;
721
+ event: typeof event;
722
+ EVENT_ABORT: typeof EVENT_ABORT;
723
+ formatBytesToProperUnit: typeof formatBytesToProperUnit;
724
+ formatNumbersWithThousandSeparator: typeof formatNumbersWithThousandSeparator;
725
+ get: typeof get;
726
+ getArray: typeof getArray;
642
727
  getCurrentGlobalMTime(): Number;
643
- getStateArrayMapFunc: typeof getStateArrayMapFunc,
644
- isVtkObject: typeof isVtkObject,
645
- keystore: typeof keystore,
646
- measurePromiseExecution: typeof measurePromiseExecution,
647
- moveToProtected: typeof moveToProtected,
648
- newInstance: typeof newInstance,
649
- normalizeWheel: typeof normalizeWheel,
650
- obj: typeof obj,
651
- proxy: typeof proxy,
652
- proxyPropertyMapping: typeof proxyPropertyMapping,
653
- proxyPropertyState: typeof proxyPropertyState,
654
- safeArrays: typeof safeArrays,
655
- set: typeof set,
656
- setArray: typeof setArray,
657
- setGet: typeof setGet,
658
- setGetArray: typeof setGetArray,
659
- setImmediate: typeof setImmediateVTK,
660
- setLoggerFunction: typeof setLoggerFunction,
661
- throttle: typeof throttle,
662
- traverseInstanceTree: typeof traverseInstanceTree,
663
- TYPED_ARRAYS: typeof TYPED_ARRAYS,
664
- uncapitalize: typeof uncapitalize,
665
- VOID: typeof VOID,
666
- vtkDebugMacro: typeof vtkDebugMacro,
667
- vtkErrorMacro: typeof vtkErrorMacro,
668
- vtkInfoMacro: typeof vtkInfoMacro,
669
- vtkLogMacro: typeof vtkLogMacro,
670
- vtkOnceErrorMacro: typeof vtkOnceErrorMacro,
671
- vtkWarningMacro: typeof vtkWarningMacro,
728
+ getStateArrayMapFunc: typeof getStateArrayMapFunc;
729
+ isVtkObject: typeof isVtkObject;
730
+ keystore: typeof keystore;
731
+ measurePromiseExecution: typeof measurePromiseExecution;
732
+ moveToProtected: typeof moveToProtected;
733
+ newInstance: typeof newInstance;
734
+ normalizeWheel: typeof normalizeWheel;
735
+ obj: typeof obj;
736
+ proxy: typeof proxy;
737
+ proxyPropertyMapping: typeof proxyPropertyMapping;
738
+ proxyPropertyState: typeof proxyPropertyState;
739
+ safeArrays: typeof safeArrays;
740
+ set: typeof set;
741
+ setArray: typeof setArray;
742
+ setGet: typeof setGet;
743
+ setGetArray: typeof setGetArray;
744
+ setImmediate: typeof setImmediateVTK;
745
+ setLoggerFunction: typeof setLoggerFunction;
746
+ throttle: typeof throttle;
747
+ traverseInstanceTree: typeof traverseInstanceTree;
748
+ TYPED_ARRAYS: typeof TYPED_ARRAYS;
749
+ uncapitalize: typeof uncapitalize;
750
+ VOID: typeof VOID;
751
+ vtkDebugMacro: typeof vtkDebugMacro;
752
+ vtkErrorMacro: typeof vtkErrorMacro;
753
+ vtkInfoMacro: typeof vtkInfoMacro;
754
+ vtkLogMacro: typeof vtkLogMacro;
755
+ vtkOnceErrorMacro: typeof vtkOnceErrorMacro;
756
+ vtkWarningMacro: typeof vtkWarningMacro;
672
757
  };
673
758
 
674
759
  export default Macro;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtk.js",
3
- "version": "26.5.3",
3
+ "version": "26.5.4",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",