@wcardinal/wcardinal-ui 0.310.1 → 0.311.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.310.1
2
+ Winter Cardinal UI v0.311.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1366,6 +1366,17 @@
1366
1366
  var DASHED_DENSELY = 256;
1367
1367
  var DASHED_LOOSELY = 512;
1368
1368
  var CURVE = 1024;
1369
+ var FORMATTER_SHIFT = 10;
1370
+ var FORMATTER_MASK = 0xffc00;
1371
+ var FORMATTER_EXTENSION_LOWEST = 512;
1372
+ var FORMATTER_EXTENSION_HIGHEST = 1023;
1373
+ var FORMATTER_CURVE = 1;
1374
+ /**
1375
+ * EShape point style.
1376
+ *
1377
+ * * Bits 0 to 9: Bit field of styles.
1378
+ * * Bits 10 to 19: Formatter ID.
1379
+ */
1369
1380
  var EShapePointsStyle = {
1370
1381
  NONE: 0,
1371
1382
  CLOSED: CLOSED,
@@ -1394,7 +1405,11 @@
1394
1405
  /** @deprecated in favor of EShapeStrokeStyle. */
1395
1406
  DASHED_MASK: DASHED | DASHED_DENSELY | DASHED_LOOSELY,
1396
1407
  CURVE: CURVE,
1397
- FORMATTER_MASK: CURVE
1408
+ FORMATTER_SHIFT: FORMATTER_SHIFT,
1409
+ FORMATTER_MASK: FORMATTER_MASK,
1410
+ FORMATTER_EXTENSION_LOWEST: FORMATTER_EXTENSION_LOWEST,
1411
+ FORMATTER_EXTENSION_HIGHEST: FORMATTER_EXTENSION_HIGHEST,
1412
+ FORMATTER_CURVE: FORMATTER_CURVE
1398
1413
  };
1399
1414
 
1400
1415
  var buildColor = function (color, alpha, voffset, vcount, colors) {
@@ -18238,191 +18253,551 @@
18238
18253
  * Copyright (C) 2019 Toshiba Corporation
18239
18254
  * SPDX-License-Identifier: Apache-2.0
18240
18255
  */
18241
- var PID = Math.PI * 2;
18242
- var PIH = Math.PI * 0.5;
18243
- var vdot = function (x0, y0, x1, y1) {
18244
- return x0 * x1 + y0 * y1;
18245
- };
18246
- var vlen = function (x0, y0) {
18247
- return Math.sqrt(vdot(x0, y0, x0, y0));
18248
- };
18249
- var vcross = function (x0, y0, x1, y1) {
18250
- return x0 * y1 - y0 * x1;
18251
- };
18252
- var pnew = function () {
18253
- return {
18254
- center: [0, 0],
18255
- axis1: [0, 0],
18256
- axis2: [0, 0],
18257
- angle: [0, 0, 0]
18258
- };
18259
- };
18260
- var pset = function (cx, cy, a1x, a1y, a2x, a2y, angle1, angle2, angle3, result) {
18261
- var c = result.center;
18262
- c[0] = cx;
18263
- c[1] = cy;
18264
- var a1 = result.axis1;
18265
- a1[0] = a1x;
18266
- a1[1] = a1y;
18267
- var a2 = result.axis2;
18268
- a2[0] = a2x;
18269
- a2[1] = a2y;
18270
- var a = result.angle;
18271
- a[0] = angle1;
18272
- a[1] = angle2;
18273
- a[2] = angle3;
18274
- return result;
18275
- };
18276
- var pcopy = function (source, result) {
18277
- var c = source.center;
18278
- var a1 = source.axis1;
18279
- var a2 = source.axis2;
18280
- var a = source.angle;
18281
- return pset(c[0], c[1], a1[0], a1[1], a2[0], a2[1], a[0], a[1], a[2], result);
18282
- };
18283
- var acopy = function (source, result) {
18284
- var sourceLength = source.length;
18285
- for (var i = 0; i < sourceLength; ++i) {
18286
- result[i] = source[i];
18256
+ var toPointsBoundary = function (values, result) {
18257
+ var valuesLength = values.length;
18258
+ if (2 <= valuesLength) {
18259
+ var xmin = values[0];
18260
+ var ymin = values[1];
18261
+ var xmax = xmin;
18262
+ var ymax = ymin;
18263
+ for (var i = 2, imax = values.length; i < imax; i += 2) {
18264
+ var x = values[i];
18265
+ var y = values[i + 1];
18266
+ xmin = Math.min(xmin, x);
18267
+ ymin = Math.min(ymin, y);
18268
+ xmax = Math.max(xmax, x);
18269
+ ymax = Math.max(ymax, y);
18270
+ }
18271
+ result[0] = xmin;
18272
+ result[1] = ymin;
18273
+ result[2] = xmax;
18274
+ result[3] = ymax;
18287
18275
  }
18288
- if (result.length !== sourceLength) {
18289
- result.length = sourceLength;
18276
+ else {
18277
+ result[0] = 0;
18278
+ result[1] = 0;
18279
+ result[2] = 0;
18280
+ result[3] = 0;
18290
18281
  }
18291
18282
  return result;
18292
18283
  };
18293
- /**
18294
- * An utility class for spline curves based on the work of Cem Yuksel.
18295
- * Pleaase refer to the paper `A class of C2 interpolating splines`.
18296
- * http://www.cemyuksel.com/research/interpolating_splines/
18284
+
18285
+ /*
18286
+ * Copyright (C) 2019 Toshiba Corporation
18287
+ * SPDX-License-Identifier: Apache-2.0
18297
18288
  */
18298
- var UtilCurve = /** @class */ (function () {
18299
- function UtilCurve() {
18289
+ var EShapePointsMarkerBase = /** @class */ (function () {
18290
+ function EShapePointsMarkerBase(parent) {
18291
+ var _this = this;
18292
+ this._parent = parent;
18293
+ this._lockCount = 0;
18294
+ this._isTypeChanged = false;
18295
+ this._isSizeChanged = false;
18296
+ this._isFillChanged = false;
18297
+ this._type = EShapePointsMarkerType.NONE;
18298
+ this._size = new pixi_js.ObservablePoint(function () {
18299
+ _this.onSizeChange();
18300
+ }, undefined, EShapeDefaults.SIZE_X * 0.15, EShapeDefaults.SIZE_Y * 0.15);
18301
+ this._fill = this.newFill();
18302
+ this._transformId = 0;
18300
18303
  }
18301
- UtilCurve.set = function (center1, angle10, angle11, axis11, axis12, center2, angle20, angle21, axis21, axis22, nsegment, isAdaptive, isEdge, result, resultIndex) {
18302
- var a = Math.max(Math.abs(angle10 - angle11), Math.abs(angle20 - angle21));
18303
- var n = isAdaptive ? Math.max(1, Math.round(nsegment * (a / PIH))) : nsegment;
18304
- var imax = isEdge ? n + 1 : n;
18305
- for (var i = 0; i < imax; ++i) {
18306
- var t = i / n;
18307
- var w0 = 1 - t;
18308
- var w1 = t;
18309
- var t1 = w0 * angle10 + w1 * angle11;
18310
- var c1 = Math.cos(t1);
18311
- var s1 = Math.sin(t1);
18312
- var x1 = center1[0] + c1 * axis11[0] + s1 * axis12[0];
18313
- var y1 = center1[1] + c1 * axis11[1] + s1 * axis12[1];
18314
- var t2 = w0 * angle20 + w1 * angle21;
18315
- var c2 = Math.cos(t2);
18316
- var s2 = Math.sin(t2);
18317
- var x2 = center2[0] + c2 * axis21[0] + s2 * axis22[0];
18318
- var y2 = center2[1] + c2 * axis21[1] + s2 * axis22[1];
18319
- var t3 = PIH * t;
18320
- var c3 = Math.cos(t3);
18321
- var s3 = Math.sin(t3);
18322
- var cc3 = c3 * c3;
18323
- var ss3 = s3 * s3;
18324
- var x3 = cc3 * x1 + ss3 * x2;
18325
- var y3 = cc3 * y1 + ss3 * y2;
18326
- result[++resultIndex] = x3;
18327
- result[++resultIndex] = y3;
18328
- }
18329
- return resultIndex;
18304
+ EShapePointsMarkerBase.prototype.newFill = function () {
18305
+ return new EShapeFillImpl(this, true, EShapeDefaults.FILL_COLOR, 1);
18330
18306
  };
18331
- /**
18332
- * Calculate an interpolated points of the given control points.
18333
- *
18334
- * @param length A number of control points.
18335
- * @param values An array of control points.
18336
- * @param toParameter An interpolation method.
18337
- * @param isClosed True if the line is closed.
18338
- * @param nsegment The number of segments per 90 degree if isAdaptive is true.
18339
- * If isAdaptive is false, the number of segments is fixed to the given number
18340
- * regardless of arc angles.
18341
- * @param isAdaptive True to adjust the number of segments adaptively.
18342
- * @returns An interpolated points of the given control points.
18343
- */
18344
- UtilCurve.interpolate = function (length, values, segments, toParameter, isClosed, nsegment, isAdaptive, result) {
18345
- var rvalues = result.values;
18346
- var rsegments = result.segments;
18347
- if (length <= 2) {
18348
- acopy(values, rvalues);
18349
- acopy(segments, rsegments);
18350
- return result;
18307
+ EShapePointsMarkerBase.prototype.lock = function () {
18308
+ this._lockCount += 1;
18309
+ if (this._lockCount === 1) {
18310
+ this._isTypeChanged = false;
18311
+ this._isSizeChanged = false;
18312
+ this._isFillChanged = false;
18351
18313
  }
18352
- var c0 = this.WORK_P0 || pnew();
18353
- var c1 = this.WORK_P1 || pnew();
18354
- var c2 = this.WORK_P2 || pnew();
18355
- this.WORK_P0 = c0;
18356
- this.WORK_P1 = c1;
18357
- this.WORK_P2 = c2;
18358
- var rvaluesCount = -1;
18359
- var rsegmentCount = -1;
18360
- if (isClosed) {
18361
- toParameter(0, length, values, c0);
18362
- pcopy(c0, c1);
18363
- for (var i = 1; i < length; ++i) {
18364
- toParameter(i, length, values, c2);
18365
- if (0 <= toIndexOf(segments, i)) {
18366
- var index = (i - 1) << 1;
18367
- rvalues[++rvaluesCount] = values[index + 0];
18368
- rvalues[++rvaluesCount] = values[index + 1];
18369
- rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18370
- }
18371
- else {
18372
- rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c2.center, c2.angle[0], c2.angle[1], c2.axis1, c2.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18373
- }
18374
- var c3 = c1;
18375
- c1 = c2;
18376
- c2 = c3;
18314
+ return this;
18315
+ };
18316
+ EShapePointsMarkerBase.prototype.unlock = function () {
18317
+ this._lockCount -= 1;
18318
+ if (this._lockCount === 0) {
18319
+ if (this._isTypeChanged) {
18320
+ this.onTypeChange();
18377
18321
  }
18378
- if (0 <= toIndexOf(segments, 0)) {
18379
- var index = (length - 1) << 1;
18380
- rvalues[++rvaluesCount] = values[index + 0];
18381
- rvalues[++rvaluesCount] = values[index + 1];
18382
- rsegments.unshift(0);
18383
- rsegmentCount += 1;
18322
+ else if (this._isSizeChanged) {
18323
+ this.onSizeChange();
18384
18324
  }
18385
- else {
18386
- rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18325
+ else if (this._isFillChanged) {
18326
+ this.onFillChange();
18387
18327
  }
18328
+ this._isTypeChanged = false;
18329
+ this._isSizeChanged = false;
18330
+ this._isFillChanged = false;
18388
18331
  }
18389
- else {
18390
- toParameter(1, length, values, c0);
18391
- if (0 <= toIndexOf(segments, 1)) {
18392
- rvalues[++rvaluesCount] = values[0];
18393
- rvalues[++rvaluesCount] = values[1];
18394
- rsegments[++rsegmentCount] = 1;
18395
- }
18396
- else {
18397
- rvaluesCount = this.set(c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18398
- }
18399
- pcopy(c0, c1);
18400
- for (var i = 2, imax = length - 1; i < imax; ++i) {
18401
- toParameter(i, length, values, c2);
18402
- if (0 <= toIndexOf(segments, i)) {
18403
- var index = (i - 1) << 1;
18404
- rvalues[++rvaluesCount] = values[index + 0];
18405
- rvalues[++rvaluesCount] = values[index + 1];
18406
- rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18407
- }
18408
- else {
18409
- rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c2.center, c2.angle[0], c2.angle[1], c2.axis1, c2.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18410
- }
18411
- var c3 = c1;
18412
- c1 = c2;
18413
- c2 = c3;
18414
- }
18415
- if (0 <= toIndexOf(segments, length - 1)) {
18416
- var index = (length - 2) << 1;
18417
- rvalues[++rvaluesCount] = values[index + 0];
18418
- rvalues[++rvaluesCount] = values[index + 1];
18419
- rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18420
- }
18421
- else {
18422
- rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, nsegment, isAdaptive, true, rvalues, rvaluesCount);
18332
+ return this;
18333
+ };
18334
+ Object.defineProperty(EShapePointsMarkerBase.prototype, "type", {
18335
+ get: function () {
18336
+ return this._type;
18337
+ },
18338
+ set: function (type) {
18339
+ if (this._type !== type) {
18340
+ this._type = type;
18341
+ this.onTypeChange();
18423
18342
  }
18343
+ },
18344
+ enumerable: false,
18345
+ configurable: true
18346
+ });
18347
+ EShapePointsMarkerBase.prototype.onTypeChange = function () {
18348
+ if (0 < this._lockCount) {
18349
+ this._isTypeChanged = true;
18350
+ return;
18424
18351
  }
18425
- rvaluesCount += 1;
18352
+ this._parent.onTypeChange();
18353
+ };
18354
+ Object.defineProperty(EShapePointsMarkerBase.prototype, "size", {
18355
+ get: function () {
18356
+ return this._size;
18357
+ },
18358
+ enumerable: false,
18359
+ configurable: true
18360
+ });
18361
+ EShapePointsMarkerBase.prototype.onSizeChange = function () {
18362
+ if (0 < this._lockCount) {
18363
+ this._isSizeChanged = true;
18364
+ return;
18365
+ }
18366
+ this._parent.onSizeChange();
18367
+ };
18368
+ Object.defineProperty(EShapePointsMarkerBase.prototype, "transform", {
18369
+ get: function () {
18370
+ return this.updateTransform();
18371
+ },
18372
+ enumerable: false,
18373
+ configurable: true
18374
+ });
18375
+ EShapePointsMarkerBase.prototype.updateTransform = function () {
18376
+ var result = this._transform;
18377
+ if (result == null) {
18378
+ result = new pixi_js.Matrix();
18379
+ this._transform = result;
18380
+ }
18381
+ var parentParent = this._parent.parent;
18382
+ var id = parentParent.id;
18383
+ if (this._transformId !== id) {
18384
+ this._transformId = id;
18385
+ var formatted = parentParent.formatted;
18386
+ if (2 <= formatted.length) {
18387
+ this.toTransform(formatted.values, result);
18388
+ }
18389
+ else {
18390
+ result.identity();
18391
+ }
18392
+ }
18393
+ return result;
18394
+ };
18395
+ EShapePointsMarkerBase.prototype.toTransformMatrix = function (x0, y0, x1, y1, result) {
18396
+ var dx = x0 - x1;
18397
+ var dy = y0 - y1;
18398
+ var n = dx * dx + dy * dy;
18399
+ if (0.00001 < n) {
18400
+ var f = 1 / Math.sqrt(n);
18401
+ var nx = dx * f;
18402
+ var ny = dy * f;
18403
+ result.set(ny, -nx, -nx, -ny, x0, y0);
18404
+ }
18405
+ else {
18406
+ result.set(1, 0, 0, 1, x0, y0);
18407
+ }
18408
+ return result;
18409
+ };
18410
+ Object.defineProperty(EShapePointsMarkerBase.prototype, "fill", {
18411
+ get: function () {
18412
+ return this._fill;
18413
+ },
18414
+ enumerable: false,
18415
+ configurable: true
18416
+ });
18417
+ EShapePointsMarkerBase.prototype.onFillChange = function () {
18418
+ if (0 < this._lockCount) {
18419
+ this._isFillChanged = true;
18420
+ return;
18421
+ }
18422
+ this._parent.onFillChange();
18423
+ };
18424
+ EShapePointsMarkerBase.prototype.updateUploaded = function () {
18425
+ this.onFillChange();
18426
+ };
18427
+ EShapePointsMarkerBase.prototype.copy = function (source) {
18428
+ var size = source.size;
18429
+ this.set(source.type, size.x, size.y);
18430
+ return this;
18431
+ };
18432
+ EShapePointsMarkerBase.prototype.set = function (type, sizeX, sizeY) {
18433
+ this.lock();
18434
+ if (type != null) {
18435
+ this.type = type;
18436
+ }
18437
+ this.size.set(sizeX, sizeY);
18438
+ this.unlock();
18439
+ return this;
18440
+ };
18441
+ EShapePointsMarkerBase.prototype.serialize = function (manager) {
18442
+ var size = this._size;
18443
+ var fillId = this._fill.serialize(manager);
18444
+ return manager.addResource("[".concat(this._type, ",").concat(size.x, ",").concat(size.y, ",").concat(fillId, "]"));
18445
+ };
18446
+ EShapePointsMarkerBase.prototype.deserialize = function (resourceId, manager) {
18447
+ var resources = manager.resources;
18448
+ if (0 <= resourceId && resourceId < resources.length) {
18449
+ var parsed = manager.getExtension(resourceId);
18450
+ if (parsed == null) {
18451
+ parsed = JSON.parse(resources[resourceId]);
18452
+ manager.setExtension(resourceId, parsed);
18453
+ }
18454
+ this.lock();
18455
+ this.type = parsed[0];
18456
+ this._size.set(parsed[1], parsed[2]);
18457
+ this._fill.deserialize(parsed[3], manager);
18458
+ this.unlock();
18459
+ }
18460
+ };
18461
+ return EShapePointsMarkerBase;
18462
+ }());
18463
+
18464
+ var EShapePointsMarkerHead = /** @class */ (function (_super) {
18465
+ __extends(EShapePointsMarkerHead, _super);
18466
+ function EShapePointsMarkerHead() {
18467
+ return _super !== null && _super.apply(this, arguments) || this;
18468
+ }
18469
+ EShapePointsMarkerHead.prototype.toTransform = function (values, result) {
18470
+ var valuesLength = values.length;
18471
+ if (4 <= valuesLength) {
18472
+ return this.toTransformMatrix(values[valuesLength - 2], values[valuesLength - 1], values[valuesLength - 4], values[valuesLength - 3], result);
18473
+ }
18474
+ else {
18475
+ result.identity();
18476
+ }
18477
+ return result;
18478
+ };
18479
+ return EShapePointsMarkerHead;
18480
+ }(EShapePointsMarkerBase));
18481
+
18482
+ var EShapePointsMarkerTail = /** @class */ (function (_super) {
18483
+ __extends(EShapePointsMarkerTail, _super);
18484
+ function EShapePointsMarkerTail() {
18485
+ return _super !== null && _super.apply(this, arguments) || this;
18486
+ }
18487
+ EShapePointsMarkerTail.prototype.toTransform = function (values, result) {
18488
+ var valuesLength = values.length;
18489
+ if (4 <= valuesLength) {
18490
+ return this.toTransformMatrix(values[0], values[1], values[2], values[3], result);
18491
+ }
18492
+ else {
18493
+ result.identity();
18494
+ }
18495
+ return result;
18496
+ };
18497
+ return EShapePointsMarkerTail;
18498
+ }(EShapePointsMarkerBase));
18499
+
18500
+ /*
18501
+ * Copyright (C) 2019 Toshiba Corporation
18502
+ * SPDX-License-Identifier: Apache-2.0
18503
+ */
18504
+ var EShapePointsMarkerContainerImpl = /** @class */ (function () {
18505
+ function EShapePointsMarkerContainerImpl(parent) {
18506
+ this._parent = parent;
18507
+ this._lockCount = 0;
18508
+ this._isTypeChanged = false;
18509
+ this._isSizeChanged = false;
18510
+ this._isFillChanged = false;
18511
+ this._head = new EShapePointsMarkerHead(this);
18512
+ this._tail = new EShapePointsMarkerTail(this);
18513
+ }
18514
+ EShapePointsMarkerContainerImpl.prototype.lock = function () {
18515
+ this._lockCount += 1;
18516
+ if (this._lockCount === 1) {
18517
+ this._isTypeChanged = false;
18518
+ this._isSizeChanged = false;
18519
+ this._isFillChanged = false;
18520
+ }
18521
+ return this;
18522
+ };
18523
+ EShapePointsMarkerContainerImpl.prototype.unlock = function () {
18524
+ this._lockCount -= 1;
18525
+ if (this._lockCount === 0) {
18526
+ if (this._isTypeChanged) {
18527
+ this.onTypeChange();
18528
+ }
18529
+ else if (this._isSizeChanged) {
18530
+ this.onSizeChange();
18531
+ }
18532
+ else if (this._isFillChanged) {
18533
+ this.onFillChange();
18534
+ }
18535
+ this._isTypeChanged = false;
18536
+ this._isSizeChanged = false;
18537
+ this._isFillChanged = false;
18538
+ }
18539
+ return this;
18540
+ };
18541
+ Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "parent", {
18542
+ get: function () {
18543
+ return this._parent;
18544
+ },
18545
+ enumerable: false,
18546
+ configurable: true
18547
+ });
18548
+ Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "head", {
18549
+ get: function () {
18550
+ return this._head;
18551
+ },
18552
+ enumerable: false,
18553
+ configurable: true
18554
+ });
18555
+ Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "tail", {
18556
+ get: function () {
18557
+ return this._tail;
18558
+ },
18559
+ enumerable: false,
18560
+ configurable: true
18561
+ });
18562
+ EShapePointsMarkerContainerImpl.prototype.onTypeChange = function () {
18563
+ if (0 < this._lockCount) {
18564
+ this._isTypeChanged = true;
18565
+ return;
18566
+ }
18567
+ this._parent.onMarkerTypeChange();
18568
+ };
18569
+ EShapePointsMarkerContainerImpl.prototype.onSizeChange = function () {
18570
+ if (0 < this._lockCount) {
18571
+ this._isSizeChanged = true;
18572
+ return;
18573
+ }
18574
+ this._parent.onMarkerSizeChange();
18575
+ };
18576
+ EShapePointsMarkerContainerImpl.prototype.onFillChange = function () {
18577
+ if (0 < this._lockCount) {
18578
+ this._isFillChanged = true;
18579
+ return;
18580
+ }
18581
+ this._parent.onMarkerFillChange();
18582
+ };
18583
+ EShapePointsMarkerContainerImpl.prototype.copy = function (source) {
18584
+ this.lock();
18585
+ this._head.copy(source.head);
18586
+ this._tail.copy(source.tail);
18587
+ this.unlock();
18588
+ return this;
18589
+ };
18590
+ EShapePointsMarkerContainerImpl.prototype.serialize = function (manager) {
18591
+ var headId = this._head.serialize(manager);
18592
+ var tailId = this._tail.serialize(manager);
18593
+ return manager.addResource("[".concat(headId, ",").concat(tailId, "]"));
18594
+ };
18595
+ EShapePointsMarkerContainerImpl.prototype.deserialize = function (resourceId, manager) {
18596
+ var resources = manager.resources;
18597
+ if (0 <= resourceId && resourceId < resources.length) {
18598
+ var parsed = manager.getExtension(resourceId);
18599
+ if (parsed == null) {
18600
+ parsed = JSON.parse(resources[resourceId]);
18601
+ manager.setExtension(resourceId, parsed);
18602
+ }
18603
+ this.lock();
18604
+ this._head.deserialize(parsed[0], manager);
18605
+ this._tail.deserialize(parsed[1], manager);
18606
+ this.unlock();
18607
+ }
18608
+ };
18609
+ return EShapePointsMarkerContainerImpl;
18610
+ }());
18611
+
18612
+ /*
18613
+ * Copyright (C) 2019 Toshiba Corporation
18614
+ * SPDX-License-Identifier: Apache-2.0
18615
+ */
18616
+ var PID = Math.PI * 2;
18617
+ var PIH = Math.PI * 0.5;
18618
+ var vdot = function (x0, y0, x1, y1) {
18619
+ return x0 * x1 + y0 * y1;
18620
+ };
18621
+ var vlen = function (x0, y0) {
18622
+ return Math.sqrt(vdot(x0, y0, x0, y0));
18623
+ };
18624
+ var vcross = function (x0, y0, x1, y1) {
18625
+ return x0 * y1 - y0 * x1;
18626
+ };
18627
+ var pnew = function () {
18628
+ return {
18629
+ center: [0, 0],
18630
+ axis1: [0, 0],
18631
+ axis2: [0, 0],
18632
+ angle: [0, 0, 0]
18633
+ };
18634
+ };
18635
+ var pset = function (cx, cy, a1x, a1y, a2x, a2y, angle1, angle2, angle3, result) {
18636
+ var c = result.center;
18637
+ c[0] = cx;
18638
+ c[1] = cy;
18639
+ var a1 = result.axis1;
18640
+ a1[0] = a1x;
18641
+ a1[1] = a1y;
18642
+ var a2 = result.axis2;
18643
+ a2[0] = a2x;
18644
+ a2[1] = a2y;
18645
+ var a = result.angle;
18646
+ a[0] = angle1;
18647
+ a[1] = angle2;
18648
+ a[2] = angle3;
18649
+ return result;
18650
+ };
18651
+ var pcopy = function (source, result) {
18652
+ var c = source.center;
18653
+ var a1 = source.axis1;
18654
+ var a2 = source.axis2;
18655
+ var a = source.angle;
18656
+ return pset(c[0], c[1], a1[0], a1[1], a2[0], a2[1], a[0], a[1], a[2], result);
18657
+ };
18658
+ var acopy = function (source, result) {
18659
+ var sourceLength = source.length;
18660
+ for (var i = 0; i < sourceLength; ++i) {
18661
+ result[i] = source[i];
18662
+ }
18663
+ if (result.length !== sourceLength) {
18664
+ result.length = sourceLength;
18665
+ }
18666
+ return result;
18667
+ };
18668
+ /**
18669
+ * An utility class for spline curves based on the work of Cem Yuksel.
18670
+ * Pleaase refer to the paper `A class of C2 interpolating splines`.
18671
+ * http://www.cemyuksel.com/research/interpolating_splines/
18672
+ */
18673
+ var UtilCurve = /** @class */ (function () {
18674
+ function UtilCurve() {
18675
+ }
18676
+ UtilCurve.set = function (center1, angle10, angle11, axis11, axis12, center2, angle20, angle21, axis21, axis22, nsegment, isAdaptive, isEdge, result, resultIndex) {
18677
+ var a = Math.max(Math.abs(angle10 - angle11), Math.abs(angle20 - angle21));
18678
+ var n = isAdaptive ? Math.max(1, Math.round(nsegment * (a / PIH))) : nsegment;
18679
+ var imax = isEdge ? n + 1 : n;
18680
+ for (var i = 0; i < imax; ++i) {
18681
+ var t = i / n;
18682
+ var w0 = 1 - t;
18683
+ var w1 = t;
18684
+ var t1 = w0 * angle10 + w1 * angle11;
18685
+ var c1 = Math.cos(t1);
18686
+ var s1 = Math.sin(t1);
18687
+ var x1 = center1[0] + c1 * axis11[0] + s1 * axis12[0];
18688
+ var y1 = center1[1] + c1 * axis11[1] + s1 * axis12[1];
18689
+ var t2 = w0 * angle20 + w1 * angle21;
18690
+ var c2 = Math.cos(t2);
18691
+ var s2 = Math.sin(t2);
18692
+ var x2 = center2[0] + c2 * axis21[0] + s2 * axis22[0];
18693
+ var y2 = center2[1] + c2 * axis21[1] + s2 * axis22[1];
18694
+ var t3 = PIH * t;
18695
+ var c3 = Math.cos(t3);
18696
+ var s3 = Math.sin(t3);
18697
+ var cc3 = c3 * c3;
18698
+ var ss3 = s3 * s3;
18699
+ var x3 = cc3 * x1 + ss3 * x2;
18700
+ var y3 = cc3 * y1 + ss3 * y2;
18701
+ result[++resultIndex] = x3;
18702
+ result[++resultIndex] = y3;
18703
+ }
18704
+ return resultIndex;
18705
+ };
18706
+ /**
18707
+ * Calculate an interpolated points of the given control points.
18708
+ *
18709
+ * @param length A number of control points.
18710
+ * @param values An array of control points.
18711
+ * @param toParameter An interpolation method.
18712
+ * @param isClosed True if the line is closed.
18713
+ * @param nsegment The number of segments per 90 degree if isAdaptive is true.
18714
+ * If isAdaptive is false, the number of segments is fixed to the given number
18715
+ * regardless of arc angles.
18716
+ * @param isAdaptive True to adjust the number of segments adaptively.
18717
+ * @returns An interpolated points of the given control points.
18718
+ */
18719
+ UtilCurve.interpolate = function (length, values, segments, toParameter, isClosed, nsegment, isAdaptive, result) {
18720
+ var rvalues = result.values;
18721
+ var rsegments = result.segments;
18722
+ if (length <= 2) {
18723
+ acopy(values, rvalues);
18724
+ acopy(segments, rsegments);
18725
+ return result;
18726
+ }
18727
+ var c0 = this.WORK_P0 || pnew();
18728
+ var c1 = this.WORK_P1 || pnew();
18729
+ var c2 = this.WORK_P2 || pnew();
18730
+ this.WORK_P0 = c0;
18731
+ this.WORK_P1 = c1;
18732
+ this.WORK_P2 = c2;
18733
+ var rvaluesCount = -1;
18734
+ var rsegmentCount = -1;
18735
+ if (isClosed) {
18736
+ toParameter(0, length, values, c0);
18737
+ pcopy(c0, c1);
18738
+ for (var i = 1; i < length; ++i) {
18739
+ toParameter(i, length, values, c2);
18740
+ if (0 <= toIndexOf(segments, i)) {
18741
+ var index = (i - 1) << 1;
18742
+ rvalues[++rvaluesCount] = values[index + 0];
18743
+ rvalues[++rvaluesCount] = values[index + 1];
18744
+ rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18745
+ }
18746
+ else {
18747
+ rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c2.center, c2.angle[0], c2.angle[1], c2.axis1, c2.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18748
+ }
18749
+ var c3 = c1;
18750
+ c1 = c2;
18751
+ c2 = c3;
18752
+ }
18753
+ if (0 <= toIndexOf(segments, 0)) {
18754
+ var index = (length - 1) << 1;
18755
+ rvalues[++rvaluesCount] = values[index + 0];
18756
+ rvalues[++rvaluesCount] = values[index + 1];
18757
+ rsegments.unshift(0);
18758
+ rsegmentCount += 1;
18759
+ }
18760
+ else {
18761
+ rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18762
+ }
18763
+ }
18764
+ else {
18765
+ toParameter(1, length, values, c0);
18766
+ if (0 <= toIndexOf(segments, 1)) {
18767
+ rvalues[++rvaluesCount] = values[0];
18768
+ rvalues[++rvaluesCount] = values[1];
18769
+ rsegments[++rsegmentCount] = 1;
18770
+ }
18771
+ else {
18772
+ rvaluesCount = this.set(c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, c0.center, c0.angle[0], c0.angle[1], c0.axis1, c0.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18773
+ }
18774
+ pcopy(c0, c1);
18775
+ for (var i = 2, imax = length - 1; i < imax; ++i) {
18776
+ toParameter(i, length, values, c2);
18777
+ if (0 <= toIndexOf(segments, i)) {
18778
+ var index = (i - 1) << 1;
18779
+ rvalues[++rvaluesCount] = values[index + 0];
18780
+ rvalues[++rvaluesCount] = values[index + 1];
18781
+ rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18782
+ }
18783
+ else {
18784
+ rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c2.center, c2.angle[0], c2.angle[1], c2.axis1, c2.axis2, nsegment, isAdaptive, false, rvalues, rvaluesCount);
18785
+ }
18786
+ var c3 = c1;
18787
+ c1 = c2;
18788
+ c2 = c3;
18789
+ }
18790
+ if (0 <= toIndexOf(segments, length - 1)) {
18791
+ var index = (length - 2) << 1;
18792
+ rvalues[++rvaluesCount] = values[index + 0];
18793
+ rvalues[++rvaluesCount] = values[index + 1];
18794
+ rsegments[++rsegmentCount] = (rvaluesCount + 1) >> 1;
18795
+ }
18796
+ else {
18797
+ rvaluesCount = this.set(c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, c1.center, c1.angle[1], c1.angle[2], c1.axis1, c1.axis2, nsegment, isAdaptive, true, rvalues, rvaluesCount);
18798
+ }
18799
+ }
18800
+ rvaluesCount += 1;
18426
18801
  if (rvalues.length !== rvaluesCount) {
18427
18802
  rvalues.length = rvaluesCount;
18428
18803
  }
@@ -18560,429 +18935,99 @@
18560
18935
  var e3y = d12y / l2;
18561
18936
  var n3x = void 0, n3y = void 0;
18562
18937
  if (0 < vcross(d10x, d10y, d12x, d12y)) {
18563
- n3x = +e3y;
18564
- n3y = -e3x;
18565
- }
18566
- else {
18567
- n3x = -e3y;
18568
- n3y = +e3x;
18569
- }
18570
- var we = -(b * b) / l2;
18571
- var wn = -(b * a) / l2;
18572
- var a1x = we * e3x + wn * n3x;
18573
- var a1y = we * e3y + wn * n3y;
18574
- var cx = x1 - a1x;
18575
- var cy = y1 - a1y;
18576
- var a2x = x2 - cx;
18577
- var a2y = y2 - cy;
18578
- return pset(cx, cy, a1x, a1y, a2x, a2y, -beta, 0, PIH, result);
18579
- }
18580
- else {
18581
- var e0x = d10x / l0;
18582
- var e0y = d10y / l0;
18583
- var n3x = void 0, n3y = void 0;
18584
- if (vcross(d10x, d10y, d12x, d12y) < 0) {
18585
- n3x = +e0y;
18586
- n3y = -e0x;
18587
- }
18588
- else {
18589
- n3x = -e0y;
18590
- n3y = +e0x;
18591
- }
18592
- var we = -(b * b) / l0;
18593
- var wn = -(b * a) / l0;
18594
- var a1x = we * e0x + wn * n3x;
18595
- var a1y = we * e0y + wn * n3y;
18596
- var cx = x1 - a1x;
18597
- var cy = y1 - a1y;
18598
- var a2x = x0 - cx;
18599
- var a2y = y0 - cy;
18600
- return pset(cx, cy, a1x, a1y, -a2x, -a2y, -PIH, 0, beta, result);
18601
- }
18602
- };
18603
- UtilCurve.toHybrid = function (index, length, values, result) {
18604
- var circle = UtilCurve.toCircle(index, length, values, result);
18605
- var a0 = circle.angle[0];
18606
- var a2 = circle.angle[2];
18607
- var amin = Math.min(a0, a2);
18608
- var amax = Math.max(a0, a2);
18609
- if (amin < -PIH || PIH < amax) {
18610
- return UtilCurve.toEllipse(index, length, values, result);
18611
- }
18612
- return circle;
18613
- };
18614
- return UtilCurve;
18615
- }());
18616
-
18617
- /*
18618
- * Copyright (C) 2019 Toshiba Corporation
18619
- * SPDX-License-Identifier: Apache-2.0
18620
- */
18621
- var eShapePointsFormatterCurve = function (length, values, segments, style, result) {
18622
- UtilCurve.interpolate(length, values, segments, UtilCurve.toHybrid, !!(style & EShapePointsStyle.CLOSED), EShapeDefaults.CURVE_SEGMENT_COUNT, true, result);
18623
- result.length = result.values.length >> 1;
18624
- result.style = style;
18625
- return result;
18626
- };
18627
-
18628
- /*
18629
- * Copyright (C) 2019 Toshiba Corporation
18630
- * SPDX-License-Identifier: Apache-2.0
18631
- */
18632
- var toPointsBoundary = function (values, result) {
18633
- var valuesLength = values.length;
18634
- if (2 <= valuesLength) {
18635
- var xmin = values[0];
18636
- var ymin = values[1];
18637
- var xmax = xmin;
18638
- var ymax = ymin;
18639
- for (var i = 2, imax = values.length; i < imax; i += 2) {
18640
- var x = values[i];
18641
- var y = values[i + 1];
18642
- xmin = Math.min(xmin, x);
18643
- ymin = Math.min(ymin, y);
18644
- xmax = Math.max(xmax, x);
18645
- ymax = Math.max(ymax, y);
18646
- }
18647
- result[0] = xmin;
18648
- result[1] = ymin;
18649
- result[2] = xmax;
18650
- result[3] = ymax;
18651
- }
18652
- else {
18653
- result[0] = 0;
18654
- result[1] = 0;
18655
- result[2] = 0;
18656
- result[3] = 0;
18657
- }
18658
- return result;
18659
- };
18660
-
18661
- /*
18662
- * Copyright (C) 2019 Toshiba Corporation
18663
- * SPDX-License-Identifier: Apache-2.0
18664
- */
18665
- var EShapePointsMarkerBase = /** @class */ (function () {
18666
- function EShapePointsMarkerBase(parent) {
18667
- var _this = this;
18668
- this._parent = parent;
18669
- this._lockCount = 0;
18670
- this._isTypeChanged = false;
18671
- this._isSizeChanged = false;
18672
- this._isFillChanged = false;
18673
- this._type = EShapePointsMarkerType.NONE;
18674
- this._size = new pixi_js.ObservablePoint(function () {
18675
- _this.onSizeChange();
18676
- }, undefined, EShapeDefaults.SIZE_X * 0.15, EShapeDefaults.SIZE_Y * 0.15);
18677
- this._fill = this.newFill();
18678
- this._transformId = 0;
18679
- }
18680
- EShapePointsMarkerBase.prototype.newFill = function () {
18681
- return new EShapeFillImpl(this, true, EShapeDefaults.FILL_COLOR, 1);
18682
- };
18683
- EShapePointsMarkerBase.prototype.lock = function () {
18684
- this._lockCount += 1;
18685
- if (this._lockCount === 1) {
18686
- this._isTypeChanged = false;
18687
- this._isSizeChanged = false;
18688
- this._isFillChanged = false;
18689
- }
18690
- return this;
18691
- };
18692
- EShapePointsMarkerBase.prototype.unlock = function () {
18693
- this._lockCount -= 1;
18694
- if (this._lockCount === 0) {
18695
- if (this._isTypeChanged) {
18696
- this.onTypeChange();
18697
- }
18698
- else if (this._isSizeChanged) {
18699
- this.onSizeChange();
18700
- }
18701
- else if (this._isFillChanged) {
18702
- this.onFillChange();
18703
- }
18704
- this._isTypeChanged = false;
18705
- this._isSizeChanged = false;
18706
- this._isFillChanged = false;
18707
- }
18708
- return this;
18709
- };
18710
- Object.defineProperty(EShapePointsMarkerBase.prototype, "type", {
18711
- get: function () {
18712
- return this._type;
18713
- },
18714
- set: function (type) {
18715
- if (this._type !== type) {
18716
- this._type = type;
18717
- this.onTypeChange();
18718
- }
18719
- },
18720
- enumerable: false,
18721
- configurable: true
18722
- });
18723
- EShapePointsMarkerBase.prototype.onTypeChange = function () {
18724
- if (0 < this._lockCount) {
18725
- this._isTypeChanged = true;
18726
- return;
18727
- }
18728
- this._parent.onTypeChange();
18729
- };
18730
- Object.defineProperty(EShapePointsMarkerBase.prototype, "size", {
18731
- get: function () {
18732
- return this._size;
18733
- },
18734
- enumerable: false,
18735
- configurable: true
18736
- });
18737
- EShapePointsMarkerBase.prototype.onSizeChange = function () {
18738
- if (0 < this._lockCount) {
18739
- this._isSizeChanged = true;
18740
- return;
18741
- }
18742
- this._parent.onSizeChange();
18743
- };
18744
- Object.defineProperty(EShapePointsMarkerBase.prototype, "transform", {
18745
- get: function () {
18746
- return this.updateTransform();
18747
- },
18748
- enumerable: false,
18749
- configurable: true
18750
- });
18751
- EShapePointsMarkerBase.prototype.updateTransform = function () {
18752
- var result = this._transform;
18753
- if (result == null) {
18754
- result = new pixi_js.Matrix();
18755
- this._transform = result;
18756
- }
18757
- var parentParent = this._parent.parent;
18758
- var id = parentParent.id;
18759
- if (this._transformId !== id) {
18760
- this._transformId = id;
18761
- var formatted = parentParent.formatted;
18762
- if (2 <= formatted.length) {
18763
- this.toTransform(formatted.values, result);
18938
+ n3x = +e3y;
18939
+ n3y = -e3x;
18764
18940
  }
18765
18941
  else {
18766
- result.identity();
18942
+ n3x = -e3y;
18943
+ n3y = +e3x;
18767
18944
  }
18768
- }
18769
- return result;
18770
- };
18771
- EShapePointsMarkerBase.prototype.toTransformMatrix = function (x0, y0, x1, y1, result) {
18772
- var dx = x0 - x1;
18773
- var dy = y0 - y1;
18774
- var n = dx * dx + dy * dy;
18775
- if (0.00001 < n) {
18776
- var f = 1 / Math.sqrt(n);
18777
- var nx = dx * f;
18778
- var ny = dy * f;
18779
- result.set(ny, -nx, -nx, -ny, x0, y0);
18945
+ var we = -(b * b) / l2;
18946
+ var wn = -(b * a) / l2;
18947
+ var a1x = we * e3x + wn * n3x;
18948
+ var a1y = we * e3y + wn * n3y;
18949
+ var cx = x1 - a1x;
18950
+ var cy = y1 - a1y;
18951
+ var a2x = x2 - cx;
18952
+ var a2y = y2 - cy;
18953
+ return pset(cx, cy, a1x, a1y, a2x, a2y, -beta, 0, PIH, result);
18780
18954
  }
18781
18955
  else {
18782
- result.set(1, 0, 0, 1, x0, y0);
18783
- }
18784
- return result;
18785
- };
18786
- Object.defineProperty(EShapePointsMarkerBase.prototype, "fill", {
18787
- get: function () {
18788
- return this._fill;
18789
- },
18790
- enumerable: false,
18791
- configurable: true
18792
- });
18793
- EShapePointsMarkerBase.prototype.onFillChange = function () {
18794
- if (0 < this._lockCount) {
18795
- this._isFillChanged = true;
18796
- return;
18797
- }
18798
- this._parent.onFillChange();
18799
- };
18800
- EShapePointsMarkerBase.prototype.updateUploaded = function () {
18801
- this.onFillChange();
18802
- };
18803
- EShapePointsMarkerBase.prototype.copy = function (source) {
18804
- var size = source.size;
18805
- this.set(source.type, size.x, size.y);
18806
- return this;
18807
- };
18808
- EShapePointsMarkerBase.prototype.set = function (type, sizeX, sizeY) {
18809
- this.lock();
18810
- if (type != null) {
18811
- this.type = type;
18812
- }
18813
- this.size.set(sizeX, sizeY);
18814
- this.unlock();
18815
- return this;
18816
- };
18817
- EShapePointsMarkerBase.prototype.serialize = function (manager) {
18818
- var size = this._size;
18819
- var fillId = this._fill.serialize(manager);
18820
- return manager.addResource("[".concat(this._type, ",").concat(size.x, ",").concat(size.y, ",").concat(fillId, "]"));
18821
- };
18822
- EShapePointsMarkerBase.prototype.deserialize = function (resourceId, manager) {
18823
- var resources = manager.resources;
18824
- if (0 <= resourceId && resourceId < resources.length) {
18825
- var parsed = manager.getExtension(resourceId);
18826
- if (parsed == null) {
18827
- parsed = JSON.parse(resources[resourceId]);
18828
- manager.setExtension(resourceId, parsed);
18956
+ var e0x = d10x / l0;
18957
+ var e0y = d10y / l0;
18958
+ var n3x = void 0, n3y = void 0;
18959
+ if (vcross(d10x, d10y, d12x, d12y) < 0) {
18960
+ n3x = +e0y;
18961
+ n3y = -e0x;
18829
18962
  }
18830
- this.lock();
18831
- this.type = parsed[0];
18832
- this._size.set(parsed[1], parsed[2]);
18833
- this._fill.deserialize(parsed[3], manager);
18834
- this.unlock();
18963
+ else {
18964
+ n3x = -e0y;
18965
+ n3y = +e0x;
18966
+ }
18967
+ var we = -(b * b) / l0;
18968
+ var wn = -(b * a) / l0;
18969
+ var a1x = we * e0x + wn * n3x;
18970
+ var a1y = we * e0y + wn * n3y;
18971
+ var cx = x1 - a1x;
18972
+ var cy = y1 - a1y;
18973
+ var a2x = x0 - cx;
18974
+ var a2y = y0 - cy;
18975
+ return pset(cx, cy, a1x, a1y, -a2x, -a2y, -PIH, 0, beta, result);
18835
18976
  }
18836
18977
  };
18837
- return EShapePointsMarkerBase;
18838
- }());
18839
-
18840
- var EShapePointsMarkerHead = /** @class */ (function (_super) {
18841
- __extends(EShapePointsMarkerHead, _super);
18842
- function EShapePointsMarkerHead() {
18843
- return _super !== null && _super.apply(this, arguments) || this;
18844
- }
18845
- EShapePointsMarkerHead.prototype.toTransform = function (values, result) {
18846
- var valuesLength = values.length;
18847
- if (4 <= valuesLength) {
18848
- return this.toTransformMatrix(values[valuesLength - 2], values[valuesLength - 1], values[valuesLength - 4], values[valuesLength - 3], result);
18849
- }
18850
- else {
18851
- result.identity();
18978
+ UtilCurve.toHybrid = function (index, length, values, result) {
18979
+ var circle = UtilCurve.toCircle(index, length, values, result);
18980
+ var a0 = circle.angle[0];
18981
+ var a2 = circle.angle[2];
18982
+ var amin = Math.min(a0, a2);
18983
+ var amax = Math.max(a0, a2);
18984
+ if (amin < -PIH || PIH < amax) {
18985
+ return UtilCurve.toEllipse(index, length, values, result);
18852
18986
  }
18853
- return result;
18987
+ return circle;
18854
18988
  };
18855
- return EShapePointsMarkerHead;
18856
- }(EShapePointsMarkerBase));
18989
+ return UtilCurve;
18990
+ }());
18857
18991
 
18858
- var EShapePointsMarkerTail = /** @class */ (function (_super) {
18859
- __extends(EShapePointsMarkerTail, _super);
18860
- function EShapePointsMarkerTail() {
18861
- return _super !== null && _super.apply(this, arguments) || this;
18862
- }
18863
- EShapePointsMarkerTail.prototype.toTransform = function (values, result) {
18864
- var valuesLength = values.length;
18865
- if (4 <= valuesLength) {
18866
- return this.toTransformMatrix(values[0], values[1], values[2], values[3], result);
18867
- }
18868
- else {
18869
- result.identity();
18870
- }
18871
- return result;
18872
- };
18873
- return EShapePointsMarkerTail;
18874
- }(EShapePointsMarkerBase));
18992
+ /*
18993
+ * Copyright (C) 2019 Toshiba Corporation
18994
+ * SPDX-License-Identifier: Apache-2.0
18995
+ */
18996
+ var eShapePointsFormatterCurve = function (length, values, segments, style, result) {
18997
+ UtilCurve.interpolate(length, values, segments, UtilCurve.toHybrid, !!(style & EShapePointsStyle.CLOSED), EShapeDefaults.CURVE_SEGMENT_COUNT, true, result);
18998
+ result.length = result.values.length >> 1;
18999
+ result.style = style;
19000
+ return result;
19001
+ };
18875
19002
 
18876
19003
  /*
18877
19004
  * Copyright (C) 2019 Toshiba Corporation
18878
19005
  * SPDX-License-Identifier: Apache-2.0
18879
19006
  */
18880
- var EShapePointsMarkerContainerImpl = /** @class */ (function () {
18881
- function EShapePointsMarkerContainerImpl(parent) {
18882
- this._parent = parent;
18883
- this._lockCount = 0;
18884
- this._isTypeChanged = false;
18885
- this._isSizeChanged = false;
18886
- this._isFillChanged = false;
18887
- this._head = new EShapePointsMarkerHead(this);
18888
- this._tail = new EShapePointsMarkerTail(this);
19007
+ var EShapePointsFormatters = /** @class */ (function () {
19008
+ function EShapePointsFormatters() {
18889
19009
  }
18890
- EShapePointsMarkerContainerImpl.prototype.lock = function () {
18891
- this._lockCount += 1;
18892
- if (this._lockCount === 1) {
18893
- this._isTypeChanged = false;
18894
- this._isSizeChanged = false;
18895
- this._isFillChanged = false;
18896
- }
18897
- return this;
18898
- };
18899
- EShapePointsMarkerContainerImpl.prototype.unlock = function () {
18900
- this._lockCount -= 1;
18901
- if (this._lockCount === 0) {
18902
- if (this._isTypeChanged) {
18903
- this.onTypeChange();
18904
- }
18905
- else if (this._isSizeChanged) {
18906
- this.onSizeChange();
18907
- }
18908
- else if (this._isFillChanged) {
18909
- this.onFillChange();
18910
- }
18911
- this._isTypeChanged = false;
18912
- this._isSizeChanged = false;
18913
- this._isFillChanged = false;
18914
- }
18915
- return this;
18916
- };
18917
- Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "parent", {
18918
- get: function () {
18919
- return this._parent;
18920
- },
18921
- enumerable: false,
18922
- configurable: true
18923
- });
18924
- Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "head", {
18925
- get: function () {
18926
- return this._head;
18927
- },
18928
- enumerable: false,
18929
- configurable: true
18930
- });
18931
- Object.defineProperty(EShapePointsMarkerContainerImpl.prototype, "tail", {
18932
- get: function () {
18933
- return this._tail;
18934
- },
18935
- enumerable: false,
18936
- configurable: true
18937
- });
18938
- EShapePointsMarkerContainerImpl.prototype.onTypeChange = function () {
18939
- if (0 < this._lockCount) {
18940
- this._isTypeChanged = true;
18941
- return;
18942
- }
18943
- this._parent.onMarkerTypeChange();
18944
- };
18945
- EShapePointsMarkerContainerImpl.prototype.onSizeChange = function () {
18946
- if (0 < this._lockCount) {
18947
- this._isSizeChanged = true;
18948
- return;
19010
+ EShapePointsFormatters.set = function (id, formatter) {
19011
+ if (this.FORMATTERS == null) {
19012
+ this.FORMATTERS = this.newFormatters();
18949
19013
  }
18950
- this._parent.onMarkerSizeChange();
19014
+ this.FORMATTERS.set(id, formatter);
18951
19015
  };
18952
- EShapePointsMarkerContainerImpl.prototype.onFillChange = function () {
18953
- if (0 < this._lockCount) {
18954
- this._isFillChanged = true;
18955
- return;
19016
+ EShapePointsFormatters.get = function (index) {
19017
+ if (this.FORMATTERS == null) {
19018
+ this.FORMATTERS = this.newFormatters();
18956
19019
  }
18957
- this._parent.onMarkerFillChange();
18958
- };
18959
- EShapePointsMarkerContainerImpl.prototype.copy = function (source) {
18960
- this.lock();
18961
- this._head.copy(source.head);
18962
- this._tail.copy(source.tail);
18963
- this.unlock();
18964
- return this;
19020
+ return this.FORMATTERS.get(index);
18965
19021
  };
18966
- EShapePointsMarkerContainerImpl.prototype.serialize = function (manager) {
18967
- var headId = this._head.serialize(manager);
18968
- var tailId = this._tail.serialize(manager);
18969
- return manager.addResource("[".concat(headId, ",").concat(tailId, "]"));
19022
+ EShapePointsFormatters.find = function (style) {
19023
+ return this.get((style & EShapePointsStyle.FORMATTER_MASK) >> EShapePointsStyle.FORMATTER_SHIFT);
18970
19024
  };
18971
- EShapePointsMarkerContainerImpl.prototype.deserialize = function (resourceId, manager) {
18972
- var resources = manager.resources;
18973
- if (0 <= resourceId && resourceId < resources.length) {
18974
- var parsed = manager.getExtension(resourceId);
18975
- if (parsed == null) {
18976
- parsed = JSON.parse(resources[resourceId]);
18977
- manager.setExtension(resourceId, parsed);
18978
- }
18979
- this.lock();
18980
- this._head.deserialize(parsed[0], manager);
18981
- this._tail.deserialize(parsed[1], manager);
18982
- this.unlock();
18983
- }
19025
+ EShapePointsFormatters.newFormatters = function () {
19026
+ var result = new Map();
19027
+ result.set(EShapePointsStyle.FORMATTER_CURVE, eShapePointsFormatterCurve);
19028
+ return result;
18984
19029
  };
18985
- return EShapePointsMarkerContainerImpl;
19030
+ return EShapePointsFormatters;
18986
19031
  }());
18987
19032
 
18988
19033
  /*
@@ -19197,12 +19242,7 @@
19197
19242
  if (this._formattedId !== id) {
19198
19243
  this._formattedId = id;
19199
19244
  var style = this._style;
19200
- var formatter = this._formatter;
19201
- if (formatter == null) {
19202
- if (style & EShapePointsStyle.CURVE) {
19203
- formatter = eShapePointsFormatterCurve;
19204
- }
19205
- }
19245
+ var formatter = this._formatter || EShapePointsFormatters.find(style);
19206
19246
  if (formatter != null) {
19207
19247
  if (result == null) {
19208
19248
  result = {