@kitware/vtk.js 28.5.0 → 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.
|
@@ -386,13 +386,17 @@ function vtkColorTransferFunction(publicAPI, model) {
|
|
|
386
386
|
var idx = publicAPI.getAnnotatedValueIndexInternal(x);
|
|
387
387
|
|
|
388
388
|
if (idx < 0 || numNodes === 0) {
|
|
389
|
-
publicAPI.
|
|
389
|
+
var nanColor = publicAPI.getNanColorByReference();
|
|
390
|
+
rgb[0] = nanColor[0];
|
|
391
|
+
rgb[1] = nanColor[1];
|
|
392
|
+
rgb[2] = nanColor[2];
|
|
390
393
|
} else {
|
|
391
394
|
var nodeVal = [];
|
|
392
|
-
publicAPI.getNodeValue(idx % numNodes, nodeVal);
|
|
393
|
-
|
|
394
|
-
rgb[
|
|
395
|
-
rgb[
|
|
395
|
+
publicAPI.getNodeValue(idx % numNodes, nodeVal); // nodeVal[0] is the x value. nodeVal[1...3] is rgb.
|
|
396
|
+
|
|
397
|
+
rgb[0] = nodeVal[1];
|
|
398
|
+
rgb[1] = nodeVal[2];
|
|
399
|
+
rgb[2] = nodeVal[3];
|
|
396
400
|
}
|
|
397
401
|
|
|
398
402
|
return;
|
|
@@ -1019,7 +1023,10 @@ function vtkColorTransferFunction(publicAPI, model) {
|
|
|
1019
1023
|
return;
|
|
1020
1024
|
}
|
|
1021
1025
|
|
|
1022
|
-
publicAPI.
|
|
1026
|
+
var nanColor = publicAPI.getNanColorByReference();
|
|
1027
|
+
rgba[0] = nanColor[0];
|
|
1028
|
+
rgba[1] = nanColor[1];
|
|
1029
|
+
rgba[2] = nanColor[2];
|
|
1023
1030
|
rgba[3] = 1.0; // NanColor is RGB-only.
|
|
1024
1031
|
}; //----------------------------------------------------------------------------
|
|
1025
1032
|
|
|
@@ -393,7 +393,9 @@ function vtkRenderWindowInteractor(publicAPI, model) {
|
|
|
393
393
|
|
|
394
394
|
|
|
395
395
|
publicAPI.exitPointerLock = function () {
|
|
396
|
-
|
|
396
|
+
var _document$exitPointer, _document;
|
|
397
|
+
|
|
398
|
+
return (_document$exitPointer = (_document = document).exitPointerLock) === null || _document$exitPointer === void 0 ? void 0 : _document$exitPointer.call(_document);
|
|
397
399
|
}; //----------------------------------------------------------------------
|
|
398
400
|
|
|
399
401
|
|
|
@@ -72,14 +72,14 @@ export interface vtkVolumeMapper extends vtkAbstractMapper {
|
|
|
72
72
|
* Get at what scale the quality is reduced when interacting for the first time with the volume
|
|
73
73
|
* It should should be set before any call to render for this volume
|
|
74
74
|
* The higher the scale is, the lower the quality of rendering is during interaction
|
|
75
|
-
* @default
|
|
75
|
+
* @default 1
|
|
76
76
|
*/
|
|
77
77
|
getInitialInteractionScale(): number;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Get by how much the sample distance should be increased when interacting
|
|
81
81
|
* This feature is only implemented in the OpenGL volume mapper
|
|
82
|
-
* @default
|
|
82
|
+
* @default 1
|
|
83
83
|
*/
|
|
84
84
|
getInteractionSampleDistanceFactor(): number;
|
|
85
85
|
|
|
@@ -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
|
|