@kitware/vtk.js 21.1.5 → 21.2.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.
- package/Common/Transform/LandmarkTransform.d.ts +1 -1
- package/Filters/Sources/Arrow2DSource.d.ts +14 -13
- package/Filters/Sources/ArrowSource.d.ts +9 -8
- package/Filters/Sources/CircleSource.d.ts +15 -14
- package/Filters/Sources/ConeSource.d.ts +18 -17
- package/Filters/Sources/CubeSource.d.ts +19 -19
- package/Filters/Sources/Cursor3D.d.ts +19 -16
- package/Filters/Sources/CylinderSource.d.ts +15 -14
- package/Filters/Sources/LineSource.d.ts +1 -1
- package/Filters/Sources/PlaneSource.d.ts +29 -28
- package/Filters/Sources/PointSource.d.ts +9 -8
- package/Filters/Sources/SphereSource.d.ts +9 -8
- package/Rendering/Core/AbstractMapper.js +1 -0
- package/Rendering/Core/Light.d.ts +277 -234
- package/Rendering/Core/Property.d.ts +43 -43
- package/Rendering/Core/Property2D.d.ts +21 -5
- package/Rendering/Core/RenderWindowInteractor.js +7 -7
- package/Rendering/Core/Volume.d.ts +9 -0
- package/Rendering/OpenGL/ImageMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +5 -17
- package/Rendering/OpenGL/RenderWindow.js +190 -106
- package/Rendering/OpenGL/ShaderProgram.js +0 -12
- package/interfaces.d.ts +66 -24
- package/package.json +1 -1
- package/types.d.ts +4 -1
|
@@ -1,248 +1,290 @@
|
|
|
1
|
+
import { mat4 } from "gl-matrix";
|
|
1
2
|
import { vtkObject } from '@kitware/vtk.js/interfaces';
|
|
2
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
|
|
289
|
-
|
|
330
|
+
newInstance: typeof newInstance,
|
|
331
|
+
extend: typeof extend,
|
|
332
|
+
LIGHT_TYPES: LIGHT_TYPES;
|
|
290
333
|
};
|
|
291
334
|
export default vtkLight;
|