@kitware/vtk.js 26.0.0-beta.3 → 26.0.0-beta.4
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## From 25.x to 26
|
|
2
|
+
|
|
3
|
+
- **ResliceCursorWidget**: vtkResliceCursorContextRepresentation is deprecated and removed.
|
|
4
|
+
Instead, a `vtkSphereHandleRepresentation` is used for `rotation` and `center` handles,
|
|
5
|
+
and a `vtkLineHandleRepresenttion` is used for the axes. `rotateLineInView()` now
|
|
6
|
+
takes an axis name (string, e.g. 'XinY') instead of a substate.
|
|
7
|
+
|
|
1
8
|
## From 24.x to 25
|
|
2
9
|
|
|
3
10
|
- **math**: For functions calling math functions for computations with matrices, the format must now be number[] or Matrix as defined in the typescript definitions.
|
|
@@ -9,7 +9,8 @@ import { InteractionMethodsName, lineNames, ScrollingMethods, planeNameToViewTyp
|
|
|
9
9
|
|
|
10
10
|
function widgetBehavior(publicAPI, model) {
|
|
11
11
|
model._isDragging = false;
|
|
12
|
-
var isScrolling = false;
|
|
12
|
+
var isScrolling = false;
|
|
13
|
+
var previousPosition; // FIXME: label information should be accessible from activeState instead of parent state.
|
|
13
14
|
|
|
14
15
|
publicAPI.getActiveInteraction = function () {
|
|
15
16
|
if (model.widgetState.getStatesWithLabel('rotation').includes(model.activeState)) {
|
|
@@ -80,7 +81,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
80
81
|
|
|
81
82
|
publicAPI.startScrolling = function (newPosition) {
|
|
82
83
|
if (newPosition) {
|
|
83
|
-
|
|
84
|
+
previousPosition = newPosition;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
isScrolling = true;
|
|
@@ -124,6 +125,8 @@ function widgetBehavior(publicAPI, model) {
|
|
|
124
125
|
var currentPlaneNormal = model.widgetState.getPlanes()[viewType].normal;
|
|
125
126
|
model.planeManipulator.setWidgetOrigin(model.widgetState.getCenter());
|
|
126
127
|
model.planeManipulator.setWidgetNormal(currentPlaneNormal);
|
|
128
|
+
var worldCoords = model.planeManipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
129
|
+
previousPosition = worldCoords;
|
|
127
130
|
publicAPI.startInteraction();
|
|
128
131
|
} else if (model.widgetState.getScrollingMethod() === ScrollingMethods.LEFT_MOUSE_BUTTON) {
|
|
129
132
|
publicAPI.startScrolling(callData.position);
|
|
@@ -140,10 +143,10 @@ function widgetBehavior(publicAPI, model) {
|
|
|
140
143
|
}
|
|
141
144
|
|
|
142
145
|
if (isScrolling) {
|
|
143
|
-
if (
|
|
144
|
-
var step =
|
|
146
|
+
if (previousPosition.y !== callData.position.y) {
|
|
147
|
+
var step = previousPosition.y - callData.position.y;
|
|
145
148
|
publicAPI.translateCenterOnPlaneDirection(step);
|
|
146
|
-
|
|
149
|
+
previousPosition = callData.position;
|
|
147
150
|
publicAPI.invokeInternalInteractionEvent();
|
|
148
151
|
}
|
|
149
152
|
}
|
|
@@ -298,8 +301,11 @@ function widgetBehavior(publicAPI, model) {
|
|
|
298
301
|
|
|
299
302
|
publicAPI[InteractionMethodsName.TranslateCenter] = function (calldata) {
|
|
300
303
|
var worldCoords = model.planeManipulator.handleEvent(calldata, model._apiSpecificRenderWindow);
|
|
301
|
-
|
|
302
|
-
|
|
304
|
+
var translation = subtract(worldCoords, previousPosition, []);
|
|
305
|
+
previousPosition = worldCoords;
|
|
306
|
+
var newCenter = add(model.widgetState.getCenter(), translation, []);
|
|
307
|
+
newCenter = publicAPI.getBoundedCenter(newCenter);
|
|
308
|
+
model.widgetState.setCenter(newCenter);
|
|
303
309
|
updateState(model.widgetState, model._factory.getDisplayScaleParams(), model._factory.getRotationHandlePosition());
|
|
304
310
|
};
|
|
305
311
|
|