@kitware/vtk.js 24.13.0 → 24.13.1
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/BREAKING_CHANGES.md +11 -1
- package/Common/Core/Math/index.js +2 -7
- package/Interaction/Style/InteractorStyleManipulator.js +6 -3
- package/Rendering/Core/ColorTransferFunction/Constants.d.ts +17 -0
- package/Rendering/Core/ColorTransferFunction.d.ts +3 -11
- package/Rendering/Core/Coordinate/Constants.d.ts +14 -0
- package/Rendering/Core/Coordinate.d.ts +5 -12
- package/Rendering/Core/Glyph3DMapper/Constants.d.ts +17 -0
- package/Rendering/Core/Glyph3DMapper.d.ts +3 -11
- package/Rendering/Core/ImageMapper/Constants.d.ts +14 -0
- package/Rendering/Core/ImageMapper.d.ts +2 -9
- package/Rendering/Core/ImageProperty/Constants.d.ts +9 -0
- package/Rendering/Core/ImageProperty.d.ts +30 -33
- package/Rendering/Core/Property2D/Constants.d.ts +9 -0
- package/Rendering/Core/Property2D.d.ts +6 -5
- package/Rendering/Core/ScalarBarActor.d.ts +42 -41
- package/Rendering/Core/VolumeProperty/Constants.d.ts +16 -0
- package/Widgets/Representations/ArrowHandleRepresentation.js +6 -4
- package/index.d.ts +7 -0
- package/package.json +1 -1
package/BREAKING_CHANGES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## From 23.x to 24
|
|
2
2
|
|
|
3
|
-
All old-style widgets except OrientationMarkerWidget and PiecewiseGaussianWidget have been removed.
|
|
3
|
+
- All old-style widgets except OrientationMarkerWidget and PiecewiseGaussianWidget have been removed.
|
|
4
4
|
|
|
5
5
|
| **Old-style/deprecated widget** | **New-style widget** |
|
|
6
6
|
|-----------------------------------|---------------------------------|
|
|
@@ -15,6 +15,16 @@ All old-style widgets except OrientationMarkerWidget and PiecewiseGaussianWidget
|
|
|
15
15
|
| ResliceCursor | ResliceCursorWidget |
|
|
16
16
|
|
|
17
17
|
- In SVGLandmarkRepresentation: `model.showCircle` is replaced by `model.circleProps.visible`
|
|
18
|
+
- In vtk.js subclasses, prefix with '_' the following "protected" model variables:
|
|
19
|
+
- vtk*: model.openglRenderWindow -> model._openglRenderWindow
|
|
20
|
+
- vtk*: model.openglRenderer -> model._openglRenderer
|
|
21
|
+
- vtkInteractorObserver, vtkOrientationMarkerWidget : model.interactor -> model._interactor
|
|
22
|
+
- vtkAbstractWidget, vtkViewNode: model.parent -> model._parent
|
|
23
|
+
- vtkProp: model.parentProp -> model._parentProp
|
|
24
|
+
- vtkRenderWindowInteractor: model.view -> model._view
|
|
25
|
+
- vtkRenderer: model.renderWindow -> model._renderWindow
|
|
26
|
+
- vtkHardwareSelector: model.renderer -> model._renderer
|
|
27
|
+
- vtkAbstractWidget: model.widgetManager -> model._widgetManager
|
|
18
28
|
|
|
19
29
|
## From 22.x to 23
|
|
20
30
|
|
|
@@ -34,13 +34,8 @@ function vtkSwapVectors3(v1, v2) {
|
|
|
34
34
|
|
|
35
35
|
function createArray() {
|
|
36
36
|
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
while (array.length < size) {
|
|
40
|
-
array.push(0);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return array;
|
|
37
|
+
// faster than Array.from and/or while loop
|
|
38
|
+
return Array(size).fill(0);
|
|
44
39
|
} // ----------------------------------------------------------------------------
|
|
45
40
|
// Global methods
|
|
46
41
|
// ----------------------------------------------------------------------------
|
|
@@ -42,13 +42,16 @@ function dollyToPosition(fact, position, renderer, rwi) {
|
|
|
42
42
|
|
|
43
43
|
if (cam.getParallelProjection()) {
|
|
44
44
|
// Zoom relatively to the cursor
|
|
45
|
-
var
|
|
45
|
+
var view = rwi.getView();
|
|
46
|
+
var aSize = view.getViewportSize(renderer);
|
|
47
|
+
var viewport = renderer.getViewport();
|
|
48
|
+
var viewSize = view.getSize();
|
|
46
49
|
var w = aSize[0];
|
|
47
50
|
var h = aSize[1];
|
|
48
51
|
var x0 = w / 2;
|
|
49
52
|
var y0 = h / 2;
|
|
50
|
-
var x1 = position.x;
|
|
51
|
-
var y1 = position.y;
|
|
53
|
+
var x1 = position.x - viewport[0] * viewSize[0];
|
|
54
|
+
var y1 = position.y - viewport[1] * viewSize[1];
|
|
52
55
|
translateCamera(renderer, rwi, x0, y0, x1, y1);
|
|
53
56
|
cam.setParallelScale(cam.getParallelScale() / fact);
|
|
54
57
|
translateCamera(renderer, rwi, x1, y1, x0, y0);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum ColorSpace {
|
|
2
|
+
RGB = 0,
|
|
3
|
+
HSV = 1,
|
|
4
|
+
LAB = 2,
|
|
5
|
+
DIVERGING = 3,
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare enum Scale {
|
|
9
|
+
LINEAR = 0,
|
|
10
|
+
LOG10 = 1,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const _default: {
|
|
14
|
+
ColorSpace: typeof ColorSpace;
|
|
15
|
+
Scale: typeof Scale;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
|
+
import { ColorSpace, Scale } from './ColorTransferFunction/Constants';
|
|
2
3
|
|
|
3
|
-
export enum ColorSpace {
|
|
4
|
-
RGB,
|
|
5
|
-
HSV,
|
|
6
|
-
LAB,
|
|
7
|
-
DIVERGING,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum Scale {
|
|
11
|
-
LINEAR,
|
|
12
|
-
LOG10,
|
|
13
|
-
}
|
|
14
4
|
|
|
15
5
|
/* TODO: use VtkScalarsToColors instead of VtkObject */
|
|
16
6
|
export interface vtkColorTransferFunction extends vtkObject {
|
|
@@ -358,5 +348,7 @@ export function newInstance(initialValues?: object): vtkColorTransferFunction;
|
|
|
358
348
|
export declare const vtkColorTransferFunction: {
|
|
359
349
|
newInstance: typeof newInstance;
|
|
360
350
|
extend: typeof extend;
|
|
351
|
+
ColorSpace: typeof ColorSpace;
|
|
352
|
+
Scale: typeof Scale;
|
|
361
353
|
};
|
|
362
354
|
export default vtkColorTransferFunction;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum Coordinate {
|
|
2
|
+
DISPLAY = 0,
|
|
3
|
+
NORMALIZED_DISPLAY = 1,
|
|
4
|
+
VIEWPORT = 2,
|
|
5
|
+
NORMALIZED_VIEWPORT = 3,
|
|
6
|
+
PROJECTION = 4,
|
|
7
|
+
VIEW = 5,
|
|
8
|
+
WORLD = 6,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const _default: {
|
|
12
|
+
Coordinate: typeof Coordinate;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { vtkObject, vtkProperty } from './../../interfaces';
|
|
2
2
|
import vtkRenderer from './Renderer';
|
|
3
|
+
import { Coordinate } from './Coordinate/Constants';
|
|
3
4
|
|
|
4
|
-
export enum Coordinate {
|
|
5
|
-
DISPLAY,
|
|
6
|
-
NORMALIZED_DISPLAY,
|
|
7
|
-
VIEWPORT,
|
|
8
|
-
NORMALIZED_VIEWPORT,
|
|
9
|
-
PROJECTION,
|
|
10
|
-
VIEW,
|
|
11
|
-
WORLD,
|
|
12
|
-
}
|
|
13
5
|
|
|
14
6
|
/**
|
|
15
7
|
*
|
|
@@ -73,7 +65,7 @@ export interface vtkCoordinate extends vtkObject {
|
|
|
73
65
|
* options are Display, Normalized Display, Viewport, Normalized Viewport,
|
|
74
66
|
* View, and World.
|
|
75
67
|
*/
|
|
76
|
-
getCoordinateSystem():
|
|
68
|
+
getCoordinateSystem(): Coordinate;
|
|
77
69
|
|
|
78
70
|
/**
|
|
79
71
|
* Get the coordinate system which this coordinate is defined in as string.
|
|
@@ -251,7 +243,8 @@ export function newInstance(initialValues?: ICoordinateInitialValues): vtkCoordi
|
|
|
251
243
|
* @see [vtkActor](./Rendering_Core_Actor.html)2D
|
|
252
244
|
*/
|
|
253
245
|
export declare const vtkCoordinate: {
|
|
254
|
-
newInstance: typeof newInstance
|
|
255
|
-
extend: typeof extend
|
|
246
|
+
newInstance: typeof newInstance;
|
|
247
|
+
extend: typeof extend;
|
|
248
|
+
Coordinate: typeof Coordinate;
|
|
256
249
|
};
|
|
257
250
|
export default vtkCoordinate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum OrientationModes {
|
|
2
|
+
DIRECTION = 0,
|
|
3
|
+
ROTATION = 1,
|
|
4
|
+
MATRIX = 2,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare enum ScaleModes {
|
|
8
|
+
SCALE_BY_CONSTANT = 0,
|
|
9
|
+
SCALE_BY_MAGNITUDE = 1,
|
|
10
|
+
SCALE_BY_COMPONENTS = 2,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const _default: {
|
|
14
|
+
OrientationModes: typeof OrientationModes;
|
|
15
|
+
ScaleModes: typeof ScaleModes;
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { Bounds } from './../../types';
|
|
2
2
|
import vtkMapper, { IMapperInitialValues } from './Mapper';
|
|
3
|
+
import { OrientationModes, ScaleModes } from './Glyph3DMapper/Constants';
|
|
3
4
|
|
|
4
|
-
export enum OrientationModes {
|
|
5
|
-
DIRECTION,
|
|
6
|
-
ROTATION,
|
|
7
|
-
MATRIX,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum ScaleModes {
|
|
11
|
-
SCALE_BY_CONSTANT,
|
|
12
|
-
SCALE_BY_MAGNITUDE,
|
|
13
|
-
SCALE_BY_COMPONENTS,
|
|
14
|
-
}
|
|
15
5
|
|
|
16
6
|
interface IPrimitiveCount {
|
|
17
7
|
points: number;
|
|
@@ -168,5 +158,7 @@ export function newInstance(initialValues?: IGlyph3DMapperInitialValues): vtkGly
|
|
|
168
158
|
export declare const vtkGlyph3DMapper: {
|
|
169
159
|
newInstance: typeof newInstance;
|
|
170
160
|
extend: typeof extend;
|
|
161
|
+
OrientationModes: typeof OrientationModes;
|
|
162
|
+
ScaleModes: typeof ScaleModes;
|
|
171
163
|
}
|
|
172
164
|
export default vtkGlyph3DMapper;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import vtkCamera from './Camera';
|
|
2
2
|
import vtkAbstractMapper, { IAbstractMapperInitialValues } from './AbstractMapper';
|
|
3
3
|
import { Bounds, Vector3 } from './../../types';
|
|
4
|
+
import { SlicingMode } from './ImageMapper/Constants';
|
|
4
5
|
|
|
5
|
-
export enum SlicingMode {
|
|
6
|
-
NONE,
|
|
7
|
-
I,
|
|
8
|
-
J,
|
|
9
|
-
K,
|
|
10
|
-
X,
|
|
11
|
-
Y,
|
|
12
|
-
Z,
|
|
13
|
-
}
|
|
14
6
|
|
|
15
7
|
interface IClosestIJKAxis {
|
|
16
8
|
ijkMode: SlicingMode,
|
|
@@ -325,5 +317,6 @@ export function newInstance(initialValues?: IImageMapperInitialValues): vtkImage
|
|
|
325
317
|
export declare const vtkImageMapper: {
|
|
326
318
|
newInstance: typeof newInstance;
|
|
327
319
|
extend: typeof extend;
|
|
320
|
+
SlicingMode: typeof SlicingMode;
|
|
328
321
|
}
|
|
329
322
|
export default vtkImageMapper;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
2
|
import vtkColorTransferFunction from './ColorTransferFunction';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
NEAREST,
|
|
6
|
-
LINEAR,
|
|
7
|
-
}
|
|
3
|
+
import vtkPiecewiseFunction from './../../Common/DataModel/PiecewiseFunction';
|
|
4
|
+
import { InterpolationType } from './ImageProperty/Constants';
|
|
8
5
|
|
|
9
6
|
interface IComponentData {
|
|
10
7
|
piecewiseFunction: number;
|
|
11
8
|
componentWeight: number;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
export interface
|
|
11
|
+
export interface IImagePropertyInitialValues {
|
|
15
12
|
independentComponents?: boolean;
|
|
16
13
|
interpolationType?: InterpolationType;
|
|
17
14
|
colorWindow?: number;
|
|
@@ -20,13 +17,13 @@ export interface IImageMapperInitialValues {
|
|
|
20
17
|
diffuse?: number;
|
|
21
18
|
opacity?: number;
|
|
22
19
|
componentData?: IComponentData[];
|
|
23
|
-
|
|
20
|
+
useLookupTableScalarRange?: boolean;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
export interface vtkImageProperty extends vtkObject {
|
|
27
24
|
|
|
28
25
|
/**
|
|
29
|
-
|
|
26
|
+
* Get the lighting coefficient.
|
|
30
27
|
* @default 1.0
|
|
31
28
|
*/
|
|
32
29
|
getAmbient(): number;
|
|
@@ -50,7 +47,7 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
50
47
|
getComponentWeight(index: number): number;
|
|
51
48
|
|
|
52
49
|
/**
|
|
53
|
-
|
|
50
|
+
* Get the diffuse lighting coefficient.
|
|
54
51
|
* @default 1.0
|
|
55
52
|
*/
|
|
56
53
|
getDiffuse(): number;
|
|
@@ -72,7 +69,7 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
72
69
|
getInterpolationTypeAsString(): string;
|
|
73
70
|
|
|
74
71
|
/**
|
|
75
|
-
|
|
72
|
+
* Get the opacity of the object.
|
|
76
73
|
* @default 1.0
|
|
77
74
|
*/
|
|
78
75
|
getOpacity(): number;
|
|
@@ -81,25 +78,25 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
81
78
|
* Get the component weighting function.
|
|
82
79
|
* @param {Number} [idx]
|
|
83
80
|
*/
|
|
84
|
-
getPiecewiseFunction(idx?: number):
|
|
81
|
+
getPiecewiseFunction(idx?: number): vtkPiecewiseFunction;
|
|
85
82
|
|
|
86
83
|
/**
|
|
87
84
|
* Get the currently set RGB transfer function.
|
|
88
85
|
* @param {Number} [idx]
|
|
89
86
|
*/
|
|
90
|
-
getRGBTransferFunction(idx?: number):
|
|
87
|
+
getRGBTransferFunction(idx?: number): vtkColorTransferFunction;
|
|
91
88
|
|
|
92
89
|
/**
|
|
93
90
|
* Alias to get the piecewise function (backwards compatibility)
|
|
94
91
|
* @param {Number} [idx]
|
|
95
92
|
*/
|
|
96
|
-
getScalarOpacity(idx
|
|
93
|
+
getScalarOpacity(idx?: number): vtkPiecewiseFunction;
|
|
97
94
|
|
|
98
|
-
|
|
95
|
+
/**
|
|
99
96
|
* Set the ambient lighting coefficient.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
* @param {Number} ambient The ambient lighting coefficient.
|
|
98
|
+
*/
|
|
99
|
+
setAmbient(ambient: number): boolean;
|
|
103
100
|
|
|
104
101
|
/**
|
|
105
102
|
* Set the level value for window/level.
|
|
@@ -120,11 +117,11 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
120
117
|
*/
|
|
121
118
|
setComponentWeight(index: number, value: number): boolean;
|
|
122
119
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Set the diffuse lighting coefficient.
|
|
122
|
+
* @param {Number} diffuse The diffuse lighting coefficient.
|
|
123
|
+
*/
|
|
124
|
+
setDiffuse(diffuse: number): boolean;
|
|
128
125
|
|
|
129
126
|
/**
|
|
130
127
|
*
|
|
@@ -149,7 +146,7 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
149
146
|
setInterpolationTypeToNearest(): boolean;
|
|
150
147
|
|
|
151
148
|
/**
|
|
152
|
-
|
|
149
|
+
* Set the opacity of the object
|
|
153
150
|
* @param {Number} opacity The opacity value.
|
|
154
151
|
*/
|
|
155
152
|
setOpacity(opacity: number): boolean;
|
|
@@ -157,9 +154,9 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
157
154
|
/**
|
|
158
155
|
* Set the piecewise function
|
|
159
156
|
* @param {Number} index
|
|
160
|
-
* @param func
|
|
157
|
+
* @param {vtkPiecewiseFunction} func
|
|
161
158
|
*/
|
|
162
|
-
setPiecewiseFunction(index: number, func:
|
|
159
|
+
setPiecewiseFunction(index: number, func: vtkPiecewiseFunction): boolean;
|
|
163
160
|
|
|
164
161
|
/**
|
|
165
162
|
* Set the color of a volume to an RGB transfer function
|
|
@@ -171,14 +168,14 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
171
168
|
/**
|
|
172
169
|
* Alias to set the piecewise function
|
|
173
170
|
* @param {Number} index
|
|
174
|
-
* @param func
|
|
171
|
+
* @param {vtkPiecewiseFunction} func
|
|
175
172
|
*/
|
|
176
|
-
setScalarOpacity(index:
|
|
173
|
+
setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean;
|
|
177
174
|
|
|
178
175
|
/**
|
|
179
176
|
* Use the range that is set on the lookup table, instead of setting the range from the
|
|
180
|
-
|
|
181
|
-
|
|
177
|
+
* ColorWindow/ColorLevel settings
|
|
178
|
+
* @default false
|
|
182
179
|
* @param {Boolean} useLookupTableScalarRange
|
|
183
180
|
*/
|
|
184
181
|
setUseLookupTableScalarRange(useLookupTableScalarRange: boolean): boolean;
|
|
@@ -189,15 +186,15 @@ export interface vtkImageProperty extends vtkObject {
|
|
|
189
186
|
*
|
|
190
187
|
* @param publicAPI object on which methods will be bounds (public)
|
|
191
188
|
* @param model object on which data structure will be bounds (protected)
|
|
192
|
-
* @param {
|
|
189
|
+
* @param {IImagePropertyInitialValues} [initialValues] (default: {})
|
|
193
190
|
*/
|
|
194
|
-
export function extend(publicAPI: object, model: object, initialValues?:
|
|
191
|
+
export function extend(publicAPI: object, model: object, initialValues?: IImagePropertyInitialValues): void;
|
|
195
192
|
|
|
196
193
|
/**
|
|
197
194
|
* Method use to create a new instance of vtkImageProperty
|
|
198
|
-
* @param {
|
|
195
|
+
* @param {IImagePropertyInitialValues} [initialValues] for pre-setting some of its content
|
|
199
196
|
*/
|
|
200
|
-
export function newInstance(initialValues?:
|
|
197
|
+
export function newInstance(initialValues?: IImagePropertyInitialValues): vtkImageProperty;
|
|
201
198
|
|
|
202
199
|
/**
|
|
203
200
|
* vtkImageProperty provides 2D image display support for vtk.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { vtkObject } from './../../interfaces';
|
|
2
2
|
import { RGBColor } from './../../types';
|
|
3
|
+
import { DisplayLocation } from './Property2D/Constants';
|
|
3
4
|
|
|
4
5
|
interface IProperty2DInitialValues{
|
|
5
6
|
color?: RGBColor;
|
|
6
7
|
opacity?: number;
|
|
7
8
|
pointSize?: number;
|
|
8
9
|
lineWidth?: number;
|
|
9
|
-
displayLocation?:
|
|
10
|
+
displayLocation?: DisplayLocation;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface vtkProperty2D extends vtkObject {
|
|
@@ -25,7 +26,7 @@ export interface vtkProperty2D extends vtkObject {
|
|
|
25
26
|
* Get the display location of the object.
|
|
26
27
|
* @default 'Foreground'
|
|
27
28
|
*/
|
|
28
|
-
getDisplayLocation():
|
|
29
|
+
getDisplayLocation(): DisplayLocation;
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* Get the width of a Line.
|
|
@@ -84,7 +85,7 @@ export interface vtkProperty2D extends vtkObject {
|
|
|
84
85
|
* Set the display location of the object.
|
|
85
86
|
* @param {String} displayLocation
|
|
86
87
|
*/
|
|
87
|
-
setDisplayLocation(displayLocation:
|
|
88
|
+
setDisplayLocation(displayLocation: DisplayLocation): boolean;
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
91
|
* Set the width of a Line. The width is expressed in screen units.
|
|
@@ -138,7 +139,7 @@ export function newInstance(initialValues?: IProperty2DInitialValues): vtkProper
|
|
|
138
139
|
* like backface properties can be set and manipulated with this object.
|
|
139
140
|
*/
|
|
140
141
|
export declare const vtkProperty2D: {
|
|
141
|
-
newInstance: typeof newInstance
|
|
142
|
-
extend: typeof extend
|
|
142
|
+
newInstance: typeof newInstance;
|
|
143
|
+
extend: typeof extend;
|
|
143
144
|
};
|
|
144
145
|
export default vtkProperty2D;
|
|
@@ -27,22 +27,22 @@ export interface IStyle {
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
export interface IScalarBarActorInitialValues extends IActorInitialValues {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
automated?: boolean,
|
|
31
|
+
autoLayout?: (publicAPI: object, model: object) => void,
|
|
32
|
+
axisLabel?: string,
|
|
33
|
+
barPosition?: Vector2,
|
|
34
|
+
barSize?: Size,
|
|
35
|
+
boxPosition?: Vector2,
|
|
36
|
+
boxSize?: Size,
|
|
37
|
+
scalarToColors?: null,
|
|
38
|
+
axisTitlePixelOffset?: number,
|
|
39
|
+
axisTextStyle?: IStyle,
|
|
40
|
+
tickLabelPixelOffset?: number,
|
|
41
|
+
tickTextStyle?: IStyle,
|
|
42
|
+
generateTicks?: (helper: any) => void,
|
|
43
|
+
drawBelowRangeSwatch?: boolean,
|
|
44
|
+
drawAboveRangeSwatch?: boolean,
|
|
45
|
+
drawNanAnnotation?: boolean,
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
export interface vtkScalarBarActor extends vtkActor {
|
|
@@ -88,10 +88,11 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
88
88
|
*/
|
|
89
89
|
getAutoLayout(): any;
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
getGenerateTicks(): any;
|
|
95
|
+
|
|
95
96
|
/**
|
|
96
97
|
*
|
|
97
98
|
*/
|
|
@@ -122,7 +123,6 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
122
123
|
*/
|
|
123
124
|
getBoxPositionByReference(): Vector2;
|
|
124
125
|
|
|
125
|
-
|
|
126
126
|
/**
|
|
127
127
|
*
|
|
128
128
|
*/
|
|
@@ -180,23 +180,24 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
180
180
|
*/
|
|
181
181
|
setAutoLayout(autoLayout: any): boolean;
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Sets the function used to generate legend ticks.
|
|
185
|
+
*
|
|
186
|
+
* This function takes a vtkScalarBarActorHelper and returns true on success.
|
|
187
|
+
* To have the desired effect, the function must call: `helper.setTicks(ticks: num[])` and `helper.setTickStrings(tickStrings: string[])`.
|
|
188
|
+
*
|
|
189
|
+
* After setting the generateTicks function you must regenerate the vtkScalarBarActor for your changes to take effect.
|
|
190
|
+
* One way to do that is:
|
|
191
|
+
* ```
|
|
192
|
+
* const mapper = scalarBarActor.getMapper()
|
|
193
|
+
* if (mapper) {
|
|
194
|
+
* mapper.getLookupTable().resetAnnotations()
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
* @param generateTicks
|
|
198
|
+
*/
|
|
199
|
+
setGenerateTicks(generateTicks: (helper: any) => void): boolean;
|
|
200
|
+
|
|
200
201
|
/**
|
|
201
202
|
*
|
|
202
203
|
* @param {Boolean} automated
|
|
@@ -279,7 +280,7 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
279
280
|
* Set whether the NaN annotation should be rendered or not.
|
|
280
281
|
* @param {Boolean} drawNanAnnotation
|
|
281
282
|
*/
|
|
282
|
-
|
|
283
|
+
setDrawNanAnnotation(drawNanAnnotation: boolean): boolean;
|
|
283
284
|
|
|
284
285
|
/**
|
|
285
286
|
* Set whether the Below range swatch should be rendered or not
|
|
@@ -360,7 +361,7 @@ export function newInstance(initialValues?: IScalarBarActorInitialValues): vtkSc
|
|
|
360
361
|
* (i.e., in the renderer's viewport) on top of the 3D graphics window.
|
|
361
362
|
*/
|
|
362
363
|
export declare const vtkScalarBarActor: {
|
|
363
|
-
newInstance: typeof newInstance
|
|
364
|
-
extend: typeof extend
|
|
364
|
+
newInstance: typeof newInstance;
|
|
365
|
+
extend: typeof extend;
|
|
365
366
|
};
|
|
366
367
|
export default vtkScalarBarActor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum InterpolationType {
|
|
2
|
+
NEAREST = 0,
|
|
3
|
+
LINEAR = 1,
|
|
4
|
+
FAST_LINEAR = 2
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare enum OpacityMode {
|
|
8
|
+
FRACTIONAL = 0,
|
|
9
|
+
PROPORTIONAL = 1,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const _default: {
|
|
13
|
+
InterpolationType: typeof InterpolationType;
|
|
14
|
+
OpacityMode: typeof OpacityMode;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -321,7 +321,9 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
publicAPI.requestData = function (inData, outData) {
|
|
324
|
-
var
|
|
324
|
+
var _publicAPI$getReprese;
|
|
325
|
+
|
|
326
|
+
var shape = (_publicAPI$getReprese = publicAPI.getRepresentationStates(inData[0])[0]) === null || _publicAPI$getReprese === void 0 ? void 0 : _publicAPI$getReprese.getShape();
|
|
325
327
|
var shouldCreateGlyph = model.glyph == null;
|
|
326
328
|
|
|
327
329
|
if (model.shape !== shape && Object.values(ShapeType).includes(shape)) {
|
|
@@ -329,7 +331,7 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
329
331
|
shouldCreateGlyph = true;
|
|
330
332
|
}
|
|
331
333
|
|
|
332
|
-
if (shouldCreateGlyph) {
|
|
334
|
+
if (shouldCreateGlyph && model.shape) {
|
|
333
335
|
model.glyph = createGlyph(model.shape);
|
|
334
336
|
model.mapper.setInputConnection(model.glyph.getOutputPort(), 1);
|
|
335
337
|
}
|
|
@@ -341,8 +343,8 @@ function vtkArrowHandleRepresentation(publicAPI, model) {
|
|
|
341
343
|
var renderingType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RenderingTypes.FRONT_BUFFER;
|
|
342
344
|
var ctxVisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
343
345
|
var handleVisible = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
344
|
-
var
|
|
345
|
-
superClass.updateActorVisibility(renderingType, ctxVisible, handleVisible &&
|
|
346
|
+
var hasValidState = publicAPI.getRepresentationStates().length > 0;
|
|
347
|
+
superClass.updateActorVisibility(renderingType, ctxVisible, handleVisible && hasValidState);
|
|
346
348
|
};
|
|
347
349
|
} // ----------------------------------------------------------------------------
|
|
348
350
|
// Object factory
|
package/index.d.ts
CHANGED
|
@@ -102,11 +102,16 @@
|
|
|
102
102
|
/// <reference path="./Rendering/Core/AxesActor.d.ts" />
|
|
103
103
|
/// <reference path="./Rendering/Core/Camera.d.ts" />
|
|
104
104
|
/// <reference path="./Rendering/Core/CellPicker.d.ts" />
|
|
105
|
+
/// <reference path="./Rendering/Core/ColorTransferFunction/Constants.d.ts" />
|
|
105
106
|
/// <reference path="./Rendering/Core/ColorTransferFunction.d.ts" />
|
|
107
|
+
/// <reference path="./Rendering/Core/Coordinate/Constants.d.ts" />
|
|
106
108
|
/// <reference path="./Rendering/Core/Coordinate.d.ts" />
|
|
107
109
|
/// <reference path="./Rendering/Core/Follower.d.ts" />
|
|
110
|
+
/// <reference path="./Rendering/Core/Glyph3DMapper/Constants.d.ts" />
|
|
108
111
|
/// <reference path="./Rendering/Core/Glyph3DMapper.d.ts" />
|
|
112
|
+
/// <reference path="./Rendering/Core/ImageMapper/Constants.d.ts" />
|
|
109
113
|
/// <reference path="./Rendering/Core/ImageMapper.d.ts" />
|
|
114
|
+
/// <reference path="./Rendering/Core/ImageProperty/Constants.d.ts" />
|
|
110
115
|
/// <reference path="./Rendering/Core/ImageProperty.d.ts" />
|
|
111
116
|
/// <reference path="./Rendering/Core/ImageSlice.d.ts" />
|
|
112
117
|
/// <reference path="./Rendering/Core/Light.d.ts" />
|
|
@@ -120,6 +125,7 @@
|
|
|
120
125
|
/// <reference path="./Rendering/Core/Prop3D.d.ts" />
|
|
121
126
|
/// <reference path="./Rendering/Core/Property/Constants.d.ts" />
|
|
122
127
|
/// <reference path="./Rendering/Core/Property.d.ts" />
|
|
128
|
+
/// <reference path="./Rendering/Core/Property2D/Constants.d.ts" />
|
|
123
129
|
/// <reference path="./Rendering/Core/Property2D.d.ts" />
|
|
124
130
|
/// <reference path="./Rendering/Core/RenderWindow.d.ts" />
|
|
125
131
|
/// <reference path="./Rendering/Core/RenderWindowInteractor/Constants.d.ts" />
|
|
@@ -134,6 +140,7 @@
|
|
|
134
140
|
/// <reference path="./Rendering/Core/Volume.d.ts" />
|
|
135
141
|
/// <reference path="./Rendering/Core/VolumeMapper/Constants.d.ts" />
|
|
136
142
|
/// <reference path="./Rendering/Core/VolumeMapper.d.ts" />
|
|
143
|
+
/// <reference path="./Rendering/Core/VolumeProperty/Constants.d.ts" />
|
|
137
144
|
/// <reference path="./Rendering/Core/VolumeProperty.d.ts" />
|
|
138
145
|
/// <reference path="./Rendering/Misc/CanvasView.d.ts" />
|
|
139
146
|
/// <reference path="./Rendering/Misc/FullScreenRenderWindow.d.ts" />
|