@kitware/vtk.js 21.1.4 → 21.2.2

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 (32) hide show
  1. package/Common/Transform/LandmarkTransform.d.ts +1 -1
  2. package/Filters/General/ImageCropFilter.js +3 -4
  3. package/Filters/Sources/Arrow2DSource.d.ts +14 -13
  4. package/Filters/Sources/ArrowSource.d.ts +9 -8
  5. package/Filters/Sources/CircleSource.d.ts +15 -14
  6. package/Filters/Sources/ConeSource.d.ts +18 -17
  7. package/Filters/Sources/CubeSource.d.ts +19 -19
  8. package/Filters/Sources/Cursor3D.d.ts +19 -16
  9. package/Filters/Sources/CylinderSource.d.ts +15 -14
  10. package/Filters/Sources/LineSource.d.ts +1 -1
  11. package/Filters/Sources/PlaneSource.d.ts +29 -28
  12. package/Filters/Sources/PointSource.d.ts +9 -8
  13. package/Filters/Sources/SphereSource.d.ts +9 -8
  14. package/IO/Geometry/STLReader.js +2 -2
  15. package/Rendering/Core/AbstractMapper.js +1 -0
  16. package/Rendering/Core/Light.d.ts +277 -234
  17. package/Rendering/Core/Property.d.ts +43 -43
  18. package/Rendering/Core/Property2D.d.ts +21 -5
  19. package/Rendering/Core/RenderWindowInteractor.js +7 -7
  20. package/Rendering/Core/Volume.d.ts +9 -0
  21. package/Rendering/OpenGL/ImageMapper.js +1 -1
  22. package/Rendering/OpenGL/PolyDataMapper.js +5 -17
  23. package/Rendering/OpenGL/RenderWindow.js +190 -106
  24. package/Rendering/OpenGL/ShaderProgram.js +0 -12
  25. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js +17 -0
  26. package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +18 -0
  27. package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +698 -2
  28. package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +274 -2
  29. package/interfaces.d.ts +66 -24
  30. package/package.json +2 -2
  31. package/types.d.ts +4 -1
  32. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -31
@@ -1,5 +1,6 @@
1
1
  import { vec3 } from 'gl-matrix';
2
2
  import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
3
+ import { Vector3 } from '@kitware/vtk.js/types';
3
4
 
4
5
  /**
5
6
  *
@@ -7,9 +8,9 @@ import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
7
8
  export interface IPlaneSourceInitialValues {
8
9
  xResolution?: number;
9
10
  yResolution?: number;
10
- origin?: number[];
11
- point1?: number[];
12
- point2?: number[];
11
+ origin?: Vector3;
12
+ point1?: Vector3;
13
+ point2?: Vector3;
13
14
  pointType?: string;
14
15
  }
15
16
 
@@ -27,56 +28,56 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
27
28
  * Get the center of the plane.
28
29
  * @default [0, 0, 0]
29
30
  */
30
- getCenter(): number[];
31
+ getCenter(): Vector3;
31
32
 
32
33
  /**
33
34
  * Get the center of the plane.
34
35
  */
35
- getCenterByReference(): number[];
36
+ getCenterByReference(): Vector3;
36
37
 
37
38
  /**
38
39
  * Get the normal of the plane.
39
40
  * @default [0, 0, 1]
40
41
  */
41
- getNormal(): number[];
42
+ getNormal(): Vector3;
42
43
 
43
44
  /**
44
45
  * Get the normal of the plane.
45
46
  */
46
- getNormalByReference(): number[];
47
+ getNormalByReference(): Vector3;
47
48
 
48
49
  /**
49
50
  * Get the origin of the plane, lower-left corner.
50
51
  * @default [0, 0, 0]
51
52
  */
52
- getOrigin(): number[];
53
+ getOrigin(): Vector3;
53
54
 
54
55
  /**
55
56
  * Get the origin of the plane, lower-left corner.
56
57
  */
57
- getOriginByReference(): number[];
58
+ getOriginByReference(): Vector3;
58
59
 
59
60
  /**
60
61
  * Get the x axes of the plane.
61
62
  * @default [1, 0, 0]
62
63
  */
63
- getPoint1(): number[];
64
+ getPoint1(): Vector3;
64
65
 
65
66
  /**
66
67
  * Get the x axes of the plane.
67
68
  */
68
- getPoint1ByReference(): number[];
69
+ getPoint1ByReference(): Vector3;
69
70
 
70
71
  /**
71
72
  * Get the y axes of the plane.
72
73
  * @default [0, 1, 0]
73
74
  */
74
- getPoint2(): number[];
75
+ getPoint2(): Vector3;
75
76
 
76
77
  /**
77
78
  * Get the y axes of the plane.
78
79
  */
79
- getPoint2ByReference(): number[];
80
+ getPoint2ByReference(): Vector3;
80
81
 
81
82
  /**
82
83
  * Get the x resolution of the plane.
@@ -114,15 +115,15 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
114
115
 
115
116
  /**
116
117
  * Set the center of the plane.
117
- * @param {Number[]} center The coordinate of the center point.
118
+ * @param {Vector3} center The coordinate of the center point.
118
119
  */
119
- setCenter(center: number[]): void;
120
+ setCenter(center: Vector3): void;
120
121
 
121
122
  /**
122
123
  * Set the normal of the plane.
123
- * @param {Number[]} normal The normal coordinate.
124
+ * @param {Vector3} normal The normal coordinate.
124
125
  */
125
- setNormal(normal: number[]): boolean;
126
+ setNormal(normal: Vector3): boolean;
126
127
 
127
128
  /**
128
129
  * Set the normal of the plane.
@@ -134,15 +135,15 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
134
135
 
135
136
  /**
136
137
  * Set the normal of the plane.
137
- * @param {Number[]} normal The normal coordinate.
138
+ * @param {Vector3} normal The normal coordinate.
138
139
  */
139
- setNormalFrom(normal: number[]): boolean;
140
+ setNormalFrom(normal: Vector3): boolean;
140
141
 
141
142
  /**
142
143
  * Set the origin of the plane.
143
- * @param {Number[]} origin The coordinate of the origin point.
144
+ * @param {Vector3} origin The coordinate of the origin point.
144
145
  */
145
- setOrigin(origin: number[]): boolean;
146
+ setOrigin(origin: Vector3): boolean;
146
147
 
147
148
  /**
148
149
  * Set the origin of the plane.
@@ -154,9 +155,9 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
154
155
 
155
156
  /**
156
157
  * Set the origin of the plane.
157
- * @param {Number[]} origin The coordinate of the origin point.
158
+ * @param {Vector3} origin The coordinate of the origin point.
158
159
  */
159
- setOriginFrom(origin: number[]): boolean;
160
+ setOriginFrom(origin: Vector3): boolean;
160
161
 
161
162
  /**
162
163
  * Specify a point defining the first axis of the plane.
@@ -168,9 +169,9 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
168
169
 
169
170
  /**
170
171
  * Specify a point defining the first axis of the plane.
171
- * @param {Number[]} point1
172
+ * @param {Vector3} point1
172
173
  */
173
- setPoint1(point1: number[]): boolean;
174
+ setPoint1(point1: Vector3): boolean;
174
175
 
175
176
  /**
176
177
  * Specify a point defining the second axis of the plane.
@@ -182,9 +183,9 @@ export interface vtkPlaneSource extends vtkPlaneSourceBase {
182
183
 
183
184
  /**
184
185
  * Specify a point defining the second axis of the plane.
185
- * @param {Number[]} point2
186
+ * @param {Vector3} point2
186
187
  */
187
- setPoint2(point2: number[]): boolean;
188
+ setPoint2(point2: Vector3): boolean;
188
189
 
189
190
  /**
190
191
  * Set the number of facets used to represent the cone.
@@ -234,7 +235,7 @@ export function newInstance(initialValues?: IPlaneSourceInitialValues): vtkPlane
234
235
  *
235
236
  * @example
236
237
  * ```js
237
- * import vtkPlaneSource from 'vtk.js/Sources/Filters/Sources/PlaneSource';
238
+ * import vtkPlaneSource from '@kitware/vtk.js/Filters/Sources/PlaneSource';
238
239
  *
239
240
  * const plane = vtkPlaneSource.newInstance({ xResolution: 10, yResolution: 10 });
240
241
  * const polydata = plane.getOutputData();
@@ -1,11 +1,12 @@
1
1
  import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
+ import { Vector3 } from '@kitware/vtk.js/types';
2
3
 
3
4
  /**
4
5
  *
5
6
  */
6
7
  export interface IPointSourceInitialValues {
7
8
  numberOfPoints?: number;
8
- center?: number[];
9
+ center?: Vector3;
9
10
  radius?: number;
10
11
  pointType?: string;
11
12
  }
@@ -24,12 +25,12 @@ export interface vtkPointSource extends vtkPointSourceBase {
24
25
  * Get the center of the plane.
25
26
  * @default [0, 0, 0]
26
27
  */
27
- getCenter(): number[];
28
+ getCenter(): Vector3;
28
29
 
29
30
  /**
30
31
  * Get the center of the plane.
31
32
  */
32
- getCenterByReference(): number[];
33
+ getCenterByReference(): Vector3;
33
34
 
34
35
  /**
35
36
  * Get the number of points to generate.
@@ -60,15 +61,15 @@ export interface vtkPointSource extends vtkPointSourceBase {
60
61
 
61
62
  /**
62
63
  * Set the center of the point cloud.
63
- * @param {Number[]} center The center point's coordinates.
64
+ * @param {Vector3} center The center point's coordinates.
64
65
  */
65
- setCenter(center: number[]): boolean;
66
+ setCenter(center: Vector3): boolean;
66
67
 
67
68
  /**
68
69
  * Set the center of the point cloud.
69
- * @param {Number[]} center The center point's coordinates.
70
+ * @param {Vector3} center The center point's coordinates.
70
71
  */
71
- setCenterFrom(center: number[]): boolean;
72
+ setCenterFrom(center: Vector3): boolean;
72
73
 
73
74
  /**
74
75
  * Set the number of points to generate.
@@ -110,7 +111,7 @@ export function newInstance(initialValues?: IPointSourceInitialValues): vtkPoint
110
111
  *
111
112
  * @example
112
113
  * ```js
113
- * import vtkPointSource from 'vtk.js/Sources/Filters/Sources/PointSource';
114
+ * import vtkPointSource from '@kitware/vtk.js/Filters/Sources/PointSource';
114
115
  *
115
116
  * const point = vtkPointSource.newInstance({ numberOfPoints: 10 });
116
117
  * const polydata = point.getOutputData();
@@ -1,4 +1,5 @@
1
1
  import { vtkAlgorithm, vtkObject } from '@kitware/vtk.js/interfaces';
2
+ import { Vector3 } from '@kitware/vtk.js/types';
2
3
 
3
4
  /**
4
5
  *
@@ -12,7 +13,7 @@ export interface ISphereSourceInitialValues {
12
13
  phiResolution?: number;
13
14
  startPhi?: number;
14
15
  endPhi?: number;
15
- center?: number[];
16
+ center?: Vector3;
16
17
  pointType?: string;
17
18
  }
18
19
 
@@ -30,12 +31,12 @@ export interface vtkSphereSource extends vtkSphereSourceBase {
30
31
  * Get the center of the sphere.
31
32
  * @default [0, 0, 0]
32
33
  */
33
- getCenter(): number[];
34
+ getCenter(): Vector3;
34
35
 
35
36
  /**
36
37
  * Get the center of the sphere.
37
38
  */
38
- getCenterByReference(): number[];
39
+ getCenterByReference(): Vector3;
39
40
 
40
41
 
41
42
  /**
@@ -103,15 +104,15 @@ export interface vtkSphereSource extends vtkSphereSourceBase {
103
104
 
104
105
  /**
105
106
  * Set the center of the sphere.
106
- * @param {Number[]} center The center point's coordinates.
107
+ * @param {Vector3} center The center point's coordinates.
107
108
  */
108
- setCenter(center: number[]): boolean;
109
+ setCenter(center: Vector3): boolean;
109
110
 
110
111
  /**
111
112
  * Set the center of the sphere.
112
- * @param {Number[]} center The center point's coordinates.
113
+ * @param {Vector3} center The center point's coordinates.
113
114
  */
114
- setCenterFrom(center: number[]): boolean;
115
+ setCenterFrom(center: Vector3): boolean;
115
116
 
116
117
  /**
117
118
  * Set the ending latitude angle.
@@ -192,7 +193,7 @@ export function newInstance(initialValues?: ISphereSourceInitialValues): vtkSphe
192
193
  *
193
194
  * @example
194
195
  * ```js
195
- * import vtkSphereSource from 'vtk.js/Sources/Filters/Sources/SphereSource';
196
+ * import vtkSphereSource from '@kitware/vtk.js/Filters/Sources/SphereSource';
196
197
  *
197
198
  * const sphere = vtkSphereSource.newInstance();
198
199
  * const polydata = sphere.getOutputData();
@@ -182,8 +182,8 @@ function vtkSTLReader(publicAPI, model) {
182
182
  var headerStr = BinaryHelper.arrayBufferToString(headerData);
183
183
  var header = parseHeader(headerStr); // Data
184
184
 
185
- var dataView = new DataView(content, 84);
186
- global.dataview = dataView;
185
+ var dataView = new DataView(content, 84); // global.dataview = dataView;
186
+
187
187
  var nbFaces = (content.byteLength - 84) / 50;
188
188
  var pointValues = new Float32Array(nbFaces * 9);
189
189
  var normalValues = new Float32Array(nbFaces * 3);
@@ -14,6 +14,7 @@ function vtkAbstractMapper(publicAPI, model) {
14
14
  }
15
15
 
16
16
  model.clippingPlanes.push(plane);
17
+ publicAPI.modified();
17
18
  };
18
19
 
19
20
  publicAPI.getNumberOfClippingPlanes = function () {