@ohif/app 3.13.0-beta.87 → 3.13.0-beta.89
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/dist/{5491.bundle.4866d2ecb20dd089e071.js → 1124.bundle.3c1b947a1884362c1241.js} +376 -222
- package/dist/1429.bundle.bd1585628440399e6c3f.js +2079 -0
- package/dist/{2108.bundle.142ee8d405727d02b16a.js → 1704.bundle.38d95b81b9e1293e04de.js} +1 -643
- package/dist/{7537.bundle.3c7d71348190ed4e9565.js → 1741.bundle.abc3a09729ada4c25685.js} +105024 -55129
- package/dist/{1927.bundle.be67b3aafe238ca9f191.js → 1927.bundle.1749aa6ae7b1dd3d06b1.js} +1 -1
- package/dist/{2516.bundle.f62228e9a800de8d4b31.js → 2516.bundle.28427294c53e067811ca.js} +2 -2
- package/dist/{6354.bundle.929febcf6d326e582e00.js → 2802.bundle.3d6cc53ef3c69901431d.js} +31 -324
- package/dist/{3461.bundle.bb85e473a5de0d8a5fcd.js → 3461.bundle.2f3e998096ef3fca602b.js} +5 -4
- package/dist/{3617.bundle.502defead09bde277a49.js → 3617.bundle.f7f53b332f72e9fe6374.js} +2 -2
- package/dist/{3754.bundle.477cfd7fc3ff13e9dc67.js → 3754.bundle.2a46971b209140d4cb08.js} +12 -6
- package/dist/{9039.bundle.49ab126163ca208e52b3.js → 4335.bundle.69a7cc007e85f043488e.js} +4114 -4263
- package/dist/{4579.bundle.1c315389368cc476aed3.js → 451.bundle.6634a9dae2b4f0e9ebc9.js} +83 -30
- package/dist/{5028.bundle.7ad439186bb8b60b0536.js → 5028.bundle.f483671d94ded4c8f6f3.js} +2 -2
- package/dist/{5830.bundle.791019deddd536980a11.js → 5830.bundle.8327ccd3c8a6334ac315.js} +2 -2
- package/dist/{5858.bundle.466e58128de344ab53f3.js → 5858.bundle.c25c73ecbc47b1a69cea.js} +0 -4
- package/dist/{7190.bundle.479332d662ffe08d1f92.js → 6125.bundle.4e46ecd271f647cb977f.js} +2476 -4044
- package/dist/{6376.bundle.527820a5cb1eece2a8d2.js → 6376.bundle.c7c515ba478be810e03d.js} +8 -5
- package/dist/{9567.bundle.ff782480a4c66e306027.js → 650.bundle.5decc3ce72a22162b8f4.js} +3080 -216
- package/dist/{7166.bundle.557612f8ac4507000ee3.js → 7166.bundle.eeeda537770d73736e46.js} +161 -55
- package/dist/{6386.bundle.dc7e3b159d6b4733647f.js → 741.bundle.e47adc12429ee838d3fb.js} +3408 -3722
- package/dist/{7431.bundle.a9b4dbf97a8c196efe51.js → 7431.bundle.c3bd9a9f1ea743c81335.js} +61 -60
- package/dist/{8305.bundle.b6d3a2931f0edcc6652d.js → 8305.bundle.71787ad9e3df5d1dd30d.js} +2 -2
- package/dist/{8558.bundle.52ae379622062062207e.js → 8558.bundle.00d5dbdf73ca0a44831a.js} +1 -1
- package/dist/{8583.bundle.2debff754409dca6d074.js → 8583.bundle.40859ef5654559a1c66b.js} +3 -3
- package/dist/{9205.bundle.c974537f15d86687f6d2.js → 9205.bundle.d43cd617e38109746e4d.js} +2257 -2133
- package/dist/{4287.bundle.4f28e48c1e39a46dfc87.js → 9400.bundle.a56bfccf2bf7a51ed297.js} +1362 -692
- package/dist/{2075.bundle.ba9ac60662f1fa739378.js → 9475.bundle.693fe4de0573042a17f3.js} +203 -156
- package/dist/{app.bundle.50519318a7e0e4d2f0b1.js → app.bundle.93ee83d5e283aa1496da.js} +81239 -52123
- package/dist/{compute.bundle.2b82d8a0d1f3b41df1d2.js → compute.bundle.2fc1182cc9b2af5f4a40.js} +3 -15
- package/dist/{histogram-worker.bundle.a2a50c4674d99c619ca7.js → histogram-worker.bundle.c81373ef983363586dc5.js} +4 -4
- package/dist/index.html +1 -1
- package/dist/{interpolation.bundle.829844ff3f72f5645f29.js → interpolation.bundle.a31edd1d26d81ef65b9b.js} +6 -6
- package/dist/{polySeg.bundle.ad2080f28d2c471bf208.js → polySeg.bundle.294012e3a5458cd3fecc.js} +3 -15
- package/dist/sw.js +1 -1
- package/package.json +21 -21
- /package/dist/{1459.bundle.39220d7120bd7df8dd23.js → 1459.bundle.763540bccf93fda17fff.js} +0 -0
- /package/dist/{1933.bundle.33d48af9ebcc4d7649c5.js → 1933.bundle.8d54b74d93a7354925c5.js} +0 -0
- /package/dist/{2018.bundle.24c380747f172d7143ae.js → 2018.bundle.7ba8f9afeb48defb425b.js} +0 -0
- /package/dist/{213.bundle.e9ea6c402317dc346091.js → 213.bundle.1a54c6878a493c5b61c5.js} +0 -0
- /package/dist/{2424.bundle.f926b3128bb41763b849.js → 2424.bundle.c6d74f7129108d885a1b.js} +0 -0
- /package/dist/{3138.bundle.133e4884969b006957f1.js → 3138.bundle.3845b7e06b8ab2564951.js} +0 -0
- /package/dist/{4507.bundle.4d7e7016f2f64adfb1ae.js → 4507.bundle.b658ff59d35614916a2b.js} +0 -0
- /package/dist/{4819.bundle.4e047ba806033d9bba23.js → 4819.bundle.e28f5f1f0d481e190bb1.js} +0 -0
- /package/dist/{5015.bundle.c96918ea054c4b2b4200.js → 5015.bundle.455552a6df9b442b3c40.js} +0 -0
- /package/dist/{5457.bundle.482ba0f5ce9ff033e2fb.js → 5457.bundle.ee1026db729958b36a2e.js} +0 -0
- /package/dist/{5485.bundle.b9c59ca9409c3e907524.js → 5485.bundle.0ecad3940c321ae65b23.js} +0 -0
- /package/dist/{5802.bundle.da6055b6bf1a3db7b6d5.js → 5802.bundle.5e1a7df7ad850a5370f8.js} +0 -0
- /package/dist/{6027.bundle.11f3dfa6d991d343bc16.js → 6027.bundle.f276566b6237d9e16333.js} +0 -0
- /package/dist/{7639.bundle.6bbfb22054fb7f0f9de8.js → 7639.bundle.25e1a86f2248148c35d5.js} +0 -0
- /package/dist/{8499.bundle.64a3161ef7d9c8fc6791.js → 8499.bundle.22f25667db4ab2e59e57.js} +0 -0
- /package/dist/{85.bundle.38ef0a2e90a30dce91ae.js → 85.bundle.2aa39c9bf12258c7ca68.js} +0 -0
- /package/dist/{9862.bundle.f92516a34b9cef88c56f.js → 9862.bundle.fb87529360fb93010555.js} +0 -0
- /package/dist/{9927.bundle.550253549cb2ae31ba95.js → 9927.bundle.f6e7785bceeeb7a1c62e.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[
|
|
1
|
+
(globalThis["webpackChunk"] = globalThis["webpackChunk"] || []).push([[1124],{
|
|
2
2
|
|
|
3
3
|
/***/ 45043
|
|
4
4
|
(module) {
|
|
@@ -4059,9 +4059,7 @@ function createRangeHelper() {
|
|
|
4059
4059
|
}
|
|
4060
4060
|
};
|
|
4061
4061
|
}
|
|
4062
|
-
function computeRange(values) {
|
|
4063
|
-
let component = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4064
|
-
let numberOfComponents = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
4062
|
+
function computeRange(values, component = 0, numberOfComponents = 1) {
|
|
4065
4063
|
if (component < 0 && numberOfComponents > 1) {
|
|
4066
4064
|
// Compute magnitude
|
|
4067
4065
|
const size = values.length;
|
|
@@ -4077,8 +4075,7 @@ function computeRange(values) {
|
|
|
4077
4075
|
}
|
|
4078
4076
|
return fastComputeRange(values, component < 0 ? 0 : component, numberOfComponents);
|
|
4079
4077
|
}
|
|
4080
|
-
function ensureRangeSize(rangeArray) {
|
|
4081
|
-
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4078
|
+
function ensureRangeSize(rangeArray, size = 0) {
|
|
4082
4079
|
const ranges = rangeArray || [];
|
|
4083
4080
|
// Pad ranges with null value to get the
|
|
4084
4081
|
while (ranges.length <= size) {
|
|
@@ -4184,10 +4181,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4184
4181
|
// Description:
|
|
4185
4182
|
// Return the data component at the location specified by tupleIdx and
|
|
4186
4183
|
// compIdx.
|
|
4187
|
-
publicAPI.getComponent =
|
|
4188
|
-
let compIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4189
|
-
return model.values[tupleIdx * model.numberOfComponents + compIdx];
|
|
4190
|
-
};
|
|
4184
|
+
publicAPI.getComponent = (tupleIdx, compIdx = 0) => model.values[tupleIdx * model.numberOfComponents + compIdx];
|
|
4191
4185
|
|
|
4192
4186
|
// Description:
|
|
4193
4187
|
// Set the data component at the location specified by tupleIdx and compIdx
|
|
@@ -4212,8 +4206,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4212
4206
|
publicAPI.setComponent(idx, comp, value);
|
|
4213
4207
|
};
|
|
4214
4208
|
publicAPI.getData = () => model.size === model.values.length ? model.values : model.values.subarray(0, model.size);
|
|
4215
|
-
publicAPI.getRange =
|
|
4216
|
-
let componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
4209
|
+
publicAPI.getRange = (componentIndex = -1) => {
|
|
4217
4210
|
let rangeIdx = componentIndex;
|
|
4218
4211
|
if (rangeIdx < 0) {
|
|
4219
4212
|
// If scalar data, then store in slot 0 (same as componentIndex = 0).
|
|
@@ -4251,8 +4244,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4251
4244
|
model.rangeTuple[1] = range.max;
|
|
4252
4245
|
return model.rangeTuple;
|
|
4253
4246
|
};
|
|
4254
|
-
publicAPI.getRanges =
|
|
4255
|
-
let computeRanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
4247
|
+
publicAPI.getRanges = (computeRanges = true) => {
|
|
4256
4248
|
if (!computeRanges) {
|
|
4257
4249
|
return structuredClone(model.ranges);
|
|
4258
4250
|
}
|
|
@@ -4318,8 +4310,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4318
4310
|
const idx = model.size / model.numberOfComponents;
|
|
4319
4311
|
return publicAPI.insertTuples(idx, tuples);
|
|
4320
4312
|
};
|
|
4321
|
-
publicAPI.findTuple =
|
|
4322
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : EPSILON;
|
|
4313
|
+
publicAPI.findTuple = (tuple, precision = EPSILON) => {
|
|
4323
4314
|
for (let i = 0; i < model.size; i += model.numberOfComponents) {
|
|
4324
4315
|
if (Math.abs(tuple[0] - model.values[i]) <= precision) {
|
|
4325
4316
|
let match = true;
|
|
@@ -4336,8 +4327,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4336
4327
|
}
|
|
4337
4328
|
return -1;
|
|
4338
4329
|
};
|
|
4339
|
-
publicAPI.getTuple =
|
|
4340
|
-
let tupleToFill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
4330
|
+
publicAPI.getTuple = (idx, tupleToFill = []) => {
|
|
4341
4331
|
const numberOfComponents = model.numberOfComponents || 1;
|
|
4342
4332
|
const offset = idx * numberOfComponents;
|
|
4343
4333
|
// Check most common component sizes first
|
|
@@ -4368,10 +4358,7 @@ function vtkDataArray(publicAPI, model) {
|
|
|
4368
4358
|
const arr = publicAPI.getData().subarray(from, to);
|
|
4369
4359
|
return arr.length > 0 ? arr : null;
|
|
4370
4360
|
};
|
|
4371
|
-
publicAPI.getTupleLocation =
|
|
4372
|
-
let idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
4373
|
-
return idx * model.numberOfComponents;
|
|
4374
|
-
};
|
|
4361
|
+
publicAPI.getTupleLocation = (idx = 1) => idx * model.numberOfComponents;
|
|
4375
4362
|
publicAPI.getNumberOfComponents = () => model.numberOfComponents;
|
|
4376
4363
|
publicAPI.getNumberOfValues = () => model.size;
|
|
4377
4364
|
publicAPI.getNumberOfTuples = () => model.size / model.numberOfComponents;
|
|
@@ -4513,8 +4500,7 @@ const DEFAULT_VALUES = {
|
|
|
4513
4500
|
|
|
4514
4501
|
// ----------------------------------------------------------------------------
|
|
4515
4502
|
|
|
4516
|
-
function extend(publicAPI, model) {
|
|
4517
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
4503
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
4518
4504
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
4519
4505
|
if (Array.isArray(initialValues.values) && initialValues.dataType === undefined) {
|
|
4520
4506
|
console.warn('vtkDataArray.newInstance: no dataType provided, converting to Float32Array');
|
|
@@ -4649,7 +4635,7 @@ var Constants = {
|
|
|
4649
4635
|
/* harmony export */ n: () => (/* binding */ norm),
|
|
4650
4636
|
/* harmony export */ s: () => (/* binding */ subtract)
|
|
4651
4637
|
/* harmony export */ });
|
|
4652
|
-
/* unused harmony exports $, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, a, a$, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, b0, b1, f, g, h, i, l, m, o, p, q, r, t, u, v, w, x, y, z */
|
|
4638
|
+
/* unused harmony exports $, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, a, a$, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, b0, b1, b2, f, g, h, i, l, m, o, p, q, r, t, u, v, w, x, y, z */
|
|
4653
4639
|
/* harmony import */ var seedrandom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56037);
|
|
4654
4640
|
/* harmony import */ var _macros2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90027);
|
|
4655
4641
|
/* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29330);
|
|
@@ -4698,8 +4684,7 @@ function swapColumnsMatrix_nxn(matrix, n, column1, column2) {
|
|
|
4698
4684
|
// Global methods
|
|
4699
4685
|
// ----------------------------------------------------------------------------
|
|
4700
4686
|
|
|
4701
|
-
function createArray() {
|
|
4702
|
-
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 3;
|
|
4687
|
+
function createArray(size = 3) {
|
|
4703
4688
|
// faster than Array.from and/or while loop
|
|
4704
4689
|
const res = Array(size);
|
|
4705
4690
|
for (let i = 0; i < size; ++i) {
|
|
@@ -4730,9 +4715,7 @@ const {
|
|
|
4730
4715
|
min,
|
|
4731
4716
|
max
|
|
4732
4717
|
} = Math;
|
|
4733
|
-
function arrayMin(arr) {
|
|
4734
|
-
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4735
|
-
let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
4718
|
+
function arrayMin(arr, offset = 0, stride = 1) {
|
|
4736
4719
|
let minValue = Infinity;
|
|
4737
4720
|
for (let i = offset, len = arr.length; i < len; i += stride) {
|
|
4738
4721
|
if (arr[i] < minValue) {
|
|
@@ -4741,9 +4724,7 @@ function arrayMin(arr) {
|
|
|
4741
4724
|
}
|
|
4742
4725
|
return minValue;
|
|
4743
4726
|
}
|
|
4744
|
-
function arrayMax(arr) {
|
|
4745
|
-
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4746
|
-
let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
4727
|
+
function arrayMax(arr, offset = 0, stride = 1) {
|
|
4747
4728
|
let maxValue = -Infinity;
|
|
4748
4729
|
for (let i = offset, len = arr.length; i < len; i += stride) {
|
|
4749
4730
|
if (maxValue < arr[i]) {
|
|
@@ -4752,9 +4733,7 @@ function arrayMax(arr) {
|
|
|
4752
4733
|
}
|
|
4753
4734
|
return maxValue;
|
|
4754
4735
|
}
|
|
4755
|
-
function arrayRange(arr) {
|
|
4756
|
-
let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4757
|
-
let stride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
4736
|
+
function arrayRange(arr, offset = 0, stride = 1) {
|
|
4758
4737
|
let minValue = Infinity;
|
|
4759
4738
|
let maxValue = -Infinity;
|
|
4760
4739
|
for (let i = offset, len = arr.length; i < len; i += stride) {
|
|
@@ -4819,9 +4798,7 @@ function randomSeed(seed) {
|
|
|
4819
4798
|
function getSeed() {
|
|
4820
4799
|
return randomSeedValue;
|
|
4821
4800
|
}
|
|
4822
|
-
function random() {
|
|
4823
|
-
let minValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
4824
|
-
let maxValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
4801
|
+
function random(minValue = 0, maxValue = 1) {
|
|
4825
4802
|
const delta = maxValue - minValue;
|
|
4826
4803
|
return minValue + delta * Math.random();
|
|
4827
4804
|
}
|
|
@@ -4885,8 +4862,7 @@ function cross(x, y, out) {
|
|
|
4885
4862
|
out[2] = Zz;
|
|
4886
4863
|
return out;
|
|
4887
4864
|
}
|
|
4888
|
-
function norm(x) {
|
|
4889
|
-
let n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
4865
|
+
function norm(x, n = 3) {
|
|
4890
4866
|
switch (n) {
|
|
4891
4867
|
case 1:
|
|
4892
4868
|
return Math.abs(x);
|
|
@@ -5081,10 +5057,7 @@ function columnsToMat3(column0, column1, column2, mat) {
|
|
|
5081
5057
|
}
|
|
5082
5058
|
return mat;
|
|
5083
5059
|
}
|
|
5084
|
-
function determinant2x2() {
|
|
5085
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5086
|
-
args[_key] = arguments[_key];
|
|
5087
|
-
}
|
|
5060
|
+
function determinant2x2(...args) {
|
|
5088
5061
|
if (args.length === 2) {
|
|
5089
5062
|
return args[0][0] * args[1][1] - args[1][0] * args[0][1];
|
|
5090
5063
|
}
|
|
@@ -5306,8 +5279,7 @@ function determinant3x3(mat_3x3) {
|
|
|
5306
5279
|
* @param {Array} b an array of numbers (vector, point, matrix...)
|
|
5307
5280
|
* @param {Number} eps tolerance
|
|
5308
5281
|
*/
|
|
5309
|
-
function areEquals(a, b) {
|
|
5310
|
-
let eps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8;
|
|
5282
|
+
function areEquals(a, b, eps = _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8) {
|
|
5311
5283
|
if (a.length !== b.length) {
|
|
5312
5284
|
return false;
|
|
5313
5285
|
}
|
|
@@ -5333,12 +5305,10 @@ function identity(n, mat) {
|
|
|
5333
5305
|
}
|
|
5334
5306
|
return mat;
|
|
5335
5307
|
}
|
|
5336
|
-
function isIdentity(mat) {
|
|
5337
|
-
let eps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8;
|
|
5308
|
+
function isIdentity(mat, eps = _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8) {
|
|
5338
5309
|
return areMatricesEqual(mat, _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .IDENTITY */ .zK, eps);
|
|
5339
5310
|
}
|
|
5340
|
-
function isIdentity3x3(mat) {
|
|
5341
|
-
let eps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8;
|
|
5311
|
+
function isIdentity3x3(mat, eps = _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .EPSILON */ .p8) {
|
|
5342
5312
|
return areMatricesEqual(mat, _Constants_js__WEBPACK_IMPORTED_MODULE_2__/* .IDENTITY_3X3 */ .GY, eps);
|
|
5343
5313
|
}
|
|
5344
5314
|
function quaternionToMatrix3x3(quat_4, mat_3x3) {
|
|
@@ -5367,8 +5337,7 @@ function quaternionToMatrix3x3(quat_4, mat_3x3) {
|
|
|
5367
5337
|
mat_3x3[5] = (yz - wx) * f;
|
|
5368
5338
|
mat_3x3[8] = zz * f + s;
|
|
5369
5339
|
}
|
|
5370
|
-
function roundNumber(num) {
|
|
5371
|
-
let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
5340
|
+
function roundNumber(num, digits = 0) {
|
|
5372
5341
|
if (!`${num}`.includes('e')) {
|
|
5373
5342
|
return +`${Math.round(`${num}e+${digits}`)}e-${digits}`;
|
|
5374
5343
|
}
|
|
@@ -5379,9 +5348,7 @@ function roundNumber(num) {
|
|
|
5379
5348
|
}
|
|
5380
5349
|
return +`${Math.round(`${+arr[0]}e${sig}${+arr[1] + digits}`)}e-${digits}`;
|
|
5381
5350
|
}
|
|
5382
|
-
function roundVector(vector) {
|
|
5383
|
-
let out = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
|
|
5384
|
-
let digits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
5351
|
+
function roundVector(vector, out = [0, 0, 0], digits = 0) {
|
|
5385
5352
|
out[0] = roundNumber(vector[0], digits);
|
|
5386
5353
|
out[1] = roundNumber(vector[1], digits);
|
|
5387
5354
|
out[2] = roundNumber(vector[2], digits);
|
|
@@ -5984,9 +5951,7 @@ function solveLinearSystem(A, x, size) {
|
|
|
5984
5951
|
}
|
|
5985
5952
|
|
|
5986
5953
|
// Note that A is modified during the inversion !
|
|
5987
|
-
function invertMatrix(A, AI, size) {
|
|
5988
|
-
let index = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
5989
|
-
let column = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
5954
|
+
function invertMatrix(A, AI, size, index = null, column = null) {
|
|
5990
5955
|
const tmp1Size = index || createArray(size);
|
|
5991
5956
|
const tmp2Size = column || createArray(size);
|
|
5992
5957
|
|
|
@@ -6078,8 +6043,7 @@ function solveHomogeneousLeastSquares(numberOfSamples, xt, xOrder, mt) {
|
|
|
6078
6043
|
}
|
|
6079
6044
|
return 1;
|
|
6080
6045
|
}
|
|
6081
|
-
function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {
|
|
6082
|
-
let checkHomogeneous = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
6046
|
+
function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt, checkHomogeneous = true) {
|
|
6083
6047
|
// check dimensional consistency
|
|
6084
6048
|
if (numberOfSamples < xOrder || numberOfSamples < yOrder) {
|
|
6085
6049
|
vtkWarningMacro('Insufficient number of samples. Underdetermined.');
|
|
@@ -6203,8 +6167,7 @@ function solveLeastSquares(numberOfSamples, xt, xOrder, yt, yOrder, mt) {
|
|
|
6203
6167
|
}
|
|
6204
6168
|
return successFlag;
|
|
6205
6169
|
}
|
|
6206
|
-
function hex2float(hexStr) {
|
|
6207
|
-
let outFloatArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0.5, 1];
|
|
6170
|
+
function hex2float(hexStr, outFloatArray = [0, 0.5, 1]) {
|
|
6208
6171
|
switch (hexStr.length) {
|
|
6209
6172
|
case 3:
|
|
6210
6173
|
// abc => #aabbcc
|
|
@@ -6370,7 +6333,6 @@ function lab2xyz(lab, xyz) {
|
|
|
6370
6333
|
xyz[1] = ref_Y * var_Y; // ref_Y = 1.000
|
|
6371
6334
|
xyz[2] = ref_Z * var_Z; // ref_Z = 1.089
|
|
6372
6335
|
}
|
|
6373
|
-
|
|
6374
6336
|
function xyz2lab(xyz, lab) {
|
|
6375
6337
|
const [x, y, z] = xyz;
|
|
6376
6338
|
const ref_X = 0.9505;
|
|
@@ -6488,8 +6450,7 @@ function clampValue(value, minValue, maxValue) {
|
|
|
6488
6450
|
}
|
|
6489
6451
|
return value;
|
|
6490
6452
|
}
|
|
6491
|
-
function clampVector(vector, minVector, maxVector) {
|
|
6492
|
-
let out = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [0, 0, 0];
|
|
6453
|
+
function clampVector(vector, minVector, maxVector, out = [0, 0, 0]) {
|
|
6493
6454
|
out[0] = clampValue(vector[0], minVector[0], maxVector[0]);
|
|
6494
6455
|
out[1] = clampValue(vector[1], minVector[1], maxVector[1]);
|
|
6495
6456
|
out[2] = clampValue(vector[2], minVector[2], maxVector[2]);
|
|
@@ -6596,7 +6557,6 @@ function createUninitializedBounds() {
|
|
|
6596
6557
|
Number.MAX_VALUE, -Number.MAX_VALUE // Z
|
|
6597
6558
|
]);
|
|
6598
6559
|
}
|
|
6599
|
-
|
|
6600
6560
|
function getMajorAxisIndex(vector) {
|
|
6601
6561
|
let maxValue = -1;
|
|
6602
6562
|
let axisIndex = -1;
|
|
@@ -6609,6 +6569,18 @@ function getMajorAxisIndex(vector) {
|
|
|
6609
6569
|
}
|
|
6610
6570
|
return axisIndex;
|
|
6611
6571
|
}
|
|
6572
|
+
function getMinorAxisIndex(vector) {
|
|
6573
|
+
let minValue = Infinity;
|
|
6574
|
+
let axisIndex = -1;
|
|
6575
|
+
for (let i = 0; i < vector.length; i++) {
|
|
6576
|
+
const value = Math.abs(vector[i]);
|
|
6577
|
+
if (value < minValue) {
|
|
6578
|
+
axisIndex = i;
|
|
6579
|
+
minValue = value;
|
|
6580
|
+
}
|
|
6581
|
+
}
|
|
6582
|
+
return axisIndex;
|
|
6583
|
+
}
|
|
6612
6584
|
|
|
6613
6585
|
// Return the closest orthogonal matrix of 1, -1 and 0
|
|
6614
6586
|
// It works for both column major and row major matrices
|
|
@@ -6616,8 +6588,7 @@ function getMajorAxisIndex(vector) {
|
|
|
6616
6588
|
// the greatest absolute value from the remaining row and columns
|
|
6617
6589
|
// For each association, a -1 or a 1 is set in the output, depending on
|
|
6618
6590
|
// the sign of the value in the original matrix
|
|
6619
|
-
function getSparseOrthogonalMatrix(matrix) {
|
|
6620
|
-
let n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
6591
|
+
function getSparseOrthogonalMatrix(matrix, n = 3) {
|
|
6621
6592
|
// Initialize rows and columns to available indices
|
|
6622
6593
|
const rows = new Array(n);
|
|
6623
6594
|
const cols = new Array(n);
|
|
@@ -6666,8 +6637,7 @@ function floatToHex2(value) {
|
|
|
6666
6637
|
}
|
|
6667
6638
|
return `0${integer.toString(16)}`;
|
|
6668
6639
|
}
|
|
6669
|
-
function floatRGB2HexCode(rgbArray) {
|
|
6670
|
-
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
|
|
6640
|
+
function floatRGB2HexCode(rgbArray, prefix = '#') {
|
|
6671
6641
|
return `${prefix}${rgbArray.map(floatToHex2).join('')}`;
|
|
6672
6642
|
}
|
|
6673
6643
|
function floatToChar(f) {
|
|
@@ -6793,6 +6763,7 @@ var vtkMath = {
|
|
|
6793
6763
|
// JS add-on
|
|
6794
6764
|
createUninitializedBounds,
|
|
6795
6765
|
getMajorAxisIndex,
|
|
6766
|
+
getMinorAxisIndex,
|
|
6796
6767
|
getSparseOrthogonalMatrix,
|
|
6797
6768
|
floatToHex2,
|
|
6798
6769
|
floatRGB2HexCode,
|
|
@@ -6915,6 +6886,7 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
6915
6886
|
isNan: isNan,
|
|
6916
6887
|
createUninitializedBounds: createUninitializedBounds,
|
|
6917
6888
|
getMajorAxisIndex: getMajorAxisIndex,
|
|
6889
|
+
getMinorAxisIndex: getMinorAxisIndex,
|
|
6918
6890
|
getSparseOrthogonalMatrix: getSparseOrthogonalMatrix,
|
|
6919
6891
|
floatToHex2: floatToHex2,
|
|
6920
6892
|
floatRGB2HexCode: floatRGB2HexCode,
|
|
@@ -6964,20 +6936,17 @@ const CellGhostTypes = {
|
|
|
6964
6936
|
// the cell is on the exterior of the data set
|
|
6965
6937
|
HIDDENCELL: 32 // the cell is needed to maintain connectivity, but the data values should be ignored.
|
|
6966
6938
|
};
|
|
6967
|
-
|
|
6968
6939
|
const PointGhostTypes = {
|
|
6969
6940
|
DUPLICATEPOINT: 1,
|
|
6970
6941
|
// the cell is present on multiple processors
|
|
6971
6942
|
HIDDENPOINT: 2 // the point is needed to maintain connectivity, but the data values should be ignored.
|
|
6972
6943
|
};
|
|
6973
|
-
|
|
6974
6944
|
const AttributeCopyOperations = {
|
|
6975
6945
|
COPYTUPLE: 0,
|
|
6976
6946
|
INTERPOLATE: 1,
|
|
6977
6947
|
PASSDATA: 2,
|
|
6978
6948
|
ALLCOPY: 3 // all of the above
|
|
6979
6949
|
};
|
|
6980
|
-
|
|
6981
6950
|
const ghostArrayName = 'vtkGhostType';
|
|
6982
6951
|
const DesiredOutputPrecision = {
|
|
6983
6952
|
DEFAULT: 0,
|
|
@@ -6986,7 +6955,6 @@ const DesiredOutputPrecision = {
|
|
|
6986
6955
|
// use Float32Array
|
|
6987
6956
|
DOUBLE: 2 // use Float64Array
|
|
6988
6957
|
};
|
|
6989
|
-
|
|
6990
6958
|
var Constants = {
|
|
6991
6959
|
AttributeCopyOperations,
|
|
6992
6960
|
AttributeLimitTypes,
|
|
@@ -7036,14 +7004,11 @@ const {
|
|
|
7036
7004
|
function vtkImageData(publicAPI, model) {
|
|
7037
7005
|
// Set our className
|
|
7038
7006
|
model.classHierarchy.push('vtkImageData');
|
|
7039
|
-
publicAPI.setExtent =
|
|
7007
|
+
publicAPI.setExtent = (...inExtent) => {
|
|
7040
7008
|
if (model.deleted) {
|
|
7041
7009
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
7042
7010
|
return false;
|
|
7043
7011
|
}
|
|
7044
|
-
for (var _len = arguments.length, inExtent = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
7045
|
-
inExtent[_key] = arguments[_key];
|
|
7046
|
-
}
|
|
7047
7012
|
const extentArray = inExtent.length === 1 ? inExtent[0] : inExtent;
|
|
7048
7013
|
if (extentArray.length !== 6) {
|
|
7049
7014
|
return false;
|
|
@@ -7056,7 +7021,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
7056
7021
|
}
|
|
7057
7022
|
return changeDetected;
|
|
7058
7023
|
};
|
|
7059
|
-
publicAPI.setDimensions =
|
|
7024
|
+
publicAPI.setDimensions = (...dims) => {
|
|
7060
7025
|
let i;
|
|
7061
7026
|
let j;
|
|
7062
7027
|
let k;
|
|
@@ -7064,15 +7029,15 @@ function vtkImageData(publicAPI, model) {
|
|
|
7064
7029
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
7065
7030
|
return;
|
|
7066
7031
|
}
|
|
7067
|
-
if (
|
|
7068
|
-
const array =
|
|
7032
|
+
if (dims.length === 1) {
|
|
7033
|
+
const array = dims[0];
|
|
7069
7034
|
i = array[0];
|
|
7070
7035
|
j = array[1];
|
|
7071
7036
|
k = array[2];
|
|
7072
|
-
} else if (
|
|
7073
|
-
i =
|
|
7074
|
-
j =
|
|
7075
|
-
k =
|
|
7037
|
+
} else if (dims.length === 3) {
|
|
7038
|
+
i = dims[0];
|
|
7039
|
+
j = dims[1];
|
|
7040
|
+
k = dims[2];
|
|
7076
7041
|
} else {
|
|
7077
7042
|
vtkErrorMacro('Bad dimension specification');
|
|
7078
7043
|
return;
|
|
@@ -7190,26 +7155,18 @@ function vtkImageData(publicAPI, model) {
|
|
|
7190
7155
|
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat4.scale */ .pB.scale(model.indexToWorld, model.indexToWorld, model.spacing);
|
|
7191
7156
|
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .mat4.invert */ .pB.invert(model.worldToIndex, model.indexToWorld);
|
|
7192
7157
|
};
|
|
7193
|
-
publicAPI.indexToWorld =
|
|
7194
|
-
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
7158
|
+
publicAPI.indexToWorld = (ain, aout = []) => {
|
|
7195
7159
|
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .vec3.transformMat4 */ .eR.transformMat4(aout, ain, model.indexToWorld);
|
|
7196
7160
|
return aout;
|
|
7197
7161
|
};
|
|
7198
7162
|
publicAPI.indexToWorldVec3 = publicAPI.indexToWorld;
|
|
7199
|
-
publicAPI.worldToIndex =
|
|
7200
|
-
let aout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
7163
|
+
publicAPI.worldToIndex = (ain, aout = []) => {
|
|
7201
7164
|
gl_matrix__WEBPACK_IMPORTED_MODULE_6__/* .vec3.transformMat4 */ .eR.transformMat4(aout, ain, model.worldToIndex);
|
|
7202
7165
|
return aout;
|
|
7203
7166
|
};
|
|
7204
7167
|
publicAPI.worldToIndexVec3 = publicAPI.worldToIndex;
|
|
7205
|
-
publicAPI.indexToWorldBounds =
|
|
7206
|
-
|
|
7207
|
-
return _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .Ay.transformBounds(bin, model.indexToWorld, bout);
|
|
7208
|
-
};
|
|
7209
|
-
publicAPI.worldToIndexBounds = function (bin) {
|
|
7210
|
-
let bout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
7211
|
-
return _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .Ay.transformBounds(bin, model.worldToIndex, bout);
|
|
7212
|
-
};
|
|
7168
|
+
publicAPI.indexToWorldBounds = (bin, bout = []) => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .Ay.transformBounds(bin, model.indexToWorld, bout);
|
|
7169
|
+
publicAPI.worldToIndexBounds = (bin, bout = []) => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].transformBounds */ .Ay.transformBounds(bin, model.worldToIndex, bout);
|
|
7213
7170
|
|
|
7214
7171
|
// Make sure the transform is correct
|
|
7215
7172
|
model._onOriginChanged = publicAPI.computeTransforms;
|
|
@@ -7217,8 +7174,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
7217
7174
|
model._onSpacingChanged = publicAPI.computeTransforms;
|
|
7218
7175
|
publicAPI.computeTransforms();
|
|
7219
7176
|
publicAPI.getCenter = () => _BoundingBox_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].getCenter */ .Ay.getCenter(publicAPI.getBounds());
|
|
7220
|
-
publicAPI.computeHistogram =
|
|
7221
|
-
let voxelFunction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
7177
|
+
publicAPI.computeHistogram = (worldBounds, voxelFunction = null) => {
|
|
7222
7178
|
const bounds = [0, 0, 0, 0, 0, 0];
|
|
7223
7179
|
publicAPI.worldToIndexBounds(worldBounds, bounds);
|
|
7224
7180
|
const point1 = [0, 0, 0];
|
|
@@ -7268,8 +7224,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
7268
7224
|
|
|
7269
7225
|
// TODO: use the unimplemented `vtkDataSetAttributes` for scalar length, that is currently also a TODO (GetNumberOfComponents).
|
|
7270
7226
|
// Scalar data could be tuples for color information?
|
|
7271
|
-
publicAPI.computeIncrements =
|
|
7272
|
-
let numberOfComponents = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
7227
|
+
publicAPI.computeIncrements = (extent, numberOfComponents = 1) => {
|
|
7273
7228
|
const increments = [];
|
|
7274
7229
|
let incr = numberOfComponents;
|
|
7275
7230
|
|
|
@@ -7286,8 +7241,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
7286
7241
|
* @param {Number[]} index the localized `[i,j,k]` pixel array position. Float values will be rounded.
|
|
7287
7242
|
* @return {Number} the corresponding flattened index in the scalar array
|
|
7288
7243
|
*/
|
|
7289
|
-
publicAPI.computeOffsetIndex =
|
|
7290
|
-
let [i, j, k] = _ref;
|
|
7244
|
+
publicAPI.computeOffsetIndex = ([i, j, k]) => {
|
|
7291
7245
|
const extent = publicAPI.getExtent();
|
|
7292
7246
|
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
7293
7247
|
const increments = publicAPI.computeIncrements(extent, numberOfComponents);
|
|
@@ -7321,8 +7275,7 @@ function vtkImageData(publicAPI, model) {
|
|
|
7321
7275
|
* @param {Number?} comp the scalar component index for multi-component scalars
|
|
7322
7276
|
* @return {Number|NaN} the corresponding pixel's scalar value
|
|
7323
7277
|
*/
|
|
7324
|
-
publicAPI.getScalarValueFromWorld =
|
|
7325
|
-
let comp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
7278
|
+
publicAPI.getScalarValueFromWorld = (xyz, comp = 0) => {
|
|
7326
7279
|
const numberOfComponents = publicAPI.getPointData().getScalars().getNumberOfComponents();
|
|
7327
7280
|
if (comp < 0 || comp >= numberOfComponents) {
|
|
7328
7281
|
vtkErrorMacro(`GetScalarPointer: Scalar Component ${comp} is not within bounds. Current Scalar numberOfComponents: ${numberOfComponents}`);
|
|
@@ -7367,8 +7320,7 @@ const DEFAULT_VALUES = {
|
|
|
7367
7320
|
|
|
7368
7321
|
// ----------------------------------------------------------------------------
|
|
7369
7322
|
|
|
7370
|
-
function extend(publicAPI, model) {
|
|
7371
|
-
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
7323
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
7372
7324
|
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
7373
7325
|
|
|
7374
7326
|
// Inheritance
|
|
@@ -7405,6 +7357,276 @@ var vtkImageData$1 = {
|
|
|
7405
7357
|
|
|
7406
7358
|
|
|
7407
7359
|
|
|
7360
|
+
/***/ },
|
|
7361
|
+
|
|
7362
|
+
/***/ 49794
|
|
7363
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
7364
|
+
|
|
7365
|
+
"use strict";
|
|
7366
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7367
|
+
/* harmony export */ Ay: () => (/* binding */ vtkPlane$1)
|
|
7368
|
+
/* harmony export */ });
|
|
7369
|
+
/* unused harmony exports STATIC, extend, newInstance, vtkPlane */
|
|
7370
|
+
/* harmony import */ var _Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8047);
|
|
7371
|
+
/* harmony import */ var _macros2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90027);
|
|
7372
|
+
/* harmony import */ var _ImplicitFunction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53001);
|
|
7373
|
+
|
|
7374
|
+
|
|
7375
|
+
|
|
7376
|
+
|
|
7377
|
+
const PLANE_TOLERANCE = 1.0e-6;
|
|
7378
|
+
const COINCIDE = 'coincide';
|
|
7379
|
+
const DISJOINT = 'disjoint';
|
|
7380
|
+
|
|
7381
|
+
// ----------------------------------------------------------------------------
|
|
7382
|
+
// Global methods
|
|
7383
|
+
// ----------------------------------------------------------------------------
|
|
7384
|
+
|
|
7385
|
+
function evaluate(normal, origin, x) {
|
|
7386
|
+
return normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);
|
|
7387
|
+
}
|
|
7388
|
+
function distanceToPlane(x, origin, normal) {
|
|
7389
|
+
const distance = normal[0] * (x[0] - origin[0]) + normal[1] * (x[1] - origin[1]) + normal[2] * (x[2] - origin[2]);
|
|
7390
|
+
return Math.abs(distance);
|
|
7391
|
+
}
|
|
7392
|
+
function projectPoint(x, origin, normal, xproj) {
|
|
7393
|
+
const xo = [];
|
|
7394
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(x, origin, xo);
|
|
7395
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, xo);
|
|
7396
|
+
xproj[0] = x[0] - t * normal[0];
|
|
7397
|
+
xproj[1] = x[1] - t * normal[1];
|
|
7398
|
+
xproj[2] = x[2] - t * normal[2];
|
|
7399
|
+
}
|
|
7400
|
+
function projectVector(v, normal, vproj) {
|
|
7401
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(v, normal);
|
|
7402
|
+
let n2 = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, normal);
|
|
7403
|
+
if (n2 === 0) {
|
|
7404
|
+
n2 = 1.0;
|
|
7405
|
+
}
|
|
7406
|
+
vproj[0] = v[0] - t * normal[0] / n2;
|
|
7407
|
+
vproj[1] = v[1] - t * normal[1] / n2;
|
|
7408
|
+
vproj[2] = v[2] - t * normal[2] / n2;
|
|
7409
|
+
return vproj;
|
|
7410
|
+
}
|
|
7411
|
+
function generalizedProjectPoint(x, origin, normal, xproj) {
|
|
7412
|
+
const xo = [];
|
|
7413
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(x, origin, xo);
|
|
7414
|
+
const t = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, xo);
|
|
7415
|
+
const n2 = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, normal);
|
|
7416
|
+
if (n2 !== 0) {
|
|
7417
|
+
xproj[0] = x[0] - t * normal[0] / n2;
|
|
7418
|
+
xproj[1] = x[1] - t * normal[1] / n2;
|
|
7419
|
+
xproj[2] = x[2] - t * normal[2] / n2;
|
|
7420
|
+
} else {
|
|
7421
|
+
xproj[0] = x[0];
|
|
7422
|
+
xproj[1] = x[1];
|
|
7423
|
+
xproj[2] = x[2];
|
|
7424
|
+
}
|
|
7425
|
+
}
|
|
7426
|
+
function intersectWithLine(p1, p2, origin, normal) {
|
|
7427
|
+
const outObj = {
|
|
7428
|
+
intersection: false,
|
|
7429
|
+
betweenPoints: false,
|
|
7430
|
+
t: Number.MAX_VALUE,
|
|
7431
|
+
x: []
|
|
7432
|
+
};
|
|
7433
|
+
const p21 = [];
|
|
7434
|
+
const p1Origin = [];
|
|
7435
|
+
// Compute line vector
|
|
7436
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(p2, p1, p21);
|
|
7437
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(origin, p1, p1Origin);
|
|
7438
|
+
|
|
7439
|
+
// Compute denominator. If ~0, line and plane are parallel.
|
|
7440
|
+
// const num = vtkMath.dot(normal, origin) - vtkMath.dot(normal, p1);
|
|
7441
|
+
const num = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, p1Origin);
|
|
7442
|
+
const den = (0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(normal, p21);
|
|
7443
|
+
|
|
7444
|
+
// If denominator with respect to numerator is "zero", then the line and
|
|
7445
|
+
// plane are considered parallel.
|
|
7446
|
+
let fabsden;
|
|
7447
|
+
let fabstolerance;
|
|
7448
|
+
|
|
7449
|
+
// Trying to avoid an expensive call to fabs()
|
|
7450
|
+
if (den < 0.0) {
|
|
7451
|
+
fabsden = -den;
|
|
7452
|
+
} else {
|
|
7453
|
+
fabsden = den;
|
|
7454
|
+
}
|
|
7455
|
+
if (num < 0.0) {
|
|
7456
|
+
fabstolerance = -num * PLANE_TOLERANCE;
|
|
7457
|
+
} else {
|
|
7458
|
+
fabstolerance = num * PLANE_TOLERANCE;
|
|
7459
|
+
}
|
|
7460
|
+
if (fabsden <= fabstolerance) {
|
|
7461
|
+
return outObj;
|
|
7462
|
+
}
|
|
7463
|
+
|
|
7464
|
+
// Where on the line between p1 and p2 is the intersection
|
|
7465
|
+
// If between 0 and 1, it is between the two points. If < 0 it's before p1, if > 1 it's after p2
|
|
7466
|
+
outObj.t = num / den;
|
|
7467
|
+
outObj.x[0] = p1[0] + outObj.t * p21[0];
|
|
7468
|
+
outObj.x[1] = p1[1] + outObj.t * p21[1];
|
|
7469
|
+
outObj.x[2] = p1[2] + outObj.t * p21[2];
|
|
7470
|
+
outObj.intersection = true;
|
|
7471
|
+
outObj.betweenPoints = outObj.t >= 0.0 && outObj.t <= 1.0;
|
|
7472
|
+
return outObj;
|
|
7473
|
+
}
|
|
7474
|
+
function intersectWithPlane(plane1Origin, plane1Normal, plane2Origin, plane2Normal) {
|
|
7475
|
+
const outObj = {
|
|
7476
|
+
intersection: false,
|
|
7477
|
+
l0: [],
|
|
7478
|
+
l1: [],
|
|
7479
|
+
error: null
|
|
7480
|
+
};
|
|
7481
|
+
const cross$1 = [];
|
|
7482
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.j)(plane1Normal, plane2Normal, cross$1);
|
|
7483
|
+
const absCross = cross$1.map(n => Math.abs(n));
|
|
7484
|
+
|
|
7485
|
+
// test if the two planes are parallel
|
|
7486
|
+
if (absCross[0] + absCross[1] + absCross[2] < PLANE_TOLERANCE) {
|
|
7487
|
+
// test if disjoint or coincide
|
|
7488
|
+
const v = [];
|
|
7489
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.s)(plane1Origin, plane2Origin, v);
|
|
7490
|
+
if ((0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane1Normal, v) === 0) {
|
|
7491
|
+
outObj.error = COINCIDE;
|
|
7492
|
+
} else {
|
|
7493
|
+
outObj.error = DISJOINT;
|
|
7494
|
+
}
|
|
7495
|
+
return outObj;
|
|
7496
|
+
}
|
|
7497
|
+
|
|
7498
|
+
// Plane1 and Plane2 intersect in a line
|
|
7499
|
+
// first determine max abs coordinate of the cross product
|
|
7500
|
+
let maxc;
|
|
7501
|
+
if (absCross[0] > absCross[1] && absCross[0] > absCross[2]) {
|
|
7502
|
+
maxc = 'x';
|
|
7503
|
+
} else if (absCross[1] > absCross[2]) {
|
|
7504
|
+
maxc = 'y';
|
|
7505
|
+
} else {
|
|
7506
|
+
maxc = 'z';
|
|
7507
|
+
}
|
|
7508
|
+
|
|
7509
|
+
// To get a point on the intersect line, zero the max coord, and solve for the other two
|
|
7510
|
+
const iP = []; // intersectionPoint
|
|
7511
|
+
// the constants in the 2 plane equations
|
|
7512
|
+
const d1 = -(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane1Normal, plane1Origin);
|
|
7513
|
+
const d2 = -(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.d)(plane2Normal, plane2Origin);
|
|
7514
|
+
|
|
7515
|
+
// eslint-disable-next-line default-case
|
|
7516
|
+
switch (maxc) {
|
|
7517
|
+
case 'x':
|
|
7518
|
+
// intersect with x=0
|
|
7519
|
+
iP[0] = 0;
|
|
7520
|
+
iP[1] = (d2 * plane1Normal[2] - d1 * plane2Normal[2]) / cross$1[0];
|
|
7521
|
+
iP[2] = (d1 * plane2Normal[1] - d2 * plane1Normal[1]) / cross$1[0];
|
|
7522
|
+
break;
|
|
7523
|
+
case 'y':
|
|
7524
|
+
// intersect with y=0
|
|
7525
|
+
iP[0] = (d1 * plane2Normal[2] - d2 * plane1Normal[2]) / cross$1[1];
|
|
7526
|
+
iP[1] = 0;
|
|
7527
|
+
iP[2] = (d2 * plane1Normal[0] - d1 * plane2Normal[0]) / cross$1[1];
|
|
7528
|
+
break;
|
|
7529
|
+
case 'z':
|
|
7530
|
+
// intersect with z=0
|
|
7531
|
+
iP[0] = (d2 * plane1Normal[1] - d1 * plane2Normal[1]) / cross$1[2];
|
|
7532
|
+
iP[1] = (d1 * plane2Normal[0] - d2 * plane1Normal[0]) / cross$1[2];
|
|
7533
|
+
iP[2] = 0;
|
|
7534
|
+
break;
|
|
7535
|
+
}
|
|
7536
|
+
outObj.l0 = iP;
|
|
7537
|
+
(0,_Core_Math_index_js__WEBPACK_IMPORTED_MODULE_0__.k)(iP, cross$1, outObj.l1);
|
|
7538
|
+
outObj.intersection = true;
|
|
7539
|
+
return outObj;
|
|
7540
|
+
}
|
|
7541
|
+
|
|
7542
|
+
// ----------------------------------------------------------------------------
|
|
7543
|
+
// Static API
|
|
7544
|
+
// ----------------------------------------------------------------------------
|
|
7545
|
+
|
|
7546
|
+
const STATIC = {
|
|
7547
|
+
evaluate,
|
|
7548
|
+
distanceToPlane,
|
|
7549
|
+
projectPoint,
|
|
7550
|
+
projectVector,
|
|
7551
|
+
generalizedProjectPoint,
|
|
7552
|
+
intersectWithLine,
|
|
7553
|
+
intersectWithPlane,
|
|
7554
|
+
DISJOINT,
|
|
7555
|
+
COINCIDE
|
|
7556
|
+
};
|
|
7557
|
+
|
|
7558
|
+
// ----------------------------------------------------------------------------
|
|
7559
|
+
// vtkPlane methods
|
|
7560
|
+
// ----------------------------------------------------------------------------
|
|
7561
|
+
|
|
7562
|
+
function vtkPlane(publicAPI, model) {
|
|
7563
|
+
// Set our className
|
|
7564
|
+
model.classHierarchy.push('vtkPlane');
|
|
7565
|
+
publicAPI.distanceToPlane = x => distanceToPlane(x, model.origin, model.normal);
|
|
7566
|
+
publicAPI.projectPoint = (x, xproj) => {
|
|
7567
|
+
projectPoint(x, model.origin, model.normal, xproj);
|
|
7568
|
+
};
|
|
7569
|
+
publicAPI.projectVector = (v, vproj) => projectVector(v, model.normal, vproj);
|
|
7570
|
+
publicAPI.push = distance => {
|
|
7571
|
+
if (distance === 0.0) {
|
|
7572
|
+
return;
|
|
7573
|
+
}
|
|
7574
|
+
for (let i = 0; i < 3; i++) {
|
|
7575
|
+
model.origin[i] += distance * model.normal[i];
|
|
7576
|
+
}
|
|
7577
|
+
};
|
|
7578
|
+
publicAPI.generalizedProjectPoint = (x, xproj) => {
|
|
7579
|
+
generalizedProjectPoint(x, model.origin, model.normal, xproj);
|
|
7580
|
+
};
|
|
7581
|
+
publicAPI.evaluateFunction = (x, y, z) => {
|
|
7582
|
+
if (!Array.isArray(x)) {
|
|
7583
|
+
return model.normal[0] * (x - model.origin[0]) + model.normal[1] * (y - model.origin[1]) + model.normal[2] * (z - model.origin[2]);
|
|
7584
|
+
}
|
|
7585
|
+
return model.normal[0] * (x[0] - model.origin[0]) + model.normal[1] * (x[1] - model.origin[1]) + model.normal[2] * (x[2] - model.origin[2]);
|
|
7586
|
+
};
|
|
7587
|
+
publicAPI.evaluateGradient = xyz => {
|
|
7588
|
+
const retVal = [model.normal[0], model.normal[1], model.normal[2]];
|
|
7589
|
+
return retVal;
|
|
7590
|
+
};
|
|
7591
|
+
publicAPI.intersectWithLine = (p1, p2) => intersectWithLine(p1, p2, model.origin, model.normal);
|
|
7592
|
+
publicAPI.intersectWithPlane = (planeOrigin, planeNormal) => intersectWithPlane(planeOrigin, planeNormal, model.origin, model.normal);
|
|
7593
|
+
}
|
|
7594
|
+
|
|
7595
|
+
// ----------------------------------------------------------------------------
|
|
7596
|
+
// Object factory
|
|
7597
|
+
// ----------------------------------------------------------------------------
|
|
7598
|
+
|
|
7599
|
+
const DEFAULT_VALUES = {
|
|
7600
|
+
normal: [0.0, 0.0, 1.0],
|
|
7601
|
+
origin: [0.0, 0.0, 0.0]
|
|
7602
|
+
};
|
|
7603
|
+
|
|
7604
|
+
// ----------------------------------------------------------------------------
|
|
7605
|
+
|
|
7606
|
+
function extend(publicAPI, model, initialValues = {}) {
|
|
7607
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
7608
|
+
|
|
7609
|
+
// Object methods
|
|
7610
|
+
_ImplicitFunction_js__WEBPACK_IMPORTED_MODULE_2__/* ["default"].extend */ .Ay.extend(publicAPI, model, initialValues);
|
|
7611
|
+
_macros2_js__WEBPACK_IMPORTED_MODULE_1__.m.setGetArray(publicAPI, model, ['normal', 'origin'], 3);
|
|
7612
|
+
vtkPlane(publicAPI, model);
|
|
7613
|
+
}
|
|
7614
|
+
|
|
7615
|
+
// ----------------------------------------------------------------------------
|
|
7616
|
+
|
|
7617
|
+
const newInstance = _macros2_js__WEBPACK_IMPORTED_MODULE_1__.m.newInstance(extend, 'vtkPlane');
|
|
7618
|
+
|
|
7619
|
+
// ----------------------------------------------------------------------------
|
|
7620
|
+
|
|
7621
|
+
var vtkPlane$1 = {
|
|
7622
|
+
newInstance,
|
|
7623
|
+
extend,
|
|
7624
|
+
...STATIC
|
|
7625
|
+
};
|
|
7626
|
+
|
|
7627
|
+
|
|
7628
|
+
|
|
7629
|
+
|
|
7408
7630
|
/***/ },
|
|
7409
7631
|
|
|
7410
7632
|
/***/ 90027
|
|
@@ -7466,20 +7688,20 @@ function setLoggerFunction(name, fn) {
|
|
|
7466
7688
|
loggerFunctions[name] = fn || noOp;
|
|
7467
7689
|
}
|
|
7468
7690
|
}
|
|
7469
|
-
function vtkLogMacro() {
|
|
7470
|
-
loggerFunctions.log(...
|
|
7691
|
+
function vtkLogMacro(...args) {
|
|
7692
|
+
loggerFunctions.log(...args);
|
|
7471
7693
|
}
|
|
7472
|
-
function vtkInfoMacro() {
|
|
7473
|
-
loggerFunctions.info(...
|
|
7694
|
+
function vtkInfoMacro(...args) {
|
|
7695
|
+
loggerFunctions.info(...args);
|
|
7474
7696
|
}
|
|
7475
|
-
function vtkDebugMacro() {
|
|
7476
|
-
loggerFunctions.debug(...
|
|
7697
|
+
function vtkDebugMacro(...args) {
|
|
7698
|
+
loggerFunctions.debug(...args);
|
|
7477
7699
|
}
|
|
7478
|
-
function vtkErrorMacro() {
|
|
7479
|
-
loggerFunctions.error(...
|
|
7700
|
+
function vtkErrorMacro(...args) {
|
|
7701
|
+
loggerFunctions.error(...args);
|
|
7480
7702
|
}
|
|
7481
|
-
function vtkWarningMacro() {
|
|
7482
|
-
loggerFunctions.warn(...
|
|
7703
|
+
function vtkWarningMacro(...args) {
|
|
7704
|
+
loggerFunctions.warn(...args);
|
|
7483
7705
|
}
|
|
7484
7706
|
const ERROR_ONCE_MAP = {};
|
|
7485
7707
|
function vtkOnceErrorMacro(str) {
|
|
@@ -7509,16 +7731,10 @@ try {
|
|
|
7509
7731
|
} catch {
|
|
7510
7732
|
// ignore
|
|
7511
7733
|
}
|
|
7512
|
-
function newTypedArray(type) {
|
|
7513
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
7514
|
-
args[_key - 1] = arguments[_key];
|
|
7515
|
-
}
|
|
7734
|
+
function newTypedArray(type, ...args) {
|
|
7516
7735
|
return new (TYPED_ARRAYS[type] || Float64Array)(...args);
|
|
7517
7736
|
}
|
|
7518
|
-
function newTypedArrayFrom(type) {
|
|
7519
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
7520
|
-
args[_key2 - 1] = arguments[_key2];
|
|
7521
|
-
}
|
|
7737
|
+
function newTypedArrayFrom(type, ...args) {
|
|
7522
7738
|
return (TYPED_ARRAYS[type] || Float64Array).from(...args);
|
|
7523
7739
|
}
|
|
7524
7740
|
|
|
@@ -7540,9 +7756,7 @@ function uncapitalize(str) {
|
|
|
7540
7756
|
// Convert byte size into a well formatted string
|
|
7541
7757
|
// ----------------------------------------------------------------------------
|
|
7542
7758
|
|
|
7543
|
-
function formatBytesToProperUnit(size) {
|
|
7544
|
-
let precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
7545
|
-
let chunkSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
7759
|
+
function formatBytesToProperUnit(size, precision = 2, chunkSize = 1000) {
|
|
7546
7760
|
const units = ['TB', 'GB', 'MB', 'KB'];
|
|
7547
7761
|
let value = Number(size);
|
|
7548
7762
|
let currentUnit = 'B';
|
|
@@ -7557,8 +7771,7 @@ function formatBytesToProperUnit(size) {
|
|
|
7557
7771
|
// Convert thousand number with proper separator
|
|
7558
7772
|
// ----------------------------------------------------------------------------
|
|
7559
7773
|
|
|
7560
|
-
function formatNumbersWithThousandSeparator(n) {
|
|
7561
|
-
let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
|
|
7774
|
+
function formatNumbersWithThousandSeparator(n, separator = ' ') {
|
|
7562
7775
|
const sections = [];
|
|
7563
7776
|
let size = n;
|
|
7564
7777
|
while (size > 1000) {
|
|
@@ -7649,9 +7862,7 @@ function measurePromiseExecution(promise, callback) {
|
|
|
7649
7862
|
// vtkObject: modified(), onModified(callback), delete()
|
|
7650
7863
|
// ----------------------------------------------------------------------------
|
|
7651
7864
|
|
|
7652
|
-
function obj() {
|
|
7653
|
-
let publicAPI = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7654
|
-
let model = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
7865
|
+
function obj(publicAPI = {}, model = {}) {
|
|
7655
7866
|
// Ensure each instance as a unique ref of array
|
|
7656
7867
|
safeArrays(model);
|
|
7657
7868
|
const callbacks = [];
|
|
@@ -7711,14 +7922,8 @@ function obj() {
|
|
|
7711
7922
|
}
|
|
7712
7923
|
return false;
|
|
7713
7924
|
};
|
|
7714
|
-
publicAPI.getClassName =
|
|
7715
|
-
|
|
7716
|
-
return model.classHierarchy[model.classHierarchy.length - 1 - depth];
|
|
7717
|
-
};
|
|
7718
|
-
publicAPI.set = function () {
|
|
7719
|
-
let map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7720
|
-
let noWarning = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
7721
|
-
let noFunction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7925
|
+
publicAPI.getClassName = (depth = 0) => model.classHierarchy[model.classHierarchy.length - 1 - depth];
|
|
7926
|
+
publicAPI.set = (map = {}, noWarning = false, noFunction = false) => {
|
|
7722
7927
|
let ret = false;
|
|
7723
7928
|
Object.keys(map).forEach(name => {
|
|
7724
7929
|
const fn = noFunction ? null : publicAPI[`set${capitalize(name)}`];
|
|
@@ -7737,10 +7942,7 @@ function obj() {
|
|
|
7737
7942
|
});
|
|
7738
7943
|
return ret;
|
|
7739
7944
|
};
|
|
7740
|
-
publicAPI.get =
|
|
7741
|
-
for (var _len3 = arguments.length, list = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
7742
|
-
list[_key3] = arguments[_key3];
|
|
7743
|
-
}
|
|
7945
|
+
publicAPI.get = (...list) => {
|
|
7744
7946
|
if (!list.length) {
|
|
7745
7947
|
return model;
|
|
7746
7948
|
}
|
|
@@ -7797,8 +7999,7 @@ function obj() {
|
|
|
7797
7999
|
};
|
|
7798
8000
|
|
|
7799
8001
|
// Add shallowCopy(otherInstance) support
|
|
7800
|
-
publicAPI.shallowCopy =
|
|
7801
|
-
let debug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
8002
|
+
publicAPI.shallowCopy = (other, debug = false) => {
|
|
7802
8003
|
if (other.getClassName() !== publicAPI.getClassName()) {
|
|
7803
8004
|
throw new Error(`Cannot ShallowCopy ${other.getClassName()} into ${publicAPI.getClassName()}`);
|
|
7804
8005
|
}
|
|
@@ -7903,10 +8104,7 @@ const objectSetterMap = {
|
|
|
7903
8104
|
vtkWarningMacro('Setter of type "object" with a single "param" field is not supported');
|
|
7904
8105
|
}
|
|
7905
8106
|
const onChanged = `_on${_capitalize(field.name)}Changed`;
|
|
7906
|
-
return
|
|
7907
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
7908
|
-
args[_key4] = arguments[_key4];
|
|
7909
|
-
}
|
|
8107
|
+
return (...args) => {
|
|
7910
8108
|
let value;
|
|
7911
8109
|
if (args.length > 1 && field.params?.length) {
|
|
7912
8110
|
value = field.params.reduce((acc, prop, idx) => Object.assign(acc, {
|
|
@@ -7990,21 +8188,17 @@ function getArray(publicAPI, model, fieldNames) {
|
|
|
7990
8188
|
// set...From: fast path to copy the content of an array to the current one without call to modified.
|
|
7991
8189
|
// ----------------------------------------------------------------------------
|
|
7992
8190
|
|
|
7993
|
-
function setArray(publicAPI, model, fieldNames, size) {
|
|
7994
|
-
let defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
8191
|
+
function setArray(publicAPI, model, fieldNames, size, defaultVal = undefined) {
|
|
7995
8192
|
fieldNames.forEach(field => {
|
|
7996
8193
|
if (model[field] && size && model[field].length !== size) {
|
|
7997
8194
|
throw new RangeError(`Invalid initial number of values for array (${field})`);
|
|
7998
8195
|
}
|
|
7999
8196
|
const onChanged = `_on${_capitalize(field)}Changed`;
|
|
8000
|
-
publicAPI[`set${_capitalize(field)}`] =
|
|
8197
|
+
publicAPI[`set${_capitalize(field)}`] = (...args) => {
|
|
8001
8198
|
if (model.deleted) {
|
|
8002
8199
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
8003
8200
|
return false;
|
|
8004
8201
|
}
|
|
8005
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8006
|
-
args[_key5] = arguments[_key5];
|
|
8007
|
-
}
|
|
8008
8202
|
let array = args;
|
|
8009
8203
|
let changeDetected;
|
|
8010
8204
|
let needCopy = false;
|
|
@@ -8056,8 +8250,7 @@ function setArray(publicAPI, model, fieldNames, size) {
|
|
|
8056
8250
|
// set/get XXX: add setter and getter for object of type array
|
|
8057
8251
|
// ----------------------------------------------------------------------------
|
|
8058
8252
|
|
|
8059
|
-
function setGetArray(publicAPI, model, fieldNames, size) {
|
|
8060
|
-
let defaultVal = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
8253
|
+
function setGetArray(publicAPI, model, fieldNames, size, defaultVal = undefined) {
|
|
8061
8254
|
getArray(publicAPI, model, fieldNames);
|
|
8062
8255
|
setArray(publicAPI, model, fieldNames, size, defaultVal);
|
|
8063
8256
|
}
|
|
@@ -8100,8 +8293,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8100
8293
|
model.numberOfInputs = numberOfInputs;
|
|
8101
8294
|
|
|
8102
8295
|
// Methods
|
|
8103
|
-
function setInputData(dataset) {
|
|
8104
|
-
let port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8296
|
+
function setInputData(dataset, port = 0) {
|
|
8105
8297
|
if (model.deleted) {
|
|
8106
8298
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
8107
8299
|
return;
|
|
@@ -8118,15 +8310,13 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8118
8310
|
}
|
|
8119
8311
|
}
|
|
8120
8312
|
}
|
|
8121
|
-
function getInputData() {
|
|
8122
|
-
let port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8313
|
+
function getInputData(port = 0) {
|
|
8123
8314
|
if (model.inputConnection[port]) {
|
|
8124
8315
|
model.inputData[port] = model.inputConnection[port]();
|
|
8125
8316
|
}
|
|
8126
8317
|
return model.inputData[port];
|
|
8127
8318
|
}
|
|
8128
|
-
function setInputConnection(outputPort) {
|
|
8129
|
-
let port = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
8319
|
+
function setInputConnection(outputPort, port = 0) {
|
|
8130
8320
|
if (model.deleted) {
|
|
8131
8321
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
8132
8322
|
return;
|
|
@@ -8141,8 +8331,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8141
8331
|
model.inputData[port] = null;
|
|
8142
8332
|
model.inputConnection[port] = outputPort;
|
|
8143
8333
|
}
|
|
8144
|
-
function getInputConnection() {
|
|
8145
|
-
let port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8334
|
+
function getInputConnection(port = 0) {
|
|
8146
8335
|
return model.inputConnection[port];
|
|
8147
8336
|
}
|
|
8148
8337
|
function getPortToFill() {
|
|
@@ -8169,8 +8358,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8169
8358
|
}
|
|
8170
8359
|
setInputData(dataset, getPortToFill());
|
|
8171
8360
|
}
|
|
8172
|
-
function getOutputData() {
|
|
8173
|
-
let port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8361
|
+
function getOutputData(port = 0) {
|
|
8174
8362
|
if (model.deleted) {
|
|
8175
8363
|
vtkErrorMacro('instance deleted - cannot call any method');
|
|
8176
8364
|
return null;
|
|
@@ -8204,8 +8392,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8204
8392
|
}
|
|
8205
8393
|
return false;
|
|
8206
8394
|
};
|
|
8207
|
-
function getOutputPort() {
|
|
8208
|
-
let port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8395
|
+
function getOutputPort(port = 0) {
|
|
8209
8396
|
const outputPortAccess = () => getOutputData(port);
|
|
8210
8397
|
// Add reference to filter
|
|
8211
8398
|
outputPortAccess.filter = publicAPI;
|
|
@@ -8256,8 +8443,7 @@ function algo(publicAPI, model, numberOfInputs, numberOfOutputs) {
|
|
|
8256
8443
|
}
|
|
8257
8444
|
return null;
|
|
8258
8445
|
};
|
|
8259
|
-
publicAPI.setInputArrayToProcess =
|
|
8260
|
-
let attributeType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Scalars';
|
|
8446
|
+
publicAPI.setInputArrayToProcess = (inputPort, arrayName, fieldAssociation, attributeType = 'Scalars') => {
|
|
8261
8447
|
while (model.inputArrayToProcess.length < inputPort) {
|
|
8262
8448
|
model.inputArrayToProcess.push(null);
|
|
8263
8449
|
}
|
|
@@ -8309,7 +8495,6 @@ function event(publicAPI, model, eventName) {
|
|
|
8309
8495
|
if (!cb) {
|
|
8310
8496
|
continue; // eslint-disable-line
|
|
8311
8497
|
}
|
|
8312
|
-
|
|
8313
8498
|
if (priority < 0) {
|
|
8314
8499
|
setTimeout(() => cb.apply(publicAPI, arguments), 1 - priority);
|
|
8315
8500
|
} else {
|
|
@@ -8322,10 +8507,8 @@ function event(publicAPI, model, eventName) {
|
|
|
8322
8507
|
}
|
|
8323
8508
|
/* eslint-enable prefer-rest-params */
|
|
8324
8509
|
}
|
|
8325
|
-
|
|
8326
8510
|
publicAPI[`invoke${_capitalize(eventName)}`] = invoke;
|
|
8327
|
-
publicAPI[`on${_capitalize(eventName)}`] =
|
|
8328
|
-
let priority = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.0;
|
|
8511
|
+
publicAPI[`on${_capitalize(eventName)}`] = (callback, priority = 0.0) => {
|
|
8329
8512
|
if (!callback.apply) {
|
|
8330
8513
|
console.error(`Invalid callback for event ${eventName}`);
|
|
8331
8514
|
return null;
|
|
@@ -8341,10 +8524,7 @@ function event(publicAPI, model, eventName) {
|
|
|
8341
8524
|
};
|
|
8342
8525
|
publicAPI.delete = () => {
|
|
8343
8526
|
previousDelete();
|
|
8344
|
-
callbacks.forEach(
|
|
8345
|
-
let [cbID] = _ref;
|
|
8346
|
-
return off(cbID);
|
|
8347
|
-
});
|
|
8527
|
+
callbacks.forEach(([cbID]) => off(cbID));
|
|
8348
8528
|
};
|
|
8349
8529
|
}
|
|
8350
8530
|
|
|
@@ -8353,8 +8533,7 @@ function event(publicAPI, model, eventName) {
|
|
|
8353
8533
|
// ----------------------------------------------------------------------------
|
|
8354
8534
|
|
|
8355
8535
|
function newInstance(extend, className) {
|
|
8356
|
-
const constructor =
|
|
8357
|
-
let initialValues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8536
|
+
const constructor = (initialValues = {}) => {
|
|
8358
8537
|
const model = {};
|
|
8359
8538
|
const publicAPI = {};
|
|
8360
8539
|
extend(publicAPI, model, initialValues);
|
|
@@ -8372,16 +8551,8 @@ function newInstance(extend, className) {
|
|
|
8372
8551
|
// Chain function calls
|
|
8373
8552
|
// ----------------------------------------------------------------------------
|
|
8374
8553
|
|
|
8375
|
-
function chain() {
|
|
8376
|
-
|
|
8377
|
-
fn[_key6] = arguments[_key6];
|
|
8378
|
-
}
|
|
8379
|
-
return function () {
|
|
8380
|
-
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8381
|
-
args[_key7] = arguments[_key7];
|
|
8382
|
-
}
|
|
8383
|
-
return fn.filter(i => !!i).map(i => i(...args));
|
|
8384
|
-
};
|
|
8554
|
+
function chain(...fn) {
|
|
8555
|
+
return (...args) => fn.filter(i => !!i).map(i => i(...args));
|
|
8385
8556
|
}
|
|
8386
8557
|
|
|
8387
8558
|
// ----------------------------------------------------------------------------
|
|
@@ -8391,9 +8562,7 @@ function chain() {
|
|
|
8391
8562
|
function isVtkObject(instance) {
|
|
8392
8563
|
return instance && instance.isA && instance.isA('vtkObject');
|
|
8393
8564
|
}
|
|
8394
|
-
function traverseInstanceTree(instance, extractFunction) {
|
|
8395
|
-
let accumulator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
8396
|
-
let visitedInstances = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
8565
|
+
function traverseInstanceTree(instance, extractFunction, accumulator = [], visitedInstances = []) {
|
|
8397
8566
|
if (isVtkObject(instance)) {
|
|
8398
8567
|
if (visitedInstances.indexOf(instance) >= 0) {
|
|
8399
8568
|
// avoid cycles
|
|
@@ -8428,13 +8597,9 @@ function traverseInstanceTree(instance, extractFunction) {
|
|
|
8428
8597
|
// leading edge, instead of the trailing.
|
|
8429
8598
|
|
|
8430
8599
|
function debounce(func, wait, immediate) {
|
|
8431
|
-
var _this = this;
|
|
8432
8600
|
let timeout;
|
|
8433
|
-
const debounced =
|
|
8434
|
-
|
|
8435
|
-
args[_key8] = arguments[_key8];
|
|
8436
|
-
}
|
|
8437
|
-
const context = _this;
|
|
8601
|
+
const debounced = (...args) => {
|
|
8602
|
+
const context = this;
|
|
8438
8603
|
const later = () => {
|
|
8439
8604
|
timeout = null;
|
|
8440
8605
|
if (!immediate) {
|
|
@@ -8466,10 +8631,7 @@ function throttle(callback, delay) {
|
|
|
8466
8631
|
argsToUse = null;
|
|
8467
8632
|
}
|
|
8468
8633
|
}
|
|
8469
|
-
function wrapper() {
|
|
8470
|
-
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
|
8471
|
-
args[_key9] = arguments[_key9];
|
|
8472
|
-
}
|
|
8634
|
+
function wrapper(...args) {
|
|
8473
8635
|
if (isThrottled) {
|
|
8474
8636
|
argsToUse = args;
|
|
8475
8637
|
return;
|
|
@@ -8494,8 +8656,7 @@ function throttle(callback, delay) {
|
|
|
8494
8656
|
// deleteKey(key) : Boolean
|
|
8495
8657
|
// ----------------------------------------------------------------------------
|
|
8496
8658
|
|
|
8497
|
-
function keystore(publicAPI, model) {
|
|
8498
|
-
let initialKeystore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8659
|
+
function keystore(publicAPI, model, initialKeystore = {}) {
|
|
8499
8660
|
model.keystore = Object.assign(model.keystore || {}, initialKeystore);
|
|
8500
8661
|
publicAPI.setKey = (key, value) => {
|
|
8501
8662
|
model.keystore[key] = value;
|
|
@@ -8557,8 +8718,7 @@ function proxy(publicAPI, model) {
|
|
|
8557
8718
|
registerProperties(model.ui, ROOT_GROUP_NAME);
|
|
8558
8719
|
publicAPI.modified();
|
|
8559
8720
|
};
|
|
8560
|
-
function listProxyProperties() {
|
|
8561
|
-
let gName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;
|
|
8721
|
+
function listProxyProperties(gName = ROOT_GROUP_NAME) {
|
|
8562
8722
|
return groupChildrenNames[gName];
|
|
8563
8723
|
}
|
|
8564
8724
|
publicAPI.updateProxyProperty = (propertyName, propUI) => {
|
|
@@ -8595,8 +8755,7 @@ function proxy(publicAPI, model) {
|
|
|
8595
8755
|
}
|
|
8596
8756
|
};
|
|
8597
8757
|
model.propertyLinkMap = {};
|
|
8598
|
-
publicAPI.getPropertyLink =
|
|
8599
|
-
let persistent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
8758
|
+
publicAPI.getPropertyLink = (id, persistent = false) => {
|
|
8600
8759
|
if (model.propertyLinkMap[id]) {
|
|
8601
8760
|
return model.propertyLinkMap[id];
|
|
8602
8761
|
}
|
|
@@ -8604,8 +8763,7 @@ function proxy(publicAPI, model) {
|
|
|
8604
8763
|
const links = [];
|
|
8605
8764
|
let count = 0;
|
|
8606
8765
|
let updateInProgress = false;
|
|
8607
|
-
function update(source) {
|
|
8608
|
-
let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
8766
|
+
function update(source, force = false) {
|
|
8609
8767
|
if (updateInProgress) {
|
|
8610
8768
|
return null;
|
|
8611
8769
|
}
|
|
@@ -8654,8 +8812,7 @@ function proxy(publicAPI, model) {
|
|
|
8654
8812
|
links.splice(indexToDelete.pop(), 1);
|
|
8655
8813
|
}
|
|
8656
8814
|
}
|
|
8657
|
-
function bind(instance, propertyName) {
|
|
8658
|
-
let updateMe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
8815
|
+
function bind(instance, propertyName, updateMe = false) {
|
|
8659
8816
|
const subscription = instance.onModified(update);
|
|
8660
8817
|
const other = links[0];
|
|
8661
8818
|
links.push({
|
|
@@ -8692,8 +8849,7 @@ function proxy(publicAPI, model) {
|
|
|
8692
8849
|
};
|
|
8693
8850
|
|
|
8694
8851
|
// extract values
|
|
8695
|
-
function getProperties() {
|
|
8696
|
-
let groupName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ROOT_GROUP_NAME;
|
|
8852
|
+
function getProperties(groupName = ROOT_GROUP_NAME) {
|
|
8697
8853
|
const values = [];
|
|
8698
8854
|
const id = model.proxyId;
|
|
8699
8855
|
const propertyNames = listProxyProperties(groupName) || [];
|
|
@@ -8820,9 +8976,7 @@ function proxyPropertyMapping(publicAPI, model, map) {
|
|
|
8820
8976
|
// get / set Representation ( string ) => push state to various internal objects
|
|
8821
8977
|
// ----------------------------------------------------------------------------
|
|
8822
8978
|
|
|
8823
|
-
function proxyPropertyState(publicAPI, model) {
|
|
8824
|
-
let state = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
8825
|
-
let defaults = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
8979
|
+
function proxyPropertyState(publicAPI, model, state = {}, defaults = {}) {
|
|
8826
8980
|
model.this = publicAPI;
|
|
8827
8981
|
function applyState(map) {
|
|
8828
8982
|
const modelKeys = Object.keys(map);
|