@kitware/vtk.js 25.0.2 → 25.1.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.
- package/Rendering/Core/Prop/Constants.d.ts +9 -0
- package/Rendering/Core/Prop/Constants.js +9 -0
- package/Rendering/Core/Prop.d.ts +69 -35
- package/Rendering/Core/Prop.js +27 -10
- package/Rendering/Core/Property2D.js +6 -2
- package/Rendering/Core/ScalarBarActor.js +113 -141
- package/Rendering/Core/VolumeProperty.d.ts +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +16 -2
- package/Rendering/Profiles/All.js +2 -0
- package/Rendering/Profiles/Geometry.js +2 -0
- package/Rendering/WebGPU/Actor.js +20 -6
- package/Rendering/WebGPU/Actor2D.js +149 -0
- package/Rendering/WebGPU/CellArrayMapper.js +69 -22
- package/Rendering/WebGPU/Glyph3DMapper.js +10 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/PolyDataMapper2D.js +99 -0
- package/Rendering/WebGPU/Profiles/All.js +2 -0
- package/Rendering/WebGPU/Profiles/Geometry.js +2 -0
- package/Rendering/WebGPU.js +2 -0
- package/Widgets/Core/AbstractWidgetFactory.js +8 -8
- package/Widgets/Widgets3D/AngleWidget.js +8 -4
- package/Widgets/Widgets3D/DistanceWidget.js +8 -4
- package/Widgets/Widgets3D/EllipseWidget.js +2 -2
- package/Widgets/Widgets3D/ImageCroppingWidget.js +10 -6
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +12 -4
- package/Widgets/Widgets3D/InteractiveOrientationWidget.js +12 -4
- package/Widgets/Widgets3D/LabelWidget.js +4 -3
- package/Widgets/Widgets3D/LineWidget.js +9 -5
- package/Widgets/Widgets3D/PaintWidget.js +13 -9
- package/Widgets/Widgets3D/PolyLineWidget.js +8 -4
- package/Widgets/Widgets3D/RectangleWidget.js +2 -3
- package/Widgets/Widgets3D/ResliceCursorWidget.js +12 -5
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/SphereWidget.js +8 -3
- package/Widgets/Widgets3D/SplineWidget.js +16 -13
- package/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -100,8 +100,6 @@ function vtkImageCroppingWidget(publicAPI, model) {
|
|
|
100
100
|
}
|
|
101
101
|
}); // --- Widget Requirement ---------------------------------------------------
|
|
102
102
|
|
|
103
|
-
model.behavior = widgetBehavior;
|
|
104
|
-
model.widgetState = build();
|
|
105
103
|
model.methodsToLink = ['scaleInPixels']; // Given a view type (geometry, slice, volume), return a description
|
|
106
104
|
// of what representations to create and what widget state to pass
|
|
107
105
|
// to the respective representations.
|
|
@@ -162,14 +160,20 @@ function vtkImageCroppingWidget(publicAPI, model) {
|
|
|
162
160
|
} // ----------------------------------------------------------------------------
|
|
163
161
|
|
|
164
162
|
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
164
|
+
return _objectSpread({
|
|
165
|
+
// cornerManipulator: null,
|
|
166
|
+
// edgeManipulator: null,
|
|
167
|
+
// faceManipulator: null,
|
|
168
|
+
behavior: widgetBehavior,
|
|
169
|
+
widgetState: build()
|
|
170
|
+
}, initialValues);
|
|
168
171
|
}; // ----------------------------------------------------------------------------
|
|
169
172
|
|
|
173
|
+
|
|
170
174
|
function extend(publicAPI, model) {
|
|
171
175
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
172
|
-
Object.assign(model,
|
|
176
|
+
Object.assign(model, defaultValues(initialValues));
|
|
173
177
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
174
178
|
macro.setGet(publicAPI, model, ['cornerManipulator', 'edgeManipulator', 'faceManipulator']);
|
|
175
179
|
vtkImageCroppingWidget(publicAPI, model);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
@@ -7,6 +8,9 @@ import vtkTrackballManipulator from '../Manipulators/TrackballManipulator.js';
|
|
|
7
8
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
8
9
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
9
10
|
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
14
|
// Widget linked to a view
|
|
11
15
|
// ----------------------------------------------------------------------------
|
|
12
16
|
|
|
@@ -143,8 +147,6 @@ function widgetBehavior(publicAPI, model) {
|
|
|
143
147
|
function vtkImplicitPlaneWidget(publicAPI, model) {
|
|
144
148
|
model.classHierarchy.push('vtkPlaneWidget'); // --- Widget Requirement ---------------------------------------------------
|
|
145
149
|
|
|
146
|
-
model.widgetState = vtkImplicitPlaneRepresentation.generateState();
|
|
147
|
-
model.behavior = widgetBehavior;
|
|
148
150
|
model.methodsToLink = ['representationStyle', 'sphereResolution', 'handleSizeRatio', 'axisScale', 'normalVisible', 'originVisible', 'planeVisible', 'outlineVisible'];
|
|
149
151
|
|
|
150
152
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
@@ -162,11 +164,17 @@ function vtkImplicitPlaneWidget(publicAPI, model) {
|
|
|
162
164
|
} // ----------------------------------------------------------------------------
|
|
163
165
|
|
|
164
166
|
|
|
165
|
-
var
|
|
167
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
168
|
+
return _objectSpread({
|
|
169
|
+
behavior: widgetBehavior,
|
|
170
|
+
widgetState: vtkImplicitPlaneRepresentation.generateState()
|
|
171
|
+
}, initialValues);
|
|
172
|
+
}; // ----------------------------------------------------------------------------
|
|
173
|
+
|
|
166
174
|
|
|
167
175
|
function extend(publicAPI, model) {
|
|
168
176
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
169
|
-
Object.assign(model,
|
|
177
|
+
Object.assign(model, defaultValues(initialValues));
|
|
170
178
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
171
179
|
vtkImplicitPlaneWidget(publicAPI, model);
|
|
172
180
|
} // ----------------------------------------------------------------------------
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import macro from '../../macros.js';
|
|
2
3
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
4
|
import vtkConvexFaceContextRepresentation from '../Representations/ConvexFaceContextRepresentation.js';
|
|
@@ -6,6 +7,9 @@ import { generateState, INITIAL_POINTS } from './InteractiveOrientationWidget/st
|
|
|
6
7
|
import { Behavior } from '../Representations/WidgetRepresentation/Constants.js';
|
|
7
8
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
8
9
|
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
13
|
// Factory
|
|
10
14
|
// ----------------------------------------------------------------------------
|
|
11
15
|
|
|
@@ -13,8 +17,6 @@ function vtkInteractiveOrientationWidget(publicAPI, model) {
|
|
|
13
17
|
model.classHierarchy.push('vtkInteractiveOrientationWidget'); // --- Widget Requirement ---------------------------------------------------
|
|
14
18
|
|
|
15
19
|
model.methodsToLink = ['closePolyLine', 'activeScaleFactor', 'activeColor', 'useActiveColor', 'glyphResolution', 'defaultScale'];
|
|
16
|
-
model.behavior = widgetBehavior;
|
|
17
|
-
model.widgetState = generateState();
|
|
18
20
|
|
|
19
21
|
publicAPI.setBounds = function (bounds) {
|
|
20
22
|
var handles = model.widgetState.getStatesWithLabel('handles');
|
|
@@ -107,11 +109,17 @@ function vtkInteractiveOrientationWidget(publicAPI, model) {
|
|
|
107
109
|
} // ----------------------------------------------------------------------------
|
|
108
110
|
|
|
109
111
|
|
|
110
|
-
var
|
|
112
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
113
|
+
return _objectSpread({
|
|
114
|
+
behavior: widgetBehavior,
|
|
115
|
+
widgetState: generateState()
|
|
116
|
+
}, initialValues);
|
|
117
|
+
}; // ----------------------------------------------------------------------------
|
|
118
|
+
|
|
111
119
|
|
|
112
120
|
function extend(publicAPI, model) {
|
|
113
121
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
114
|
-
Object.assign(model,
|
|
122
|
+
Object.assign(model, defaultValues(initialValues));
|
|
115
123
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
116
124
|
vtkInteractiveOrientationWidget(publicAPI, model);
|
|
117
125
|
} // ----------------------------------------------------------------------------
|
|
@@ -22,8 +22,6 @@ function vtkLabelWidget(publicAPI, model) {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
model.methodsToLink = ['textProps', 'fontProperties', 'strokeFontProperties', 'scaleInPixels'];
|
|
25
|
-
model.behavior = widgetBehavior;
|
|
26
|
-
model.widgetState = generateState();
|
|
27
25
|
|
|
28
26
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
29
27
|
switch (viewType) {
|
|
@@ -72,7 +70,10 @@ function vtkLabelWidget(publicAPI, model) {
|
|
|
72
70
|
|
|
73
71
|
|
|
74
72
|
function defaultValues(initialValues) {
|
|
75
|
-
return _objectSpread({
|
|
73
|
+
return _objectSpread({
|
|
74
|
+
behavior: widgetBehavior,
|
|
75
|
+
widgetState: generateState()
|
|
76
|
+
}, initialValues);
|
|
76
77
|
} // ----------------------------------------------------------------------------
|
|
77
78
|
|
|
78
79
|
|
|
@@ -21,10 +21,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
21
21
|
function vtkLineWidget(publicAPI, model) {
|
|
22
22
|
model.classHierarchy.push('vtkLineWidget');
|
|
23
23
|
|
|
24
|
-
var superClass = _objectSpread({}, publicAPI);
|
|
24
|
+
var superClass = _objectSpread({}, publicAPI); // --- Widget Requirement ---------------------------------------------------
|
|
25
25
|
|
|
26
|
-
model.widgetState = generateState();
|
|
27
|
-
model.behavior = widgetBehavior; // --- Widget Requirement ---------------------------------------------------
|
|
28
26
|
|
|
29
27
|
model.methodsToLink = ['activeScaleFactor', 'activeColor', 'useActiveColor', 'glyphResolution', 'defaultScale', 'scaleInPixels'];
|
|
30
28
|
|
|
@@ -165,12 +163,18 @@ function vtkLineWidget(publicAPI, model) {
|
|
|
165
163
|
} // ----------------------------------------------------------------------------
|
|
166
164
|
|
|
167
165
|
|
|
168
|
-
var
|
|
166
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
167
|
+
return _objectSpread({
|
|
168
|
+
// manipulator: null,
|
|
169
|
+
behavior: widgetBehavior,
|
|
170
|
+
widgetState: generateState()
|
|
171
|
+
}, initialValues);
|
|
169
172
|
}; // ----------------------------------------------------------------------------
|
|
170
173
|
|
|
174
|
+
|
|
171
175
|
function extend(publicAPI, model) {
|
|
172
176
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
173
|
-
Object.assign(model,
|
|
177
|
+
Object.assign(model, defaultValues(initialValues));
|
|
174
178
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
175
179
|
macro.setGet(publicAPI, model, ['manipulator']);
|
|
176
180
|
vtkLineWidget(publicAPI, model);
|
|
@@ -20,9 +20,6 @@ function vtkPaintWidget(publicAPI, model) {
|
|
|
20
20
|
var superClass = _objectSpread({}, publicAPI); // --- Widget Requirement ---------------------------------------------------
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
model.behavior = widgetBehavior;
|
|
24
|
-
model.widgetState = generateState(model.radius);
|
|
25
|
-
|
|
26
23
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
27
24
|
switch (viewType) {
|
|
28
25
|
case ViewTypes.DEFAULT:
|
|
@@ -67,16 +64,23 @@ function vtkPaintWidget(publicAPI, model) {
|
|
|
67
64
|
} // ----------------------------------------------------------------------------
|
|
68
65
|
|
|
69
66
|
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
68
|
+
var _initialValues$radius;
|
|
69
|
+
|
|
70
|
+
return _objectSpread({
|
|
71
|
+
// manipulator: null,
|
|
72
|
+
radius: 1,
|
|
73
|
+
painting: false,
|
|
74
|
+
color: [1],
|
|
75
|
+
behavior: widgetBehavior,
|
|
76
|
+
widgetState: generateState((_initialValues$radius = initialValues === null || initialValues === void 0 ? void 0 : initialValues.radius) !== null && _initialValues$radius !== void 0 ? _initialValues$radius : 1)
|
|
77
|
+
}, initialValues);
|
|
75
78
|
}; // ----------------------------------------------------------------------------
|
|
76
79
|
|
|
80
|
+
|
|
77
81
|
function extend(publicAPI, model) {
|
|
78
82
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
79
|
-
Object.assign(model,
|
|
83
|
+
Object.assign(model, defaultValues(initialValues));
|
|
80
84
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
81
85
|
macro.get(publicAPI, model, ['painting']);
|
|
82
86
|
macro.setGet(publicAPI, model, ['manipulator', 'radius', 'color']);
|
|
@@ -22,8 +22,6 @@ function vtkPolyLineWidget(publicAPI, model) {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
model.methodsToLink = ['activeColor', 'activeScaleFactor', 'closePolyLine', 'defaultScale', 'glyphResolution', 'lineThickness', 'useActiveColor', 'scaleInPixels'];
|
|
25
|
-
model.behavior = widgetBehavior;
|
|
26
|
-
model.widgetState = generateState();
|
|
27
25
|
|
|
28
26
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
29
27
|
switch (viewType) {
|
|
@@ -78,12 +76,18 @@ function vtkPolyLineWidget(publicAPI, model) {
|
|
|
78
76
|
} // ----------------------------------------------------------------------------
|
|
79
77
|
|
|
80
78
|
|
|
81
|
-
var
|
|
79
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
80
|
+
return _objectSpread({
|
|
81
|
+
manipulator: null,
|
|
82
|
+
behavior: widgetBehavior,
|
|
83
|
+
widgetState: generateState()
|
|
84
|
+
}, initialValues);
|
|
82
85
|
}; // ----------------------------------------------------------------------------
|
|
83
86
|
|
|
87
|
+
|
|
84
88
|
function extend(publicAPI, model) {
|
|
85
89
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
86
|
-
Object.assign(model,
|
|
90
|
+
Object.assign(model, defaultValues(initialValues));
|
|
87
91
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
88
92
|
macro.setGet(publicAPI, model, ['manipulator']);
|
|
89
93
|
vtkPolyLineWidget(publicAPI, model);
|
|
@@ -21,8 +21,6 @@ function vtkRectangleWidget(publicAPI, model) {
|
|
|
21
21
|
model.classHierarchy.push('vtkRectangleWidget');
|
|
22
22
|
model.methodsToLink = [].concat(_toConsumableArray(model.methodsToLink), ['activeScaleFactor', 'activeColor', 'useActiveColor', 'drawBorder', 'drawFace', 'opacity']); // --- Widget Requirement ---------------------------------------------------
|
|
23
23
|
|
|
24
|
-
model.behavior = widgetBehavior;
|
|
25
|
-
|
|
26
24
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
27
25
|
switch (viewType) {
|
|
28
26
|
case ViewTypes.DEFAULT:
|
|
@@ -49,7 +47,6 @@ function vtkRectangleWidget(publicAPI, model) {
|
|
|
49
47
|
// --------------------------------------------------------------------------
|
|
50
48
|
|
|
51
49
|
|
|
52
|
-
model.widgetState = generateState();
|
|
53
50
|
model.manipulator = vtkPlanePointManipulator.newInstance({
|
|
54
51
|
useCameraNormal: true
|
|
55
52
|
});
|
|
@@ -60,6 +57,8 @@ function defaultValues(initialValues) {
|
|
|
60
57
|
var _None;
|
|
61
58
|
|
|
62
59
|
return _objectSpread({
|
|
60
|
+
behavior: widgetBehavior,
|
|
61
|
+
widgetState: generateState(),
|
|
63
62
|
modifierBehavior: {
|
|
64
63
|
None: (_None = {}, _defineProperty(_None, BehaviorCategory.PLACEMENT, ShapeBehavior[BehaviorCategory.PLACEMENT].CLICK_AND_DRAG), _defineProperty(_None, BehaviorCategory.POINTS, ShapeBehavior[BehaviorCategory.POINTS].CORNER_TO_CORNER), _defineProperty(_None, BehaviorCategory.RATIO, ShapeBehavior[BehaviorCategory.RATIO].FREE), _None),
|
|
65
64
|
Shift: _defineProperty({}, BehaviorCategory.RATIO, ShapeBehavior[BehaviorCategory.RATIO].FIXED),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
@@ -12,6 +13,9 @@ import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
|
12
13
|
import { mat4, vec4 } from 'gl-matrix';
|
|
13
14
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
14
15
|
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
19
|
var VTK_INT_MAX = 2147483647;
|
|
16
20
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
17
21
|
// Factory
|
|
@@ -136,9 +140,6 @@ function vtkResliceCursorWidget(publicAPI, model) {
|
|
|
136
140
|
// --------------------------------------------------------------------------
|
|
137
141
|
|
|
138
142
|
|
|
139
|
-
model.behavior = widgetBehavior;
|
|
140
|
-
model.widgetState = generateState();
|
|
141
|
-
|
|
142
143
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
143
144
|
switch (viewType) {
|
|
144
145
|
case ViewTypes.XY_PLANE:
|
|
@@ -400,11 +401,17 @@ function vtkResliceCursorWidget(publicAPI, model) {
|
|
|
400
401
|
} // ----------------------------------------------------------------------------
|
|
401
402
|
|
|
402
403
|
|
|
403
|
-
var
|
|
404
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
405
|
+
return _objectSpread({
|
|
406
|
+
behavior: widgetBehavior,
|
|
407
|
+
widgetState: generateState()
|
|
408
|
+
}, initialValues);
|
|
409
|
+
}; // ----------------------------------------------------------------------------
|
|
410
|
+
|
|
404
411
|
|
|
405
412
|
function extend(publicAPI, model) {
|
|
406
413
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
407
|
-
Object.assign(model,
|
|
414
|
+
Object.assign(model, defaultValues(initialValues));
|
|
408
415
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
409
416
|
vtkResliceCursorWidget(publicAPI, model);
|
|
410
417
|
} // ----------------------------------------------------------------------------
|
|
@@ -271,7 +271,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
271
271
|
|
|
272
272
|
var displayPlaneNormalPoint = (_model$_apiSpecificRe4 = model._apiSpecificRenderWindow).worldToDisplay.apply(_model$_apiSpecificRe4, _toConsumableArray(planeNormalPoint).concat([model._renderer]));
|
|
273
273
|
|
|
274
|
-
var displayPlaneNormal = vtkMath.subtract(displayPlaneNormalPoint, displayPlaneOrigin); // Project view plane into bounding box
|
|
274
|
+
var displayPlaneNormal = vtkMath.subtract(displayPlaneNormalPoint, displayPlaneOrigin, []); // Project view plane into bounding box
|
|
275
275
|
|
|
276
276
|
var largeDistance = 10 * vtkBoundingBox.getDiagonalLength(displayBounds);
|
|
277
277
|
vtkPlane.projectPoint(vtkBoundingBox.getCenter(displayBounds), displayPlaneOrigin, displayPlaneNormal, planeOrigin);
|
|
@@ -17,7 +17,6 @@ function vtkSphereWidget(publicAPI, model) {
|
|
|
17
17
|
|
|
18
18
|
var superClass = _objectSpread({}, publicAPI);
|
|
19
19
|
|
|
20
|
-
model.behavior = widgetBehavior;
|
|
21
20
|
model.methodsToLink = ['scaleInPixels'];
|
|
22
21
|
|
|
23
22
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
@@ -53,15 +52,21 @@ function vtkSphereWidget(publicAPI, model) {
|
|
|
53
52
|
// --------------------------------------------------------------------------
|
|
54
53
|
|
|
55
54
|
|
|
56
|
-
model.widgetState = stateGenerator();
|
|
57
55
|
publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
|
|
58
56
|
useCameraNormal: true
|
|
59
57
|
}));
|
|
60
58
|
}
|
|
61
59
|
|
|
60
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
61
|
+
return _objectSpread({
|
|
62
|
+
behavior: widgetBehavior,
|
|
63
|
+
widgetState: stateGenerator()
|
|
64
|
+
}, initialValues);
|
|
65
|
+
};
|
|
66
|
+
|
|
62
67
|
function extend(publicAPI, model) {
|
|
63
68
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
64
|
-
Object.assign(model,
|
|
69
|
+
Object.assign(model, defaultValues(initialValues));
|
|
65
70
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
66
71
|
macro.setGet(publicAPI, model, ['manipulator', 'widgetState']);
|
|
67
72
|
vtkSphereWidget(publicAPI, model);
|
|
@@ -21,8 +21,6 @@ function vtkSplineWidget(publicAPI, model) {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
model.methodsToLink = ['boundaryCondition', 'close', 'outputBorder', 'fill', 'borderColor', 'errorBorderColor', 'scaleInPixels'];
|
|
24
|
-
model.behavior = widgetBehavior;
|
|
25
|
-
model.widgetState = generateState();
|
|
26
24
|
|
|
27
25
|
publicAPI.getRepresentationsForViewType = function (viewType) {
|
|
28
26
|
switch (viewType) {
|
|
@@ -60,21 +58,26 @@ function vtkSplineWidget(publicAPI, model) {
|
|
|
60
58
|
} // ----------------------------------------------------------------------------
|
|
61
59
|
|
|
62
60
|
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
var defaultValues = function defaultValues(initialValues) {
|
|
62
|
+
return _objectSpread({
|
|
63
|
+
// manipulator: null,
|
|
64
|
+
freehandMinDistance: 0.1,
|
|
65
|
+
allowFreehand: true,
|
|
66
|
+
resolution: 32,
|
|
67
|
+
// propagates to SplineContextRepresentation
|
|
68
|
+
defaultCursor: 'pointer',
|
|
69
|
+
handleSizeInPixels: 10,
|
|
70
|
+
// propagates to SplineContextRepresentation
|
|
71
|
+
resetAfterPointPlacement: false,
|
|
72
|
+
behavior: widgetBehavior,
|
|
73
|
+
widgetState: generateState()
|
|
74
|
+
}, initialValues);
|
|
73
75
|
}; // ----------------------------------------------------------------------------
|
|
74
76
|
|
|
77
|
+
|
|
75
78
|
function extend(publicAPI, model) {
|
|
76
79
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
77
|
-
Object.assign(model,
|
|
80
|
+
Object.assign(model, defaultValues(initialValues));
|
|
78
81
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
79
82
|
macro.setGet(publicAPI, model, ['manipulator', 'freehandMinDistance', 'allowFreehand', 'resolution', 'defaultCursor', 'handleSizeInPixels', 'resetAfterPointPlacement']);
|
|
80
83
|
vtkSplineWidget(publicAPI, model);
|
package/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
/// <reference path="./Rendering/Core/Picker.d.ts" />
|
|
124
124
|
/// <reference path="./Rendering/Core/PixelSpaceCallbackMapper.d.ts" />
|
|
125
125
|
/// <reference path="./Rendering/Core/PointPicker.d.ts" />
|
|
126
|
+
/// <reference path="./Rendering/Core/Prop/Constants.d.ts" />
|
|
126
127
|
/// <reference path="./Rendering/Core/Prop.d.ts" />
|
|
127
128
|
/// <reference path="./Rendering/Core/Prop3D.d.ts" />
|
|
128
129
|
/// <reference path="./Rendering/Core/Property/Constants.d.ts" />
|