@wcardinal/wcardinal-ui 0.459.0-beta.2 → 0.459.0-beta.3
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/types/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.d.ts +3 -2
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js +27 -3
- package/dist/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-dark.js +1 -1
- package/dist/wcardinal-ui-theme-dark.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
- package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
- package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
- package/dist/wcardinal-ui-theme-white.js +1 -1
- package/dist/wcardinal-ui-theme-white.min.js +1 -1
- package/dist/wcardinal-ui.cjs.js +28 -4
- package/dist/wcardinal-ui.js +28 -4
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,8 @@ export type EShapePolygonTriangulatedExtensionSerialized = [
|
|
|
9
9
|
number,
|
|
10
10
|
number,
|
|
11
11
|
number,
|
|
12
|
-
number
|
|
12
|
+
number,
|
|
13
|
+
number?
|
|
13
14
|
];
|
|
14
15
|
export declare class EShapePolygonTriangulatedImpl implements EShapePolygonTriangulated {
|
|
15
16
|
protected _id: number;
|
|
@@ -35,7 +36,7 @@ export declare class EShapePolygonTriangulatedImpl implements EShapePolygonTrian
|
|
|
35
36
|
get indices(): number[];
|
|
36
37
|
get nindices(): number;
|
|
37
38
|
get boundary(): EShapeBoundary;
|
|
38
|
-
set(parentPointsId?: number, vertices?: number[], distances?: number[], lengths?: number[], clippings?: number[], uvs?: number[], indices?: number[]): this;
|
|
39
|
+
set(parentPointsId?: number, vertices?: number[], distances?: number[], lengths?: number[], clippings?: number[], uvs?: number[], indices?: number[], boundary?: EShapeBoundary): this;
|
|
39
40
|
protected triangulate(): void;
|
|
40
41
|
protected toUvs(vertices: number[], boundary: EShapeBoundary): number[];
|
|
41
42
|
copy(source: EShapePolygonTriangulated): this;
|
|
@@ -96,7 +96,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
96
96
|
enumerable: false,
|
|
97
97
|
configurable: true
|
|
98
98
|
});
|
|
99
|
-
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices) {
|
|
99
|
+
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices, boundary) {
|
|
100
100
|
var isChanged = false;
|
|
101
101
|
// Parent Vertex ID
|
|
102
102
|
if (parentPointsId != null) {
|
|
@@ -171,6 +171,14 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
171
171
|
this._nindices = indicesLength / 3;
|
|
172
172
|
isChanged = true;
|
|
173
173
|
}
|
|
174
|
+
// Boundary
|
|
175
|
+
if (boundary != null) {
|
|
176
|
+
this._boundary[0] = boundary[0];
|
|
177
|
+
this._boundary[1] = boundary[1];
|
|
178
|
+
this._boundary[2] = boundary[2];
|
|
179
|
+
this._boundary[3] = boundary[3];
|
|
180
|
+
isChanged = true;
|
|
181
|
+
}
|
|
174
182
|
// Done
|
|
175
183
|
if (isChanged) {
|
|
176
184
|
this._id += 1;
|
|
@@ -216,7 +224,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
216
224
|
return result;
|
|
217
225
|
};
|
|
218
226
|
EShapePolygonTriangulatedImpl.prototype.copy = function (source) {
|
|
219
|
-
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices);
|
|
227
|
+
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices, source.boundary);
|
|
220
228
|
return this;
|
|
221
229
|
};
|
|
222
230
|
EShapePolygonTriangulatedImpl.prototype.serialize = function (manager) {
|
|
@@ -227,7 +235,8 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
227
235
|
manager.addResource(JSON.stringify(this._lengths)),
|
|
228
236
|
manager.addResource(JSON.stringify(this._clippings)),
|
|
229
237
|
manager.addResource(JSON.stringify(this._uvs)),
|
|
230
|
-
manager.addResource(JSON.stringify(this._indices))
|
|
238
|
+
manager.addResource(JSON.stringify(this._indices)),
|
|
239
|
+
manager.addResource(JSON.stringify(this._boundary))
|
|
231
240
|
];
|
|
232
241
|
return manager.addResource(JSON.stringify(serialized));
|
|
233
242
|
};
|
|
@@ -304,6 +313,21 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
304
313
|
this._indices = indices;
|
|
305
314
|
this._nindices = indices.length / 3;
|
|
306
315
|
}
|
|
316
|
+
// Boundary
|
|
317
|
+
var boundaryId = parsed[6];
|
|
318
|
+
if (boundaryId != null) {
|
|
319
|
+
if (0 <= boundaryId && boundaryId < resourcesLength) {
|
|
320
|
+
var boundary = manager.getExtension(boundaryId);
|
|
321
|
+
if (boundary == null) {
|
|
322
|
+
boundary = JSON.parse(resources[indexId]);
|
|
323
|
+
manager.setExtension(indexId, boundary);
|
|
324
|
+
}
|
|
325
|
+
this._boundary = boundary;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
toPointsBoundary(this._vertices, this._boundary);
|
|
330
|
+
}
|
|
307
331
|
this._id += 1;
|
|
308
332
|
}
|
|
309
333
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e-shape-polygon-triangulated-impl.js","sourceR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,CAAW,IAAI,CAAC,CAAC;gBAC/C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;oBACjB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAa,CAAC;oBAC9C,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBACjC,CAAC;gBACD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;YACjB,CAAC;YAED,UAAU;YACV,IAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,IAAI,OAAO,IAAI,OAAO,GAAG,eAAe,EAAE,CAAC;gBAC/C,IAAI,OAAO,GAAG,OAAO,CAAC,YAAY,CAAW,OAAO,CAAC,CAAC;gBACtD,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;oBACrB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAa,CAAC;oBACrD,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACxC,CAAC;gBACD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;gBACxB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YACrC,CAAC;YAED,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACf,CAAC;IACF,CAAC;IACF,oCAAC;AAAD,CAAC,AA5UD,IA4UC","sourcesContent":["import { UtilStraightSkeleton } from \"../../util/util-straight-skeleton\";\nimport { UtilStraightSkeletonBuffer } from \"../../util/util-straight-skeleton-buffer\";\nimport { EShapeBoundary } from \"../e-shape-boundary\";\nimport { toPointsBoundary } from \"../e-shape-points-formatted\";\nimport { EShapeResourceManagerDeserialization } from \"../e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport type { EShapePolygon } from \"./e-shape-polygon\";\nimport type { EShapePolygonTriangulated } from \"./e-shape-polygon-triangulated\";\n\nexport type EShapePolygonTriangulatedExtensionSerialized = [\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber\n];\n\nexport class EShapePolygonTriangulatedImpl implements EShapePolygonTriangulated {\n\tprotected _id: number;\n\tprotected _parent: EShapePolygon;\n\tprotected _parentPointsId: number;\n\tprotected _vertices: number[];\n\tprotected _nvertices: number;\n\tprotected _distances: number[];\n\tprotected _lengths: number[];\n\tprotected _clippings: number[];\n\tprotected _uvs: number[];\n\tprotected _indices: number[];\n\tprotected _nindices: number;\n\tprotected _boundary: EShapeBoundary;\n\n\tconstructor(parent: EShapePolygon) {\n\t\tthis._id = 0;\n\t\tthis._parent = parent;\n\t\tthis._parentPointsId = -1;\n\t\tthis._vertices = [];\n\t\tthis._nvertices = 0;\n\t\tthis._distances = [];\n\t\tthis._lengths = [];\n\t\tthis._clippings = [];\n\t\tthis._uvs = [];\n\t\tthis._indices = [];\n\t\tthis._nindices = 0;\n\t\tthis._boundary = [0, 0, 0, 0];\n\t}\n\n\tget id(): number {\n\t\tthis.triangulate();\n\t\treturn this._id;\n\t}\n\n\tget vertices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._vertices;\n\t}\n\n\tget nvertices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nvertices;\n\t}\n\n\tget distances(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._distances;\n\t}\n\n\tget lengths(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._lengths;\n\t}\n\n\tget clippings(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._clippings;\n\t}\n\n\tget uvs(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._uvs;\n\t}\n\n\tget indices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._indices;\n\t}\n\n\tget nindices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nindices;\n\t}\n\n\tget boundary(): EShapeBoundary {\n\t\tthis.triangulate();\n\t\treturn this._boundary;\n\t}\n\n\tset(\n\t\tparentPointsId?: number,\n\t\tvertices?: number[],\n\t\tdistances?: number[],\n\t\tlengths?: number[],\n\t\tclippings?: number[],\n\t\tuvs?: number[],\n\t\tindices?: number[]\n\t): this {\n\t\tlet isChanged = false;\n\n\t\t// Parent Vertex ID\n\t\tif (parentPointsId != null) {\n\t\t\tthis._parentPointsId = parentPointsId;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Vertices\n\t\tif (vertices != null) {\n\t\t\tconst verticesLength = vertices.length;\n\t\t\tfor (let i = 0; i < verticesLength; ++i) {\n\t\t\t\tthis._vertices[i] = vertices[i];\n\t\t\t}\n\t\t\tif (this._vertices.length !== verticesLength) {\n\t\t\t\tthis._vertices.length = verticesLength;\n\t\t\t}\n\t\t\tthis._nvertices = verticesLength >> 1;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Distances\n\t\tif (distances != null) {\n\t\t\tconst distancesLength = distances.length;\n\t\t\tfor (let i = 0; i < distancesLength; ++i) {\n\t\t\t\tthis._distances[i] = distances[i];\n\t\t\t}\n\t\t\tif (this._distances.length !== distancesLength) {\n\t\t\t\tthis._distances.length = distancesLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Lengths\n\t\tif (lengths != null) {\n\t\t\tconst lengthsLength = lengths.length;\n\t\t\tfor (let i = 0; i < lengthsLength; ++i) {\n\t\t\t\tthis._lengths[i] = lengths[i];\n\t\t\t}\n\t\t\tif (this._lengths.length !== lengthsLength) {\n\t\t\t\tthis._lengths.length = lengthsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Clippings\n\t\tif (clippings != null) {\n\t\t\tconst clippingsLength = clippings.length;\n\t\t\tfor (let i = 0; i < clippingsLength; ++i) {\n\t\t\t\tthis._clippings[i] = clippings[i];\n\t\t\t}\n\t\t\tif (this._clippings.length !== clippingsLength) {\n\t\t\t\tthis._clippings.length = clippingsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// UVs\n\t\tif (uvs != null) {\n\t\t\tconst uvsLength = uvs.length;\n\t\t\tfor (let i = 0; i < uvsLength; ++i) {\n\t\t\t\tthis._uvs[i] = uvs[i];\n\t\t\t}\n\t\t\tif (this._uvs.length !== uvsLength) {\n\t\t\t\tthis._uvs.length = uvsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Indices\n\t\tif (indices != null) {\n\t\t\tconst indicesLength = indices.length;\n\t\t\tfor (let i = 0; i < indicesLength; ++i) {\n\t\t\t\tthis._indices[i] = indices[i];\n\t\t\t}\n\t\t\tif (this._indices.length !== indicesLength) {\n\t\t\t\tthis._indices.length = indicesLength;\n\t\t\t}\n\t\t\tthis._nindices = indicesLength / 3;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Done\n\t\tif (isChanged) {\n\t\t\tthis._id += 1;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected triangulate(): void {\n\t\tconst parent = this._parent;\n\t\tconst parentPoints = parent.points;\n\t\tconst parentPointsId = parentPoints.id;\n\t\tconst isParentIdChanged = this._parentPointsId !== parentPointsId;\n\t\tif (isParentIdChanged) {\n\t\t\tthis._parentPointsId = parentPointsId;\n\t\t\tconst buffer = UtilStraightSkeletonBuffer.from(\n\t\t\t\tUtilStraightSkeleton.from(parentPoints.formatted.values)\n\t\t\t);\n\t\t\tthis._id += 1;\n\t\t\tconst vertices = buffer.vertices;\n\t\t\tthis._vertices = vertices;\n\t\t\tthis._nvertices = buffer.vertices.length >> 1;\n\t\t\tthis._distances = buffer.distances;\n\t\t\tthis._lengths = buffer.lengths;\n\t\t\tthis._clippings = buffer.clippings;\n\t\t\tconst boundary = this._boundary;\n\t\t\ttoPointsBoundary(vertices, boundary);\n\t\t\tthis._uvs = this.toUvs(vertices, boundary);\n\t\t\tthis._indices = buffer.indices;\n\t\t\tthis._nindices = buffer.indices.length / 3;\n\t\t}\n\t}\n\n\tprotected toUvs(vertices: number[], boundary: EShapeBoundary): number[] {\n\t\tconst result: number[] = [];\n\t\tconst xmin = boundary[0];\n\t\tconst ymin = boundary[1];\n\t\tconst xmax = boundary[2];\n\t\tconst ymax = boundary[3];\n\t\tconst sx = xmax - xmin;\n\t\tconst sy = ymax - ymin;\n\t\tconst fx = 0 < sx ? 1 / sx : 0;\n\t\tconst fy = 0 < sy ? 1 / sy : 0;\n\t\tconst verticesLength = vertices.length;\n\t\tfor (let i = 0; i < verticesLength; i += 2) {\n\t\t\tresult.push((vertices[i] - xmin) * fx, (vertices[i + 1] - ymin) * fy);\n\t\t}\n\t\treturn result;\n\t}\n\n\tcopy(source: EShapePolygonTriangulated): this {\n\t\tthis.set(\n\t\t\tthis._parent.points.id,\n\t\t\tsource.vertices,\n\t\t\tsource.distances,\n\t\t\tsource.lengths,\n\t\t\tsource.clippings,\n\t\t\tsource.uvs,\n\t\t\tsource.indices\n\t\t);\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tthis.triangulate();\n\t\tconst serialized: EShapePolygonTriangulatedExtensionSerialized = [\n\t\t\tmanager.addResource(JSON.stringify(this._vertices)),\n\t\t\tmanager.addResource(JSON.stringify(this._distances)),\n\t\t\tmanager.addResource(JSON.stringify(this._lengths)),\n\t\t\tmanager.addResource(JSON.stringify(this._clippings)),\n\t\t\tmanager.addResource(JSON.stringify(this._uvs)),\n\t\t\tmanager.addResource(JSON.stringify(this._indices))\n\t\t];\n\t\treturn manager.addResource(JSON.stringify(serialized));\n\t}\n\n\tdeserialize(resourceId: number, manager: EShapeResourceManagerDeserialization): void {\n\t\tconst resources = manager.resources;\n\t\tconst resourcesLength = resources.length;\n\t\tif (0 <= resourceId && resourceId < resourcesLength) {\n\t\t\tlet parsed =\n\t\t\t\tmanager.getExtension<EShapePolygonTriangulatedExtensionSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(\n\t\t\t\t\tresources[resourceId]\n\t\t\t\t) as EShapePolygonTriangulatedExtensionSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\n\t\t\t// Parent Points Id\n\t\t\tthis._parentPointsId = this._parent.points.id;\n\n\t\t\t// Vertices\n\t\t\tconst vertexId = parsed[0];\n\t\t\tif (0 <= vertexId && vertexId < resourcesLength) {\n\t\t\t\tlet vertices = manager.getExtension<number[]>(vertexId);\n\t\t\t\tif (vertices == null) {\n\t\t\t\t\tvertices = JSON.parse(resources[vertexId]) as number[];\n\t\t\t\t\tmanager.setExtension(vertexId, vertices);\n\t\t\t\t}\n\t\t\t\tthis._vertices = vertices;\n\t\t\t\tthis._nvertices = vertices.length >> 1;\n\t\t\t}\n\n\t\t\t// Distances\n\t\t\tconst distanceId = parsed[1];\n\t\t\tif (0 <= distanceId && distanceId < resourcesLength) {\n\t\t\t\tlet distances = manager.getExtension<number[]>(distanceId);\n\t\t\t\tif (distances == null) {\n\t\t\t\t\tdistances = JSON.parse(resources[distanceId]) as number[];\n\t\t\t\t\tmanager.setExtension(distanceId, distances);\n\t\t\t\t}\n\t\t\t\tthis._distances = distances;\n\t\t\t}\n\n\t\t\t// Lengths\n\t\t\tconst lengthId = parsed[2];\n\t\t\tif (0 <= lengthId && lengthId < resourcesLength) {\n\t\t\t\tlet lengths = manager.getExtension<number[]>(lengthId);\n\t\t\t\tif (lengths == null) {\n\t\t\t\t\tlengths = JSON.parse(resources[lengthId]) as number[];\n\t\t\t\t\tmanager.setExtension(lengthId, lengths);\n\t\t\t\t}\n\t\t\t\tthis._lengths = lengths;\n\t\t\t}\n\n\t\t\t// Clippings\n\t\t\tconst clippingId = parsed[3];\n\t\t\tif (0 <= clippingId && clippingId < resourcesLength) {\n\t\t\t\tlet clippings = manager.getExtension<number[]>(clippingId);\n\t\t\t\tif (clippings == null) {\n\t\t\t\t\tclippings = JSON.parse(resources[clippingId]) as number[];\n\t\t\t\t\tmanager.setExtension(clippingId, clippings);\n\t\t\t\t}\n\t\t\t\tthis._clippings = clippings;\n\t\t\t}\n\n\t\t\t// UVs\n\t\t\tconst uvId = parsed[4];\n\t\t\tif (0 <= uvId && uvId < resourcesLength) {\n\t\t\t\tlet uvs = manager.getExtension<number[]>(uvId);\n\t\t\t\tif (uvs == null) {\n\t\t\t\t\tuvs = JSON.parse(resources[uvId]) as number[];\n\t\t\t\t\tmanager.setExtension(uvId, uvs);\n\t\t\t\t}\n\t\t\t\tthis._uvs = uvs;\n\t\t\t}\n\n\t\t\t// Indices\n\t\t\tconst indexId = parsed[5];\n\t\t\tif (0 <= indexId && indexId < resourcesLength) {\n\t\t\t\tlet indices = manager.getExtension<number[]>(indexId);\n\t\t\t\tif (indices == null) {\n\t\t\t\t\tindices = JSON.parse(resources[indexId]) as number[];\n\t\t\t\t\tmanager.setExtension(indexId, indices);\n\t\t\t\t}\n\t\t\t\tthis._indices = indices;\n\t\t\t\tthis._nindices = indices.length / 3;\n\t\t\t}\n\n\t\t\tthis._id += 1;\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"e-shape-polygon-triangulated-impl.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/shape/variant/e-shape-polygon-triangulated-impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAgB/D;IAcC,uCAAY,MAAqB;QAChC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;Q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GAAG,QAAQ,CAAC;gBAC3B,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;YAED,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACf,CAAC;IACF,CAAC;IACF,oCAAC;AAAD,CAAC,AAvWD,IAuWC","sourcesContent":["import { UtilStraightSkeleton } from \"../../util/util-straight-skeleton\";\nimport { UtilStraightSkeletonBuffer } from \"../../util/util-straight-skeleton-buffer\";\nimport { EShapeBoundary } from \"../e-shape-boundary\";\nimport { toPointsBoundary } from \"../e-shape-points-formatted\";\nimport { EShapeResourceManagerDeserialization } from \"../e-shape-resource-manager-deserialization\";\nimport { EShapeResourceManagerSerialization } from \"../e-shape-resource-manager-serialization\";\nimport type { EShapePolygon } from \"./e-shape-polygon\";\nimport type { EShapePolygonTriangulated } from \"./e-shape-polygon-triangulated\";\n\nexport type EShapePolygonTriangulatedExtensionSerialized = [\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber,\n\tnumber?\n];\n\nexport class EShapePolygonTriangulatedImpl implements EShapePolygonTriangulated {\n\tprotected _id: number;\n\tprotected _parent: EShapePolygon;\n\tprotected _parentPointsId: number;\n\tprotected _vertices: number[];\n\tprotected _nvertices: number;\n\tprotected _distances: number[];\n\tprotected _lengths: number[];\n\tprotected _clippings: number[];\n\tprotected _uvs: number[];\n\tprotected _indices: number[];\n\tprotected _nindices: number;\n\tprotected _boundary: EShapeBoundary;\n\n\tconstructor(parent: EShapePolygon) {\n\t\tthis._id = 0;\n\t\tthis._parent = parent;\n\t\tthis._parentPointsId = -1;\n\t\tthis._vertices = [];\n\t\tthis._nvertices = 0;\n\t\tthis._distances = [];\n\t\tthis._lengths = [];\n\t\tthis._clippings = [];\n\t\tthis._uvs = [];\n\t\tthis._indices = [];\n\t\tthis._nindices = 0;\n\t\tthis._boundary = [0, 0, 0, 0];\n\t}\n\n\tget id(): number {\n\t\tthis.triangulate();\n\t\treturn this._id;\n\t}\n\n\tget vertices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._vertices;\n\t}\n\n\tget nvertices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nvertices;\n\t}\n\n\tget distances(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._distances;\n\t}\n\n\tget lengths(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._lengths;\n\t}\n\n\tget clippings(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._clippings;\n\t}\n\n\tget uvs(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._uvs;\n\t}\n\n\tget indices(): number[] {\n\t\tthis.triangulate();\n\t\treturn this._indices;\n\t}\n\n\tget nindices(): number {\n\t\tthis.triangulate();\n\t\treturn this._nindices;\n\t}\n\n\tget boundary(): EShapeBoundary {\n\t\tthis.triangulate();\n\t\treturn this._boundary;\n\t}\n\n\tset(\n\t\tparentPointsId?: number,\n\t\tvertices?: number[],\n\t\tdistances?: number[],\n\t\tlengths?: number[],\n\t\tclippings?: number[],\n\t\tuvs?: number[],\n\t\tindices?: number[],\n\t\tboundary?: EShapeBoundary\n\t): this {\n\t\tlet isChanged = false;\n\n\t\t// Parent Vertex ID\n\t\tif (parentPointsId != null) {\n\t\t\tthis._parentPointsId = parentPointsId;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Vertices\n\t\tif (vertices != null) {\n\t\t\tconst verticesLength = vertices.length;\n\t\t\tfor (let i = 0; i < verticesLength; ++i) {\n\t\t\t\tthis._vertices[i] = vertices[i];\n\t\t\t}\n\t\t\tif (this._vertices.length !== verticesLength) {\n\t\t\t\tthis._vertices.length = verticesLength;\n\t\t\t}\n\t\t\tthis._nvertices = verticesLength >> 1;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Distances\n\t\tif (distances != null) {\n\t\t\tconst distancesLength = distances.length;\n\t\t\tfor (let i = 0; i < distancesLength; ++i) {\n\t\t\t\tthis._distances[i] = distances[i];\n\t\t\t}\n\t\t\tif (this._distances.length !== distancesLength) {\n\t\t\t\tthis._distances.length = distancesLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Lengths\n\t\tif (lengths != null) {\n\t\t\tconst lengthsLength = lengths.length;\n\t\t\tfor (let i = 0; i < lengthsLength; ++i) {\n\t\t\t\tthis._lengths[i] = lengths[i];\n\t\t\t}\n\t\t\tif (this._lengths.length !== lengthsLength) {\n\t\t\t\tthis._lengths.length = lengthsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Clippings\n\t\tif (clippings != null) {\n\t\t\tconst clippingsLength = clippings.length;\n\t\t\tfor (let i = 0; i < clippingsLength; ++i) {\n\t\t\t\tthis._clippings[i] = clippings[i];\n\t\t\t}\n\t\t\tif (this._clippings.length !== clippingsLength) {\n\t\t\t\tthis._clippings.length = clippingsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// UVs\n\t\tif (uvs != null) {\n\t\t\tconst uvsLength = uvs.length;\n\t\t\tfor (let i = 0; i < uvsLength; ++i) {\n\t\t\t\tthis._uvs[i] = uvs[i];\n\t\t\t}\n\t\t\tif (this._uvs.length !== uvsLength) {\n\t\t\t\tthis._uvs.length = uvsLength;\n\t\t\t}\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Indices\n\t\tif (indices != null) {\n\t\t\tconst indicesLength = indices.length;\n\t\t\tfor (let i = 0; i < indicesLength; ++i) {\n\t\t\t\tthis._indices[i] = indices[i];\n\t\t\t}\n\t\t\tif (this._indices.length !== indicesLength) {\n\t\t\t\tthis._indices.length = indicesLength;\n\t\t\t}\n\t\t\tthis._nindices = indicesLength / 3;\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Boundary\n\t\tif (boundary != null) {\n\t\t\tthis._boundary[0] = boundary[0];\n\t\t\tthis._boundary[1] = boundary[1];\n\t\t\tthis._boundary[2] = boundary[2];\n\t\t\tthis._boundary[3] = boundary[3];\n\t\t\tisChanged = true;\n\t\t}\n\n\t\t// Done\n\t\tif (isChanged) {\n\t\t\tthis._id += 1;\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected triangulate(): void {\n\t\tconst parent = this._parent;\n\t\tconst parentPoints = parent.points;\n\t\tconst parentPointsId = parentPoints.id;\n\t\tconst isParentIdChanged = this._parentPointsId !== parentPointsId;\n\t\tif (isParentIdChanged) {\n\t\t\tthis._parentPointsId = parentPointsId;\n\t\t\tconst buffer = UtilStraightSkeletonBuffer.from(\n\t\t\t\tUtilStraightSkeleton.from(parentPoints.formatted.values)\n\t\t\t);\n\t\t\tthis._id += 1;\n\t\t\tconst vertices = buffer.vertices;\n\t\t\tthis._vertices = vertices;\n\t\t\tthis._nvertices = buffer.vertices.length >> 1;\n\t\t\tthis._distances = buffer.distances;\n\t\t\tthis._lengths = buffer.lengths;\n\t\t\tthis._clippings = buffer.clippings;\n\t\t\tconst boundary = this._boundary;\n\t\t\ttoPointsBoundary(vertices, boundary);\n\t\t\tthis._uvs = this.toUvs(vertices, boundary);\n\t\t\tthis._indices = buffer.indices;\n\t\t\tthis._nindices = buffer.indices.length / 3;\n\t\t}\n\t}\n\n\tprotected toUvs(vertices: number[], boundary: EShapeBoundary): number[] {\n\t\tconst result: number[] = [];\n\t\tconst xmin = boundary[0];\n\t\tconst ymin = boundary[1];\n\t\tconst xmax = boundary[2];\n\t\tconst ymax = boundary[3];\n\t\tconst sx = xmax - xmin;\n\t\tconst sy = ymax - ymin;\n\t\tconst fx = 0 < sx ? 1 / sx : 0;\n\t\tconst fy = 0 < sy ? 1 / sy : 0;\n\t\tconst verticesLength = vertices.length;\n\t\tfor (let i = 0; i < verticesLength; i += 2) {\n\t\t\tresult.push((vertices[i] - xmin) * fx, (vertices[i + 1] - ymin) * fy);\n\t\t}\n\t\treturn result;\n\t}\n\n\tcopy(source: EShapePolygonTriangulated): this {\n\t\tthis.set(\n\t\t\tthis._parent.points.id,\n\t\t\tsource.vertices,\n\t\t\tsource.distances,\n\t\t\tsource.lengths,\n\t\t\tsource.clippings,\n\t\t\tsource.uvs,\n\t\t\tsource.indices,\n\t\t\tsource.boundary\n\t\t);\n\t\treturn this;\n\t}\n\n\tserialize(manager: EShapeResourceManagerSerialization): number {\n\t\tthis.triangulate();\n\t\tconst serialized: EShapePolygonTriangulatedExtensionSerialized = [\n\t\t\tmanager.addResource(JSON.stringify(this._vertices)),\n\t\t\tmanager.addResource(JSON.stringify(this._distances)),\n\t\t\tmanager.addResource(JSON.stringify(this._lengths)),\n\t\t\tmanager.addResource(JSON.stringify(this._clippings)),\n\t\t\tmanager.addResource(JSON.stringify(this._uvs)),\n\t\t\tmanager.addResource(JSON.stringify(this._indices)),\n\t\t\tmanager.addResource(JSON.stringify(this._boundary))\n\t\t];\n\t\treturn manager.addResource(JSON.stringify(serialized));\n\t}\n\n\tdeserialize(resourceId: number, manager: EShapeResourceManagerDeserialization): void {\n\t\tconst resources = manager.resources;\n\t\tconst resourcesLength = resources.length;\n\t\tif (0 <= resourceId && resourceId < resourcesLength) {\n\t\t\tlet parsed =\n\t\t\t\tmanager.getExtension<EShapePolygonTriangulatedExtensionSerialized>(resourceId);\n\t\t\tif (parsed == null) {\n\t\t\t\tparsed = JSON.parse(\n\t\t\t\t\tresources[resourceId]\n\t\t\t\t) as EShapePolygonTriangulatedExtensionSerialized;\n\t\t\t\tmanager.setExtension(resourceId, parsed);\n\t\t\t}\n\n\t\t\t// Parent Points Id\n\t\t\tthis._parentPointsId = this._parent.points.id;\n\n\t\t\t// Vertices\n\t\t\tconst vertexId = parsed[0];\n\t\t\tif (0 <= vertexId && vertexId < resourcesLength) {\n\t\t\t\tlet vertices = manager.getExtension<number[]>(vertexId);\n\t\t\t\tif (vertices == null) {\n\t\t\t\t\tvertices = JSON.parse(resources[vertexId]) as number[];\n\t\t\t\t\tmanager.setExtension(vertexId, vertices);\n\t\t\t\t}\n\t\t\t\tthis._vertices = vertices;\n\t\t\t\tthis._nvertices = vertices.length >> 1;\n\t\t\t}\n\n\t\t\t// Distances\n\t\t\tconst distanceId = parsed[1];\n\t\t\tif (0 <= distanceId && distanceId < resourcesLength) {\n\t\t\t\tlet distances = manager.getExtension<number[]>(distanceId);\n\t\t\t\tif (distances == null) {\n\t\t\t\t\tdistances = JSON.parse(resources[distanceId]) as number[];\n\t\t\t\t\tmanager.setExtension(distanceId, distances);\n\t\t\t\t}\n\t\t\t\tthis._distances = distances;\n\t\t\t}\n\n\t\t\t// Lengths\n\t\t\tconst lengthId = parsed[2];\n\t\t\tif (0 <= lengthId && lengthId < resourcesLength) {\n\t\t\t\tlet lengths = manager.getExtension<number[]>(lengthId);\n\t\t\t\tif (lengths == null) {\n\t\t\t\t\tlengths = JSON.parse(resources[lengthId]) as number[];\n\t\t\t\t\tmanager.setExtension(lengthId, lengths);\n\t\t\t\t}\n\t\t\t\tthis._lengths = lengths;\n\t\t\t}\n\n\t\t\t// Clippings\n\t\t\tconst clippingId = parsed[3];\n\t\t\tif (0 <= clippingId && clippingId < resourcesLength) {\n\t\t\t\tlet clippings = manager.getExtension<number[]>(clippingId);\n\t\t\t\tif (clippings == null) {\n\t\t\t\t\tclippings = JSON.parse(resources[clippingId]) as number[];\n\t\t\t\t\tmanager.setExtension(clippingId, clippings);\n\t\t\t\t}\n\t\t\t\tthis._clippings = clippings;\n\t\t\t}\n\n\t\t\t// UVs\n\t\t\tconst uvId = parsed[4];\n\t\t\tif (0 <= uvId && uvId < resourcesLength) {\n\t\t\t\tlet uvs = manager.getExtension<number[]>(uvId);\n\t\t\t\tif (uvs == null) {\n\t\t\t\t\tuvs = JSON.parse(resources[uvId]) as number[];\n\t\t\t\t\tmanager.setExtension(uvId, uvs);\n\t\t\t\t}\n\t\t\t\tthis._uvs = uvs;\n\t\t\t}\n\n\t\t\t// Indices\n\t\t\tconst indexId = parsed[5];\n\t\t\tif (0 <= indexId && indexId < resourcesLength) {\n\t\t\t\tlet indices = manager.getExtension<number[]>(indexId);\n\t\t\t\tif (indices == null) {\n\t\t\t\t\tindices = JSON.parse(resources[indexId]) as number[];\n\t\t\t\t\tmanager.setExtension(indexId, indices);\n\t\t\t\t}\n\t\t\t\tthis._indices = indices;\n\t\t\t\tthis._nindices = indices.length / 3;\n\t\t\t}\n\n\t\t\t// Boundary\n\t\t\tconst boundaryId = parsed[6];\n\t\t\tif (boundaryId != null) {\n\t\t\t\tif (0 <= boundaryId && boundaryId < resourcesLength) {\n\t\t\t\t\tlet boundary = manager.getExtension<EShapeBoundary>(boundaryId);\n\t\t\t\t\tif (boundary == null) {\n\t\t\t\t\t\tboundary = JSON.parse(resources[indexId]) as EShapeBoundary;\n\t\t\t\t\t\tmanager.setExtension(indexId, boundary);\n\t\t\t\t\t}\n\t\t\t\t\tthis._boundary = boundary;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttoPointsBoundary(this._vertices, this._boundary);\n\t\t\t}\n\n\t\t\tthis._id += 1;\n\t\t}\n\t}\n}\n"]}
|
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.459.0-beta.
|
|
2
|
+
Winter Cardinal UI v0.459.0-beta.3
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -50117,7 +50117,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
50117
50117
|
enumerable: false,
|
|
50118
50118
|
configurable: true
|
|
50119
50119
|
});
|
|
50120
|
-
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices) {
|
|
50120
|
+
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices, boundary) {
|
|
50121
50121
|
var isChanged = false;
|
|
50122
50122
|
// Parent Vertex ID
|
|
50123
50123
|
if (parentPointsId != null) {
|
|
@@ -50192,6 +50192,14 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
50192
50192
|
this._nindices = indicesLength / 3;
|
|
50193
50193
|
isChanged = true;
|
|
50194
50194
|
}
|
|
50195
|
+
// Boundary
|
|
50196
|
+
if (boundary != null) {
|
|
50197
|
+
this._boundary[0] = boundary[0];
|
|
50198
|
+
this._boundary[1] = boundary[1];
|
|
50199
|
+
this._boundary[2] = boundary[2];
|
|
50200
|
+
this._boundary[3] = boundary[3];
|
|
50201
|
+
isChanged = true;
|
|
50202
|
+
}
|
|
50195
50203
|
// Done
|
|
50196
50204
|
if (isChanged) {
|
|
50197
50205
|
this._id += 1;
|
|
@@ -50237,7 +50245,7 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
50237
50245
|
return result;
|
|
50238
50246
|
};
|
|
50239
50247
|
EShapePolygonTriangulatedImpl.prototype.copy = function (source) {
|
|
50240
|
-
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices);
|
|
50248
|
+
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices, source.boundary);
|
|
50241
50249
|
return this;
|
|
50242
50250
|
};
|
|
50243
50251
|
EShapePolygonTriangulatedImpl.prototype.serialize = function (manager) {
|
|
@@ -50248,7 +50256,8 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
50248
50256
|
manager.addResource(JSON.stringify(this._lengths)),
|
|
50249
50257
|
manager.addResource(JSON.stringify(this._clippings)),
|
|
50250
50258
|
manager.addResource(JSON.stringify(this._uvs)),
|
|
50251
|
-
manager.addResource(JSON.stringify(this._indices))
|
|
50259
|
+
manager.addResource(JSON.stringify(this._indices)),
|
|
50260
|
+
manager.addResource(JSON.stringify(this._boundary))
|
|
50252
50261
|
];
|
|
50253
50262
|
return manager.addResource(JSON.stringify(serialized));
|
|
50254
50263
|
};
|
|
@@ -50325,6 +50334,21 @@ var EShapePolygonTriangulatedImpl = /** @class */ (function () {
|
|
|
50325
50334
|
this._indices = indices;
|
|
50326
50335
|
this._nindices = indices.length / 3;
|
|
50327
50336
|
}
|
|
50337
|
+
// Boundary
|
|
50338
|
+
var boundaryId = parsed[6];
|
|
50339
|
+
if (boundaryId != null) {
|
|
50340
|
+
if (0 <= boundaryId && boundaryId < resourcesLength) {
|
|
50341
|
+
var boundary = manager.getExtension(boundaryId);
|
|
50342
|
+
if (boundary == null) {
|
|
50343
|
+
boundary = JSON.parse(resources[indexId]);
|
|
50344
|
+
manager.setExtension(indexId, boundary);
|
|
50345
|
+
}
|
|
50346
|
+
this._boundary = boundary;
|
|
50347
|
+
}
|
|
50348
|
+
}
|
|
50349
|
+
else {
|
|
50350
|
+
toPointsBoundary(this._vertices, this._boundary);
|
|
50351
|
+
}
|
|
50328
50352
|
this._id += 1;
|
|
50329
50353
|
}
|
|
50330
50354
|
};
|
package/dist/wcardinal-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.459.0-beta.
|
|
2
|
+
Winter Cardinal UI v0.459.0-beta.3
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -50114,7 +50114,7 @@
|
|
|
50114
50114
|
enumerable: false,
|
|
50115
50115
|
configurable: true
|
|
50116
50116
|
});
|
|
50117
|
-
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices) {
|
|
50117
|
+
EShapePolygonTriangulatedImpl.prototype.set = function (parentPointsId, vertices, distances, lengths, clippings, uvs, indices, boundary) {
|
|
50118
50118
|
var isChanged = false;
|
|
50119
50119
|
// Parent Vertex ID
|
|
50120
50120
|
if (parentPointsId != null) {
|
|
@@ -50189,6 +50189,14 @@
|
|
|
50189
50189
|
this._nindices = indicesLength / 3;
|
|
50190
50190
|
isChanged = true;
|
|
50191
50191
|
}
|
|
50192
|
+
// Boundary
|
|
50193
|
+
if (boundary != null) {
|
|
50194
|
+
this._boundary[0] = boundary[0];
|
|
50195
|
+
this._boundary[1] = boundary[1];
|
|
50196
|
+
this._boundary[2] = boundary[2];
|
|
50197
|
+
this._boundary[3] = boundary[3];
|
|
50198
|
+
isChanged = true;
|
|
50199
|
+
}
|
|
50192
50200
|
// Done
|
|
50193
50201
|
if (isChanged) {
|
|
50194
50202
|
this._id += 1;
|
|
@@ -50234,7 +50242,7 @@
|
|
|
50234
50242
|
return result;
|
|
50235
50243
|
};
|
|
50236
50244
|
EShapePolygonTriangulatedImpl.prototype.copy = function (source) {
|
|
50237
|
-
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices);
|
|
50245
|
+
this.set(this._parent.points.id, source.vertices, source.distances, source.lengths, source.clippings, source.uvs, source.indices, source.boundary);
|
|
50238
50246
|
return this;
|
|
50239
50247
|
};
|
|
50240
50248
|
EShapePolygonTriangulatedImpl.prototype.serialize = function (manager) {
|
|
@@ -50245,7 +50253,8 @@
|
|
|
50245
50253
|
manager.addResource(JSON.stringify(this._lengths)),
|
|
50246
50254
|
manager.addResource(JSON.stringify(this._clippings)),
|
|
50247
50255
|
manager.addResource(JSON.stringify(this._uvs)),
|
|
50248
|
-
manager.addResource(JSON.stringify(this._indices))
|
|
50256
|
+
manager.addResource(JSON.stringify(this._indices)),
|
|
50257
|
+
manager.addResource(JSON.stringify(this._boundary))
|
|
50249
50258
|
];
|
|
50250
50259
|
return manager.addResource(JSON.stringify(serialized));
|
|
50251
50260
|
};
|
|
@@ -50322,6 +50331,21 @@
|
|
|
50322
50331
|
this._indices = indices;
|
|
50323
50332
|
this._nindices = indices.length / 3;
|
|
50324
50333
|
}
|
|
50334
|
+
// Boundary
|
|
50335
|
+
var boundaryId = parsed[6];
|
|
50336
|
+
if (boundaryId != null) {
|
|
50337
|
+
if (0 <= boundaryId && boundaryId < resourcesLength) {
|
|
50338
|
+
var boundary = manager.getExtension(boundaryId);
|
|
50339
|
+
if (boundary == null) {
|
|
50340
|
+
boundary = JSON.parse(resources[indexId]);
|
|
50341
|
+
manager.setExtension(indexId, boundary);
|
|
50342
|
+
}
|
|
50343
|
+
this._boundary = boundary;
|
|
50344
|
+
}
|
|
50345
|
+
}
|
|
50346
|
+
else {
|
|
50347
|
+
toPointsBoundary(this._vertices, this._boundary);
|
|
50348
|
+
}
|
|
50325
50349
|
this._id += 1;
|
|
50326
50350
|
}
|
|
50327
50351
|
};
|