@kitware/vtk.js 21.1.3 → 21.2.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/Transform/LandmarkTransform.d.ts +1 -1
- package/Filters/General/ImageCropFilter.js +3 -4
- package/Filters/Sources/Arrow2DSource.d.ts +14 -13
- package/Filters/Sources/ArrowSource.d.ts +9 -8
- package/Filters/Sources/CircleSource.d.ts +15 -14
- package/Filters/Sources/ConeSource.d.ts +18 -17
- package/Filters/Sources/CubeSource.d.ts +19 -19
- package/Filters/Sources/Cursor3D.d.ts +19 -16
- package/Filters/Sources/CylinderSource.d.ts +15 -14
- package/Filters/Sources/LineSource.d.ts +1 -1
- package/Filters/Sources/PlaneSource.d.ts +29 -28
- package/Filters/Sources/PointSource.d.ts +9 -8
- package/Filters/Sources/SphereSource.d.ts +9 -8
- package/IO/Core/ImageStream/DefaultProtocol.d.ts +25 -0
- package/IO/Core/ImageStream/ViewStream.d.ts +256 -0
- package/IO/Core/WSLinkClient.d.ts +29 -6
- package/Interaction/Manipulators/MouseBoxSelectorManipulator.js +7 -3
- package/Rendering/Core/AbstractMapper.js +1 -0
- package/Rendering/Core/Light.d.ts +277 -234
- package/Rendering/Core/Property.d.ts +43 -43
- package/Rendering/Core/Property2D.d.ts +21 -5
- package/Rendering/Core/RenderWindowInteractor.js +7 -7
- package/Rendering/Core/Volume.d.ts +9 -0
- package/Rendering/Misc/RemoteView.d.ts +199 -0
- package/Rendering/OpenGL/ImageMapper.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +5 -17
- package/Rendering/OpenGL/RenderWindow.js +190 -106
- package/Rendering/OpenGL/ShaderProgram.js +0 -12
- package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js +17 -0
- package/_virtual/rollup-plugin-web-worker-loader__helper__funcToSource.js +18 -0
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Filters/General/PaintFilter/PaintFilter.worker.js +698 -2
- package/_virtual/rollup-plugin-worker-loader__module_Sources/Interaction/Widgets/PiecewiseGaussianWidget/ComputeHistogram.worker.js +274 -2
- package/interfaces.d.ts +66 -24
- package/package.json +2 -2
- package/types.d.ts +4 -1
- package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js +0 -31
|
@@ -1,6 +1,278 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as createInlineWorkerFactory } from '../../../../rollup-plugin-web-worker-loader__helper__browser__createInlineWorkerFactory.js';
|
|
2
2
|
|
|
3
|
-
var WorkerFactory =
|
|
3
|
+
var WorkerFactory = createInlineWorkerFactory(/* rollup-plugin-web-worker-loader */function () {
|
|
4
|
+
(function () {
|
|
5
|
+
'__worker_loader_strict__';
|
|
6
|
+
|
|
7
|
+
var register = {exports: {}};
|
|
8
|
+
|
|
9
|
+
var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
+
|
|
11
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
|
|
13
|
+
var TinyEmitter$1 = function () {
|
|
14
|
+
function TinyEmitter() {
|
|
15
|
+
_classCallCheck$1(this, TinyEmitter);
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(this, '__listeners', {
|
|
18
|
+
value: {},
|
|
19
|
+
enumerable: false,
|
|
20
|
+
writable: false
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_createClass$1(TinyEmitter, [{
|
|
25
|
+
key: 'emit',
|
|
26
|
+
value: function emit(eventName) {
|
|
27
|
+
if (!this.__listeners[eventName]) return this;
|
|
28
|
+
|
|
29
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
30
|
+
args[_key - 1] = arguments[_key];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var _iteratorNormalCompletion = true;
|
|
34
|
+
var _didIteratorError = false;
|
|
35
|
+
var _iteratorError = undefined;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
for (var _iterator = this.__listeners[eventName][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
39
|
+
var handler = _step.value;
|
|
40
|
+
|
|
41
|
+
handler.apply(undefined, args);
|
|
42
|
+
}
|
|
43
|
+
} catch (err) {
|
|
44
|
+
_didIteratorError = true;
|
|
45
|
+
_iteratorError = err;
|
|
46
|
+
} finally {
|
|
47
|
+
try {
|
|
48
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
49
|
+
_iterator.return();
|
|
50
|
+
}
|
|
51
|
+
} finally {
|
|
52
|
+
if (_didIteratorError) {
|
|
53
|
+
throw _iteratorError;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: 'once',
|
|
62
|
+
value: function once(eventName, handler) {
|
|
63
|
+
var _this = this;
|
|
64
|
+
|
|
65
|
+
var once = function once() {
|
|
66
|
+
_this.off(eventName, once);
|
|
67
|
+
handler.apply(undefined, arguments);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return this.on(eventName, once);
|
|
71
|
+
}
|
|
72
|
+
}, {
|
|
73
|
+
key: 'on',
|
|
74
|
+
value: function on(eventName, handler) {
|
|
75
|
+
if (!this.__listeners[eventName]) this.__listeners[eventName] = [];
|
|
76
|
+
|
|
77
|
+
this.__listeners[eventName].push(handler);
|
|
78
|
+
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: 'off',
|
|
83
|
+
value: function off(eventName, handler) {
|
|
84
|
+
if (handler) this.__listeners[eventName] = this.__listeners[eventName].filter(function (h) {
|
|
85
|
+
return h !== handler;
|
|
86
|
+
});else this.__listeners[eventName] = [];
|
|
87
|
+
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
}]);
|
|
91
|
+
|
|
92
|
+
return TinyEmitter;
|
|
93
|
+
}();
|
|
94
|
+
|
|
95
|
+
var tinyEmitter = TinyEmitter$1;
|
|
96
|
+
|
|
97
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
98
|
+
|
|
99
|
+
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
|
100
|
+
|
|
101
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
102
|
+
|
|
103
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
104
|
+
|
|
105
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
106
|
+
|
|
107
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
108
|
+
|
|
109
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
110
|
+
|
|
111
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
112
|
+
|
|
113
|
+
var TinyEmitter = tinyEmitter;
|
|
114
|
+
|
|
115
|
+
var MESSAGE_RESULT = 0;
|
|
116
|
+
var MESSAGE_EVENT = 1;
|
|
117
|
+
|
|
118
|
+
var RESULT_ERROR = 0;
|
|
119
|
+
var RESULT_SUCCESS = 1;
|
|
120
|
+
|
|
121
|
+
var DEFAULT_HANDLER = 'main';
|
|
122
|
+
|
|
123
|
+
var isPromise = function isPromise(o) {
|
|
124
|
+
return (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object' && o !== null && typeof o.then === 'function' && typeof o.catch === 'function';
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
function RegisterPromise(fn) {
|
|
128
|
+
var handlers = _defineProperty({}, DEFAULT_HANDLER, fn);
|
|
129
|
+
var sendPostMessage = self.postMessage.bind(self);
|
|
130
|
+
|
|
131
|
+
var server = new (function (_TinyEmitter) {
|
|
132
|
+
_inherits(WorkerRegister, _TinyEmitter);
|
|
133
|
+
|
|
134
|
+
function WorkerRegister() {
|
|
135
|
+
_classCallCheck(this, WorkerRegister);
|
|
136
|
+
|
|
137
|
+
return _possibleConstructorReturn(this, (WorkerRegister.__proto__ || Object.getPrototypeOf(WorkerRegister)).apply(this, arguments));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_createClass(WorkerRegister, [{
|
|
141
|
+
key: 'emit',
|
|
142
|
+
value: function emit(eventName) {
|
|
143
|
+
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
144
|
+
args[_key - 1] = arguments[_key];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (args.length == 1 && args[0] instanceof TransferableResponse) {
|
|
148
|
+
sendPostMessage({ eventName: eventName, args: args }, args[0].transferable);
|
|
149
|
+
} else {
|
|
150
|
+
sendPostMessage({ eventName: eventName, args: args });
|
|
151
|
+
}
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: 'emitLocally',
|
|
156
|
+
value: function emitLocally(eventName) {
|
|
157
|
+
var _get2;
|
|
158
|
+
|
|
159
|
+
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
160
|
+
args[_key2 - 1] = arguments[_key2];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
(_get2 = _get(WorkerRegister.prototype.__proto__ || Object.getPrototypeOf(WorkerRegister.prototype), 'emit', this)).call.apply(_get2, [this, eventName].concat(args));
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: 'operation',
|
|
167
|
+
value: function operation(name, handler) {
|
|
168
|
+
handlers[name] = handler;
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
}]);
|
|
172
|
+
|
|
173
|
+
return WorkerRegister;
|
|
174
|
+
}(TinyEmitter))();
|
|
175
|
+
|
|
176
|
+
var run = function run(messageId, payload, handlerName) {
|
|
177
|
+
|
|
178
|
+
var onSuccess = function onSuccess(result) {
|
|
179
|
+
if (result && result instanceof TransferableResponse) {
|
|
180
|
+
sendResult(messageId, RESULT_SUCCESS, result.payload, result.transferable);
|
|
181
|
+
} else {
|
|
182
|
+
sendResult(messageId, RESULT_SUCCESS, result);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
var onError = function onError(e) {
|
|
187
|
+
sendResult(messageId, RESULT_ERROR, {
|
|
188
|
+
message: e.message,
|
|
189
|
+
stack: e.stack
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
var result = runFn(messageId, payload, handlerName);
|
|
195
|
+
if (isPromise(result)) {
|
|
196
|
+
result.then(onSuccess).catch(onError);
|
|
197
|
+
} else {
|
|
198
|
+
onSuccess(result);
|
|
199
|
+
}
|
|
200
|
+
} catch (e) {
|
|
201
|
+
onError(e);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
var runFn = function runFn(messageId, payload, handlerName) {
|
|
206
|
+
var handler = handlers[handlerName || DEFAULT_HANDLER];
|
|
207
|
+
if (!handler) throw new Error('Not found handler for this request');
|
|
208
|
+
|
|
209
|
+
return handler(payload, sendEvent.bind(null, messageId));
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
var sendResult = function sendResult(messageId, success, payload) {
|
|
213
|
+
var transferable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
214
|
+
|
|
215
|
+
sendPostMessage([MESSAGE_RESULT, messageId, success, payload], transferable);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
var sendEvent = function sendEvent(messageId, eventName, payload) {
|
|
219
|
+
if (!eventName) throw new Error('eventName is required');
|
|
220
|
+
|
|
221
|
+
if (typeof eventName !== 'string') throw new Error('eventName should be string');
|
|
222
|
+
|
|
223
|
+
sendPostMessage([MESSAGE_EVENT, messageId, eventName, payload]);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
self.addEventListener('message', function (_ref) {
|
|
227
|
+
var data = _ref.data;
|
|
228
|
+
|
|
229
|
+
if (Array.isArray(data)) {
|
|
230
|
+
run.apply(undefined, _toConsumableArray(data));
|
|
231
|
+
} else if (data && data.eventName) {
|
|
232
|
+
server.emitLocally.apply(server, [data.eventName].concat(_toConsumableArray(data.args)));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
return server;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
var TransferableResponse = function TransferableResponse(payload, transferable) {
|
|
240
|
+
_classCallCheck(this, TransferableResponse);
|
|
241
|
+
|
|
242
|
+
this.payload = payload;
|
|
243
|
+
this.transferable = transferable;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
register.exports = RegisterPromise;
|
|
247
|
+
register.exports.TransferableResponse = TransferableResponse;
|
|
248
|
+
|
|
249
|
+
var registerWebworker = register.exports;
|
|
250
|
+
|
|
251
|
+
/* eslint-disable */
|
|
252
|
+
// prettier-ignore
|
|
253
|
+
|
|
254
|
+
registerWebworker(function (message, emit) {
|
|
255
|
+
var array = message.array;
|
|
256
|
+
var min = message.min;
|
|
257
|
+
var max = message.max;
|
|
258
|
+
var offset = message.component || 0;
|
|
259
|
+
var step = message.numberOfComponents || 1;
|
|
260
|
+
var numberOfBins = message.numberOfBins;
|
|
261
|
+
var delta = max - min;
|
|
262
|
+
var histogram = new Float32Array(numberOfBins);
|
|
263
|
+
histogram.fill(0);
|
|
264
|
+
var len = array.length;
|
|
265
|
+
|
|
266
|
+
for (var i = offset; i < len; i += step) {
|
|
267
|
+
var idx = Math.floor((numberOfBins - 1) * (Number(array[i]) - min) / delta);
|
|
268
|
+
histogram[idx] += 1;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return Promise.resolve(new registerWebworker.TransferableResponse(histogram, [histogram.buffer]));
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
}());
|
|
275
|
+
}, null);
|
|
4
276
|
/* eslint-enable */
|
|
5
277
|
|
|
6
278
|
export { WorkerFactory as W };
|
package/interfaces.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
2
|
+
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
3
|
+
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
2
4
|
import { vtkPipelineConnection } from '@kitware/vtk.js/types';
|
|
3
5
|
|
|
4
6
|
/**
|
|
@@ -32,48 +34,88 @@ export interface vtkOutputPort {
|
|
|
32
34
|
* vtkAlgorithm API
|
|
33
35
|
*/
|
|
34
36
|
export interface vtkAlgorithm {
|
|
37
|
+
|
|
35
38
|
/**
|
|
36
|
-
*
|
|
37
|
-
* @param
|
|
39
|
+
* Assign a data object as input.
|
|
40
|
+
* @param {vtkPolyData} dataset
|
|
41
|
+
* @param {Number} [port] The port number (default 0).
|
|
38
42
|
*/
|
|
39
|
-
setInputData(dataset:
|
|
43
|
+
setInputData(dataset: vtkPolyData, port?: number): void;
|
|
44
|
+
|
|
40
45
|
/**
|
|
41
|
-
* @param port (default 0)
|
|
46
|
+
* @param {Number} [port] The port number (default 0).
|
|
42
47
|
*/
|
|
43
48
|
getInputData(port?: number): any;
|
|
49
|
+
|
|
44
50
|
/**
|
|
45
51
|
* @param outputPort
|
|
46
|
-
* @param port (default 0)
|
|
52
|
+
* @param {Number} [port] The port number (default 0).
|
|
47
53
|
*/
|
|
48
54
|
setInputConnection(outputPort: vtkPipelineConnection, port?: number): void;
|
|
55
|
+
|
|
49
56
|
/**
|
|
50
|
-
* @param port (default 0)
|
|
57
|
+
* @param {Number} [port] The port number (default 0).
|
|
51
58
|
*/
|
|
52
59
|
getInputConnection(port?: number): vtkPipelineConnection;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Add a connection to the given input port index.
|
|
63
|
+
* @param {vtkPipelineConnection} outputPort
|
|
64
|
+
*/
|
|
53
65
|
addInputConnection(outputPort: vtkPipelineConnection): void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @param dataset
|
|
70
|
+
*/
|
|
54
71
|
addInputData(dataset: any): void;
|
|
72
|
+
|
|
55
73
|
/**
|
|
56
|
-
*
|
|
74
|
+
* Get the data object that will contain the algorithm output for the given
|
|
75
|
+
* port.
|
|
76
|
+
* @param {Number} [port] The port number (default 0).
|
|
77
|
+
*/
|
|
78
|
+
getOutputData(port?: number): vtkImageData | vtkPolyData;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
57
82
|
*/
|
|
58
|
-
getOutputData(port?: number): any;
|
|
59
83
|
shouldUpdate(): boolean;
|
|
84
|
+
|
|
60
85
|
/**
|
|
61
|
-
*
|
|
86
|
+
* Get a proxy object corresponding to the given output port of this
|
|
87
|
+
* algorithm.
|
|
88
|
+
* @param {Number} [port] The port number (default 0).
|
|
62
89
|
*/
|
|
63
90
|
getOutputPort(port?: number): vtkPipelineConnection;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Bring this algorithm's outputs up-to-date.
|
|
94
|
+
*/
|
|
64
95
|
update(): void;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get the number of input ports used by the algorithm.
|
|
99
|
+
*/
|
|
65
100
|
getNumberOfInputPorts(): number;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Get the number of output ports provided by the algorithm.
|
|
104
|
+
*/
|
|
66
105
|
getNumberOfOutputPorts(): number;
|
|
106
|
+
|
|
67
107
|
/**
|
|
68
|
-
*
|
|
108
|
+
* Get the actual data array for the input array sepcified by idx.
|
|
109
|
+
* @param {Number} port (default 0)
|
|
69
110
|
*/
|
|
70
111
|
getInputArrayToProcess(inputPort?: number): vtkDataArray;
|
|
112
|
+
|
|
71
113
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @param inputPort
|
|
74
|
-
* @param arrayName
|
|
75
|
-
* @param fieldAssociation
|
|
76
|
-
* @param attributeType (default 'Scalars')
|
|
114
|
+
* Set the input data arrays that this algorithm will process.
|
|
115
|
+
* @param {Number} inputPort The port number.
|
|
116
|
+
* @param {String} arrayName The name of the array.
|
|
117
|
+
* @param {String} fieldAssociation The name of the association field.
|
|
118
|
+
* @param {String} attributeType (default 'Scalars')
|
|
77
119
|
*/
|
|
78
120
|
setInputArrayToProcess(
|
|
79
121
|
inputPort: number,
|
|
@@ -87,9 +129,9 @@ export interface vtkAlgorithm {
|
|
|
87
129
|
* Base vtkClass which provides MTime tracking and class infrastructure
|
|
88
130
|
*/
|
|
89
131
|
export interface vtkObject {
|
|
132
|
+
|
|
90
133
|
/**
|
|
91
134
|
* Allow to check if that object was deleted (.delete() was called before).
|
|
92
|
-
*
|
|
93
135
|
* @returns true if delete() was previously called
|
|
94
136
|
*/
|
|
95
137
|
isDeleted(): boolean;
|
|
@@ -137,14 +179,14 @@ export interface vtkObject {
|
|
|
137
179
|
* Generic method to set many fields at one.
|
|
138
180
|
*
|
|
139
181
|
* For example calling the following function
|
|
140
|
-
* ```
|
|
182
|
+
* ```js
|
|
141
183
|
* changeDetected = sphereSourceInstance.set({
|
|
142
184
|
* phiResolution: 10,
|
|
143
185
|
* thetaResolution: 20,
|
|
144
186
|
* });
|
|
145
187
|
* ```
|
|
146
188
|
* will be equivalent of calling
|
|
147
|
-
* ```
|
|
189
|
+
* ```js
|
|
148
190
|
* changeDetected += sphereSourceInstance.setPhiResolution(10);
|
|
149
191
|
* changeDetected += sphereSourceInstance.setThetaResolution(20);
|
|
150
192
|
* changeDetected = !!changeDetected;
|
|
@@ -157,9 +199,9 @@ export interface vtkObject {
|
|
|
157
199
|
* If `noFunction` is set to true, the field will be set directly on the model
|
|
158
200
|
* without calling the `set${FieldName}()` method.
|
|
159
201
|
*
|
|
160
|
-
* @param map (default: {}) Object capturing the set of fieldNames and associated values to set.
|
|
161
|
-
* @param noWarning (default: false) Boolean to disable any warning.
|
|
162
|
-
* @param noFunctions (default: false) Boolean to skip any function execution and rely on only setting the fields on the model.
|
|
202
|
+
* @param [map] (default: {}) Object capturing the set of fieldNames and associated values to set.
|
|
203
|
+
* @param [noWarning] (default: false) Boolean to disable any warning.
|
|
204
|
+
* @param [noFunctions] (default: false) Boolean to skip any function execution and rely on only setting the fields on the model.
|
|
163
205
|
* @return true if a change was actually performed. False otherwise when the value provided were equal to the ones already set inside the instance.
|
|
164
206
|
*/
|
|
165
207
|
set(map?: object, noWarning?: boolean, noFunction?: boolean): boolean;
|
|
@@ -215,15 +257,15 @@ export interface vtkObject {
|
|
|
215
257
|
/**
|
|
216
258
|
* Try to copy the state of the other to ourselves by just using references.
|
|
217
259
|
*
|
|
218
|
-
* @param other instance to copy the reference from
|
|
219
|
-
* @param debug (default: false) if true feedback will be provided when mismatch happen
|
|
260
|
+
* @param {vtkObject} other instance to copy the reference from
|
|
261
|
+
* @param {Boolean} [debug] (default: false) if true feedback will be provided when mismatch happen
|
|
220
262
|
*/
|
|
221
263
|
shallowCopy(other: vtkObject, debug?: boolean): void;
|
|
222
264
|
}
|
|
223
265
|
|
|
224
266
|
export interface vtkProperty {
|
|
225
267
|
name: string;
|
|
226
|
-
children?:
|
|
268
|
+
children?: vtkProperty[];
|
|
227
269
|
}
|
|
228
270
|
|
|
229
271
|
export interface vtkPropertyDomain {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitware/vtk.js",
|
|
3
|
-
"version": "21.1
|
|
3
|
+
"version": "21.2.1",
|
|
4
4
|
"description": "Visualization Toolkit for the Web",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"xml2js": "0.4.23"
|
|
132
132
|
},
|
|
133
133
|
"peerDependencies": {
|
|
134
|
-
"wslink": "1.0
|
|
134
|
+
"wslink": "^1.1.0"
|
|
135
135
|
},
|
|
136
136
|
"scripts": {
|
|
137
137
|
"validate": "prettier --config ./prettier.config.js --list-different \"Sources/**/*.js\" \"Examples/**/*.js\"",
|
package/types.d.ts
CHANGED
|
@@ -17,9 +17,12 @@ declare type Extent = [number, number, number, number, number, number];
|
|
|
17
17
|
declare type Placement = 'top' | 'left' | 'right' | 'bottom';
|
|
18
18
|
declare type Size = [number, number];
|
|
19
19
|
declare type Range = [number, number];
|
|
20
|
-
declare type Point = [number, number, number];
|
|
21
20
|
declare type Vector2 = [number, number];
|
|
22
21
|
declare type Vector3 = [number, number, number];
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated The `Point` type is depracted, please use `Vector3` instead.
|
|
24
|
+
*/
|
|
25
|
+
declare type Point = Vector3;
|
|
23
26
|
declare type HSLColor = [number, number, number];
|
|
24
27
|
declare type HSVColor = [number, number, number];
|
|
25
28
|
declare type RGBColor = [number, number, number];
|
package/_virtual/rollup-plugin-web-worker-loader__helper__browser__createBase64WorkerFactory.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
function decodeBase64(base64, enableUnicode) {
|
|
2
|
-
var binaryString = atob(base64);
|
|
3
|
-
if (enableUnicode) {
|
|
4
|
-
var binaryView = new Uint8Array(binaryString.length);
|
|
5
|
-
for (var i = 0, n = binaryString.length; i < n; ++i) {
|
|
6
|
-
binaryView[i] = binaryString.charCodeAt(i);
|
|
7
|
-
}
|
|
8
|
-
return String.fromCharCode.apply(null, new Uint16Array(binaryView.buffer));
|
|
9
|
-
}
|
|
10
|
-
return binaryString;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function createURL(base64, sourcemapArg, enableUnicodeArg) {
|
|
14
|
-
var sourcemap = sourcemapArg === undefined ? null : sourcemapArg;
|
|
15
|
-
var enableUnicode = enableUnicodeArg === undefined ? false : enableUnicodeArg;
|
|
16
|
-
var source = decodeBase64(base64, enableUnicode);
|
|
17
|
-
var start = source.indexOf('\n', 10) + 1;
|
|
18
|
-
var body = source.substring(start) + (sourcemap ? '\/\/# sourceMappingURL=' + sourcemap : '');
|
|
19
|
-
var blob = new Blob([body], { type: 'application/javascript' });
|
|
20
|
-
return URL.createObjectURL(blob);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function createBase64WorkerFactory(base64, sourcemapArg, enableUnicodeArg) {
|
|
24
|
-
var url;
|
|
25
|
-
return function WorkerFactory(options) {
|
|
26
|
-
url = url || createURL(base64, sourcemapArg, enableUnicodeArg);
|
|
27
|
-
return new Worker(url, options);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { createBase64WorkerFactory as c };
|