@kitware/vtk.js 28.5.1 → 28.6.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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
3
|
import macro from '../../../macros.js';
|
|
3
4
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
4
5
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
@@ -7,10 +8,17 @@ import { getLineNames, getOtherLineName, updateState, boundPointOnPlane, getLine
|
|
|
7
8
|
import { InteractionMethodsName, ScrollingMethods, planeNameToViewType } from './Constants.js';
|
|
8
9
|
|
|
9
10
|
function widgetBehavior(publicAPI, model) {
|
|
11
|
+
var _publicAPI$setCursorS;
|
|
12
|
+
|
|
10
13
|
model._isDragging = false;
|
|
11
14
|
var isScrolling = false;
|
|
12
15
|
var previousPosition;
|
|
13
|
-
macro.setGet(publicAPI, model, ['keepOrthogonality'
|
|
16
|
+
macro.setGet(publicAPI, model, ['keepOrthogonality', {
|
|
17
|
+
type: 'object',
|
|
18
|
+
name: 'cursorStyles'
|
|
19
|
+
}]); // Set default value for cursorStyles
|
|
20
|
+
|
|
21
|
+
publicAPI.setCursorStyles((_publicAPI$setCursorS = {}, _defineProperty(_publicAPI$setCursorS, InteractionMethodsName.TranslateCenter, 'move'), _defineProperty(_publicAPI$setCursorS, InteractionMethodsName.RotateLine, 'alias'), _defineProperty(_publicAPI$setCursorS, InteractionMethodsName.TranslateAxis, 'pointer'), _defineProperty(_publicAPI$setCursorS, "default", 'default'), _publicAPI$setCursorS));
|
|
14
22
|
|
|
15
23
|
publicAPI.setEnableTranslation = function (enable) {
|
|
16
24
|
model.representations[0].setPickable(enable); // line handle
|
|
@@ -104,26 +112,30 @@ function widgetBehavior(publicAPI, model) {
|
|
|
104
112
|
};
|
|
105
113
|
|
|
106
114
|
publicAPI.updateCursor = function () {
|
|
107
|
-
|
|
108
|
-
case InteractionMethodsName.TranslateCenter:
|
|
109
|
-
model._apiSpecificRenderWindow.setCursor('move');
|
|
115
|
+
var cursorStyles = publicAPI.getCursorStyles();
|
|
110
116
|
|
|
111
|
-
|
|
117
|
+
if (cursorStyles) {
|
|
118
|
+
switch (publicAPI.getActiveInteraction()) {
|
|
119
|
+
case InteractionMethodsName.TranslateCenter:
|
|
120
|
+
model._apiSpecificRenderWindow.setCursor(cursorStyles.translateCenter);
|
|
112
121
|
|
|
113
|
-
|
|
114
|
-
model._apiSpecificRenderWindow.setCursor('alias');
|
|
122
|
+
break;
|
|
115
123
|
|
|
116
|
-
|
|
124
|
+
case InteractionMethodsName.RotateLine:
|
|
125
|
+
model._apiSpecificRenderWindow.setCursor(cursorStyles.rotateLine);
|
|
117
126
|
|
|
118
|
-
|
|
119
|
-
model._apiSpecificRenderWindow.setCursor('pointer');
|
|
127
|
+
break;
|
|
120
128
|
|
|
121
|
-
|
|
129
|
+
case InteractionMethodsName.TranslateAxis:
|
|
130
|
+
model._apiSpecificRenderWindow.setCursor(cursorStyles.translateAxis);
|
|
122
131
|
|
|
123
|
-
|
|
124
|
-
model._apiSpecificRenderWindow.setCursor('default');
|
|
132
|
+
break;
|
|
125
133
|
|
|
126
|
-
|
|
134
|
+
default:
|
|
135
|
+
model._apiSpecificRenderWindow.setCursor(cursorStyles.default);
|
|
136
|
+
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
127
139
|
}
|
|
128
140
|
};
|
|
129
141
|
|