@kitware/vtk.js 24.10.0 → 24.12.1
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/LookupTable.d.ts +6 -6
- package/Common/DataModel/PiecewiseFunction.js +8 -8
- package/Common/DataModel/PolyLine.js +0 -7
- package/Rendering/Core/ScalarBarActor.d.ts +37 -15
- package/Rendering/Core/ScalarBarActor.js +39 -14
- package/Widgets/Core/StateBuilder.js +6 -2
- package/Widgets/Representations/SplineContextRepresentation.js +8 -9
- package/Widgets/Widgets3D/AngleWidget/behavior.js +10 -5
- package/Widgets/Widgets3D/DistanceWidget/behavior.js +11 -5
- package/Widgets/Widgets3D/ImageCroppingWidget/state.js +51 -50
- package/Widgets/Widgets3D/ImageCroppingWidget.js +2 -2
- package/Widgets/Widgets3D/LabelWidget/behavior.js +10 -4
- package/Widgets/Widgets3D/PolyLineWidget/behavior.js +7 -5
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +9 -1
- package/Widgets/Widgets3D/SplineWidget/state.js +1 -1
- package/index.d.ts +9 -9
- package/package.json +43 -43
|
@@ -22,12 +22,12 @@ export interface vtkLookupTable extends vtkScalarsToColors {
|
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
24
|
*/
|
|
25
|
-
getAboveRangeColor():
|
|
25
|
+
getAboveRangeColor(): RGBAColor;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
getAboveRangeColorByReference():
|
|
30
|
+
getAboveRangeColorByReference(): RGBAColor;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
*
|
|
@@ -153,13 +153,13 @@ export interface vtkLookupTable extends vtkScalarsToColors {
|
|
|
153
153
|
*
|
|
154
154
|
* @param aboveRangeColor
|
|
155
155
|
*/
|
|
156
|
-
setAboveRangeColor(aboveRangeColor:
|
|
156
|
+
setAboveRangeColor(aboveRangeColor: RGBAColor): boolean;
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
*
|
|
160
160
|
* @param aboveRangeColor
|
|
161
161
|
*/
|
|
162
|
-
setAboveRangeColorFrom(aboveRangeColor:
|
|
162
|
+
setAboveRangeColorFrom(aboveRangeColor: RGBAColor): boolean;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
*
|
|
@@ -177,13 +177,13 @@ export interface vtkLookupTable extends vtkScalarsToColors {
|
|
|
177
177
|
*
|
|
178
178
|
* @param belowRangeColor
|
|
179
179
|
*/
|
|
180
|
-
setBelowRangeColor(belowRangeColor:
|
|
180
|
+
setBelowRangeColor(belowRangeColor: RGBAColor): boolean;
|
|
181
181
|
|
|
182
182
|
/**
|
|
183
183
|
*
|
|
184
184
|
* @param belowRangeColor
|
|
185
185
|
*/
|
|
186
|
-
setBelowRangeColorFrom(belowRangeColor:
|
|
186
|
+
setBelowRangeColorFrom(belowRangeColor: RGBAColor): boolean;
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
189
|
*
|
|
@@ -37,14 +37,14 @@ function vtkPiecewiseFunction(publicAPI, model) {
|
|
|
37
37
|
switch (functionType) {
|
|
38
38
|
case 0:
|
|
39
39
|
case 1:
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// NonDecreasing
|
|
41
|
+
functionType = 1;
|
|
42
42
|
break;
|
|
43
43
|
|
|
44
44
|
case 2:
|
|
45
45
|
default:
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
// Varied
|
|
47
|
+
functionType = 3;
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
} else {
|
|
@@ -52,14 +52,14 @@ function vtkPiecewiseFunction(publicAPI, model) {
|
|
|
52
52
|
switch (functionType) {
|
|
53
53
|
case 0:
|
|
54
54
|
case 2:
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// NonIncreasing
|
|
56
|
+
functionType = 2;
|
|
57
57
|
break;
|
|
58
58
|
|
|
59
59
|
case 1:
|
|
60
60
|
default:
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
// Varied
|
|
62
|
+
functionType = 3;
|
|
63
63
|
break;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -28,8 +28,6 @@ function vtkPolyLine(publicAPI, model) {
|
|
|
28
28
|
};
|
|
29
29
|
var numLines = superClass.getPoints().getNumberOfPoints() - 1;
|
|
30
30
|
var pDistMin = Number.MAX_VALUE;
|
|
31
|
-
var minXYZ = [0, 0, 0];
|
|
32
|
-
var minPCoords = [0, 0, 0];
|
|
33
31
|
|
|
34
32
|
for (var subId = 0; subId < numLines; subId++) {
|
|
35
33
|
var pCoords = [0, 0, 0];
|
|
@@ -44,11 +42,6 @@ function vtkPolyLine(publicAPI, model) {
|
|
|
44
42
|
outObj.subId = subId;
|
|
45
43
|
outObj.t = lineIntersected.t;
|
|
46
44
|
pDistMin = pDist;
|
|
47
|
-
|
|
48
|
-
for (var k = 0; k < 3; k++) {
|
|
49
|
-
minXYZ[k] = x[k];
|
|
50
|
-
minPCoords[k] = pCoords[k];
|
|
51
|
-
}
|
|
52
45
|
}
|
|
53
46
|
}
|
|
54
47
|
}
|
|
@@ -27,21 +27,22 @@ export interface IStyle {
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
export interface IScalarBarActorInitialValues extends IActorInitialValues {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
automated?: boolean,
|
|
31
|
+
autoLayout?: (publicAPI: object, model: object) => void,
|
|
32
|
+
axisLabel?: string,
|
|
33
|
+
barPosition?: Vector2,
|
|
34
|
+
barSize?: Size,
|
|
35
|
+
boxPosition?: Vector2,
|
|
36
|
+
boxSize?: Size,
|
|
37
|
+
scalarToColors?: null,
|
|
38
|
+
axisTitlePixelOffset?: number,
|
|
39
|
+
axisTextStyle?: IStyle,
|
|
40
|
+
tickLabelPixelOffset?: number,
|
|
41
|
+
tickTextStyle?: IStyle,
|
|
42
|
+
generateTicks?: (helper: any) => void,
|
|
43
|
+
drawBelowRangeSwatch?: boolean,
|
|
44
|
+
drawAboveRangeSwatch?: boolean,
|
|
45
|
+
drawNanAnnotation?: boolean,
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export interface vtkScalarBarActor extends vtkActor {
|
|
@@ -87,6 +88,10 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
87
88
|
*/
|
|
88
89
|
getAutoLayout(): any;
|
|
89
90
|
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
getGenerateTicks(): any;
|
|
90
95
|
/**
|
|
91
96
|
*
|
|
92
97
|
*/
|
|
@@ -175,6 +180,23 @@ export interface vtkScalarBarActor extends vtkActor {
|
|
|
175
180
|
*/
|
|
176
181
|
setAutoLayout(autoLayout: any): boolean;
|
|
177
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Sets the function used to generate legend ticks.
|
|
185
|
+
*
|
|
186
|
+
* This function takes a vtkScalarBarActorHelper and returns true on success.
|
|
187
|
+
* To have the desired effect, the function must call: `helper.setTicks(ticks: num[])` and `helper.setTickStrings(tickStrings: string[])`.
|
|
188
|
+
*
|
|
189
|
+
* After setting the generateTicks function you must regenerate the vtkScalarBarActor for your changes to take effect.
|
|
190
|
+
* One way to do that is:
|
|
191
|
+
* ```
|
|
192
|
+
* const mapper = scalarBarActor.getMapper()
|
|
193
|
+
* if (mapper) {
|
|
194
|
+
* mapper.getLookupTable().resetAnnotations()
|
|
195
|
+
* }
|
|
196
|
+
* ```
|
|
197
|
+
* @param {(helper: any) => void} generateTicks
|
|
198
|
+
*/
|
|
199
|
+
setGenerateTicks(generateTicks: (helper: any) => void): boolean;
|
|
178
200
|
/**
|
|
179
201
|
*
|
|
180
202
|
* @param {Boolean} automated
|
|
@@ -129,6 +129,25 @@ function defaultAutoLayout(publicAPI, model) {
|
|
|
129
129
|
|
|
130
130
|
helper.recomputeBarSegments(textSizes);
|
|
131
131
|
};
|
|
132
|
+
} // ----------------------------------------------------------------------------
|
|
133
|
+
// Default generateTicks function
|
|
134
|
+
// ----------------------------------------------------------------------------
|
|
135
|
+
// This function returns the default function used to generate vtkScalarBarActor ticks.
|
|
136
|
+
// The default function makes use of d3.scaleLinear() to generate 5 tick marks between
|
|
137
|
+
// the minimum and maximum values of the scalar bar. Customize this behavior by passing
|
|
138
|
+
// a function to vtkScalarBarActor.newInstance({ generateTicks: customGenerateTicks })
|
|
139
|
+
// or by calling scalarBarActor.setGenerateTicks(customGenerateTicks).
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
function defaultGenerateTicks(publicApi, model) {
|
|
143
|
+
return function (helper) {
|
|
144
|
+
var lastTickBounds = helper.getLastTickBounds();
|
|
145
|
+
var scale = d3.scaleLinear().domain([lastTickBounds[0], lastTickBounds[1]]);
|
|
146
|
+
var ticks = scale.ticks(5);
|
|
147
|
+
var format = scale.tickFormat(5);
|
|
148
|
+
helper.setTicks(ticks);
|
|
149
|
+
helper.setTickStrings(ticks.map(format));
|
|
150
|
+
};
|
|
132
151
|
} // many properties of this actor depend on the API specific view The main
|
|
133
152
|
// dependency being the resolution as that drives what font sizes to use.
|
|
134
153
|
// Bacause of this we need to do some of the calculations in a API specific
|
|
@@ -152,6 +171,7 @@ function vtkScalarBarActorHelper(publicAPI, model) {
|
|
|
152
171
|
model.barActor.setParentProp(renderable);
|
|
153
172
|
model.tmActor.setProperty(renderable.getProperty());
|
|
154
173
|
model.tmActor.setParentProp(renderable);
|
|
174
|
+
model.generateTicks = renderable.generateTicks;
|
|
155
175
|
model.axisTextStyle = _objectSpread({}, renderable.getAxisTextStyle());
|
|
156
176
|
model.tickTextStyle = _objectSpread({}, renderable.getTickTextStyle());
|
|
157
177
|
publicAPI.modified();
|
|
@@ -182,10 +202,7 @@ function vtkScalarBarActorHelper(publicAPI, model) {
|
|
|
182
202
|
var range = scalarsToColors.getMappingRange();
|
|
183
203
|
model.lastTickBounds = _toConsumableArray(range); // compute tick marks for axes (update for log scale)
|
|
184
204
|
|
|
185
|
-
|
|
186
|
-
model.ticks = scale.ticks(5);
|
|
187
|
-
var format = scale.tickFormat(5);
|
|
188
|
-
model.tickstrings = model.ticks.map(format);
|
|
205
|
+
model.renderable.getGenerateTicks()(publicAPI);
|
|
189
206
|
|
|
190
207
|
if (model.renderable.getAutomated()) {
|
|
191
208
|
model.renderable.getAutoLayout()(publicAPI);
|
|
@@ -253,7 +270,7 @@ function vtkScalarBarActorHelper(publicAPI, model) {
|
|
|
253
270
|
results.tickWidth = 0;
|
|
254
271
|
results.tickHeight = 0;
|
|
255
272
|
applyTextStyle(model.tmContext, model.tickTextStyle);
|
|
256
|
-
var strings = [].concat(_toConsumableArray(
|
|
273
|
+
var strings = [].concat(_toConsumableArray(publicAPI.getTickStrings()), ['NaN', 'Below', 'Above']);
|
|
257
274
|
|
|
258
275
|
for (var t = 0; t < strings.length; t++) {
|
|
259
276
|
if (!newTmAtlas.has(strings[t])) {
|
|
@@ -501,7 +518,7 @@ function vtkScalarBarActorHelper(publicAPI, model) {
|
|
|
501
518
|
} // update the polydata
|
|
502
519
|
|
|
503
520
|
|
|
504
|
-
var numLabels =
|
|
521
|
+
var numLabels = publicAPI.getTickStrings().length + model.barSegments.length;
|
|
505
522
|
var numPts = numLabels * 4;
|
|
506
523
|
var numTris = numLabels * 2;
|
|
507
524
|
var points = new Float64Array(numPts * 3);
|
|
@@ -568,12 +585,14 @@ function vtkScalarBarActorHelper(publicAPI, model) {
|
|
|
568
585
|
|
|
569
586
|
var tickSegmentStart = model.barPosition[spacedAxis] + model.barSize[spacedAxis] * tickSeg.corners[0][spacedAxis];
|
|
570
587
|
var tickSegmentSize = model.barSize[spacedAxis] * (tickSeg.corners[2][spacedAxis] - tickSeg.corners[0][spacedAxis]);
|
|
588
|
+
var ticks = publicAPI.getTicks();
|
|
589
|
+
var tickStrings = publicAPI.getTickStrings();
|
|
571
590
|
|
|
572
|
-
for (var t = 0; t <
|
|
573
|
-
var tickPos = (
|
|
591
|
+
for (var t = 0; t < ticks.length; t++) {
|
|
592
|
+
var tickPos = (ticks[t] - model.lastTickBounds[0]) / (model.lastTickBounds[1] - model.lastTickBounds[0]);
|
|
574
593
|
tmp2v3[spacedAxis] = tickSegmentStart + tickSegmentSize * tickPos;
|
|
575
594
|
vec3.transformMat4(ptv3, tmp2v3, invmat);
|
|
576
|
-
publicAPI.createPolyDataForOneLabel(
|
|
595
|
+
publicAPI.createPolyDataForOneLabel(tickStrings[t], ptv3, xDir, yDir, dir, model.tickLabelPixelOffset, results);
|
|
577
596
|
}
|
|
578
597
|
|
|
579
598
|
var tcoordDA = vtkDataArray.newInstance({
|
|
@@ -675,8 +694,8 @@ var newScalarBarActorHelper = macro.newInstance(function (publicAPI, model) {
|
|
|
675
694
|
Object.assign(model, {}, initialValues); // Inheritance
|
|
676
695
|
|
|
677
696
|
macro.obj(publicAPI, model);
|
|
678
|
-
macro.setGet(publicAPI, model, ['axisTitlePixelOffset', 'tickLabelPixelOffset', 'renderable', 'topTitle']);
|
|
679
|
-
macro.get(publicAPI, model, ['lastSize', 'lastAspectRatio', 'axisTextStyle', 'tickTextStyle', 'barActor', 'tmActor'
|
|
697
|
+
macro.setGet(publicAPI, model, ['axisTitlePixelOffset', 'tickLabelPixelOffset', 'renderable', 'topTitle', 'ticks', 'tickStrings']);
|
|
698
|
+
macro.get(publicAPI, model, ['lastSize', 'lastAspectRatio', 'lastTickBounds', 'axisTextStyle', 'tickTextStyle', 'barActor', 'tmActor']);
|
|
680
699
|
macro.getArray(publicAPI, model, ['boxPosition', 'boxSize']);
|
|
681
700
|
macro.setArray(publicAPI, model, ['boxPosition', 'boxSize'], 2);
|
|
682
701
|
model.forceUpdate = false;
|
|
@@ -739,7 +758,11 @@ function vtkScalarBarActor(publicAPI, model) {
|
|
|
739
758
|
};
|
|
740
759
|
|
|
741
760
|
publicAPI.resetAutoLayoutToDefault = function () {
|
|
742
|
-
|
|
761
|
+
publicAPI.setAutoLayout(defaultAutoLayout(publicAPI, model));
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
publicAPI.resetGenerateTicksToDefault = function () {
|
|
765
|
+
publicAPI.setGenerateTicks(defaultGenerateTicks());
|
|
743
766
|
};
|
|
744
767
|
} // ----------------------------------------------------------------------------
|
|
745
768
|
// Object factory
|
|
@@ -770,6 +793,7 @@ function defaultValues(initialValues) {
|
|
|
770
793
|
fontSize: 14,
|
|
771
794
|
fontFamily: 'serif'
|
|
772
795
|
},
|
|
796
|
+
generateTicks: null,
|
|
773
797
|
drawNanAnnotation: true,
|
|
774
798
|
drawBelowRangeSwatch: true,
|
|
775
799
|
drawAboveRangeSwatch: true
|
|
@@ -780,12 +804,13 @@ function defaultValues(initialValues) {
|
|
|
780
804
|
function extend(publicAPI, model) {
|
|
781
805
|
var initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
782
806
|
Object.assign(model, defaultValues(initialValues));
|
|
783
|
-
if (!model.autoLayout) model.autoLayout = defaultAutoLayout(publicAPI, model);
|
|
807
|
+
if (!model.autoLayout) model.autoLayout = defaultAutoLayout(publicAPI, model);
|
|
808
|
+
if (!model.generateTicks) model.generateTicks = defaultGenerateTicks(); // Inheritance
|
|
784
809
|
|
|
785
810
|
vtkActor.extend(publicAPI, model, initialValues);
|
|
786
811
|
publicAPI.getProperty().setDiffuse(0.0);
|
|
787
812
|
publicAPI.getProperty().setAmbient(1.0);
|
|
788
|
-
macro.setGet(publicAPI, model, ['automated', 'autoLayout', 'axisTitlePixelOffset', 'axisLabel', 'scalarsToColors', 'tickLabelPixelOffset', 'drawNanAnnotation', 'drawBelowRangeSwatch', 'drawAboveRangeSwatch']);
|
|
813
|
+
macro.setGet(publicAPI, model, ['automated', 'autoLayout', 'axisTitlePixelOffset', 'axisLabel', 'scalarsToColors', 'tickLabelPixelOffset', 'generateTicks', 'drawNanAnnotation', 'drawBelowRangeSwatch', 'drawAboveRangeSwatch']);
|
|
789
814
|
macro.get(publicAPI, model, ['axisTextStyle', 'tickTextStyle']);
|
|
790
815
|
macro.getArray(publicAPI, model, ['barPosition', 'barSize', 'boxPosition', 'boxSize']);
|
|
791
816
|
macro.setArray(publicAPI, model, ['barPosition', 'barSize', 'boxPosition', 'boxSize'], 2); // Object methods
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
1
2
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
3
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
4
|
import macro from '../../macros.js';
|
|
@@ -16,6 +17,9 @@ import text from './StateBuilder/textMixin.js';
|
|
|
16
17
|
import visible from './StateBuilder/visibleMixin.js';
|
|
17
18
|
import shape from './StateBuilder/shapeMixin.js';
|
|
18
19
|
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
19
23
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
20
24
|
// Global type lookup map
|
|
21
25
|
// ----------------------------------------------------------------------------
|
|
@@ -85,8 +89,8 @@ var Builder = /*#__PURE__*/function () {
|
|
|
85
89
|
var listName = "".concat(name, "List");
|
|
86
90
|
this.model[listName] = []; // Create new Instance method
|
|
87
91
|
|
|
88
|
-
this.publicAPI["add".concat(macro.capitalize(name))] = function () {
|
|
89
|
-
var instance = newInstance(mixins, initialValues);
|
|
92
|
+
this.publicAPI["add".concat(macro.capitalize(name))] = function (values) {
|
|
93
|
+
var instance = newInstance(mixins, _objectSpread(_objectSpread({}, initialValues), values));
|
|
90
94
|
|
|
91
95
|
_this.publicAPI.bindState(instance, labels);
|
|
92
96
|
|
|
@@ -56,6 +56,7 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
56
56
|
|
|
57
57
|
var polydata = vtkPolyData.newInstance();
|
|
58
58
|
var widgetState = inData[0];
|
|
59
|
+
var closed = widgetState.getSplineClosed();
|
|
59
60
|
var list = publicAPI.getRepresentationStates(widgetState).filter(function (state) {
|
|
60
61
|
return state.getVisible && state.getVisible() && state.getOrigin && state.getOrigin();
|
|
61
62
|
});
|
|
@@ -70,14 +71,14 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
70
71
|
|
|
71
72
|
var numVertices = inPoints.length;
|
|
72
73
|
|
|
73
|
-
if (!
|
|
74
|
+
if (!closed) {
|
|
74
75
|
--numVertices;
|
|
75
76
|
} else {
|
|
76
77
|
inPoints.push(inPoints[0]);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
var spline = vtkSpline3D.newInstance({
|
|
80
|
-
close: widgetState.
|
|
81
|
+
close: widgetState.getSplineClosed(),
|
|
81
82
|
kind: widgetState.getSplineKind(),
|
|
82
83
|
tension: widgetState.getSplineTension(),
|
|
83
84
|
bias: widgetState.getSplineBias(),
|
|
@@ -86,7 +87,7 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
86
87
|
boundaryConditionValues: widgetState.getSplineBoundaryConditionValues()
|
|
87
88
|
});
|
|
88
89
|
spline.computeCoefficients(inPoints);
|
|
89
|
-
var outPoints = new Float32Array(3 * ((numVertices + !
|
|
90
|
+
var outPoints = new Float32Array(3 * ((numVertices + !closed) * model.resolution));
|
|
90
91
|
var outCells = new Uint32Array(numVertices * model.resolution + 2);
|
|
91
92
|
outCells[0] = numVertices * model.resolution + 1;
|
|
92
93
|
outCells[numVertices * model.resolution + 1] = 0;
|
|
@@ -102,7 +103,7 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
if (
|
|
106
|
+
if (closed) {
|
|
106
107
|
outCells[numVertices * model.resolution + 1] = 0;
|
|
107
108
|
} else {
|
|
108
109
|
var lastPointIndex = numVertices * model.resolution + 1;
|
|
@@ -115,7 +116,7 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
115
116
|
|
|
116
117
|
polydata.getPoints().setData(outPoints);
|
|
117
118
|
|
|
118
|
-
if (model.fill
|
|
119
|
+
if (model.fill) {
|
|
119
120
|
polydata.getPolys().setData(outCells);
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -131,11 +132,10 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
131
132
|
};
|
|
132
133
|
|
|
133
134
|
function updateAreaVisibility() {
|
|
134
|
-
model.pipelines.area.actor.setVisibility(model.fill
|
|
135
|
+
model.pipelines.area.actor.setVisibility(model.fill);
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
publicAPI.setFill = macro.chain(publicAPI.setFill, updateAreaVisibility);
|
|
138
|
-
publicAPI.setClose = macro.chain(publicAPI.setClose, updateAreaVisibility);
|
|
139
139
|
publicAPI.setOutputBorder = macro.chain(publicAPI.setOutputBorder, function (v) {
|
|
140
140
|
return model.pipelines.border.actor.setVisibility(v);
|
|
141
141
|
});
|
|
@@ -146,7 +146,6 @@ function vtkSplineContextRepresentation(publicAPI, model) {
|
|
|
146
146
|
|
|
147
147
|
var DEFAULT_VALUES = {
|
|
148
148
|
resolution: 16,
|
|
149
|
-
close: true,
|
|
150
149
|
fill: true,
|
|
151
150
|
// boundaryCondition : BoundaryCondition.DEFAULT
|
|
152
151
|
outputBorder: false,
|
|
@@ -159,7 +158,7 @@ function extend(publicAPI, model) {
|
|
|
159
158
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
160
159
|
vtkContextRepresentation.extend(publicAPI, model, initialValues);
|
|
161
160
|
macro.get(publicAPI, model, ['mapper']);
|
|
162
|
-
macro.setGet(publicAPI, model, ['resolution', '
|
|
161
|
+
macro.setGet(publicAPI, model, ['resolution', 'boundaryCondition', 'fill', 'outputBorder']);
|
|
163
162
|
macro.setGetArray(publicAPI, model, ['borderColor', 'errorBorderColor'], 3); // Object specific methods
|
|
164
163
|
|
|
165
164
|
vtkSplineContextRepresentation(publicAPI, model);
|
|
@@ -26,21 +26,26 @@ function widgetBehavior(publicAPI, model) {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
publicAPI.handleLeftButtonPress = function (e) {
|
|
29
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
30
|
+
|
|
29
31
|
if (!model.activeState || !model.activeState.getActive() || !model.pickable || ignoreKey(e)) {
|
|
30
32
|
return macro.VOID;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
picker.initializePickList();
|
|
34
36
|
picker.setPickList(publicAPI.getNestedProps());
|
|
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 (model.activeState === model.widgetState.getMoveHandle() && model.widgetState.getHandleList().length < MAX_POINTS && manipulator) {
|
|
40
|
+
var worldCoords = manipulator.handleEvent(e, model._apiSpecificRenderWindow); // Commit handle to location
|
|
35
41
|
|
|
36
|
-
if (model.activeState === model.widgetState.getMoveHandle() && model.widgetState.getHandleList().length < MAX_POINTS) {
|
|
37
|
-
// Commit handle to location
|
|
38
42
|
var moveHandle = model.widgetState.getMoveHandle();
|
|
43
|
+
moveHandle.setOrigin.apply(moveHandle, _toConsumableArray(worldCoords));
|
|
39
44
|
var newHandle = model.widgetState.addHandle();
|
|
40
45
|
newHandle.setOrigin.apply(newHandle, _toConsumableArray(moveHandle.getOrigin()));
|
|
41
46
|
newHandle.setColor(moveHandle.getColor());
|
|
42
47
|
newHandle.setScale1(moveHandle.getScale1());
|
|
43
|
-
newHandle.setManipulator(
|
|
48
|
+
newHandle.setManipulator(manipulator);
|
|
44
49
|
} else {
|
|
45
50
|
isDragging = true;
|
|
46
51
|
|
|
@@ -57,9 +62,9 @@ function widgetBehavior(publicAPI, model) {
|
|
|
57
62
|
|
|
58
63
|
|
|
59
64
|
publicAPI.handleMouseMove = function (callData) {
|
|
60
|
-
var _model$activeState$
|
|
65
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
61
66
|
|
|
62
|
-
var manipulator = (_model$activeState$
|
|
67
|
+
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;
|
|
63
68
|
|
|
64
69
|
if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
65
70
|
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
@@ -23,18 +23,24 @@ function widgetBehavior(publicAPI, model) {
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
publicAPI.handleLeftButtonPress = function (e) {
|
|
26
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
27
|
+
|
|
26
28
|
if (!model.activeState || !model.activeState.getActive() || !model.pickable || ignoreKey(e)) {
|
|
27
29
|
return macro.VOID;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
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;
|
|
33
|
+
|
|
34
|
+
if (model.activeState === model.widgetState.getMoveHandle() && model.widgetState.getHandleList().length < MAX_POINTS && manipulator) {
|
|
35
|
+
var worldCoords = manipulator.handleEvent(e, model._apiSpecificRenderWindow); // Commit handle to location
|
|
36
|
+
|
|
32
37
|
var moveHandle = model.widgetState.getMoveHandle();
|
|
38
|
+
moveHandle.setOrigin.apply(moveHandle, _toConsumableArray(worldCoords));
|
|
33
39
|
var newHandle = model.widgetState.addHandle();
|
|
34
40
|
newHandle.setOrigin.apply(newHandle, _toConsumableArray(moveHandle.getOrigin()));
|
|
35
41
|
newHandle.setColor(moveHandle.getColor());
|
|
36
42
|
newHandle.setScale1(moveHandle.getScale1());
|
|
37
|
-
newHandle.setManipulator(
|
|
43
|
+
newHandle.setManipulator(manipulator);
|
|
38
44
|
} else {
|
|
39
45
|
isDragging = true;
|
|
40
46
|
|
|
@@ -51,14 +57,14 @@ function widgetBehavior(publicAPI, model) {
|
|
|
51
57
|
|
|
52
58
|
|
|
53
59
|
publicAPI.handleMouseMove = function (callData) {
|
|
54
|
-
var _model$activeState$
|
|
60
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
55
61
|
|
|
56
62
|
if (model.hasFocus && model.widgetState.getHandleList().length === MAX_POINTS) {
|
|
57
63
|
publicAPI.loseFocus();
|
|
58
64
|
return macro.VOID;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
var manipulator = (_model$activeState$
|
|
67
|
+
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;
|
|
62
68
|
|
|
63
69
|
if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
64
70
|
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
@@ -1,57 +1,58 @@
|
|
|
1
1
|
import vtkStateBuilder from '../../Core/StateBuilder.js';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
builder.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
2
|
+
import { AXES, handleTypeFromName } from './helpers.js';
|
|
3
|
+
|
|
4
|
+
function build() {
|
|
5
|
+
// create our state builder
|
|
6
|
+
var builder = vtkStateBuilder.createBuilder(); // add image data description fields
|
|
7
|
+
|
|
8
|
+
builder.addField({
|
|
9
|
+
name: 'indexToWorldT',
|
|
10
|
+
initialValue: Array(16).fill(0)
|
|
11
|
+
}).addField({
|
|
12
|
+
name: 'worldToIndexT',
|
|
13
|
+
initialValue: Array(16).fill(0)
|
|
14
|
+
}); // make cropping planes a sub-state so we can listen to it
|
|
15
|
+
// separately from the rest of the widget state.
|
|
16
|
+
|
|
17
|
+
var croppingState = vtkStateBuilder.createBuilder().addField({
|
|
18
|
+
name: 'planes',
|
|
19
|
+
// index space
|
|
20
|
+
initialValue: [0, 1, 0, 1, 0, 1]
|
|
21
|
+
}).build(); // add cropping planes state to our primary state
|
|
22
|
+
|
|
23
|
+
builder.addStateFromInstance({
|
|
24
|
+
labels: ['croppingPlanes'],
|
|
25
|
+
name: 'croppingPlanes',
|
|
26
|
+
instance: croppingState
|
|
27
|
+
}); // add all handle states
|
|
28
|
+
// default bounds is [-1, 1] in all dimensions
|
|
29
|
+
|
|
30
|
+
for (var i = -1; i < 2; i++) {
|
|
31
|
+
for (var j = -1; j < 2; j++) {
|
|
32
|
+
for (var k = -1; k < 2; k++) {
|
|
33
|
+
// skip center of box
|
|
34
|
+
if (i !== 0 || j !== 0 || k !== 0) {
|
|
35
|
+
var name = AXES[i + 1] + AXES[j + 1] + AXES[k + 1];
|
|
36
|
+
var type = handleTypeFromName(name); // since handle states are rendered via vtkSphereHandleRepresentation,
|
|
37
|
+
// we can dictate the handle origin, size (scale1), color, and visibility.
|
|
38
|
+
|
|
39
|
+
builder.addStateFromMixin({
|
|
40
|
+
labels: ['handles', name, type],
|
|
41
|
+
mixins: ['name', 'origin', 'color', 'scale1', 'visible', 'manipulator'],
|
|
42
|
+
name: name,
|
|
43
|
+
initialValues: {
|
|
44
|
+
scale1: 10,
|
|
45
|
+
origin: [i, j, k],
|
|
46
|
+
visible: true,
|
|
47
|
+
name: name
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
}
|
|
52
54
|
|
|
53
|
-
var state = (function () {
|
|
54
55
|
return builder.build();
|
|
55
|
-
}
|
|
56
|
+
}
|
|
56
57
|
|
|
57
|
-
export {
|
|
58
|
+
export { build as default };
|
|
@@ -8,7 +8,7 @@ import vtkLineManipulator from '../Manipulators/LineManipulator.js';
|
|
|
8
8
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
9
9
|
import vtkCroppingOutlineRepresentation from '../Representations/CroppingOutlineRepresentation.js';
|
|
10
10
|
import widgetBehavior from './ImageCroppingWidget/behavior.js';
|
|
11
|
-
import
|
|
11
|
+
import build from './ImageCroppingWidget/state.js';
|
|
12
12
|
import { transformVec3, AXES } from './ImageCroppingWidget/helpers.js';
|
|
13
13
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
14
14
|
|
|
@@ -101,7 +101,7 @@ function vtkImageCroppingWidget(publicAPI, model) {
|
|
|
101
101
|
}); // --- Widget Requirement ---------------------------------------------------
|
|
102
102
|
|
|
103
103
|
model.behavior = widgetBehavior;
|
|
104
|
-
model.widgetState =
|
|
104
|
+
model.widgetState = build(); // Given a view type (geometry, slice, volume), return a description
|
|
105
105
|
// of what representations to create and what widget state to pass
|
|
106
106
|
// to the respective representations.
|
|
107
107
|
|
|
@@ -41,13 +41,19 @@ function widgetBehavior(publicAPI, model) {
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
publicAPI.handleLeftButtonPress = function (e) {
|
|
44
|
+
var _model$activeState$ge, _model$activeState, _model$activeState$ge2;
|
|
45
|
+
|
|
44
46
|
if (!model.activeState || !model.activeState.getActive() || !model.pickable || ignoreKey(e)) {
|
|
45
47
|
return macro.VOID;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
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;
|
|
51
|
+
|
|
52
|
+
if (model.activeState === model.widgetState.getMoveHandle() && manipulator) {
|
|
53
|
+
var worldCoords = manipulator.handleEvent(e, model._apiSpecificRenderWindow); // Commit handle to location
|
|
54
|
+
|
|
50
55
|
var moveHandle = model.widgetState.getMoveHandle();
|
|
56
|
+
moveHandle.setOrigin(worldCoords);
|
|
51
57
|
model.widgetState.getText().setOrigin(moveHandle.getOrigin());
|
|
52
58
|
publicAPI.loseFocus();
|
|
53
59
|
} else {
|
|
@@ -93,9 +99,9 @@ function widgetBehavior(publicAPI, model) {
|
|
|
93
99
|
|
|
94
100
|
|
|
95
101
|
publicAPI.handleMouseMove = function (callData) {
|
|
96
|
-
var _model$activeState$
|
|
102
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
97
103
|
|
|
98
|
-
var manipulator = (_model$activeState$
|
|
104
|
+
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;
|
|
99
105
|
|
|
100
106
|
if (manipulator && model.pickable && model.dragable && model.activeState && model.activeState.getActive() && !ignoreKey(callData)) {
|
|
101
107
|
var worldCoords = manipulator.handleEvent(callData, model._apiSpecificRenderWindow);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
1
|
import macro from '../../../macros.js';
|
|
3
2
|
|
|
4
3
|
function widgetBehavior(publicAPI, model) {
|
|
@@ -66,19 +65,22 @@ function widgetBehavior(publicAPI, model) {
|
|
|
66
65
|
|
|
67
66
|
|
|
68
67
|
publicAPI.handleLeftButtonPress = function (e) {
|
|
68
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
69
|
+
|
|
69
70
|
if (!model.activeState || !model.activeState.getActive() || !model.pickable || ignoreKey(e)) {
|
|
70
71
|
return macro.VOID;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
updateMoveHandle(e); // Commit handle to location
|
|
74
|
+
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;
|
|
75
75
|
|
|
76
|
+
if (model.activeState === model.widgetState.getMoveHandle() && manipulator) {
|
|
77
|
+
updateMoveHandle(e);
|
|
76
78
|
var moveHandle = model.widgetState.getMoveHandle();
|
|
77
79
|
var newHandle = model.widgetState.addHandle();
|
|
78
|
-
newHandle.setOrigin
|
|
80
|
+
newHandle.setOrigin(moveHandle.getOrigin());
|
|
79
81
|
newHandle.setColor(moveHandle.getColor());
|
|
80
82
|
newHandle.setScale1(moveHandle.getScale1());
|
|
81
|
-
newHandle.setManipulator(
|
|
83
|
+
newHandle.setManipulator(manipulator);
|
|
82
84
|
} else {
|
|
83
85
|
isDragging = true;
|
|
84
86
|
|
|
@@ -403,15 +403,23 @@ function widgetBehavior(publicAPI, model) {
|
|
|
403
403
|
|
|
404
404
|
|
|
405
405
|
publicAPI.handleLeftButtonPress = function (e) {
|
|
406
|
-
|
|
406
|
+
var _model$activeState$ge3, _model$activeState2, _model$activeState2$g;
|
|
407
|
+
|
|
408
|
+
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;
|
|
409
|
+
|
|
410
|
+
if (!model.activeState || !model.activeState.getActive() || !model.pickable || !manipulator) {
|
|
407
411
|
return macro.VOID;
|
|
408
412
|
}
|
|
409
413
|
|
|
410
414
|
if (model.hasFocus) {
|
|
415
|
+
var worldCoords = manipulator.handleEvent(e, model._apiSpecificRenderWindow);
|
|
416
|
+
|
|
411
417
|
if (!model.point1) {
|
|
418
|
+
model.point1Handle.setOrigin(worldCoords);
|
|
412
419
|
publicAPI.placePoint1(model.point1Handle.getOrigin());
|
|
413
420
|
publicAPI.invokeStartInteractionEvent();
|
|
414
421
|
} else {
|
|
422
|
+
model.point2Handle.setOrigin(worldCoords);
|
|
415
423
|
publicAPI.placePoint2(model.point2Handle.getOrigin());
|
|
416
424
|
publicAPI.invokeInteractionEvent();
|
|
417
425
|
publicAPI.invokeEndInteractionEvent();
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference path="./types.d.ts" />
|
|
2
2
|
/// <reference path="./interfaces.d.ts" />
|
|
3
|
-
/// <reference path="./macros.d.ts" />
|
|
4
|
-
/// <reference path="./vtk.d.ts" />
|
|
5
3
|
/// <reference path="./Common/Core/Base64.d.ts" />
|
|
6
4
|
/// <reference path="./Common/Core/CellArray.d.ts" />
|
|
7
5
|
/// <reference path="./Common/Core/DataArray.d.ts" />
|
|
@@ -26,8 +24,8 @@
|
|
|
26
24
|
/// <reference path="./Common/DataModel/DataSet.d.ts" />
|
|
27
25
|
/// <reference path="./Common/DataModel/DataSetAttributes/FieldData.d.ts" />
|
|
28
26
|
/// <reference path="./Common/DataModel/DataSetAttributes.d.ts" />
|
|
29
|
-
/// <reference path="./Common/DataModel/ImageData.d.ts" />
|
|
30
27
|
/// <reference path="./Common/DataModel/ITKHelper.d.ts" />
|
|
28
|
+
/// <reference path="./Common/DataModel/ImageData.d.ts" />
|
|
31
29
|
/// <reference path="./Common/DataModel/KochanekSpline1D.d.ts" />
|
|
32
30
|
/// <reference path="./Common/DataModel/Line.d.ts" />
|
|
33
31
|
/// <reference path="./Common/DataModel/PiecewiseFunction.d.ts" />
|
|
@@ -35,8 +33,8 @@
|
|
|
35
33
|
/// <reference path="./Common/DataModel/PointSet.d.ts" />
|
|
36
34
|
/// <reference path="./Common/DataModel/PolyData/Constants.d.ts" />
|
|
37
35
|
/// <reference path="./Common/DataModel/PolyData.d.ts" />
|
|
38
|
-
/// <reference path="./Common/DataModel/Polygon.d.ts" />
|
|
39
36
|
/// <reference path="./Common/DataModel/PolyLine.d.ts" />
|
|
37
|
+
/// <reference path="./Common/DataModel/Polygon.d.ts" />
|
|
40
38
|
/// <reference path="./Common/DataModel/SelectionNode.d.ts" />
|
|
41
39
|
/// <reference path="./Common/DataModel/Sphere.d.ts" />
|
|
42
40
|
/// <reference path="./Common/DataModel/Spline1D.d.ts" />
|
|
@@ -66,18 +64,16 @@
|
|
|
66
64
|
/// <reference path="./Filters/Sources/SphereSource.d.ts" />
|
|
67
65
|
/// <reference path="./Filters/Texture/TextureMapToPlane.d.ts" />
|
|
68
66
|
/// <reference path="./Filters/Texture/TextureMapToSphere.d.ts" />
|
|
69
|
-
/// <reference path="./Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts" />
|
|
70
|
-
/// <reference path="./Interaction/Widgets/OrientationMarkerWidget.d.ts" />
|
|
71
67
|
/// <reference path="./IO/Core/DataAccessHelper/HtmlDataAccessHelper.d.ts" />
|
|
72
68
|
/// <reference path="./IO/Core/DataAccessHelper/HttpDataAccessHelper.d.ts" />
|
|
73
|
-
/// <reference path="./IO/Core/DataAccessHelper.d.ts" />
|
|
74
69
|
/// <reference path="./IO/Core/DataAccessHelper/JSZipDataAccessHelper.d.ts" />
|
|
75
70
|
/// <reference path="./IO/Core/DataAccessHelper/LiteHttpDataAccessHelper.d.ts" />
|
|
71
|
+
/// <reference path="./IO/Core/DataAccessHelper.d.ts" />
|
|
76
72
|
/// <reference path="./IO/Core/HttpDataSetReader.d.ts" />
|
|
77
73
|
/// <reference path="./IO/Core/HttpSceneLoader.d.ts" />
|
|
78
74
|
/// <reference path="./IO/Core/ImageStream/DefaultProtocol.d.ts" />
|
|
79
|
-
/// <reference path="./IO/Core/ImageStream.d.ts" />
|
|
80
75
|
/// <reference path="./IO/Core/ImageStream/ViewStream.d.ts" />
|
|
76
|
+
/// <reference path="./IO/Core/ImageStream.d.ts" />
|
|
81
77
|
/// <reference path="./IO/Core/WSLinkClient.d.ts" />
|
|
82
78
|
/// <reference path="./IO/Geometry/DracoReader.d.ts" />
|
|
83
79
|
/// <reference path="./IO/Geometry/PLYReader.d.ts" />
|
|
@@ -95,6 +91,8 @@
|
|
|
95
91
|
/// <reference path="./IO/XML/XMLImageDataReader.d.ts" />
|
|
96
92
|
/// <reference path="./IO/XML/XMLPolyDataReader.d.ts" />
|
|
97
93
|
/// <reference path="./IO/XML/XMLReader.d.ts" />
|
|
94
|
+
/// <reference path="./Interaction/Widgets/OrientationMarkerWidget/Constants.d.ts" />
|
|
95
|
+
/// <reference path="./Interaction/Widgets/OrientationMarkerWidget.d.ts" />
|
|
98
96
|
/// <reference path="./Rendering/Core/AbstractMapper.d.ts" />
|
|
99
97
|
/// <reference path="./Rendering/Core/AbstractMapper3D.d.ts" />
|
|
100
98
|
/// <reference path="./Rendering/Core/AbstractPicker.d.ts" />
|
|
@@ -123,10 +121,10 @@
|
|
|
123
121
|
/// <reference path="./Rendering/Core/Property/Constants.d.ts" />
|
|
124
122
|
/// <reference path="./Rendering/Core/Property.d.ts" />
|
|
125
123
|
/// <reference path="./Rendering/Core/Property2D.d.ts" />
|
|
126
|
-
/// <reference path="./Rendering/Core/Renderer.d.ts" />
|
|
127
124
|
/// <reference path="./Rendering/Core/RenderWindow.d.ts" />
|
|
128
125
|
/// <reference path="./Rendering/Core/RenderWindowInteractor/Constants.d.ts" />
|
|
129
126
|
/// <reference path="./Rendering/Core/RenderWindowInteractor.d.ts" />
|
|
127
|
+
/// <reference path="./Rendering/Core/Renderer.d.ts" />
|
|
130
128
|
/// <reference path="./Rendering/Core/ScalarBarActor.d.ts" />
|
|
131
129
|
/// <reference path="./Rendering/Core/Skybox.d.ts" />
|
|
132
130
|
/// <reference path="./Rendering/Core/SphereMapper.d.ts" />
|
|
@@ -155,4 +153,6 @@
|
|
|
155
153
|
/// <reference path="./Widgets/Representations/ResliceCursorContextRepresentation.d.ts" />
|
|
156
154
|
/// <reference path="./Widgets/Representations/WidgetRepresentation.d.ts" />
|
|
157
155
|
/// <reference path="./Widgets/Widgets3D/SphereWidget.d.ts" />
|
|
156
|
+
/// <reference path="./macros.d.ts" />
|
|
157
|
+
/// <reference path="./vtk.d.ts" />
|
|
158
158
|
/// <reference path="./Common/Core/Math.d.ts" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitware/vtk.js",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.12.1",
|
|
4
4
|
"description": "Visualization Toolkit for the Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -30,84 +30,84 @@
|
|
|
30
30
|
"main": "./index.js",
|
|
31
31
|
"module": "./index.js",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@babel/runtime": "7.
|
|
34
|
-
"commander": "
|
|
33
|
+
"@babel/runtime": "7.17.9",
|
|
34
|
+
"commander": "9.2.0",
|
|
35
35
|
"d3-scale": "4.0.2",
|
|
36
36
|
"gl-matrix": "3.4.3",
|
|
37
|
-
"globalthis": "1.0.
|
|
38
|
-
"jszip": "3.
|
|
37
|
+
"globalthis": "1.0.3",
|
|
38
|
+
"jszip": "3.9.1",
|
|
39
39
|
"pako": "2.0.4",
|
|
40
40
|
"seedrandom": "3.0.5",
|
|
41
41
|
"shader-loader": "1.3.1",
|
|
42
42
|
"shelljs": "0.8.5",
|
|
43
43
|
"spark-md5": "^3.0.2",
|
|
44
44
|
"stream-browserify": "3.0.0",
|
|
45
|
-
"webworker-promise": "0.
|
|
45
|
+
"webworker-promise": "0.5.0",
|
|
46
46
|
"worker-loader": "3.0.8",
|
|
47
47
|
"xmlbuilder2": "3.0.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/core": "7.
|
|
51
|
-
"@babel/eslint-parser": "7.
|
|
52
|
-
"@babel/plugin-transform-runtime": "7.
|
|
53
|
-
"@babel/preset-env": "7.
|
|
54
|
-
"@commitlint/cli": "16.
|
|
55
|
-
"@commitlint/config-conventional": "16.
|
|
56
|
-
"@mapbox/node-pre-gyp": "1.0.
|
|
50
|
+
"@babel/core": "7.17.10",
|
|
51
|
+
"@babel/eslint-parser": "7.17.0",
|
|
52
|
+
"@babel/plugin-transform-runtime": "7.17.10",
|
|
53
|
+
"@babel/preset-env": "7.17.10",
|
|
54
|
+
"@commitlint/cli": "16.2.4",
|
|
55
|
+
"@commitlint/config-conventional": "16.2.4",
|
|
56
|
+
"@mapbox/node-pre-gyp": "1.0.9",
|
|
57
57
|
"@rollup/plugin-alias": "3.1.9",
|
|
58
|
-
"@rollup/plugin-babel": "5.3.
|
|
59
|
-
"@rollup/plugin-commonjs": "21.0
|
|
60
|
-
"@rollup/plugin-eslint": "8.0.
|
|
58
|
+
"@rollup/plugin-babel": "5.3.1",
|
|
59
|
+
"@rollup/plugin-commonjs": "21.1.0",
|
|
60
|
+
"@rollup/plugin-eslint": "8.0.2",
|
|
61
61
|
"@rollup/plugin-json": "4.1.0",
|
|
62
62
|
"@rollup/plugin-node-resolve": "13.1.3",
|
|
63
|
-
"autoprefixer": "10.4.
|
|
64
|
-
"babel-loader": "8.2.
|
|
63
|
+
"autoprefixer": "10.4.7",
|
|
64
|
+
"babel-loader": "8.2.5",
|
|
65
65
|
"babel-plugin-istanbul": "6.1.1",
|
|
66
66
|
"buffer": "6.0.3",
|
|
67
67
|
"commitizen": "4.2.4",
|
|
68
|
-
"concurrently": "7.
|
|
69
|
-
"copy-webpack-plugin": "10.2.
|
|
68
|
+
"concurrently": "7.1.0",
|
|
69
|
+
"copy-webpack-plugin": "10.2.4",
|
|
70
70
|
"cross-env": "7.0.3",
|
|
71
|
-
"css-loader": "6.
|
|
72
|
-
"dotenv": "
|
|
73
|
-
"dox": "0.9.
|
|
74
|
-
"eslint": "8.
|
|
71
|
+
"css-loader": "6.7.1",
|
|
72
|
+
"dotenv": "16.0.1",
|
|
73
|
+
"dox": "0.9.1",
|
|
74
|
+
"eslint": "8.15.0",
|
|
75
75
|
"eslint-config-airbnb": "19.0.4",
|
|
76
|
-
"eslint-config-prettier": "8.
|
|
76
|
+
"eslint-config-prettier": "8.5.0",
|
|
77
77
|
"eslint-import-resolver-webpack": "0.13.2",
|
|
78
|
-
"eslint-plugin-import": "2.
|
|
78
|
+
"eslint-plugin-import": "2.26.0",
|
|
79
79
|
"eslint-plugin-jsx-a11y": "6.5.1",
|
|
80
80
|
"eslint-plugin-prettier": "4.0.0",
|
|
81
81
|
"eslint-webpack-plugin": "3.1.1",
|
|
82
82
|
"expose-loader": "3.1.0",
|
|
83
|
-
"glob": "
|
|
83
|
+
"glob": "8.0.3",
|
|
84
84
|
"handlebars": "4.7.7",
|
|
85
85
|
"hson-loader": "2.0.0",
|
|
86
86
|
"html-loader": "3.1.0",
|
|
87
87
|
"html-webpack-plugin": "5.5.0",
|
|
88
|
-
"husky": "
|
|
88
|
+
"husky": "8.0.1",
|
|
89
89
|
"ignore-loader": "0.1.2",
|
|
90
|
-
"karma": "6.3.
|
|
91
|
-
"karma-chrome-launcher": "3.1.
|
|
92
|
-
"karma-coverage": "2.
|
|
90
|
+
"karma": "6.3.20",
|
|
91
|
+
"karma-chrome-launcher": "3.1.1",
|
|
92
|
+
"karma-coverage": "2.2.0",
|
|
93
93
|
"karma-firefox-launcher": "2.1.2",
|
|
94
94
|
"karma-junit-reporter": "2.0.1",
|
|
95
95
|
"karma-webpack": "5.0.0",
|
|
96
96
|
"kw-doc": "3.1.2",
|
|
97
97
|
"lodash": "4.17.21",
|
|
98
|
-
"magic-string": "0.
|
|
99
|
-
"moment": "2.29.
|
|
98
|
+
"magic-string": "0.26.2",
|
|
99
|
+
"moment": "2.29.3",
|
|
100
100
|
"patch-package": "6.4.7",
|
|
101
|
-
"pixelmatch": "5.
|
|
101
|
+
"pixelmatch": "5.3.0",
|
|
102
102
|
"postcss-loader": "6.2.1",
|
|
103
|
-
"prettier": "2.
|
|
103
|
+
"prettier": "2.6.2",
|
|
104
104
|
"process": "0.11.10",
|
|
105
105
|
"regenerator-runtime": "0.13.9",
|
|
106
|
-
"rollup": "2.
|
|
106
|
+
"rollup": "2.73.0",
|
|
107
107
|
"rollup-plugin-auto-external": "2.0.0",
|
|
108
108
|
"rollup-plugin-copy": "3.4.0",
|
|
109
109
|
"rollup-plugin-ignore": "1.0.10",
|
|
110
|
-
"rollup-plugin-polyfill-node": "0.
|
|
110
|
+
"rollup-plugin-polyfill-node": "0.9.0",
|
|
111
111
|
"rollup-plugin-postcss": "4.0.2",
|
|
112
112
|
"rollup-plugin-string": "3.0.0",
|
|
113
113
|
"rollup-plugin-svgo": "1.1.0",
|
|
@@ -115,16 +115,16 @@
|
|
|
115
115
|
"semantic-release": "19.0.2",
|
|
116
116
|
"string-replace-loader": "3.1.0",
|
|
117
117
|
"style-loader": "3.3.1",
|
|
118
|
-
"tape": "5.
|
|
118
|
+
"tape": "5.5.3",
|
|
119
119
|
"tape-catch": "1.0.6",
|
|
120
|
-
"webpack": "5.
|
|
120
|
+
"webpack": "5.72.1",
|
|
121
121
|
"webpack-bundle-analyzer": "4.5.0",
|
|
122
|
-
"webpack-cli": "4.9.
|
|
123
|
-
"webpack-dashboard": "3.3.
|
|
124
|
-
"webpack-dev-server": "4.
|
|
122
|
+
"webpack-cli": "4.9.2",
|
|
123
|
+
"webpack-dashboard": "3.3.7",
|
|
124
|
+
"webpack-dev-server": "4.9.0",
|
|
125
125
|
"webpack-merge": "5.8.0",
|
|
126
126
|
"webpack-notifier": "1.15.0",
|
|
127
|
-
"wslink": "1.
|
|
127
|
+
"wslink": "1.6.4",
|
|
128
128
|
"xml2js": "0.4.23"
|
|
129
129
|
},
|
|
130
130
|
"peerDependencies": {
|