@kitware/vtk.js 21.1.5 → 21.3.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 (48) 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/Actor2D.js +1 -3
  17. package/Rendering/Core/Light.d.ts +277 -234
  18. package/Rendering/Core/Mapper2D.d.ts +402 -0
  19. package/Rendering/Core/Mapper2D.js +213 -0
  20. package/Rendering/Core/Property.d.ts +43 -43
  21. package/Rendering/Core/Property2D/Constants.js +9 -0
  22. package/Rendering/Core/Property2D.d.ts +21 -5
  23. package/Rendering/Core/Property2D.js +30 -2
  24. package/Rendering/Core/RenderWindowInteractor.js +7 -7
  25. package/Rendering/Core/Volume.d.ts +9 -0
  26. package/Rendering/Core.js +2 -0
  27. package/Rendering/OpenGL/Actor2D.js +74 -30
  28. package/Rendering/OpenGL/ForwardPass.js +11 -0
  29. package/Rendering/OpenGL/ImageMapper.js +1 -1
  30. package/Rendering/OpenGL/PolyDataMapper.js +8 -19
  31. package/Rendering/OpenGL/PolyDataMapper2D.js +667 -0
  32. package/Rendering/OpenGL/Profiles/All.js +1 -0
  33. package/Rendering/OpenGL/Profiles/Geometry.js +1 -0
  34. package/Rendering/OpenGL/RenderWindow.js +190 -106
  35. package/Rendering/OpenGL/ShaderProgram.js +0 -12
  36. package/Rendering/OpenGL/glsl/vtkPolyData2DFS.glsl.js +3 -0
  37. package/Rendering/OpenGL/glsl/vtkPolyData2DVS.glsl.js +3 -0
  38. package/Rendering/OpenGL.js +2 -0
  39. package/Rendering/Profiles/All.js +1 -0
  40. package/Rendering/Profiles/Geometry.js +1 -0
  41. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js +17 -0
  42. package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +18 -0
  43. package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +698 -2
  44. package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +274 -2
  45. package/interfaces.d.ts +66 -24
  46. package/package.json +1 -1
  47. package/types.d.ts +4 -1
  48. package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -31
@@ -1,248 +1,290 @@
1
+ import { mat4 } from "gl-matrix";
1
2
  import { vtkObject } from '@kitware/vtk.js/interfaces';
2
- import { Color } from '@kitware/vtk.js/types';
3
+ import { RGBColor, Vector3 } from '@kitware/vtk.js/types';
4
+
5
+ export enum LIGHT_TYPES {
6
+ 'HeadLight',
7
+ 'CameraLight',
8
+ 'SceneLight'
9
+ }
3
10
 
4
11
  export interface ILightInitialValues {
5
- switch?: boolean;
6
- intensity?: number;
7
- color?: Color;
8
- position?: number[];
9
- focalPoint?: number[];
10
- positional?: boolean;
11
- exponent?: number;
12
- coneAngle?: number;
13
- attenuationValues?: number[];
14
- lightType?: string;
15
- shadowAttenuation?: number;
16
- direction?: number[];
17
- directionMTime?: number;
12
+ switch?: boolean;
13
+ intensity?: number;
14
+ color?: RGBColor;
15
+ position?: Vector3;
16
+ focalPoint?: Vector3;
17
+ positional?: boolean;
18
+ exponent?: number;
19
+ coneAngle?: number;
20
+ attenuationValues?: number[];
21
+ lightType?: LIGHT_TYPES;
22
+ shadowAttenuation?: number;
23
+ direction?: Vector3;
24
+ directionMTime?: number;
18
25
  }
19
26
 
20
27
  export interface vtkLight extends vtkObject {
21
28
 
22
- /**
23
- *
24
- */
25
- getAttenuationValues(): number[];
26
-
27
- /**
28
- *
29
- */
30
- getAttenuationValuesByReference(): number[];
31
-
32
- /**
33
- *
34
- */
35
- getColor(): Color;
36
-
37
- /**
38
- *
39
- */
40
- getColorByReference(): Color;
41
-
42
- /**
43
- *
44
- */
45
- getConeAngle(): number;
46
-
47
- /**
48
- *
49
- */
50
- getDirection(): number[];
51
-
52
- /**
53
- * Get the exponent of the cosine used in positional lighting.
54
- */
55
- getExponent(): number;
56
-
57
- /**
58
- * Get the focal point.
59
- */
60
- getFocalPoint(): number[];
61
-
62
- /**
63
- * Get the focal point.
64
- */
65
- getFocalPointByReference(): number[];
66
-
67
- /**
68
- * Get the brightness of the light
69
- */
70
- getIntensity(): number
71
-
72
- /**
73
- * Get the type of the light.
74
- */
75
- getLightType(): string
76
-
77
- /**
78
- *
79
- */
80
- getPosition(): number[];
81
-
82
- /**
83
- *
84
- */
85
- getPositionByReference(): number[];
86
-
87
- /**
88
- *
89
- */
90
- getPositional(): boolean
91
-
92
- /**
93
- * Get the position of the light, modified by the transformation matrix (if it exists).
94
- */
95
- getTransformedPosition(): any;
96
-
97
- /**
98
- * Get the focal point of the light, modified by the transformation matrix (if it exists).
99
- */
100
- getTransformedFocalPoint(): number[];
101
-
102
- /**
103
- * Set the quadratic attenuation constants.
104
- * @param a
105
- * @param b
106
- * @param c
107
- */
108
- setAttenuationValues(a: number, b: number, c: number): boolean;
109
-
110
- /**
111
- * Set the quadratic attenuation constants from an array.
112
- * @param attenuationValues
113
- */
114
- setAttenuationValuesFrom(attenuationValues: number[]): boolean;
115
-
116
- /**
117
- * Set the color of the object
118
- * @param {Number} r Defines the red component (between 0 and 1).
119
- * @param {Number} g Defines the green component (between 0 and 1).
120
- * @param {Number} b Defines the blue component (between 0 and 1).
121
- */
122
- setColor(r: number, g: number, b: number): boolean;
123
-
124
- /**
125
- *
126
- * @param {Number[]} color
127
- */
128
- setColorFrom(color: number[]): boolean;
129
-
130
- /**
131
- * Set the lighting cone angle of a positional light in degrees.
132
- * This is the angle between the axis of the cone and a ray along the edge of the cone.
133
- * A value of 90 (or more) indicates that you want no spot lighting effects just a positional light.
134
- * @param coneAngle
135
- */
136
- setConeAngle(coneAngle: number): boolean;
137
-
138
- /**
139
- * Set the position and focal point of a light based on elevation and azimuth.
140
- * The light is moved so it is shining from the given angle.
141
- * Angles are given in degrees. If the light is a positional light, it is made directional instead.
142
- * @param elevation
143
- * @param azimuth
144
- */
145
- setDirectionAngle(elevation: number, azimuth: number): boolean;
146
-
147
- /**
148
- * Set the exponent of the cosine used in positional lighting.
149
- * @param exponent
150
- */
151
- setExponent(exponent: number): boolean;
152
-
153
- /**
154
- * Set the focal point.
29
+ /**
30
+ *
31
+ */
32
+ getAttenuationValues(): number[];
33
+
34
+ /**
35
+ *
36
+ */
37
+ getAttenuationValuesByReference(): number[];
38
+
39
+ /**
40
+ * Get the color of the light.
41
+ */
42
+ getColor(): RGBColor;
43
+
44
+ /**
45
+ * Get the color of the light.
46
+ */
47
+ getColorByReference(): RGBColor;
48
+
49
+ /**
50
+ * Get the lighting cone angle of a positional light in degrees.
51
+ * This is the angle between the axis of the cone and a ray along the edge
52
+ * of the cone. A value of 90 (or more) indicates that you want no spot
53
+ * lighting effects just a positional light.
54
+ */
55
+ getConeAngle(): number;
56
+
57
+ /**
58
+ * Set the position and focal point of a light based on elevation and azimuth.
59
+ * The light is moved so it is shining from the given angle. Angles are
60
+ * given in degrees. If the light is a positional light, it is made
61
+ * directional instead.
62
+ */
63
+ getDirection(): Vector3;
64
+
65
+ /**
66
+ * Get the exponent of the cosine used in positional lighting.
67
+ */
68
+ getExponent(): number;
69
+
70
+ /**
71
+ * Get the focal point.
72
+ */
73
+ getFocalPoint(): Vector3;
74
+
75
+ /**
76
+ * Get the focal point.
77
+ */
78
+ getFocalPointByReference(): Vector3;
79
+
80
+ /**
81
+ * Get the brightness of the light
82
+ */
83
+ getIntensity(): number
84
+
85
+ /**
86
+ * Get the type of the light.
87
+ */
88
+ getLightType(): string
89
+
90
+ /**
91
+ * Get the position of the light.
92
+ */
93
+ getPosition(): Vector3;
94
+
95
+ /**
96
+ * Get the position of the light.
97
+ */
98
+ getPositionByReference(): Vector3;
99
+
100
+ /**
101
+ * Get if positional lighting is on or off.
102
+ */
103
+ getPositional(): boolean
104
+
105
+ /**
106
+ * Get the position of the light, modified by the transformation matrix (if
107
+ * it exists).
108
+ */
109
+ getTransformedPosition(): Vector3;
110
+
111
+ /**
112
+ * Get the focal point of the light, modified by the transformation matrix
113
+ * (if it exists).
114
+ */
115
+ getTransformedFocalPoint(): Vector3;
116
+
117
+ /**
118
+ * Set the quadratic attenuation constants.
119
+ * @param {Number} a
120
+ * @param {Number} b
121
+ * @param {Number} c
122
+ */
123
+ setAttenuationValues(a: number, b: number, c: number): boolean;
124
+
125
+ /**
126
+ * Set the quadratic attenuation constants from an array.
127
+ * @param {Number[]} attenuationValues The quadratic attenuation.
128
+ */
129
+ setAttenuationValuesFrom(attenuationValues: number[]): boolean;
130
+
131
+ /**
132
+ * Set the color of the object. Has the side effect of setting the
133
+ * ambient diffuse and specular colors as well. This is basically
134
+ * a quick overall color setting method.
135
+ * @param {Number} r Defines the red component (between 0 and 1).
136
+ * @param {Number} g Defines the green component (between 0 and 1).
137
+ * @param {Number} b Defines the blue component (between 0 and 1).
138
+ */
139
+ setColor(r: number, g: number, b: number): boolean;
140
+
141
+ /**
142
+ * Set the color of the object. Has the side effect of setting the
143
+ * ambient diffuse and specular colors as well. This is basically
144
+ * a quick overall color setting method.
145
+ * @param {RGBColor} color Defines the RGB color array..
146
+ */
147
+ setColor(color: RGBColor): boolean;
148
+
149
+ /**
150
+ * Set the color of the object. Has the side effect of setting the
151
+ * ambient diffuse and specular colors as well. This is basically
152
+ * a quick overall color setting method.
153
+ * @param {Number} r Defines the red component (between 0 and 1).
154
+ * @param {Number} g Defines the green component (between 0 and 1).
155
+ * @param {Number} b Defines the blue component (between 0 and 1).
156
+ */
157
+ setColorFrom(r: number, g: number, b: number): boolean;
158
+
159
+ /**
160
+ * Set the color of the object. Has the side effect of setting the
161
+ * ambient diffuse and specular colors as well. This is basically
162
+ * a quick overall color setting method.
163
+ * @param {RGBColor} color Defines the RGB color array..
164
+ */
165
+ setColorFrom(color: RGBColor): boolean;
166
+
167
+ /**
168
+ * Set the lighting cone angle of a positional light in degrees.
169
+ * This is the angle between the axis of the cone and a ray along the edge
170
+ * of the cone.
171
+ * A value of 90 (or more) indicates that you want no spot lighting effects
172
+ * just a positional light.
173
+ * @param {Number} coneAngle The cone angle.
174
+ */
175
+ setConeAngle(coneAngle: number): boolean;
176
+
177
+ /**
178
+ * Set the position and focal point of a light based on elevation and
179
+ * azimuth. The light is moved so it is shining from the given angle. Angles
180
+ * are given in degrees. If the light is a positional light, it is made
181
+ * directional instead.
182
+ * @param {Number} elevation
183
+ * @param {Number} azimuth
184
+ */
185
+ setDirectionAngle(elevation: number, azimuth: number): boolean;
186
+
187
+ /**
188
+ * Set the exponent of the cosine used in positional lighting.
189
+ * @param {Number} exponent The exponent of the cosine.
190
+ */
191
+ setExponent(exponent: number): boolean;
192
+
193
+ /**
194
+ * Set the focal point.
155
195
  * @param {Number} x The x coordinate.
156
196
  * @param {Number} y The y coordinate.
157
197
  * @param {Number} z The z coordinate.
158
- */
159
- setFocalPoint(x: number, y: number, z: number): boolean;
160
-
161
- /**
162
- * Set the focal point from an array
163
- * @param focalPoint
164
- */
165
- setFocalPointFrom(focalPoint: number[]): boolean;
166
-
167
- /**
168
- * Set the brightness of the light (from one to zero).
169
- * @param intensity
170
- */
171
- setIntensity(intensity: number): boolean;
172
-
173
- /**
174
- * Set the type of the light to lightType
175
- * @param lightType
176
- */
177
- setLightType(lightType: string): boolean;
178
-
179
- /**
180
- * Set the type of the light is CameraLight.
181
- */
182
- setLightTypeToCameraLight(): boolean;
183
-
184
- /**
185
- * Set the the type of the light is HeadLight.
186
- */
187
- setLightTypeToHeadLight(): boolean;
188
-
189
- /**
190
- * Set the the type of the light is SceneLight.
191
- */
192
- setLightTypeToSceneLight(): boolean;
193
-
194
- /**
195
- * Check if the type of the light is CameraLight.
196
- */
197
- lightTypeIsCameraLight(): boolean;
198
-
199
- /**
200
- * Check if the type of the light is HeadLight.
201
- */
202
- lightTypeIsHeadLight(): boolean;
203
-
204
- /**
205
- * Check if the type of the light is SceneLight.
206
- */
207
- lightTypeIsSceneLight(): boolean;
208
-
209
- /**
210
- *
198
+ */
199
+ setFocalPoint(x: number, y: number, z: number): boolean;
200
+
201
+ /**
202
+ * Set the focal point from an array
203
+ * @param {Vector3} focalPoint The focal point array.
204
+ */
205
+ setFocalPointFrom(focalPoint: Vector3): boolean;
206
+
207
+ /**
208
+ * Set the brightness of the light (from one to zero).
209
+ * @param {Number} intensity
210
+ */
211
+ setIntensity(intensity: number): boolean;
212
+
213
+ /**
214
+ * Set the type of the light to lightType
215
+ * @param {LIGHT_TYPES} lightType The light type.
216
+ */
217
+ setLightType(lightType: LIGHT_TYPES): boolean;
218
+
219
+ /**
220
+ * Set the type of the light is CameraLight.
221
+ */
222
+ setLightTypeToCameraLight(): boolean;
223
+
224
+ /**
225
+ * Set the the type of the light is HeadLight.
226
+ */
227
+ setLightTypeToHeadLight(): boolean;
228
+
229
+ /**
230
+ * Set the the type of the light is SceneLight.
231
+ */
232
+ setLightTypeToSceneLight(): boolean;
233
+
234
+ /**
235
+ * Check if the type of the light is CameraLight.
236
+ */
237
+ lightTypeIsCameraLight(): boolean;
238
+
239
+ /**
240
+ * Check if the type of the light is HeadLight.
241
+ */
242
+ lightTypeIsHeadLight(): boolean;
243
+
244
+ /**
245
+ * Check if the type of the light is SceneLight.
246
+ */
247
+ lightTypeIsSceneLight(): boolean;
248
+
249
+ /**
250
+ * Set the position of the light.
211
251
  * @param {Number} x The x coordinate.
212
252
  * @param {Number} y The y coordinate.
213
253
  * @param {Number} z The z coordinate.
214
- */
215
- setPosition(x: number, y: number, z: number): boolean;
216
-
217
- /**
218
- *
219
- * @param position
220
- */
221
- setPositionFrom(position: number[]): boolean;
222
-
223
- /**
224
- *
225
- * @param positional
226
- */
227
- setPositional(positional: boolean): boolean;
228
-
229
- /**
230
- *
231
- * @param shadowAttenuation
232
- */
233
- setShadowAttenuation(shadowAttenuation: number): boolean;
234
-
235
- /**
236
- *
237
- * @param switchValue
238
- */
239
- setSwitch(switchValue: boolean): boolean;
240
-
241
- /**
242
- *
243
- * @param transformMatrix
244
- */
245
- setTransformMatrix(transformMatrix: any): boolean;
254
+ */
255
+ setPosition(x: number, y: number, z: number): boolean;
256
+
257
+ /**
258
+ * Set the position of the light.
259
+ * @param {Vector3} position The position coordinate of the light.
260
+ */
261
+ setPositionFrom(position: Vector3): boolean;
262
+
263
+ /**
264
+ * Turn positional lighting on or off.
265
+ * @param {Boolean} positional The positional value.
266
+ */
267
+ setPositional(positional: boolean): boolean;
268
+
269
+ /**
270
+ * Set the shadow intensity By default a light will be completely blocked
271
+ * when in shadow by setting this value to less than 1.0 you can control how
272
+ * much light is attenuated when in shadow.
273
+ * @param {Number} shadowAttenuation The shadow attenuation value.
274
+ */
275
+ setShadowAttenuation(shadowAttenuation: number): boolean;
276
+
277
+ /**
278
+ * Turn the light on or off.
279
+ * @param {Boolean} switchValue The switch value.
280
+ */
281
+ setSwitch(switchValue: boolean): boolean;
282
+
283
+ /**
284
+ * Set the light's transformation matrix.
285
+ * @param {mat4} transformMatrix The transform matrix.
286
+ */
287
+ setTransformMatrix(transformMatrix: mat4): boolean;
246
288
  }
247
289
 
248
290
  /**
@@ -285,7 +327,8 @@ export function newInstance(initialValues?: ILightInitialValues): vtkLight;
285
327
  * their transformation matrix (if it exists).
286
328
  */
287
329
  export declare const vtkLight: {
288
- newInstance: typeof newInstance,
289
- extend: typeof extend,
330
+ newInstance: typeof newInstance,
331
+ extend: typeof extend,
332
+ LIGHT_TYPES: LIGHT_TYPES;
290
333
  };
291
334
  export default vtkLight;