@kitware/vtk.js 22.6.1 → 23.1.0

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 (157) hide show
  1. package/Common/Core/CellArray.d.ts +2 -2
  2. package/Common/Core/DataArray.d.ts +2 -2
  3. package/Common/Core/Endian.d.ts +3 -1
  4. package/Common/Core/ImageHelper.d.ts +1 -1
  5. package/Common/Core/LookupTable.d.ts +2 -2
  6. package/Common/Core/Math.d.ts +1 -1
  7. package/Common/Core/MatrixBuilder.d.ts +1 -1
  8. package/Common/Core/Points.d.ts +2 -2
  9. package/Common/Core/PriorityQueue.d.ts +1 -1
  10. package/Common/Core/ProgressHandler.d.ts +1 -1
  11. package/Common/Core/ScalarsToColors.d.ts +3 -3
  12. package/Common/Core/StringArray.d.ts +1 -1
  13. package/Common/Core/VariantArray.d.ts +1 -1
  14. package/Common/DataModel/Box.d.ts +2 -2
  15. package/Common/DataModel/CardinalSpline1D.d.ts +2 -2
  16. package/Common/DataModel/Cell.d.ts +3 -3
  17. package/Common/DataModel/Cone.d.ts +2 -2
  18. package/Common/DataModel/Cylinder.d.ts +2 -2
  19. package/Common/DataModel/DataSet.d.ts +2 -2
  20. package/Common/DataModel/DataSetAttributes/FieldData.d.ts +1 -1
  21. package/Common/DataModel/DataSetAttributes.d.ts +3 -3
  22. package/Common/DataModel/ITKHelper.js +16 -20
  23. package/Common/DataModel/ImageData.d.ts +36 -36
  24. package/Common/DataModel/KochanekSpline1D.d.ts +1 -1
  25. package/Common/DataModel/Line.d.ts +2 -2
  26. package/Common/DataModel/PiecewiseFunction.d.ts +2 -2
  27. package/Common/DataModel/Plane.d.ts +2 -2
  28. package/Common/DataModel/PointSet.d.ts +3 -3
  29. package/Common/DataModel/PolyData.d.ts +3 -3
  30. package/Common/DataModel/Polygon.d.ts +2 -2
  31. package/Common/DataModel/SelectionNode.d.ts +2 -2
  32. package/Common/DataModel/Sphere.d.ts +2 -2
  33. package/Common/DataModel/Spline1D.d.ts +1 -1
  34. package/Common/DataModel/Spline3D.d.ts +1 -1
  35. package/Common/DataModel/Triangle.d.ts +2 -2
  36. package/Common/Transform/LandmarkTransform.d.ts +2 -2
  37. package/Filters/General/AppendPolyData.d.ts +1 -1
  38. package/Filters/General/ImageCropFilter.d.ts +1 -1
  39. package/Filters/General/ImageOutlineFilter.d.ts +1 -1
  40. package/Filters/General/ImageSliceFilter.d.ts +2 -2
  41. package/Filters/General/ImageStreamline.d.ts +135 -0
  42. package/Filters/General/LineFilter.d.ts +1 -1
  43. package/Filters/General/OutlineFilter.d.ts +1 -1
  44. package/Filters/General/TriangleFilter.d.ts +1 -1
  45. package/Filters/General/TubeFilter.d.ts +2 -2
  46. package/Filters/Sources/Arrow2DSource.d.ts +2 -2
  47. package/Filters/Sources/ArrowSource.d.ts +2 -2
  48. package/Filters/Sources/CircleSource.d.ts +2 -2
  49. package/Filters/Sources/ConeSource.d.ts +2 -2
  50. package/Filters/Sources/CubeSource.d.ts +2 -2
  51. package/Filters/Sources/Cursor3D.d.ts +3 -3
  52. package/Filters/Sources/CylinderSource.d.ts +2 -2
  53. package/Filters/Sources/LineSource.d.ts +2 -2
  54. package/Filters/Sources/PlaneSource.d.ts +2 -2
  55. package/Filters/Sources/PointSource.d.ts +2 -2
  56. package/Filters/Sources/SphereSource.d.ts +2 -2
  57. package/Filters/Texture/TextureMapToPlane.d.ts +1 -1
  58. package/Filters/Texture/TextureMapToSphere.d.ts +1 -1
  59. package/IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts +9 -0
  60. package/IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts +9 -0
  61. package/IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts +13 -0
  62. package/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts +9 -0
  63. package/IO/Core/DataAccessHelper.d.ts +32 -0
  64. package/IO/Core/HttpDataSetReader.d.ts +226 -0
  65. package/IO/Core/HttpSceneLoader.d.ts +5 -5
  66. package/IO/Core/ImageStream/DefaultProtocol.d.ts +1 -1
  67. package/IO/Core/ImageStream/ViewStream.d.ts +4 -4
  68. package/IO/Core/ImageStream.d.ts +3 -3
  69. package/IO/Core/WSLinkClient.d.ts +1 -1
  70. package/IO/Geometry/DracoReader.d.ts +13 -9
  71. package/IO/Geometry/PLYReader.d.ts +13 -9
  72. package/IO/Geometry/PLYWriter.d.ts +2 -2
  73. package/IO/Geometry/STLReader.d.ts +14 -9
  74. package/IO/Geometry/STLWriter.d.ts +2 -2
  75. package/IO/Misc/ElevationReader.d.ts +11 -6
  76. package/IO/Misc/ITKImageReader.d.ts +1 -1
  77. package/IO/Misc/ITKPolyDataReader.d.ts +1 -1
  78. package/IO/Misc/JSONNucleoReader.d.ts +13 -9
  79. package/IO/Misc/JSONReader.d.ts +4 -4
  80. package/IO/Misc/MTLReader.d.ts +11 -7
  81. package/IO/Misc/OBJReader.d.ts +10 -6
  82. package/IO/Misc/PDBReader.d.ts +10 -6
  83. package/IO/XML/XMLImageDataReader.d.ts +1 -1
  84. package/IO/XML/XMLPolyDataReader.d.ts +1 -1
  85. package/IO/XML/XMLReader.d.ts +20 -16
  86. package/Interaction/Manipulators/MouseRangeManipulator.js +55 -1
  87. package/Interaction/Widgets/OrientationMarkerWidget.d.ts +22 -8
  88. package/Interaction/Widgets/OrientationMarkerWidget.js +62 -37
  89. package/Rendering/Core/AbstractMapper.d.ts +2 -2
  90. package/Rendering/Core/AbstractMapper3D.d.ts +2 -2
  91. package/Rendering/Core/AbstractPicker.d.ts +4 -4
  92. package/Rendering/Core/Actor.d.ts +21 -18
  93. package/Rendering/Core/Actor2D.d.ts +5 -5
  94. package/Rendering/Core/AnnotatedCubeActor.d.ts +1 -1
  95. package/Rendering/Core/AxesActor.d.ts +1 -1
  96. package/Rendering/Core/Camera.d.ts +2 -2
  97. package/Rendering/Core/CellPicker.d.ts +5 -5
  98. package/Rendering/Core/ColorTransferFunction.d.ts +1 -1
  99. package/Rendering/Core/Coordinate.d.ts +2 -2
  100. package/Rendering/Core/Follower.d.ts +2 -2
  101. package/Rendering/Core/Glyph3DMapper.d.ts +2 -2
  102. package/Rendering/Core/ImageMapper.d.ts +3 -3
  103. package/Rendering/Core/ImageProperty.d.ts +11 -2
  104. package/Rendering/Core/ImageProperty.js +3 -2
  105. package/Rendering/Core/ImageSlice.d.ts +4 -4
  106. package/Rendering/Core/Light.d.ts +2 -2
  107. package/Rendering/Core/Mapper.d.ts +5 -5
  108. package/Rendering/Core/Mapper2D.d.ts +4 -3
  109. package/Rendering/Core/Picker.d.ts +5 -5
  110. package/Rendering/Core/PixelSpaceCallbackMapper.d.ts +2 -2
  111. package/Rendering/Core/PointPicker.d.ts +3 -3
  112. package/Rendering/Core/Prop.d.ts +5 -5
  113. package/Rendering/Core/Prop3D.d.ts +2 -2
  114. package/Rendering/Core/Property.d.ts +2 -2
  115. package/Rendering/Core/Property2D.d.ts +2 -2
  116. package/Rendering/Core/RenderWindow.d.ts +4 -4
  117. package/Rendering/Core/RenderWindowInteractor.d.ts +2 -2
  118. package/Rendering/Core/Renderer.d.ts +17 -16
  119. package/Rendering/Core/ScalarBarActor.d.ts +3 -3
  120. package/Rendering/Core/Skybox.d.ts +1 -1
  121. package/Rendering/Core/SphereMapper.d.ts +1 -1
  122. package/Rendering/Core/StickMapper.d.ts +1 -1
  123. package/Rendering/Core/Texture.d.ts +1 -1
  124. package/Rendering/Core/Viewport.d.ts +4 -4
  125. package/Rendering/Core/Volume.d.ts +4 -4
  126. package/Rendering/Core/VolumeMapper.d.ts +2 -2
  127. package/Rendering/Core/VolumeProperty.d.ts +1 -1
  128. package/Rendering/Misc/CanvasView.d.ts +2 -2
  129. package/Rendering/Misc/FullScreenRenderWindow.d.ts +8 -8
  130. package/Rendering/Misc/GenericRenderWindow.d.ts +6 -6
  131. package/Rendering/Misc/RemoteView.d.ts +3 -3
  132. package/Rendering/Misc/RenderWindowWithControlBar.d.ts +2 -2
  133. package/Rendering/Misc/SynchronizableRenderWindow.d.ts +4 -3
  134. package/Rendering/Misc/TextureLODsDownloader.d.ts +4 -4
  135. package/Rendering/OpenGL/ImageMapper.js +1 -1
  136. package/Rendering/OpenGL/RenderWindow.d.ts +18 -18
  137. package/Rendering/OpenGL/VolumeMapper.js +16 -1
  138. package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
  139. package/Rendering/SceneGraph/RenderPass.d.ts +2 -2
  140. package/Rendering/SceneGraph/ViewNode.d.ts +2 -2
  141. package/Rendering/SceneGraph/ViewNodeFactory.d.ts +1 -1
  142. package/Rendering/WebGPU/HardwareSelectionPass.js +0 -1
  143. package/Rendering/WebGPU/ImageMapper.js +1 -1
  144. package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -3
  145. package/Rendering/WebGPU/RenderEncoder.js +1 -4
  146. package/Widgets/Core/AbstractWidgetFactory.js +5 -3
  147. package/Widgets/Manipulators/LineManipulator.d.ts +1 -1
  148. package/Widgets/Manipulators/PlaneManipulator.d.ts +1 -1
  149. package/Widgets/Manipulators/TrackballManipulator.d.ts +1 -1
  150. package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +1 -1
  151. package/Widgets/Representations/WidgetRepresentation.d.ts +1 -1
  152. package/index.d.ts +7 -0
  153. package/interfaces.d.ts +4 -4
  154. package/macros.d.ts +1 -1
  155. package/package.json +1 -1
  156. package/types.d.ts +22 -1
  157. package/vtk.d.ts +7 -2
@@ -0,0 +1,135 @@
1
+ import vtkImageData from '../../Common/DataModel/ImageData';
2
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
3
+ import { Bounds, Extent, Vector2, Vector3 } from '../../types';
4
+
5
+ /**
6
+ *
7
+ */
8
+ export interface IImageStreamlineInitialValues {
9
+ integrationStep?: number,
10
+ maximumNumberOfSteps?: number,
11
+ }
12
+
13
+ type vtkImageStreamlineBase = vtkObject & vtkAlgorithm;
14
+
15
+ export interface vtkImageStreamline extends vtkImageStreamlineBase {
16
+
17
+ /**
18
+ *
19
+ * @param velArray
20
+ * @param image
21
+ * @param {Number} delT
22
+ * @param {Number[]} xyz
23
+ */
24
+ computeNextStep(velArray: any, image: any, delT: number, xyz: number[]): boolean;
25
+
26
+ /**
27
+ *
28
+ * @param {Vector3} x
29
+ * @param {Vector3} ijk
30
+ * @param {Vector3} pcoords
31
+ * @param {Extent} extent
32
+ * @param {Vector3} spacing
33
+ * @param {Vector3} origin
34
+ * @param {Bounds} bounds
35
+ */
36
+ computeStructuredCoordinates(x: Vector3, ijk: Vector3, pcoords: Vector3, extent: Extent, spacing: Vector3, origin: Vector3, bounds: Bounds): boolean;
37
+
38
+ /**
39
+ * Get the step length (delT) used during integration.
40
+ */
41
+ getIntegrationStep(): number;
42
+
43
+ /**
44
+ * Get the number of steps to be used in the integration.
45
+ */
46
+ getMaximumNumberOfSteps(): number;
47
+
48
+ /**
49
+ *
50
+ * @param {Vector3} ijk
51
+ * @param {Vector2} dims
52
+ * @param {Number[]} ids
53
+ */
54
+ getVoxelIndices(ijk: Vector3, dims: Vector2, ids: number[]): void;
55
+
56
+ /**
57
+ *
58
+ * @param {Vector3} pcoords
59
+ * @param {Number[]} sf
60
+ */
61
+ interpolationFunctions(pcoords: Vector3, sf: number[]): void;
62
+ /**
63
+ *
64
+ * @param inData
65
+ * @param outData
66
+ */
67
+ requestData(inData: any, outData: any): void;
68
+
69
+ /**
70
+ * Set the step length (delT) used during integration.
71
+ * @param {Number} integrationStep
72
+ */
73
+ setIntegrationStep(integrationStep: number): boolean;
74
+
75
+ /**
76
+ * Set the number of steps to be used in the integration.
77
+ * Integration can terminal earlier if the streamline leaves the domain.
78
+ * @param {Number} maximumNumberOfSteps
79
+ */
80
+ setMaximumNumberOfSteps(maximumNumberOfSteps: number): boolean;
81
+
82
+ /**
83
+ *
84
+ * @param velArray
85
+ * @param {vtkImageData} image
86
+ * @param {Number[]} seed
87
+ * @param {Number} offset
88
+ */
89
+ streamIntegrate(velArray: any, image: vtkImageData, seed: number[], offset: number): any[];
90
+
91
+ /**
92
+ *
93
+ * @param {Number[]} xyz
94
+ * @param velArray
95
+ * @param {vtkImageData} image
96
+ * @param velAtArg
97
+ */
98
+ vectorAt(xyz: number[], velArray: any, image: vtkImageData, velAtArg: any): boolean;
99
+ }
100
+
101
+ /**
102
+ * Method used to decorate a given object (publicAPI+model) with vtkImageStreamline characteristics.
103
+ *
104
+ * @param publicAPI object on which methods will be bounds (public)
105
+ * @param model object on which data structure will be bounds (protected)
106
+ * @param {IImageStreamlineInitialValues} [initialValues] (default: {})
107
+ */
108
+ export function extend(publicAPI: object, model: object, initialValues?: IImageStreamlineInitialValues): void;
109
+
110
+ /**
111
+ * Method used to create a new instance of vtkImageStreamline
112
+ * @param {IImageStreamlineInitialValues} [initialValues] for pre-setting some of its content
113
+ */
114
+ export function newInstance(initialValues?: IImageStreamlineInitialValues): vtkImageStreamline;
115
+
116
+
117
+ /**
118
+ * vtkImageStreamline - integrate streamlines in a vtkImageData
119
+ *
120
+ * vtkImageStreamline is a filter that generates streamlines from a vtkImageData
121
+ * input over which a vector field is defined. This filter will look for vectors
122
+ * (i.e. getVectors()) in the input. It will then integrate these vectors, using
123
+ * Runge-Kutta 2, from a starting set of seeds defined by the points of the 2nd
124
+ * input until a specified maximum number of steps is reached or until the
125
+ * streamline leaves the domain.
126
+ *
127
+ * The output will be a vtkPolyData which contains a polyline for each
128
+ * streamline. Currently, this filter does not interpolate any input fields to
129
+ * the points of the streamline.
130
+ */
131
+ export declare const vtkImageStreamline: {
132
+ newInstance: typeof newInstance;
133
+ extend: typeof extend;
134
+ }
135
+ export default vtkImageStreamline;
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  export const BOUNDS_MAP: number[];
4
4
 
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { DesiredOutputPrecision } from '@kitware/vtk.js/Common/DataModel/DataSetAttributes';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { DesiredOutputPrecision } from '../../Common/DataModel/DataSetAttributes';
3
3
 
4
4
  export enum VaryRadius {
5
5
  VARY_RADIUS_OFF,
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  export enum ShapeType {
5
5
  TRIANGLE,
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  export enum ShapeType {
5
5
  TRIANGLE,
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Bounds, Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Bounds, Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,6 +1,6 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
3
- import { Bounds, Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import vtkPolyData from '../../Common/DataModel/PolyData';
3
+ import { Bounds, Vector3 } from '../../types';
4
4
 
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { vec3 } from 'gl-matrix';
2
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
3
- import { Vector3 } from '@kitware/vtk.js/types';
2
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
3
+ import { Vector3 } from '../../types';
4
4
 
5
5
  /**
6
6
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Vector3 } from '@kitware/vtk.js/types';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
+ import { Vector3 } from '../../types';
3
3
 
4
4
  /**
5
5
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -1,4 +1,4 @@
1
- import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
1
+ import { vtkAlgorithm, vtkObject } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  *
@@ -0,0 +1,9 @@
1
+ export interface HtmlDataAccessHelper {
2
+ fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise<object[]>;
3
+ fetchJSON(instance: any, url: string, options?: object): Promise<object>;
4
+ fetchText(instance: any, url: string, options?: object): Promise<string>;
5
+ fetchBinary(instance: any, url: string, options?: object): Promise<ArrayBuffer>;
6
+ fetchImage(instance: any, url: string, options?: object): Promise<HTMLImageElement>;
7
+ }
8
+
9
+ export default HtmlDataAccessHelper;
@@ -0,0 +1,9 @@
1
+ export interface HttpDataAccessHelper {
2
+ fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise<object[]>;
3
+ fetchJSON(instance: any, url: string, options?: object): Promise<object>;
4
+ fetchText(instance: any, url: string, options?: object): Promise<string>;
5
+ fetchBinary(instance: any, url: string, options?: object): Promise<ArrayBuffer>;
6
+ fetchImage(instance: any, url: string, options?: object): Promise<HTMLImageElement>;
7
+ }
8
+
9
+ export default HttpDataAccessHelper;
@@ -0,0 +1,13 @@
1
+ interface IJSZipDataAccessHelper {
2
+ fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise<object[]>;
3
+ fetchJSON(instance: any, url: string, options?: object): Promise<object>;
4
+ fetchText(instance: any, url: string, options?: object): Promise<string>;
5
+ fetchBinary(instance: any, url: string, options?: object): Promise<ArrayBuffer>;
6
+ fetchImage(instance: any, url: string, options?: object): Promise<HTMLImageElement>;
7
+ }
8
+
9
+ export interface JSZipDataAccessHelper {
10
+ create(createOptions: object): IJSZipDataAccessHelper
11
+ }
12
+
13
+ export default JSZipDataAccessHelper;
@@ -0,0 +1,9 @@
1
+ export interface LiteHttpDataAccessHelper {
2
+ fetchArray(instance: any, baseURL: string, array: object[], options?: object): Promise<object[]>;
3
+ fetchJSON(instance: any, url: string, options?: object): Promise<object>;
4
+ fetchText(instance: any, url: string, options?: object): Promise<string>;
5
+ fetchBinary(instance: any, url: string, options?: object): Promise<ArrayBuffer>;
6
+ fetchImage(instance: any, url: string, options?: object): Promise<HTMLImageElement>;
7
+ }
8
+
9
+ export default LiteHttpDataAccessHelper;
@@ -0,0 +1,32 @@
1
+ import HtmlDataAccessHelper from '././HtmlDataAccessHelper';
2
+ import HttpDataAccessHelper from '././HttpDataAccessHelper';
3
+ import JSZipDataAccessHelper from '././JSZipDataAccessHelper';
4
+ import LiteHttpDataAccessHelper from '././LiteHttpDataAccessHelper';
5
+
6
+ export function has(type: string): boolean;
7
+ export function get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper
8
+ export function registerType(type: string, fn: any): void;
9
+
10
+ export interface DataAccessHelper {
11
+ /**
12
+ *
13
+ * @param {String} type
14
+ */
15
+ has(type: string): boolean;
16
+
17
+ /**
18
+ *
19
+ * @param {String} type
20
+ * @param options
21
+ */
22
+ get(type?: string, options?: object): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper
23
+
24
+ /**
25
+ *
26
+ * @param {String} type
27
+ * @param fn
28
+ */
29
+ registerType(type: string, fn: any): void;
30
+ }
31
+
32
+ export default DataAccessHelper;
@@ -0,0 +1,226 @@
1
+ import { vtkAlgorithm, vtkObject, vtkSubscription } from '../../interfaces';
2
+ import HtmlDataAccessHelper from './DataAccessHelper/HtmlDataAccessHelper';
3
+ import HttpDataAccessHelper from './DataAccessHelper/HttpDataAccessHelper';
4
+ import JSZipDataAccessHelper from './DataAccessHelper/JSZipDataAccessHelper';
5
+ import LiteHttpDataAccessHelper from './DataAccessHelper/LiteHttpDataAccessHelper';
6
+
7
+ /**
8
+ *
9
+ */
10
+ export interface IHttpDataSetReaderInitialValues {
11
+ enableArray?: boolean;
12
+ fetchGzip?: boolean;
13
+ arrays?: any[];
14
+ url?: string;
15
+ baseURL?: string;
16
+ requestCount?: number;
17
+ }
18
+
19
+ export interface IHttpDataSetReaderOptions {
20
+ fullpath?: string,
21
+ compression?: string,
22
+ loadData?: boolean;
23
+ }
24
+
25
+ export interface IHttpDataSetReaderArray {
26
+ location: string;
27
+ name: string;
28
+ enable: boolean;
29
+ }
30
+
31
+ type vtkHttpDataSetReaderBase = vtkObject & Omit<vtkAlgorithm,
32
+ | 'getInputData'
33
+ | 'setInputData'
34
+ | 'setInputConnection'
35
+ | 'getInputConnection'
36
+ | 'addInputConnection'
37
+ | 'addInputData'>;
38
+
39
+ export interface vtkHttpDataSetReader extends vtkHttpDataSetReaderBase {
40
+
41
+ /**
42
+ * Enable or disable a given array.
43
+ *
44
+ * ```js
45
+ * reader.enableArray('pointData', 'Temperature');
46
+ * reader.enableArray('pointData', 'Pressure', false);
47
+ * reader.enableArray('cellData', 'CellId', true);
48
+ * reader.enableArray('fieldData', 'labels', true);
49
+ * ```
50
+ * @param {String} location
51
+ * @param {String} name
52
+ * @param {Boolean} [enable]
53
+ */
54
+ enableArray(location: string, name: string, enable?: boolean): void;
55
+
56
+ /**
57
+ * Get the list of available array with their location and if they are
58
+ * enable or not for download using the __update()__ method.
59
+ */
60
+ getArrays(): IHttpDataSetReaderArray[];
61
+
62
+ /**
63
+ *
64
+ */
65
+ getArraysByReference(): IHttpDataSetReaderArray[];
66
+
67
+ /**
68
+ * Get the base url to use to download arrays or other data from the given
69
+ * dataset.
70
+ *
71
+ * ```js
72
+ * reader.setURL('/Data/can.ex2/index.json');
73
+ *
74
+ * if (reader.getBaseURL() === '/Data/can.ex2') {
75
+ * console.log('Good guess...');
76
+ * }
77
+ * ```
78
+ */
79
+ getBaseURL(): string;
80
+
81
+ /**
82
+ *
83
+ */
84
+ getDataAccessHelper(): HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper;
85
+
86
+ /**
87
+ *
88
+ */
89
+ getEnableArray(): boolean;
90
+
91
+ /**
92
+ *
93
+ */
94
+ getFetchGzip(): boolean;
95
+
96
+ /**
97
+ * Get the url of the object to load.
98
+ */
99
+ getUrl(): string;
100
+
101
+ /**
102
+ *
103
+ * @param {Boolean} busy
104
+ */
105
+ invokeBusy(busy: boolean): void;
106
+
107
+ /**
108
+ * Get the current status of the reader. True means busy and False means
109
+ * idle.
110
+ */
111
+ isBusy(): boolean;
112
+
113
+ /**
114
+ *
115
+ */
116
+ loadData(): string;
117
+
118
+ /**
119
+ * Attach listener to monitor when the reader is downloading data or not.
120
+ *
121
+ * ```js
122
+ * const subscription = reader.onBusy(busy => {
123
+ * console.log('Reader is', busy ? 'downloading' : 'idle');
124
+ * })
125
+ *
126
+ * reader.update();
127
+ * // much later
128
+ * subscription.unsubscribe();
129
+ * ```
130
+ * @param callback
131
+ */
132
+ onBusy(callback: (busy: boolean) => any): vtkSubscription;
133
+
134
+ /**
135
+ *
136
+ * @param inData
137
+ * @param outData
138
+ */
139
+ requestData(inData: any, outData: any): void;
140
+
141
+ /**
142
+ *
143
+ * @param dataAccessHelper
144
+ */
145
+ setDataAccessHelper(dataAccessHelper: HtmlDataAccessHelper | HttpDataAccessHelper | JSZipDataAccessHelper | LiteHttpDataAccessHelper): boolean;
146
+
147
+ /**
148
+ *
149
+ * @param progressCallback
150
+ */
151
+ setProgressCallback(progressCallback: any): boolean;
152
+
153
+ /**
154
+ * Set the url for the dataset to load.
155
+ *
156
+ * ```js
157
+ * const reader = HttpDataSetReader.newInstance();
158
+ * isReady = reader.setURL('/Data/can.ex2/index.json');
159
+ *
160
+ * // Same as
161
+ * const reader = HttpDataSetReader.newInstance({ url: '/Data/can.ex2/index.json' });
162
+ * isReady = reader.updateMetadata();
163
+ * ```
164
+ * @param {String} url the url of the object to load.
165
+ * @param {IHttpDataSetReaderOptions} [option] The Draco reader options.
166
+ */
167
+ setUrl(url: string, option?: IHttpDataSetReaderOptions): Promise<any>;
168
+
169
+ /**
170
+ *
171
+ */
172
+ updateMetadata(): Promise<any>;
173
+ }
174
+
175
+ /**
176
+ * Method used to decorate a given object (publicAPI+model) with vtkHttpDataSetReader characteristics.
177
+ *
178
+ * @param publicAPI object on which methods will be bounds (public)
179
+ * @param model object on which data structure will be bounds (protected)
180
+ * @param {IHttpDataSetReaderInitialValues} [initialValues] (default: {})
181
+ */
182
+ export function extend(publicAPI: object, model: object, initialValues?: IHttpDataSetReaderInitialValues): void;
183
+
184
+ /**
185
+ * Method used to create a new instance of vtkHttpDataSetReader while enabling a
186
+ * default behavior regarding the data array and the way they should be fetched
187
+ * from the server.
188
+ *
189
+ * The __enableArray__ argument allow you to choose if you want to activate all
190
+ * data array by default or if you will have to manually enable them before
191
+ * downloading them.
192
+ * @param {IHttpDataSetReaderInitialValues} [initialValues] for pre-setting some of its content
193
+ */
194
+ export function newInstance(initialValues?: IHttpDataSetReaderInitialValues): vtkHttpDataSetReader;
195
+
196
+ /**
197
+ * The vtkHttpDataSetReader is using a custom format that only exist in vtk.js
198
+ * which aims to simplify data fetching in an HTTP context. Basically the format
199
+ * is composed of a JSON metadata file referencing all the required data array
200
+ * as side binary files along with all the dataset configuration (i.e.: type,
201
+ * extent...).
202
+ *
203
+ * @example
204
+ * ```js
205
+ * import vtkHttpDataSetReader from '@kitware/vtk.js/IO/Core/HttpDataSetReader';
206
+ *
207
+ * const reader = vtkHttpDataSetReader.newInstance();
208
+ * reader.setURL('/Data/can.ex2/index.json').then((reader, dataset) => {
209
+ * console.log('Metadata loaded with the geometry', dataset);
210
+ *
211
+ * reader.getArrays().forEach(array => {
212
+ * console.log('-', array.name, array.location, ':', array.enable);
213
+ * });
214
+ *
215
+ * reader.update()
216
+ * .then((reader, dataset) => {
217
+ * console.log('dataset fully loaded', dataset);
218
+ * });
219
+ * });
220
+ * ```
221
+ */
222
+ export declare const vtkHttpDataSetReader: {
223
+ newInstance: typeof newInstance,
224
+ extend: typeof extend,
225
+ };
226
+ export default vtkHttpDataSetReader;
@@ -1,8 +1,8 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import vtkAnnotatedCubeActor from '@kitware/vtk.js/Rendering/Core/AnnotatedCubeActor';
3
- import vtkAxesActor from '@kitware/vtk.js/Rendering/Core/AxesActor';
4
- import vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
5
- import vtkRenderWindowInteractor from '@kitware/vtk.js/Rendering/Core/RenderWindowInteractor';
1
+ import { vtkObject } from '../../interfaces';
2
+ import vtkAnnotatedCubeActor from '../../Rendering/Core/AnnotatedCubeActor';
3
+ import vtkAxesActor from '../../Rendering/Core/AxesActor';
4
+ import vtkRenderer from '../../Rendering/Core/Renderer';
5
+ import vtkRenderWindowInteractor from '../../Rendering/Core/RenderWindowInteractor';
6
6
 
7
7
  /**
8
8
  *
@@ -1,4 +1,4 @@
1
- import { Size, Vector3 } from '@kitware/vtk.js/types';
1
+ import { Size, Vector3 } from '../../types';
2
2
 
3
3
  declare function createMethods(session: any): {
4
4
  subscribeToImageStream: (callback: any) => any;
@@ -1,7 +1,7 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Size } from '@kitware/vtk.js/types';
3
- import vtkCamera from '@kitware/vtk.js/Rendering/Core/Camera';
4
- import DefaultProtocol from '@kitware/vtk.js/IO/Core/ImageStream/DefaultProtocol';
1
+ import { vtkObject } from '../../interfaces';
2
+ import { Size } from '../../types';
3
+ import vtkCamera from '../../Rendering/Core/Camera';
4
+ import DefaultProtocol from '././DefaultProtocol';
5
5
  /**
6
6
  *
7
7
  */
@@ -1,6 +1,6 @@
1
- import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Size } from '@kitware/vtk.js/types';
3
- import vtkViewStream from '@kitware/vtk.js/IO/Core/ImageStream/ViewStream';
1
+ import { vtkObject } from '../../interfaces';
2
+ import { Size } from '../../types';
3
+ import vtkViewStream from '././ViewStream';
4
4
 
5
5
  /**
6
6
  *
@@ -1,4 +1,4 @@
1
- import { vtkObject, vtkSubscription } from '@kitware/vtk.js/interfaces';
1
+ import { vtkObject, vtkSubscription } from '../../interfaces';
2
2
 
3
3
  /**
4
4
  * Bind optional dependency from WSLink to our current class.