@kitware/vtk.js 24.7.1 → 24.10.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/Core/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/ScalarsToColors/Constants.d.ts +18 -0
- package/Common/Core/ScalarsToColors.d.ts +6 -16
- package/Common/DataModel/Box.d.ts +4 -4
- package/Common/DataModel/CardinalSpline1D.d.ts +8 -4
- package/Common/DataModel/CardinalSpline1D.js +133 -4
- package/Common/DataModel/Cell.js +3 -1
- package/Common/DataModel/CellTypes.js +6 -1
- package/Common/DataModel/ITKHelper.d.ts +54 -0
- package/Common/DataModel/KochanekSpline1D.d.ts +8 -4
- package/Common/DataModel/KochanekSpline1D.js +103 -2
- package/Common/DataModel/Line.d.ts +8 -3
- package/Common/DataModel/Line.js +16 -11
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/PolyData/Constants.d.ts +6 -0
- package/Common/DataModel/PolyLine.d.ts +63 -0
- package/Common/DataModel/PolyLine.js +84 -0
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Spline1D/Constants.js +17 -0
- package/Common/DataModel/Spline1D.d.ts +20 -2
- package/Common/DataModel/Spline3D/Constants.d.ts +9 -0
- package/Common/DataModel/Spline3D.d.ts +4 -9
- package/Common/DataModel/Spline3D.js +20 -15
- package/Filters/General/ImageCropFilter.d.ts +9 -6
- package/Filters/Sources/LineSource.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseRangeManipulator.js +23 -6
- package/Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts +11 -0
- package/Interaction/Widgets/OrientationMarkerWidget.d.ts +2 -6
- package/Rendering/Core/CellPicker.js +53 -32
- package/Rendering/Core/Mapper/Constants.d.ts +26 -0
- package/Rendering/Core/Mapper.d.ts +5 -21
- package/Rendering/Core/Property/Constants.d.ts +24 -0
- package/Rendering/Core/Property.d.ts +6 -20
- package/Rendering/Core/RenderWindowInteractor/Constants.d.ts +31 -0
- package/Rendering/Core/RenderWindowInteractor.d.ts +223 -121
- package/Rendering/Core/Viewport.d.ts +2 -4
- package/Rendering/Core/VolumeMapper/Constants.d.ts +19 -0
- package/Rendering/Core/VolumeMapper.d.ts +5 -9
- package/Rendering/Core/VolumeProperty.d.ts +5 -13
- package/Rendering/Misc/FullScreenRenderWindow.d.ts +3 -2
- package/Rendering/OpenGL/RenderWindow.d.ts +28 -10
- package/Widgets/Core/StateBuilder/manipulatorMixin.js +15 -15
- package/Widgets/Manipulators/AbstractManipulator.d.ts +221 -0
- package/Widgets/Manipulators/AbstractManipulator.js +57 -0
- package/Widgets/Manipulators/LineManipulator.d.ts +8 -74
- package/Widgets/Manipulators/LineManipulator.js +14 -11
- package/Widgets/Manipulators/PlaneManipulator.d.ts +8 -74
- package/Widgets/Manipulators/PlaneManipulator.js +12 -9
- package/Widgets/Manipulators/TrackballManipulator.d.ts +8 -44
- package/Widgets/Manipulators/TrackballManipulator.js +13 -10
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Representations/SplineContextRepresentation.js +28 -9
- package/Widgets/Representations/WidgetRepresentation.js +1 -1
- package/Widgets/Widgets3D/AngleWidget/behavior.js +7 -4
- package/Widgets/Widgets3D/AngleWidget/state.js +2 -2
- package/Widgets/Widgets3D/AngleWidget.js +20 -3
- package/Widgets/Widgets3D/DistanceWidget/behavior.js +7 -2
- package/Widgets/Widgets3D/DistanceWidget/state.js +2 -2
- package/Widgets/Widgets3D/DistanceWidget.js +19 -2
- package/Widgets/Widgets3D/EllipseWidget.js +4 -3
- package/Widgets/Widgets3D/ImageCroppingWidget/behavior.js +3 -4
- package/Widgets/Widgets3D/ImageCroppingWidget.js +42 -13
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +5 -5
- package/Widgets/Widgets3D/LabelWidget/behavior.js +6 -2
- package/Widgets/Widgets3D/LabelWidget/state.js +2 -2
- package/Widgets/Widgets3D/LabelWidget.js +18 -3
- package/Widgets/Widgets3D/LineWidget/behavior.js +11 -4
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/LineWidget/state.js +1 -1
- package/Widgets/Widgets3D/LineWidget.js +18 -1
- package/Widgets/Widgets3D/PaintWidget/behavior.js +12 -9
- package/Widgets/Widgets3D/PaintWidget.js +24 -8
- package/Widgets/Widgets3D/PolyLineWidget/behavior.js +11 -4
- package/Widgets/Widgets3D/PolyLineWidget/state.js +2 -2
- package/Widgets/Widgets3D/PolyLineWidget.js +21 -2
- package/Widgets/Widgets3D/RectangleWidget.js +6 -5
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +5 -5
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +9 -5
- package/Widgets/Widgets3D/ShapeWidget.js +12 -2
- package/Widgets/Widgets3D/SphereWidget/behavior.js +4 -3
- package/Widgets/Widgets3D/SphereWidget.js +23 -2
- package/Widgets/Widgets3D/SplineWidget/behavior.js +7 -3
- package/Widgets/Widgets3D/SplineWidget/state.js +12 -2
- package/Widgets/Widgets3D/SplineWidget.js +22 -3
- package/index.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
4
|
import macro from '../../macros.js';
|
|
4
5
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
5
6
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
@@ -11,12 +12,18 @@ import state from './ImageCroppingWidget/state.js';
|
|
|
11
12
|
import { transformVec3, AXES } from './ImageCroppingWidget/helpers.js';
|
|
12
13
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
13
14
|
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
14
18
|
// ----------------------------------------------------------------------------
|
|
15
19
|
// Factory
|
|
16
20
|
// ----------------------------------------------------------------------------
|
|
17
21
|
|
|
18
22
|
function vtkImageCroppingWidget(publicAPI, model) {
|
|
19
23
|
model.classHierarchy.push('vtkImageCroppingWidget');
|
|
24
|
+
|
|
25
|
+
var superClass = _objectSpread({}, publicAPI);
|
|
26
|
+
|
|
20
27
|
var stateSub = null; // --------------------------------------------------------------------------
|
|
21
28
|
|
|
22
29
|
function setHandlesEnabled(label, flag) {
|
|
@@ -120,28 +127,50 @@ function vtkImageCroppingWidget(publicAPI, model) {
|
|
|
120
127
|
}; // Update handle positions when cropping planes update
|
|
121
128
|
|
|
122
129
|
|
|
123
|
-
stateSub = model.widgetState.getCroppingPlanes().onModified(publicAPI.updateHandles);
|
|
130
|
+
stateSub = model.widgetState.getCroppingPlanes().onModified(publicAPI.updateHandles);
|
|
131
|
+
|
|
132
|
+
publicAPI.setCornerManipulator = function (manipulator) {
|
|
133
|
+
superClass.setCornerManipulator(manipulator);
|
|
134
|
+
model.widgetState.getStatesWithLabel('corners').forEach(function (handle) {
|
|
135
|
+
return handle.setManipulator(manipulator);
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
publicAPI.setEdgeManipulator = function (manipulator) {
|
|
140
|
+
superClass.setEdgeManipulator(manipulator);
|
|
141
|
+
model.widgetState.getStatesWithLabel('edges').forEach(function (handle) {
|
|
142
|
+
return handle.setManipulator(manipulator);
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
publicAPI.setFaceManipulator = function (manipulator) {
|
|
147
|
+
superClass.setFaceManipulator(manipulator);
|
|
148
|
+
model.widgetState.getStatesWithLabel('faces').forEach(function (handle) {
|
|
149
|
+
return handle.setManipulator(manipulator);
|
|
150
|
+
});
|
|
151
|
+
}; // --------------------------------------------------------------------------
|
|
152
|
+
// initialization
|
|
153
|
+
// --------------------------------------------------------------------------
|
|
154
|
+
|
|
124
155
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
model.widgetState.getStatesWithLabel('edges').forEach(function (handle) {
|
|
131
|
-
return handle.setManipulator(planeManipulator);
|
|
132
|
-
});
|
|
133
|
-
model.widgetState.getStatesWithLabel('faces').forEach(function (handle) {
|
|
134
|
-
return handle.setManipulator(lineManipulator);
|
|
135
|
-
});
|
|
156
|
+
publicAPI.setCornerManipulator(vtkPlanePointManipulator.newInstance({
|
|
157
|
+
useCameraNormal: true
|
|
158
|
+
}));
|
|
159
|
+
publicAPI.setEdgeManipulator(vtkPlanePointManipulator.newInstance());
|
|
160
|
+
publicAPI.setFaceManipulator(vtkLineManipulator.newInstance());
|
|
136
161
|
} // ----------------------------------------------------------------------------
|
|
137
162
|
|
|
138
163
|
|
|
139
|
-
var DEFAULT_VALUES = {
|
|
164
|
+
var DEFAULT_VALUES = {// cornerManipulator: null,
|
|
165
|
+
// edgeManipulator: null,
|
|
166
|
+
// faceManipulator: null
|
|
167
|
+
}; // ----------------------------------------------------------------------------
|
|
140
168
|
|
|
141
169
|
function extend(publicAPI, model) {
|
|
142
170
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
143
171
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
144
172
|
vtkAbstractWidgetFactory.extend(publicAPI, model, initialValues);
|
|
173
|
+
macro.setGet(publicAPI, model, ['cornerManipulator', 'edgeManipulator', 'faceManipulator']);
|
|
145
174
|
vtkImageCroppingWidget(publicAPI, model);
|
|
146
175
|
} // ----------------------------------------------------------------------------
|
|
147
176
|
|
|
@@ -48,8 +48,8 @@ function widgetBehavior(publicAPI, model) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
isDragging = true;
|
|
51
|
-
model.lineManipulator.
|
|
52
|
-
model.planeManipulator.
|
|
51
|
+
model.lineManipulator.setWidgetOrigin(model.widgetState.getOrigin());
|
|
52
|
+
model.planeManipulator.setWidgetOrigin(model.widgetState.getOrigin());
|
|
53
53
|
model.trackballManipulator.reset(callData); // setup trackball delta
|
|
54
54
|
|
|
55
55
|
model._interactor.requestAnimation(publicAPI);
|
|
@@ -91,7 +91,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
publicAPI.updateFromOrigin = function (callData) {
|
|
94
|
-
model.planeManipulator.
|
|
94
|
+
model.planeManipulator.setWidgetNormal(model.widgetState.getNormal());
|
|
95
95
|
var worldCoords = model.planeManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
96
96
|
|
|
97
97
|
if (model.widgetState.containsPoint(worldCoords)) {
|
|
@@ -104,7 +104,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
104
104
|
var _model$widgetState;
|
|
105
105
|
|
|
106
106
|
// Move origin along normal axis
|
|
107
|
-
model.lineManipulator.
|
|
107
|
+
model.lineManipulator.setWidgetNormal(model.activeState.getNormal());
|
|
108
108
|
var worldCoords = model.lineManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
109
109
|
|
|
110
110
|
if ((_model$widgetState = model.widgetState).containsPoint.apply(_model$widgetState, _toConsumableArray(worldCoords))) {
|
|
@@ -114,7 +114,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
publicAPI.updateFromNormal = function (callData) {
|
|
117
|
-
model.trackballManipulator.
|
|
117
|
+
model.trackballManipulator.setWidgetNormal(model.activeState.getNormal());
|
|
118
118
|
var newNormal = model.trackballManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
119
119
|
model.activeState.setNormal(newNormal);
|
|
120
120
|
}; // --------------------------------------------------------------------------
|
|
@@ -93,8 +93,12 @@ function widgetBehavior(publicAPI, model) {
|
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
publicAPI.handleMouseMove = function (callData) {
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
97
|
+
|
|
98
|
+
var manipulator = (_model$activeState$ge = (_model$activeState = model.activeState) === null || _model$activeState === void 0 ? void 0 : (_model$activeState$ge2 = _model$activeState.getManipulator) === null || _model$activeState$ge2 === void 0 ? void 0 : _model$activeState$ge2.call(_model$activeState)) !== null && _model$activeState$ge !== void 0 ? _model$activeState$ge : model.manipulator;
|
|
99
|
+
|
|
100
|
+
if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
101
|
+
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
98
102
|
|
|
99
103
|
if (worldCoords.length && (model.activeState === model.widgetState.getMoveHandle() || model.isDragging)) {
|
|
100
104
|
model.activeState.setOrigin(worldCoords);
|
|
@@ -3,7 +3,7 @@ import vtkStateBuilder from '../../Core/StateBuilder.js';
|
|
|
3
3
|
function generateState() {
|
|
4
4
|
return vtkStateBuilder.createBuilder().addStateFromMixin({
|
|
5
5
|
labels: ['moveHandle'],
|
|
6
|
-
mixins: ['origin', 'color', 'scale1', 'visible'],
|
|
6
|
+
mixins: ['origin', 'color', 'scale1', 'visible', 'manipulator'],
|
|
7
7
|
name: 'moveHandle',
|
|
8
8
|
initialValues: {
|
|
9
9
|
scale1: 0.1,
|
|
@@ -11,7 +11,7 @@ function generateState() {
|
|
|
11
11
|
}
|
|
12
12
|
}).addStateFromMixin({
|
|
13
13
|
labels: ['SVGtext'],
|
|
14
|
-
mixins: ['origin', 'color', 'text', 'visible'],
|
|
14
|
+
mixins: ['origin', 'color', 'text', 'visible', 'manipulator'],
|
|
15
15
|
name: 'text',
|
|
16
16
|
initialValues: {
|
|
17
17
|
visible: true
|
|
@@ -16,7 +16,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
// ----------------------------------------------------------------------------
|
|
17
17
|
|
|
18
18
|
function vtkLabelWidget(publicAPI, model) {
|
|
19
|
-
model.classHierarchy.push('vtkLabelWidget');
|
|
19
|
+
model.classHierarchy.push('vtkLabelWidget');
|
|
20
|
+
|
|
21
|
+
var superClass = _objectSpread({}, publicAPI); // --- Widget Requirement ---------------------------------------------------
|
|
22
|
+
|
|
20
23
|
|
|
21
24
|
model.methodsToLink = ['textProps', 'fontProperties', 'strokeFontProperties'];
|
|
22
25
|
model.behavior = widgetBehavior;
|
|
@@ -49,10 +52,22 @@ function vtkLabelWidget(publicAPI, model) {
|
|
|
49
52
|
labels: ['SVGtext']
|
|
50
53
|
}];
|
|
51
54
|
}
|
|
52
|
-
}; //
|
|
55
|
+
}; // --- Public methods -------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
publicAPI.setManipulator = function (manipulator) {
|
|
59
|
+
superClass.setManipulator(manipulator);
|
|
60
|
+
model.widgetState.getMoveHandle().setManipulator(manipulator);
|
|
61
|
+
model.widgetState.getText().setManipulator(manipulator);
|
|
62
|
+
}; // --------------------------------------------------------------------------
|
|
63
|
+
// initialization
|
|
64
|
+
// --------------------------------------------------------------------------
|
|
65
|
+
// Default manipulator
|
|
53
66
|
|
|
54
67
|
|
|
55
|
-
model.manipulator
|
|
68
|
+
publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
|
|
69
|
+
useCameraNormal: true
|
|
70
|
+
}));
|
|
56
71
|
} // ----------------------------------------------------------------------------
|
|
57
72
|
|
|
58
73
|
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import Constants from './Constants.js';
|
|
4
4
|
import macro from '../../../macros.js';
|
|
5
|
-
import {
|
|
5
|
+
import { s as subtract, k as add, l as normalize } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import { getNumberOfPlacedHandles, isHandlePlaced, calculateTextPosition, updateTextPosition, getPoint } from './helpers.js';
|
|
7
7
|
|
|
8
8
|
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; }
|
|
@@ -35,8 +35,11 @@ function widgetBehavior(publicAPI, model) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
function updateCursor(callData) {
|
|
38
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
39
|
+
|
|
38
40
|
model.isDragging = true;
|
|
39
|
-
|
|
41
|
+
var manipulator = (_model$activeState$ge = (_model$activeState = model.activeState) === null || _model$activeState === void 0 ? void 0 : (_model$activeState$ge2 = _model$activeState.getManipulator) === null || _model$activeState$ge2 === void 0 ? void 0 : _model$activeState$ge2.call(_model$activeState)) !== null && _model$activeState$ge !== void 0 ? _model$activeState$ge : model.manipulator;
|
|
42
|
+
model.previousPosition = _toConsumableArray(manipulator.handleEvent(callData, model._apiSpecificRenderWindow));
|
|
40
43
|
|
|
41
44
|
model._apiSpecificRenderWindow.setCursor('grabbing');
|
|
42
45
|
|
|
@@ -222,13 +225,17 @@ function widgetBehavior(publicAPI, model) {
|
|
|
222
225
|
|
|
223
226
|
|
|
224
227
|
publicAPI.handleMouseMove = function (callData) {
|
|
228
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
229
|
+
|
|
225
230
|
if (model.hasFocus && publicAPI.isPlaced() && !model.isDragging) {
|
|
226
231
|
publicAPI.loseFocus();
|
|
227
232
|
return macro.VOID;
|
|
228
233
|
}
|
|
229
234
|
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
var manipulator = (_model$activeState$ge3 = (_model$activeState2 = model.activeState) === null || _model$activeState2 === void 0 ? void 0 : (_model$activeState2$g = _model$activeState2.getManipulator) === null || _model$activeState2$g === void 0 ? void 0 : _model$activeState2$g.call(_model$activeState2)) !== null && _model$activeState$ge3 !== void 0 ? _model$activeState$ge3 : model.manipulator;
|
|
236
|
+
|
|
237
|
+
if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
238
|
+
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
232
239
|
var translation = model.previousPosition ? subtract(worldCoords, model.previousPosition, []) : [0, 0, 0];
|
|
233
240
|
model.previousPosition = worldCoords;
|
|
234
241
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as subtract, x as multiplyScalar, k as add, B as areEquals } from '../../../Common/Core/Math/index.js';
|
|
2
2
|
|
|
3
3
|
function calculateTextPosition(model) {
|
|
4
4
|
var vector = [0, 0, 0];
|
|
@@ -9,7 +9,7 @@ var linePosState = vtkStateBuilder.createBuilder().addField({
|
|
|
9
9
|
function generateState() {
|
|
10
10
|
return vtkStateBuilder.createBuilder().addStateFromMixin({
|
|
11
11
|
labels: ['moveHandle'],
|
|
12
|
-
mixins: ['origin', 'color', 'scale1', 'visible', 'shape'],
|
|
12
|
+
mixins: ['origin', 'color', 'scale1', 'visible', 'manipulator', 'shape'],
|
|
13
13
|
name: 'moveHandle',
|
|
14
14
|
initialValues: {
|
|
15
15
|
scale1: 50,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
2
3
|
import macro from '../../macros.js';
|
|
3
4
|
import generateState from './LineWidget/state.js';
|
|
@@ -11,11 +12,17 @@ import { Behavior } from '../Representations/WidgetRepresentation/Constants.js';
|
|
|
11
12
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
12
13
|
import { getPoint, updateTextPosition } from './LineWidget/helpers.js';
|
|
13
14
|
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
14
18
|
// Factory
|
|
15
19
|
// ----------------------------------------------------------------------------
|
|
16
20
|
|
|
17
21
|
function vtkLineWidget(publicAPI, model) {
|
|
18
22
|
model.classHierarchy.push('vtkLineWidget');
|
|
23
|
+
|
|
24
|
+
var superClass = _objectSpread({}, publicAPI);
|
|
25
|
+
|
|
19
26
|
model.widgetState = generateState();
|
|
20
27
|
model.behavior = widgetBehavior; // --- Widget Requirement ---------------------------------------------------
|
|
21
28
|
|
|
@@ -135,6 +142,13 @@ function vtkLineWidget(publicAPI, model) {
|
|
|
135
142
|
var p1 = getPoint(0, model.widgetState);
|
|
136
143
|
var p2 = getPoint(1, model.widgetState);
|
|
137
144
|
return p1 && p2 ? Math.sqrt(distance2BetweenPoints(p1, p2)) : 0;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
publicAPI.setManipulator = function (manipulator) {
|
|
148
|
+
superClass.setManipulator(manipulator);
|
|
149
|
+
model.widgetState.getMoveHandle().setManipulator(manipulator);
|
|
150
|
+
model.widgetState.getHandle1().setManipulator(manipulator);
|
|
151
|
+
model.widgetState.getHandle2().setManipulator(manipulator);
|
|
138
152
|
}; // --------------------------------------------------------------------------
|
|
139
153
|
// initialization
|
|
140
154
|
// --------------------------------------------------------------------------
|
|
@@ -152,11 +166,14 @@ function vtkLineWidget(publicAPI, model) {
|
|
|
152
166
|
updateTextPosition(model);
|
|
153
167
|
}); // Default manipulator
|
|
154
168
|
|
|
155
|
-
model.manipulator
|
|
169
|
+
publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
|
|
170
|
+
useCameraNormal: true
|
|
171
|
+
}));
|
|
156
172
|
} // ----------------------------------------------------------------------------
|
|
157
173
|
|
|
158
174
|
|
|
159
175
|
var DEFAULT_VALUES = {
|
|
176
|
+
// manipulator: null,
|
|
160
177
|
isDragging: false
|
|
161
178
|
}; // ----------------------------------------------------------------------------
|
|
162
179
|
|
|
@@ -32,8 +32,12 @@ function widgetBehavior(publicAPI, model) {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
publicAPI.handleEvent = function (callData) {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
36
|
+
|
|
37
|
+
var manipulator = (_model$activeState$ge = (_model$activeState = model.activeState) === null || _model$activeState === void 0 ? void 0 : (_model$activeState$ge2 = _model$activeState.getManipulator) === null || _model$activeState$ge2 === void 0 ? void 0 : _model$activeState$ge2.call(_model$activeState)) !== null && _model$activeState$ge !== void 0 ? _model$activeState$ge : model.manipulator;
|
|
38
|
+
|
|
39
|
+
if (manipulator && model.activeState && model.activeState.getActive()) {
|
|
40
|
+
var _model$activeState2, _model$activeState3, _model$activeState4;
|
|
37
41
|
|
|
38
42
|
var normal = model._camera.getDirectionOfProjection();
|
|
39
43
|
|
|
@@ -42,21 +46,20 @@ function widgetBehavior(publicAPI, model) {
|
|
|
42
46
|
var right = [];
|
|
43
47
|
vec3.cross(right, up, normal);
|
|
44
48
|
|
|
45
|
-
(_model$
|
|
49
|
+
(_model$activeState2 = model.activeState).setUp.apply(_model$activeState2, _toConsumableArray(up));
|
|
46
50
|
|
|
47
|
-
(_model$
|
|
51
|
+
(_model$activeState3 = model.activeState).setRight.apply(_model$activeState3, right);
|
|
48
52
|
|
|
49
|
-
(_model$
|
|
53
|
+
(_model$activeState4 = model.activeState).setDirection.apply(_model$activeState4, _toConsumableArray(normal));
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
var worldCoords = model.manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
55
|
+
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
53
56
|
|
|
54
57
|
if (worldCoords.length) {
|
|
55
|
-
var _model$widgetState, _model$
|
|
58
|
+
var _model$widgetState, _model$activeState5;
|
|
56
59
|
|
|
57
60
|
(_model$widgetState = model.widgetState).setTrueOrigin.apply(_model$widgetState, _toConsumableArray(worldCoords));
|
|
58
61
|
|
|
59
|
-
(_model$
|
|
62
|
+
(_model$activeState5 = model.activeState).setOrigin.apply(_model$activeState5, _toConsumableArray(worldCoords));
|
|
60
63
|
|
|
61
64
|
if (model.painting) {
|
|
62
65
|
var trailCircle = model.widgetState.addTrail();
|
|
@@ -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 vtkCircleContextRepresentation from '../Representations/CircleContextRepresentation.js';
|
|
@@ -7,11 +8,17 @@ import widgetBehavior from './PaintWidget/behavior.js';
|
|
|
7
8
|
import generateState from './PaintWidget/state.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
|
// Factory
|
|
11
15
|
// ----------------------------------------------------------------------------
|
|
12
16
|
|
|
13
17
|
function vtkPaintWidget(publicAPI, model) {
|
|
14
|
-
model.classHierarchy.push('vtkPaintWidget');
|
|
18
|
+
model.classHierarchy.push('vtkPaintWidget');
|
|
19
|
+
|
|
20
|
+
var superClass = _objectSpread({}, publicAPI); // --- Widget Requirement ---------------------------------------------------
|
|
21
|
+
|
|
15
22
|
|
|
16
23
|
model.behavior = widgetBehavior;
|
|
17
24
|
model.widgetState = generateState(model.radius);
|
|
@@ -33,26 +40,35 @@ function vtkPaintWidget(publicAPI, model) {
|
|
|
33
40
|
labels: ['handle']
|
|
34
41
|
}];
|
|
35
42
|
}
|
|
36
|
-
}; // ---
|
|
43
|
+
}; // --- Public methods -------------------------------------------------------
|
|
37
44
|
|
|
38
45
|
|
|
39
|
-
|
|
46
|
+
publicAPI.setManipulator = function (manipulator) {
|
|
47
|
+
superClass.setManipulator(manipulator);
|
|
48
|
+
model.widgetState.getHandle().setManipulator(manipulator);
|
|
49
|
+
}; // override
|
|
40
50
|
|
|
41
|
-
model.manipulator = vtkPlanePointManipulator.newInstance();
|
|
42
|
-
handle.setManipulator(model.manipulator); // override
|
|
43
51
|
|
|
44
52
|
var superSetRadius = publicAPI.setRadius;
|
|
45
53
|
|
|
46
54
|
publicAPI.setRadius = function (r) {
|
|
47
55
|
if (superSetRadius(r)) {
|
|
48
|
-
|
|
56
|
+
model.widgetState.getHandle().setScale1(r);
|
|
49
57
|
}
|
|
50
|
-
};
|
|
58
|
+
}; // --------------------------------------------------------------------------
|
|
59
|
+
// initialization
|
|
60
|
+
// --------------------------------------------------------------------------
|
|
61
|
+
// Default manipulator
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
|
|
65
|
+
useCameraNormal: true
|
|
66
|
+
}));
|
|
51
67
|
} // ----------------------------------------------------------------------------
|
|
52
68
|
|
|
53
69
|
|
|
54
70
|
var DEFAULT_VALUES = {
|
|
55
|
-
manipulator: null,
|
|
71
|
+
// manipulator: null,
|
|
56
72
|
radius: 1,
|
|
57
73
|
painting: false,
|
|
58
74
|
color: [1]
|
|
@@ -19,9 +19,15 @@ function widgetBehavior(publicAPI, model) {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function updateMoveHandle(callData) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
22
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
23
|
+
|
|
24
|
+
var manipulator = (_model$activeState$ge = (_model$activeState = model.activeState) === null || _model$activeState === void 0 ? void 0 : (_model$activeState$ge2 = _model$activeState.getManipulator) === null || _model$activeState$ge2 === void 0 ? void 0 : _model$activeState$ge2.call(_model$activeState)) !== null && _model$activeState$ge !== void 0 ? _model$activeState$ge : model.manipulator;
|
|
25
|
+
|
|
26
|
+
if (!manipulator) {
|
|
27
|
+
return macro.VOID;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
25
31
|
|
|
26
32
|
if (worldCoords.length && (model.activeState === model.widgetState.getMoveHandle() || isDragging)) {
|
|
27
33
|
model.activeState.setOrigin(worldCoords);
|
|
@@ -72,6 +78,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
72
78
|
newHandle.setOrigin.apply(newHandle, _toConsumableArray(moveHandle.getOrigin()));
|
|
73
79
|
newHandle.setColor(moveHandle.getColor());
|
|
74
80
|
newHandle.setScale1(moveHandle.getScale1());
|
|
81
|
+
newHandle.setManipulator(model.manipulator);
|
|
75
82
|
} else {
|
|
76
83
|
isDragging = true;
|
|
77
84
|
|
|
@@ -88,7 +95,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
88
95
|
|
|
89
96
|
|
|
90
97
|
publicAPI.handleMouseMove = function (callData) {
|
|
91
|
-
if (model.pickable && model.dragable && model.
|
|
98
|
+
if (model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
92
99
|
if (updateMoveHandle(callData) === macro.EVENT_ABORT) {
|
|
93
100
|
return macro.EVENT_ABORT;
|
|
94
101
|
}
|
|
@@ -3,7 +3,7 @@ import vtkStateBuilder from '../../Core/StateBuilder.js';
|
|
|
3
3
|
function generateState() {
|
|
4
4
|
return vtkStateBuilder.createBuilder().addStateFromMixin({
|
|
5
5
|
labels: ['moveHandle'],
|
|
6
|
-
mixins: ['origin', 'color', 'scale1', 'visible'],
|
|
6
|
+
mixins: ['origin', 'color', 'scale1', 'visible', 'manipulator'],
|
|
7
7
|
name: 'moveHandle',
|
|
8
8
|
initialValues: {
|
|
9
9
|
// when scaleInPixels=true, the handles have 30px height
|
|
@@ -12,7 +12,7 @@ function generateState() {
|
|
|
12
12
|
}
|
|
13
13
|
}).addDynamicMixinState({
|
|
14
14
|
labels: ['handles'],
|
|
15
|
-
mixins: ['origin', 'color', 'scale1', 'visible'],
|
|
15
|
+
mixins: ['origin', 'color', 'scale1', 'visible', 'manipulator'],
|
|
16
16
|
name: 'handle',
|
|
17
17
|
initialValues: {
|
|
18
18
|
scale1: 30
|
|
@@ -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 vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
@@ -8,11 +9,17 @@ import widgetBehavior from './PolyLineWidget/behavior.js';
|
|
|
8
9
|
import generateState from './PolyLineWidget/state.js';
|
|
9
10
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
10
11
|
|
|
12
|
+
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; }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
11
15
|
// Factory
|
|
12
16
|
// ----------------------------------------------------------------------------
|
|
13
17
|
|
|
14
18
|
function vtkPolyLineWidget(publicAPI, model) {
|
|
15
|
-
model.classHierarchy.push('vtkPolyLineWidget');
|
|
19
|
+
model.classHierarchy.push('vtkPolyLineWidget');
|
|
20
|
+
|
|
21
|
+
var superClass = _objectSpread({}, publicAPI); // --- Widget Requirement ---------------------------------------------------
|
|
22
|
+
|
|
16
23
|
|
|
17
24
|
model.methodsToLink = ['activeColor', 'activeScaleFactor', 'closePolyLine', 'defaultScale', 'glyphResolution', 'lineThickness', 'useActiveColor', 'scaleInPixels'];
|
|
18
25
|
model.behavior = widgetBehavior;
|
|
@@ -51,6 +58,15 @@ function vtkPolyLineWidget(publicAPI, model) {
|
|
|
51
58
|
labels: ['handles', 'moveHandle']
|
|
52
59
|
}];
|
|
53
60
|
}
|
|
61
|
+
}; // --- Public methods -------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
publicAPI.setManipulator = function (manipulator) {
|
|
65
|
+
superClass.setManipulator(manipulator);
|
|
66
|
+
model.widgetState.getMoveHandle().setManipulator(manipulator);
|
|
67
|
+
model.widgetState.getHandleList().forEach(function (handle) {
|
|
68
|
+
handle.setManipulator(manipulator);
|
|
69
|
+
});
|
|
54
70
|
}; // --------------------------------------------------------------------------
|
|
55
71
|
// initialization
|
|
56
72
|
// --------------------------------------------------------------------------
|
|
@@ -61,7 +77,10 @@ function vtkPolyLineWidget(publicAPI, model) {
|
|
|
61
77
|
model.widgetState.getMoveHandle().setOrigin(center);
|
|
62
78
|
}); // Default manipulator
|
|
63
79
|
|
|
64
|
-
model.manipulator
|
|
80
|
+
publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
|
|
81
|
+
useCameraFocalPoint: true,
|
|
82
|
+
useCameraNormal: true
|
|
83
|
+
}));
|
|
65
84
|
} // ----------------------------------------------------------------------------
|
|
66
85
|
|
|
67
86
|
|
|
@@ -50,15 +50,16 @@ function vtkRectangleWidget(publicAPI, model) {
|
|
|
50
50
|
}; // --------------------------------------------------------------------------
|
|
51
51
|
// initialization
|
|
52
52
|
// --------------------------------------------------------------------------
|
|
53
|
-
// Default manipulator
|
|
54
53
|
|
|
55
54
|
|
|
56
|
-
model.manipulator = vtkPlanePointManipulator.newInstance();
|
|
57
55
|
model.widgetState = generateState();
|
|
56
|
+
model.manipulator = vtkPlanePointManipulator.newInstance({
|
|
57
|
+
useCameraNormal: true
|
|
58
|
+
});
|
|
58
59
|
} // ----------------------------------------------------------------------------
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
function defaultValues(
|
|
62
|
+
function defaultValues(initialValues) {
|
|
62
63
|
var _None;
|
|
63
64
|
|
|
64
65
|
return _objectSpread({
|
|
@@ -67,14 +68,14 @@ function defaultValues(initalValues) {
|
|
|
67
68
|
Shift: _defineProperty({}, BehaviorCategory.RATIO, ShapeBehavior[BehaviorCategory.RATIO].FIXED),
|
|
68
69
|
Control: _defineProperty({}, BehaviorCategory.POINTS, ShapeBehavior[BehaviorCategory.POINTS].CENTER_TO_CORNER)
|
|
69
70
|
}
|
|
70
|
-
},
|
|
71
|
+
}, initialValues);
|
|
71
72
|
} // ----------------------------------------------------------------------------
|
|
72
73
|
|
|
73
74
|
|
|
74
75
|
function extend(publicAPI, model) {
|
|
75
76
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
76
77
|
vtkShapeWidget.extend(publicAPI, model, defaultValues(initialValues));
|
|
77
|
-
macro.setGet(publicAPI, model, ['
|
|
78
|
+
macro.setGet(publicAPI, model, ['widgetState']);
|
|
78
79
|
vtkRectangleWidget(publicAPI, model);
|
|
79
80
|
} // ----------------------------------------------------------------------------
|
|
80
81
|
|
|
@@ -3,7 +3,7 @@ import macro from '../../../macros.js';
|
|
|
3
3
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
4
4
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
5
5
|
import vtkPlanePointManipulator from '../../Manipulators/PlaneManipulator.js';
|
|
6
|
-
import { x as multiplyScalar,
|
|
6
|
+
import { x as multiplyScalar, s as subtract, l as normalize, d as dot, j as cross, m as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import { updateState, getAssociatedLinesName, boundPointOnPlane, rotateVector } from './helpers.js';
|
|
8
8
|
import { InteractionMethodsName, ScrollingMethods } from './Constants.js';
|
|
9
9
|
|
|
@@ -63,8 +63,8 @@ function widgetBehavior(publicAPI, model) {
|
|
|
63
63
|
isDragging = true;
|
|
64
64
|
var viewType = model.widgetState.getActiveViewType();
|
|
65
65
|
var currentPlaneNormal = model.widgetState.getPlanes()[viewType].normal;
|
|
66
|
-
model.planeManipulator.
|
|
67
|
-
model.planeManipulator.
|
|
66
|
+
model.planeManipulator.setWidgetOrigin(model.widgetState.getCenter());
|
|
67
|
+
model.planeManipulator.setWidgetNormal(currentPlaneNormal);
|
|
68
68
|
publicAPI.startInteraction();
|
|
69
69
|
} else if (model.widgetState.getScrollingMethod() === ScrollingMethods.LEFT_MOUSE_BUTTON) {
|
|
70
70
|
publicAPI.startScrolling(callData.position);
|
|
@@ -215,7 +215,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
215
215
|
var dot$1 = dot(currentLineVector, otherLineVector); // lines are colinear, translate along perpendicular axis from current line
|
|
216
216
|
|
|
217
217
|
if (dot$1 === 1 || dot$1 === -1) {
|
|
218
|
-
cross(currentLineVector, model.planeManipulator.
|
|
218
|
+
cross(currentLineVector, model.planeManipulator.getWidgetNormal(), axisTranslation);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
var closestPoint = [];
|
|
@@ -249,7 +249,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
249
249
|
|
|
250
250
|
publicAPI[InteractionMethodsName.RotateLine] = function (calldata) {
|
|
251
251
|
var activeLine = model.widgetState.getActiveLineState();
|
|
252
|
-
var planeNormal = model.planeManipulator.
|
|
252
|
+
var planeNormal = model.planeManipulator.getWidgetNormal();
|
|
253
253
|
var worldCoords = model.planeManipulator.handleEvent(calldata, model._apiSpecificRenderWindow);
|
|
254
254
|
var center = model.widgetState.getCenter();
|
|
255
255
|
var previousLineDirection = subtract(activeLine.getPoint1(), activeLine.getPoint2(), []);
|
|
@@ -3,7 +3,7 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
|
|
|
3
3
|
import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
|
|
4
4
|
import vtkCutter from '../../../Filters/Core/Cutter.js';
|
|
5
5
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
6
|
-
import {
|
|
6
|
+
import { s as subtract, l as normalize, j as cross, x as multiplyScalar, m as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
8
8
|
import { ViewTypes } from '../../Core/WidgetManager/Constants.js';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
4
4
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
5
5
|
import vtkPlaneSource from '../../Filters/Sources/PlaneSource.js';
|
|
6
6
|
import vtkResliceCursorContextRepresentation from '../Representations/ResliceCursorContextRepresentation.js';
|
|
7
|
-
import { f as distance2BetweenPoints, m as multiplyAccumulate,
|
|
7
|
+
import { f as distance2BetweenPoints, m as multiplyAccumulate, s as subtract, l as normalize, x as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
|
|
8
8
|
import widgetBehavior from './ResliceCursorWidget/behavior.js';
|
|
9
9
|
import generateState from './ResliceCursorWidget/state.js';
|
|
10
10
|
import { updateState, transformPlane, boundPlane } from './ResliceCursorWidget/helpers.js';
|