@cesium/engine 23.0.0 → 24.0.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.
- package/Build/Workers/{chunk-QTOHIXGF.js → chunk-2N4KDHS3.js} +10 -10
- package/Build/Workers/{chunk-SQTRWKO2.js → chunk-44EMEGKW.js} +5 -5
- package/Build/Workers/{chunk-OHBM4YG4.js → chunk-4TIG36AW.js} +12 -12
- package/Build/Workers/{chunk-BNBD2YZK.js → chunk-5A2SW66E.js} +16 -16
- package/Build/Workers/{chunk-52K3GJKG.js → chunk-5GXYJQ2K.js} +3 -3
- package/Build/Workers/{chunk-NQCAZU7S.js → chunk-63SIWPLS.js} +13 -13
- package/Build/Workers/{chunk-UEEGWJJP.js → chunk-6MPGQEHA.js} +2 -2
- package/Build/Workers/{chunk-PQVNT5CJ.js → chunk-6RMS4S72.js} +6 -6
- package/Build/Workers/{chunk-HYTFXWMY.js → chunk-6WLHJFD3.js} +7 -7
- package/Build/Workers/{chunk-DT5SJBKA.js → chunk-72VYSVEW.js} +9 -9
- package/Build/Workers/{chunk-JUGY5AZN.js → chunk-7MDYBRYJ.js} +4 -4
- package/Build/Workers/{chunk-6SLGTBB2.js → chunk-7O5XJTVE.js} +5 -5
- package/Build/Workers/{chunk-4UNQX2MP.js → chunk-7QRFIKWQ.js} +2 -2
- package/Build/Workers/{chunk-GN5NEUDT.js → chunk-7TYLCBGK.js} +8 -8
- package/Build/Workers/{chunk-SGKTBHFQ.js → chunk-7X322WP2.js} +13 -13
- package/Build/Workers/{chunk-T43FXHNC.js → chunk-A47HVBC5.js} +7 -7
- package/Build/Workers/{chunk-FSDVXW7M.js → chunk-AF3MU2RL.js} +5 -5
- package/Build/Workers/{chunk-3B65YFXC.js → chunk-AJLTU6PF.js} +1 -1
- package/Build/Workers/{chunk-OQ3EAJNW.js → chunk-AMIHNSST.js} +2 -2
- package/Build/Workers/{chunk-N4AWE7TZ.js → chunk-B6SCUUFP.js} +10 -10
- package/Build/Workers/{chunk-OMXN7YF4.js → chunk-BJD6QGXZ.js} +12 -12
- package/Build/Workers/{chunk-APDKMX7W.js → chunk-C6P4IG5P.js} +6 -6
- package/Build/Workers/{chunk-QA24Q62E.js → chunk-D4EJ2NXG.js} +17 -17
- package/Build/Workers/{chunk-HYLEKKO5.js → chunk-DHKPFLSJ.js} +1 -1
- package/Build/Workers/{chunk-MQJG522T.js → chunk-DVB56LG7.js} +6 -6
- package/Build/Workers/{chunk-Y5AJSEEN.js → chunk-EDXL4W76.js} +2 -2
- package/Build/Workers/{chunk-QQX7S5QT.js → chunk-EV3VGO6Y.js} +17 -17
- package/Build/Workers/{chunk-IFA7VHHP.js → chunk-GOQBUCXH.js} +10 -10
- package/Build/Workers/{chunk-5A7YSAXT.js → chunk-GQUNK2XC.js} +14 -14
- package/Build/Workers/{chunk-36LBFITA.js → chunk-HKUES6UG.js} +12 -12
- package/Build/Workers/{chunk-OC6X22PG.js → chunk-HRHRYFHS.js} +9 -9
- package/Build/Workers/{chunk-L7RDJ4V7.js → chunk-HXJMS2ZI.js} +1 -1
- package/Build/Workers/{chunk-NAYRNPEP.js → chunk-ILMFADZA.js} +4 -4
- package/Build/Workers/{chunk-AA33B6PU.js → chunk-ISY4EZCA.js} +4 -4
- package/Build/Workers/{chunk-7KRN6JPQ.js → chunk-J6AW5YHS.js} +14 -14
- package/Build/Workers/{chunk-OQBPOKPZ.js → chunk-JCI63T3K.js} +6 -6
- package/Build/Workers/{chunk-2WI4HGJU.js → chunk-KLPGTXS3.js} +6 -6
- package/Build/Workers/{chunk-5R7SBUTW.js → chunk-LIB2H534.js} +10 -10
- package/Build/Workers/{chunk-IYVDOB5V.js → chunk-LXMCPFFS.js} +4 -4
- package/Build/Workers/{chunk-NUYLNQKV.js → chunk-MKM27KGV.js} +2 -2
- package/Build/Workers/{chunk-R7M4XNPP.js → chunk-N65BAKSH.js} +8 -8
- package/Build/Workers/{chunk-4LGFX2P5.js → chunk-NKT5K3K3.js} +11 -11
- package/Build/Workers/{chunk-NNHU33JK.js → chunk-NPF7SSHZ.js} +7 -7
- package/Build/Workers/{chunk-LDQWNMEC.js → chunk-PVV64VFW.js} +1 -1
- package/Build/Workers/{chunk-WKXDCVBO.js → chunk-Q3C6VQH6.js} +4 -4
- package/Build/Workers/{chunk-ARCFIOKA.js → chunk-RQNJD3O4.js} +12 -12
- package/Build/Workers/{chunk-G3YT7M7A.js → chunk-UIGVOKKI.js} +1 -1
- package/Build/Workers/{chunk-ZIW5FCIW.js → chunk-UQU4RXLT.js} +27 -19
- package/Build/Workers/{chunk-MT5M7RLZ.js → chunk-VLDEUTOP.js} +2 -2
- package/Build/Workers/{chunk-5JP5FG7U.js → chunk-VMVOUQ5J.js} +7 -7
- package/Build/Workers/{chunk-2GL2EUEE.js → chunk-XJRBB253.js} +11 -11
- package/Build/Workers/{chunk-ESD4IEOU.js → chunk-XY6HMDGI.js} +5 -5
- package/Build/Workers/{chunk-56OHFSLH.js → chunk-Y7HNNPNK.js} +10 -10
- package/Build/Workers/{chunk-6FVFM2KB.js → chunk-YAOZMOFL.js} +5 -5
- package/Build/Workers/{chunk-AP6XWET5.js → chunk-YJZGW74L.js} +8 -8
- package/Build/Workers/{chunk-KPYU6YZG.js → chunk-YQFTYQMZ.js} +1 -1
- package/Build/Workers/{chunk-5VKZVPO5.js → chunk-ZBZRTRJB.js} +10 -10
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +25 -25
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +12 -12
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/BoundingSphere.js +1 -1
- package/Source/Core/Cartesian2.js +7 -5
- package/Source/Core/Cartesian3.js +8 -6
- package/Source/Core/Cartesian4.js +8 -6
- package/Source/Core/Color.js +5 -3
- package/Source/Core/DeveloperError.js +2 -1
- package/Source/Core/ITwinPlatform.js +1 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/S2Cell.js +2 -2
- package/Source/Core/TerrainMesh.js +10 -1
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/assert.js +27 -0
- package/Source/Core/globalTypes.js +4 -0
- package/Source/DataSources/CzmlDataSource.js +9 -0
- package/Source/DataSources/PathGraphics.js +13 -0
- package/Source/DataSources/PathVisualizer.js +330 -18
- package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +3 -1
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +3 -1
- package/Source/Renderer/Context.js +1 -1
- package/Source/Renderer/RenderState.js +2 -2
- package/Source/Renderer/VertexArray.js +80 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardCollection.js +65 -364
- package/Source/Scene/BufferPoint.js +148 -0
- package/Source/Scene/BufferPointCollection.js +135 -0
- package/Source/Scene/BufferPointMaterial.js +95 -0
- package/Source/Scene/BufferPolygon.js +516 -0
- package/Source/Scene/BufferPolygonCollection.js +368 -0
- package/Source/Scene/BufferPolygonMaterial.js +41 -0
- package/Source/Scene/BufferPolyline.js +185 -0
- package/Source/Scene/BufferPolylineCollection.js +136 -0
- package/Source/Scene/BufferPolylineMaterial.js +93 -0
- package/Source/Scene/BufferPrimitive.js +347 -0
- package/Source/Scene/BufferPrimitiveCollection.js +702 -0
- package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
- package/Source/Scene/Cesium3DTileContent.js +5 -1
- package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
- package/Source/Scene/Cesium3DTileStyle.js +22 -0
- package/Source/Scene/Cesium3DTileset.js +1 -0
- package/Source/Scene/ClippingPolygonCollection.js +270 -101
- package/Source/Scene/CubeMapPanorama.js +4 -4
- package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
- package/Source/Scene/GaussianSplatPrimitive.js +413 -70
- package/Source/Scene/GetFeatureInfoFormat.js +3 -3
- package/Source/Scene/GltfLoader.js +227 -34
- package/Source/Scene/GltfSpzLoader.js +109 -0
- package/Source/Scene/ITwinData.js +1 -0
- package/Source/Scene/Label.js +32 -0
- package/Source/Scene/LabelCollection.js +14 -13
- package/Source/Scene/Material.js +2 -0
- package/Source/Scene/Megatexture.js +1 -0
- package/Source/Scene/MetadataClassProperty.js +24 -10
- package/Source/Scene/MetadataComponentType.js +115 -23
- package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +761 -263
- package/Source/Scene/Model/MaterialPipelineStage.js +147 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +6 -0
- package/Source/Scene/Model/ModelReader.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +3 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +330 -0
- package/Source/Scene/ModelComponents.js +1632 -1542
- package/Source/Scene/PickedMetadataInfo.js +1 -0
- package/Source/Scene/ScreenSpaceCameraController.js +13 -0
- package/Source/Scene/SkyBox.js +17 -8
- package/Source/Scene/TileBoundingRegion.js +1 -1
- package/Source/Scene/TileBoundingS2Cell.js +1 -1
- package/Source/Scene/TileBoundingSphere.js +1 -1
- package/Source/Scene/TweenCollection.js +7 -0
- package/Source/Scene/VectorGltf3DTileContent.js +382 -0
- package/Source/Scene/VertexAttributeSemantic.js +14 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
- package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
- package/Source/Scene/parseStructuralMetadata.js +97 -37
- package/Source/Scene/renderBufferPointCollection.js +334 -0
- package/Source/Scene/renderBufferPolygonCollection.js +386 -0
- package/Source/Scene/renderBufferPolylineCollection.js +529 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
- package/Source/Shaders/BillboardCollectionFS.js +2 -77
- package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
- package/Source/Shaders/BillboardCollectionVS.js +2 -60
- package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
- package/Source/Shaders/BufferPointMaterialFS.js +29 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
- package/Source/Shaders/BufferPointMaterialVS.js +50 -0
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
- package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
- package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
- package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
- package/Source/Shaders/Model/ModelFS.glsl +15 -0
- package/Source/Shaders/Model/ModelFS.js +15 -0
- package/Source/Shaders/Model/ModelVS.glsl +8 -0
- package/Source/Shaders/Model/ModelVS.js +8 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
- package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
- package/Source/Shaders/Voxels/VoxelFS.js +1 -1
- package/Source/Workers/decodeDraco.js +3 -0
- package/Source/Workers/decodeI3S.js +5 -2
- package/index.d.ts +1007 -111
- package/index.js +368 -343
- package/package.json +2 -2
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import defined from "../Core/defined.js";
|
|
4
|
+
import BufferPrimitiveCollection from "./BufferPrimitiveCollection.js";
|
|
5
|
+
import BufferPolygon from "./BufferPolygon.js";
|
|
6
|
+
import Frozen from "../Core/Frozen.js";
|
|
7
|
+
import assert from "../Core/assert.js";
|
|
8
|
+
import IndexDatatype from "../Core/IndexDatatype.js";
|
|
9
|
+
import renderPolygons from "./renderBufferPolygonCollection.js";
|
|
10
|
+
import BufferPolygonMaterial from "./BufferPolygonMaterial.js";
|
|
11
|
+
|
|
12
|
+
/** @import { TypedArray } from "../Core/globalTypes.js"; */
|
|
13
|
+
/** @import Matrix4 from "../Core/Matrix4.js"; */
|
|
14
|
+
/** @import FrameState from "./FrameState.js" */
|
|
15
|
+
/** @import ComponentDatatype from "../Core/ComponentDatatype.js"; */
|
|
16
|
+
|
|
17
|
+
const { ERR_CAPACITY } = BufferPrimitiveCollection.Error;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {object} BufferPolygonOptions
|
|
21
|
+
* @property {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] Transforms geometry from model to world coordinates.
|
|
22
|
+
* @property {boolean} [show=true]
|
|
23
|
+
* @property {BufferPolygonMaterial} [material=BufferPolygonMaterial.DEFAULT_MATERIAL]
|
|
24
|
+
* @property {TypedArray} [positions]
|
|
25
|
+
* @property {TypedArray} [holes]
|
|
26
|
+
* @property {TypedArray} [triangles]
|
|
27
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Collection of polygons held in ArrayBuffer storage for performance and memory optimization.
|
|
32
|
+
*
|
|
33
|
+
* <p>Default buffer memory allocation is arbitrary, and collections cannot be resized,
|
|
34
|
+
* so specific per-buffer capacities should be provided in the collection
|
|
35
|
+
* constructor when available.</p>
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* import earcut from "earcut";
|
|
39
|
+
*
|
|
40
|
+
* const collection = new BufferPolygonCollection({
|
|
41
|
+
* primitiveCountMax: 1024,
|
|
42
|
+
* vertexCountMax: 4096,
|
|
43
|
+
* holeCountMax: 1024,
|
|
44
|
+
* triangleCountMax: 2048,
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* const polygon = new BufferPolygon();
|
|
48
|
+
* const positions = [ ... ];
|
|
49
|
+
* const holes = [ ... ];
|
|
50
|
+
* const material = new BufferPolygonMaterial({color: Color.WHITE});
|
|
51
|
+
*
|
|
52
|
+
* // Create a new polygon, temporarily bound to 'polygon' local variable.
|
|
53
|
+
* collection.add({
|
|
54
|
+
* positions: new Float64Array(positions),
|
|
55
|
+
* holes: new Uint32Array(holes),
|
|
56
|
+
* triangles: new Uint32Array(earcut(positions, holes, 3)),
|
|
57
|
+
* material
|
|
58
|
+
* }, polygon);
|
|
59
|
+
*
|
|
60
|
+
* // Iterate over all polygons in collection, temporarily binding 'polygon'
|
|
61
|
+
* // local variable to each, and updating polygon material.
|
|
62
|
+
* for (let i = 0; i < collection.primitiveCount; i++) {
|
|
63
|
+
* collection.get(i, polygon);
|
|
64
|
+
* polygon.setMaterial(material);
|
|
65
|
+
* }
|
|
66
|
+
*
|
|
67
|
+
* @see BufferPolygon
|
|
68
|
+
* @see BufferPolygonMaterial
|
|
69
|
+
* @see BufferPrimitiveCollection
|
|
70
|
+
* @extends BufferPrimitiveCollection<BufferPolygon>
|
|
71
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
72
|
+
*/
|
|
73
|
+
class BufferPolygonCollection extends BufferPrimitiveCollection {
|
|
74
|
+
/**
|
|
75
|
+
* @param {object} options
|
|
76
|
+
* @param {number} [options.primitiveCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
|
|
77
|
+
* @param {number} [options.vertexCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
|
|
78
|
+
* @param {number} [options.holeCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
|
|
79
|
+
* @param {number} [options.triangleCountMax=BufferPrimitiveCollection.DEFAULT_CAPACITY]
|
|
80
|
+
* @param {ComponentDatatype} [options.positionDatatype=ComponentDatatype.DOUBLE]
|
|
81
|
+
* @param {boolean} [options.show=true]
|
|
82
|
+
* @param {boolean} [options.allowPicking=true] When <code>true</code>, primitives are pickable with {@link Scene#pick}. When <code>false</code>, memory and initialization cost are lower.
|
|
83
|
+
* @param {boolean} [options.debugShowBoundingVolume=false]
|
|
84
|
+
*/
|
|
85
|
+
constructor(options = Frozen.EMPTY_OBJECT) {
|
|
86
|
+
super(options);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @type {number}
|
|
90
|
+
* @ignore
|
|
91
|
+
*/
|
|
92
|
+
this._holeCount = 0;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @type {number}
|
|
96
|
+
* @protected
|
|
97
|
+
* @ignore
|
|
98
|
+
*/
|
|
99
|
+
this._holeCountMax =
|
|
100
|
+
options.holeCountMax ?? BufferPrimitiveCollection.DEFAULT_CAPACITY;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @type {TypedArray}
|
|
104
|
+
* @ignore
|
|
105
|
+
*/
|
|
106
|
+
this._holeIndexView = null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @type {number}
|
|
110
|
+
* @ignore
|
|
111
|
+
*/
|
|
112
|
+
this._triangleCount = 0;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @type {number}
|
|
116
|
+
* @protected
|
|
117
|
+
* @ignore
|
|
118
|
+
*/
|
|
119
|
+
this._triangleCountMax =
|
|
120
|
+
options.triangleCountMax ?? BufferPrimitiveCollection.DEFAULT_CAPACITY;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @type {TypedArray}
|
|
124
|
+
* @ignore
|
|
125
|
+
*/
|
|
126
|
+
this._triangleIndexView = null;
|
|
127
|
+
|
|
128
|
+
this._allocateHoleIndexBuffer();
|
|
129
|
+
this._allocateTriangleIndexBuffer();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_getCollectionClass() {
|
|
133
|
+
return BufferPolygonCollection;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
_getPrimitiveClass() {
|
|
137
|
+
return BufferPolygon;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_getMaterialClass() {
|
|
141
|
+
return BufferPolygonMaterial;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
145
|
+
// COLLECTION LIFECYCLE
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @private
|
|
149
|
+
* @ignore
|
|
150
|
+
*/
|
|
151
|
+
_allocateHoleIndexBuffer() {
|
|
152
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
153
|
+
this._holeIndexView = IndexDatatype.createTypedArray(
|
|
154
|
+
this._positionCountMax,
|
|
155
|
+
this._holeCountMax,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @private
|
|
161
|
+
* @ignore
|
|
162
|
+
*/
|
|
163
|
+
_allocateTriangleIndexBuffer() {
|
|
164
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
165
|
+
this._triangleIndexView = IndexDatatype.createTypedArray(
|
|
166
|
+
this._positionCountMax,
|
|
167
|
+
this._triangleCountMax * 3,
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Duplicates the contents of this collection into the result collection.
|
|
173
|
+
* Result collection is not resized, and must contain enough space for all
|
|
174
|
+
* primitives in the source collection. Existing polygons in the result
|
|
175
|
+
* collection will be overwritten.
|
|
176
|
+
*
|
|
177
|
+
* <p>Useful when allocating more space for a collection that has reached its
|
|
178
|
+
* capacity, and efficiently transferring polygons to the new collection.</p>
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* const result = new BufferPolygonCollection({ ... }); // allocate larger 'result' collection
|
|
182
|
+
* BufferPolygonCollection.clone(collection, result); // copy polygons from 'collection' into 'result'
|
|
183
|
+
*
|
|
184
|
+
* @param {BufferPolygonCollection} collection
|
|
185
|
+
* @param {BufferPolygonCollection} result
|
|
186
|
+
* @returns {BufferPolygonCollection}
|
|
187
|
+
*/
|
|
188
|
+
static clone(collection, result) {
|
|
189
|
+
super.clone(collection, result);
|
|
190
|
+
|
|
191
|
+
//>>includeStart('debug', pragmas.debug);
|
|
192
|
+
assert(collection.holeCount <= result.holeCountMax, ERR_CAPACITY);
|
|
193
|
+
assert(collection.triangleCount <= result.triangleCountMax, ERR_CAPACITY);
|
|
194
|
+
//>>includeEnd('debug');
|
|
195
|
+
|
|
196
|
+
this._copySubArray(
|
|
197
|
+
collection._holeIndexView,
|
|
198
|
+
result._holeIndexView,
|
|
199
|
+
collection.holeCount,
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
this._copySubArray(
|
|
203
|
+
collection._triangleIndexView,
|
|
204
|
+
result._triangleIndexView,
|
|
205
|
+
collection._triangleCount * 3,
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
result._holeCount = collection._holeCount;
|
|
209
|
+
result._triangleCount = collection._triangleCount;
|
|
210
|
+
|
|
211
|
+
return result;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @param {BufferPolygonCollection} collection
|
|
216
|
+
* @returns {BufferPolygonCollection}
|
|
217
|
+
* @override
|
|
218
|
+
* @ignore
|
|
219
|
+
*/
|
|
220
|
+
static _cloneEmpty(collection) {
|
|
221
|
+
return new BufferPolygonCollection({
|
|
222
|
+
primitiveCountMax: collection.primitiveCountMax,
|
|
223
|
+
vertexCountMax: collection.vertexCountMax,
|
|
224
|
+
holeCountMax: collection.holeCountMax,
|
|
225
|
+
triangleCountMax: collection.triangleCountMax,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {BufferPolygonCollection} src
|
|
231
|
+
* @param {BufferPolygonCollection} dst
|
|
232
|
+
* @override
|
|
233
|
+
* @ignore
|
|
234
|
+
*/
|
|
235
|
+
static _replaceBuffers(src, dst) {
|
|
236
|
+
super._replaceBuffers(src, dst);
|
|
237
|
+
dst._holeIndexView = src._holeIndexView;
|
|
238
|
+
dst._triangleIndexView = src._triangleIndexView;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
242
|
+
// PRIMITIVE LIFECYCLE
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Adds a new polygon to the collection, with the specified options. A
|
|
246
|
+
* {@link BufferPolygon} instance is linked to the new polygon, using
|
|
247
|
+
* the 'result' argument if given, or a new instance if not. For repeated
|
|
248
|
+
* calls, prefer to reuse a single BufferPolygon instance rather than
|
|
249
|
+
* allocating a new instance on each call.
|
|
250
|
+
*
|
|
251
|
+
* @param {BufferPolygonOptions} options
|
|
252
|
+
* @param {BufferPolygon} result
|
|
253
|
+
* @returns {BufferPolygon}
|
|
254
|
+
* @override
|
|
255
|
+
*/
|
|
256
|
+
add(options, result = new BufferPolygon()) {
|
|
257
|
+
super.add(options, result);
|
|
258
|
+
|
|
259
|
+
const vertexOffset = this._positionCount;
|
|
260
|
+
result._setUint32(BufferPolygon.Layout.POSITION_OFFSET_U32, vertexOffset);
|
|
261
|
+
result._setUint32(BufferPolygon.Layout.POSITION_COUNT_U32, 0);
|
|
262
|
+
|
|
263
|
+
const holeOffset = this._holeCount;
|
|
264
|
+
result._setUint32(BufferPolygon.Layout.HOLE_OFFSET_U32, holeOffset);
|
|
265
|
+
result._setUint32(BufferPolygon.Layout.HOLE_COUNT_U32, 0);
|
|
266
|
+
|
|
267
|
+
const triangleOffset = this._triangleCount;
|
|
268
|
+
result._setUint32(BufferPolygon.Layout.TRIANGLE_OFFSET_U32, triangleOffset);
|
|
269
|
+
result._setUint32(BufferPolygon.Layout.TRIANGLE_COUNT_U32, 0);
|
|
270
|
+
|
|
271
|
+
if (defined(options.positions)) {
|
|
272
|
+
result.setPositions(options.positions);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (defined(options.holes)) {
|
|
276
|
+
result.setHoles(options.holes);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (defined(options.triangles)) {
|
|
280
|
+
result.setTriangles(options.triangles);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
287
|
+
// RENDER
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @param {FrameState} frameState
|
|
291
|
+
* @ignore
|
|
292
|
+
*/
|
|
293
|
+
update(frameState) {
|
|
294
|
+
super.update(frameState);
|
|
295
|
+
|
|
296
|
+
const passes = frameState.passes;
|
|
297
|
+
if (this.show && (passes.render || passes.pick)) {
|
|
298
|
+
this._renderContext = renderPolygons(
|
|
299
|
+
this,
|
|
300
|
+
frameState,
|
|
301
|
+
this._renderContext,
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
307
|
+
// ACCESSORS
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Total byte length of buffers owned by this collection. Includes any unused
|
|
311
|
+
* space allocated by {@link primitiveCountMax}, even if no polygons have
|
|
312
|
+
* yet been added in that space.
|
|
313
|
+
*
|
|
314
|
+
* @type {number}
|
|
315
|
+
* @readonly
|
|
316
|
+
* @override
|
|
317
|
+
*/
|
|
318
|
+
get byteLength() {
|
|
319
|
+
return (
|
|
320
|
+
super.byteLength +
|
|
321
|
+
this._holeIndexView.byteLength +
|
|
322
|
+
this._triangleIndexView.byteLength
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Number of holes in collection. Must be <= {@link holeCountMax}.
|
|
328
|
+
*
|
|
329
|
+
* @type {number}
|
|
330
|
+
* @readonly
|
|
331
|
+
*/
|
|
332
|
+
get holeCount() {
|
|
333
|
+
return this._holeCount;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Maximum number of holes in collection. Must be >= {@link holeCount}.
|
|
338
|
+
*
|
|
339
|
+
* @type {number}
|
|
340
|
+
* @readonly
|
|
341
|
+
* @default {@link BufferPrimitiveCollection.DEFAULT_CAPACITY}
|
|
342
|
+
*/
|
|
343
|
+
get holeCountMax() {
|
|
344
|
+
return this._holeCountMax;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Number of triangles in collection. Must be <= {@link triangleCountMax}.
|
|
349
|
+
*
|
|
350
|
+
* @type {number}
|
|
351
|
+
* @readonly
|
|
352
|
+
*/
|
|
353
|
+
get triangleCount() {
|
|
354
|
+
return this._triangleCount;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Maximum number of triangles in collection. Must be >= {@link triangleCount}.
|
|
359
|
+
*
|
|
360
|
+
* @type {number}
|
|
361
|
+
* @readonly
|
|
362
|
+
* @default {@link BufferPrimitiveCollection.DEFAULT_CAPACITY}
|
|
363
|
+
*/
|
|
364
|
+
get triangleCountMax() {
|
|
365
|
+
return this._triangleCountMax;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
export default BufferPolygonCollection;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import Frozen from "../Core/Frozen.js";
|
|
4
|
+
import BufferPrimitiveMaterial from "./BufferPrimitiveMaterial.js";
|
|
5
|
+
|
|
6
|
+
/** @import Color from "../Core/Color.js"; */
|
|
7
|
+
/** @import BufferPolygon from "./BufferPolygon.js"; */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {object} BufferPolygonMaterialOptions
|
|
11
|
+
* @property {Color} [color=Color.WHITE] Color of fill.
|
|
12
|
+
* @property {Color} [outlineColor=Color.WHITE] Color of outline.
|
|
13
|
+
* @property {number} [outlineWidth=0.0] Width of outline, 0-255px.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Material description for a {@link BufferPolygon}.
|
|
18
|
+
*
|
|
19
|
+
* <p>BufferPolygonMaterial objects are {@link Packable|packable}, stored
|
|
20
|
+
* when calling {@link BufferPolygon#setMaterial}. Subsequent changes to the
|
|
21
|
+
* material will not affect the polygon until setMaterial() is called again.</p>
|
|
22
|
+
*
|
|
23
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
24
|
+
* @extends BufferPrimitiveMaterial
|
|
25
|
+
*/
|
|
26
|
+
class BufferPolygonMaterial extends BufferPrimitiveMaterial {
|
|
27
|
+
/**
|
|
28
|
+
* @type {BufferPolygonMaterial}
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
static DEFAULT_MATERIAL = Object.freeze(new BufferPolygonMaterial());
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param {BufferPolygonMaterialOptions} [options]
|
|
35
|
+
*/
|
|
36
|
+
constructor(options = Frozen.EMPTY_OBJECT) {
|
|
37
|
+
super(options);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default BufferPolygonMaterial;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import BufferPrimitive from "./BufferPrimitive.js";
|
|
4
|
+
import assert from "../Core/assert.js";
|
|
5
|
+
import BufferPrimitiveCollection from "./BufferPrimitiveCollection.js";
|
|
6
|
+
import defined from "../Core/defined.js";
|
|
7
|
+
|
|
8
|
+
/** @import { TypedArray, TypedArrayConstructor } from "../Core/globalTypes.js"; */
|
|
9
|
+
/** @import BufferPolylineCollection from "./BufferPolylineCollection.js"; */
|
|
10
|
+
|
|
11
|
+
const { ERR_RESIZE, ERR_CAPACITY } = BufferPrimitiveCollection.Error;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* View bound to the underlying buffer data of a {@link BufferPolylineCollection}.
|
|
15
|
+
*
|
|
16
|
+
* <p>BufferPolyline instances are {@link https://en.wikipedia.org/wiki/Flyweight_pattern|flyweights}:
|
|
17
|
+
* a single BufferPolyline instance can be temporarily bound to any conceptual
|
|
18
|
+
* "polyline" in a BufferPolylineCollection, allowing very large collections to be
|
|
19
|
+
* iterated and updated with a minimal memory footprint.</p>
|
|
20
|
+
*
|
|
21
|
+
* Represented as two (2) or more positions.
|
|
22
|
+
*
|
|
23
|
+
* @see BufferPolylineCollection
|
|
24
|
+
* @see BufferPolylineMaterial
|
|
25
|
+
* @see BufferPrimitive
|
|
26
|
+
* @extends BufferPrimitive
|
|
27
|
+
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
28
|
+
*/
|
|
29
|
+
class BufferPolyline extends BufferPrimitive {
|
|
30
|
+
/**
|
|
31
|
+
* @type {BufferPolylineCollection}
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
34
|
+
_collection = null;
|
|
35
|
+
|
|
36
|
+
/** @ignore */
|
|
37
|
+
static Layout = {
|
|
38
|
+
...BufferPrimitive.Layout,
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Offset in position array to first vertex in polyline, number of VEC3 elements.
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
POSITION_OFFSET_U32: BufferPrimitive.Layout.__BYTE_LENGTH,
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Count of positions (vertices) in this polyline, number of VEC3 elements.
|
|
49
|
+
* @type {number}
|
|
50
|
+
* @ignore
|
|
51
|
+
*/
|
|
52
|
+
POSITION_COUNT_U32: BufferPrimitive.Layout.__BYTE_LENGTH + 4,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @type {number}
|
|
56
|
+
* @ignore
|
|
57
|
+
*/
|
|
58
|
+
__BYTE_LENGTH: BufferPrimitive.Layout.__BYTE_LENGTH + 8,
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
62
|
+
// LIFECYCLE
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Copies data from source polyline to result. If the result polyline is not
|
|
66
|
+
* new (the last polyline in the collection) then source and result polylines
|
|
67
|
+
* must have the same vertex counts.
|
|
68
|
+
*
|
|
69
|
+
* @param {BufferPolyline} polyline
|
|
70
|
+
* @param {BufferPolyline} result
|
|
71
|
+
* @return {BufferPolyline}
|
|
72
|
+
* @override
|
|
73
|
+
*/
|
|
74
|
+
static clone(polyline, result) {
|
|
75
|
+
super.clone(polyline, result);
|
|
76
|
+
result.setPositions(polyline.getPositions());
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
81
|
+
// GEOMETRY
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Offset in collection position array to first vertex in polyline, number
|
|
85
|
+
* of VEC3 elements.
|
|
86
|
+
*
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @readonly
|
|
89
|
+
* @ignore
|
|
90
|
+
*/
|
|
91
|
+
get vertexOffset() {
|
|
92
|
+
return this._getUint32(BufferPolyline.Layout.POSITION_OFFSET_U32);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Count of positions (vertices) in this polyline, number of VEC3 elements.
|
|
97
|
+
*
|
|
98
|
+
* @type {number}
|
|
99
|
+
* @readonly
|
|
100
|
+
*/
|
|
101
|
+
get vertexCount() {
|
|
102
|
+
return this._getUint32(BufferPolyline.Layout.POSITION_COUNT_U32);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Returns an array view of this polyline's vertex positions. If 'result'
|
|
107
|
+
* argument is given, vertex positions are written to that array and returned.
|
|
108
|
+
* Otherwise, returns an ArrayView on collection memory — changes to this array
|
|
109
|
+
* will not trigger render updates, which requires `.setPositions()`.
|
|
110
|
+
*
|
|
111
|
+
* @param {TypedArray} [result]
|
|
112
|
+
* return {TypedArray}
|
|
113
|
+
*/
|
|
114
|
+
getPositions(result) {
|
|
115
|
+
const { vertexOffset, vertexCount } = this;
|
|
116
|
+
const positionView = this._collection._positionView;
|
|
117
|
+
|
|
118
|
+
if (!defined(result)) {
|
|
119
|
+
const byteOffset =
|
|
120
|
+
positionView.byteOffset +
|
|
121
|
+
vertexOffset * 3 * positionView.BYTES_PER_ELEMENT;
|
|
122
|
+
const TypedArray = /** @type {TypedArrayConstructor} */ (
|
|
123
|
+
positionView.constructor
|
|
124
|
+
);
|
|
125
|
+
return new TypedArray(
|
|
126
|
+
/** @type {ArrayBuffer} */ (positionView.buffer),
|
|
127
|
+
byteOffset,
|
|
128
|
+
vertexCount * 3,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
for (let i = 0; i < vertexCount; i++) {
|
|
133
|
+
result[i * 3] = positionView[(vertexOffset + i) * 3];
|
|
134
|
+
result[i * 3 + 1] = positionView[(vertexOffset + i) * 3 + 1];
|
|
135
|
+
result[i * 3 + 2] = positionView[(vertexOffset + i) * 3 + 2];
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** @param {TypedArray} positions */
|
|
141
|
+
setPositions(positions) {
|
|
142
|
+
const collection = this._collection;
|
|
143
|
+
const vertexOffset = this.vertexOffset;
|
|
144
|
+
const srcCount = this.vertexCount;
|
|
145
|
+
const dstCount = positions.length / 3;
|
|
146
|
+
const collectionCount = collection._positionCount + dstCount - srcCount;
|
|
147
|
+
|
|
148
|
+
//>>includeStart('debug', pragmas.debug);
|
|
149
|
+
assert(srcCount === dstCount || this._isResizable(), ERR_RESIZE);
|
|
150
|
+
assert(collectionCount <= collection.vertexCountMax, ERR_CAPACITY);
|
|
151
|
+
//>>includeEnd('debug');
|
|
152
|
+
|
|
153
|
+
collection._positionCount = collectionCount;
|
|
154
|
+
this._setUint32(BufferPolyline.Layout.POSITION_COUNT_U32, dstCount);
|
|
155
|
+
|
|
156
|
+
const positionView = collection._positionView;
|
|
157
|
+
for (let i = 0; i < dstCount; i++) {
|
|
158
|
+
positionView[(vertexOffset + i) * 3] = positions[i * 3];
|
|
159
|
+
positionView[(vertexOffset + i) * 3 + 1] = positions[i * 3 + 1];
|
|
160
|
+
positionView[(vertexOffset + i) * 3 + 2] = positions[i * 3 + 2];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
collection._makeDirtyBoundingVolume();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
167
|
+
// DEBUG
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Returns a JSON-serializable object representing the polyline. This encoding
|
|
171
|
+
* is not memory-efficient, and should generally be used for debugging and
|
|
172
|
+
* testing.
|
|
173
|
+
*
|
|
174
|
+
* @returns {Object} JSON-serializable object.
|
|
175
|
+
* @override
|
|
176
|
+
*/
|
|
177
|
+
toJSON() {
|
|
178
|
+
return {
|
|
179
|
+
...super.toJSON(),
|
|
180
|
+
positions: Array.from(this.getPositions()),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export default BufferPolyline;
|