itowns 2.45.1 → 2.45.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/dist/455.js +1 -1
  2. package/dist/455.js.map +1 -1
  3. package/dist/debug.js +1 -1
  4. package/dist/debug.js.LICENSE.txt +8 -2
  5. package/dist/debug.js.map +1 -1
  6. package/dist/itowns.js +1 -1
  7. package/dist/itowns.js.LICENSE.txt +1 -1
  8. package/dist/itowns.js.map +1 -1
  9. package/dist/itowns_lasparser.js +1 -1
  10. package/dist/itowns_lasparser.js.map +1 -1
  11. package/dist/itowns_lasworker.js +1 -1
  12. package/dist/itowns_lasworker.js.map +1 -1
  13. package/dist/itowns_potree2worker.js +1 -1
  14. package/dist/itowns_potree2worker.js.map +1 -1
  15. package/dist/itowns_widgets.js +1 -1
  16. package/dist/itowns_widgets.js.map +1 -1
  17. package/examples/copc_simple_loader.html +3 -3
  18. package/examples/entwine_3d_loader.html +2 -2
  19. package/examples/entwine_simple_loader.html +10 -6
  20. package/examples/potree2_25d_map.html +2 -2
  21. package/examples/potree_25d_map.html +2 -2
  22. package/examples/potree_3d_map.html +2 -2
  23. package/examples/view_3d_map_webxr.html +2 -5
  24. package/lib/Controls/FirstPersonControls.d.ts +90 -0
  25. package/lib/Controls/FlyControls.d.ts +36 -0
  26. package/lib/Controls/GlobeControls.d.ts +274 -0
  27. package/lib/Controls/PlanarControls.d.ts +339 -0
  28. package/lib/Controls/StateControl.d.ts +140 -0
  29. package/lib/Controls/StreetControls.d.ts +134 -0
  30. package/lib/Controls/VRControls.d.ts +56 -0
  31. package/lib/Controls/VRControls.js +409 -0
  32. package/lib/Converter/Feature2Mesh.d.ts +42 -0
  33. package/lib/Converter/Feature2Texture.d.ts +5 -0
  34. package/lib/Converter/convertToTile.d.ts +5 -0
  35. package/lib/Converter/convertToTile.js +2 -2
  36. package/lib/Converter/textureConverter.d.ts +4 -0
  37. package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
  38. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
  39. package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
  40. package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
  41. package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
  42. package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
  43. package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
  44. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
  45. package/lib/Core/AnimationPlayer.d.ts +53 -0
  46. package/lib/Core/CopcNode.d.ts +68 -0
  47. package/lib/Core/CopcNode.js +57 -74
  48. package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
  49. package/lib/Core/EntwinePointTileNode.d.ts +59 -0
  50. package/lib/Core/EntwinePointTileNode.js +16 -41
  51. package/lib/Core/Feature.d.ts +323 -0
  52. package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
  53. package/lib/Core/Label.d.ts +86 -0
  54. package/lib/Core/MainLoop.d.ts +23 -0
  55. package/lib/Core/Picking.d.ts +6 -0
  56. package/lib/Core/Picking.js +4 -0
  57. package/lib/Core/PointCloudNode.d.ts +16 -0
  58. package/lib/Core/PointCloudNode.js +34 -4
  59. package/lib/Core/Potree2Node.d.ts +11 -0
  60. package/lib/Core/Potree2Node.js +5 -60
  61. package/lib/Core/Potree2PointAttributes.d.ts +97 -0
  62. package/lib/Core/PotreeNode.d.ts +14 -0
  63. package/lib/Core/PotreeNode.js +28 -18
  64. package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
  65. package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
  66. package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
  67. package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
  68. package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
  69. package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
  70. package/lib/Core/Prefab/GlobeView.d.ts +65 -0
  71. package/lib/Core/Prefab/GlobeView.js +9 -0
  72. package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
  73. package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
  74. package/lib/Core/Prefab/PlanarView.d.ts +33 -0
  75. package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
  76. package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
  77. package/lib/Core/Scheduler/Cache.d.ts +25 -0
  78. package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
  79. package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
  80. package/lib/Core/Style.d.ts +248 -0
  81. package/lib/Core/StyleOptions.d.ts +455 -0
  82. package/lib/Core/System/Capabilities.d.ts +9 -0
  83. package/lib/Core/Tile/Tile.d.ts +70 -0
  84. package/lib/Core/Tile/TileGrid.d.ts +12 -0
  85. package/lib/Core/TileGeometry.d.ts +46 -0
  86. package/lib/Core/TileMesh.d.ts +50 -0
  87. package/lib/Core/TileMesh.js +2 -4
  88. package/lib/Core/View.d.ts +403 -0
  89. package/lib/Core/View.js +1 -7
  90. package/lib/Layer/C3DTilesLayer.d.ts +140 -0
  91. package/lib/Layer/ColorLayer.d.ts +128 -0
  92. package/lib/Layer/ColorLayer.js +4 -4
  93. package/lib/Layer/CopcLayer.d.ts +42 -0
  94. package/lib/Layer/CopcLayer.js +3 -6
  95. package/lib/Layer/ElevationLayer.d.ts +96 -0
  96. package/lib/Layer/ElevationLayer.js +3 -3
  97. package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
  98. package/lib/Layer/EntwinePointTileLayer.js +4 -3
  99. package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
  100. package/lib/Layer/GeoidLayer.d.ts +41 -0
  101. package/lib/Layer/GeometryLayer.d.ts +120 -0
  102. package/lib/Layer/InfoLayer.d.ts +24 -0
  103. package/lib/Layer/InfoLayer.js +1 -1
  104. package/lib/Layer/LabelLayer.d.ts +93 -0
  105. package/lib/Layer/LabelLayer.js +2 -2
  106. package/lib/Layer/Layer.d.ts +185 -0
  107. package/lib/Layer/LayerUpdateState.d.ts +24 -0
  108. package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
  109. package/lib/Layer/LayerUpdateStrategy.js +2 -7
  110. package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
  111. package/lib/Layer/OGC3DTilesLayer.js +21 -0
  112. package/lib/Layer/OrientedImageLayer.d.ts +53 -0
  113. package/lib/Layer/PointCloudLayer.d.ts +103 -0
  114. package/lib/Layer/PointCloudLayer.js +8 -11
  115. package/lib/Layer/Potree2Layer.d.ts +56 -0
  116. package/lib/Layer/Potree2Layer.js +0 -2
  117. package/lib/Layer/PotreeLayer.d.ts +55 -0
  118. package/lib/Layer/RasterLayer.d.ts +8 -0
  119. package/lib/Layer/RasterLayer.js +2 -2
  120. package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
  121. package/lib/Layer/ReferencingLayerProperties.js +0 -12
  122. package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
  123. package/lib/Layer/TiledGeometryLayer.js +4 -3
  124. package/lib/Main.d.ts +89 -0
  125. package/lib/Main.js +3 -1
  126. package/lib/Parser/B3dmParser.d.ts +26 -0
  127. package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
  128. package/lib/Parser/GDFParser.d.ts +24 -0
  129. package/lib/Parser/GTXParser.d.ts +28 -0
  130. package/lib/Parser/GeoJsonParser.d.ts +12 -0
  131. package/lib/Parser/GpxParser.d.ts +12 -0
  132. package/lib/Parser/ISGParser.d.ts +23 -0
  133. package/lib/Parser/KMLParser.d.ts +12 -0
  134. package/lib/Parser/LASParser.d.ts +61 -0
  135. package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
  136. package/lib/Parser/PntsParser.d.ts +4 -0
  137. package/lib/Parser/Potree2BinParser.d.ts +8 -0
  138. package/lib/Parser/PotreeBinParser.d.ts +4 -0
  139. package/lib/Parser/PotreeCinParser.d.ts +4 -0
  140. package/lib/Parser/ShapefileParser.d.ts +25 -0
  141. package/lib/Parser/VectorTileParser.d.ts +34 -0
  142. package/lib/Parser/XbilParser.d.ts +18 -0
  143. package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
  144. package/lib/Parser/iGLTFLoader.d.ts +104 -0
  145. package/lib/Process/3dTilesProcessing.d.ts +43 -0
  146. package/lib/Process/FeatureProcessing.d.ts +4 -0
  147. package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
  148. package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
  149. package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
  150. package/lib/Process/handlerNodeError.d.ts +1 -0
  151. package/lib/Provider/3dTilesProvider.d.ts +7 -0
  152. package/lib/Provider/DataSourceProvider.d.ts +4 -0
  153. package/lib/Provider/Fetcher.d.ts +101 -0
  154. package/lib/Provider/PointCloudProvider.d.ts +4 -0
  155. package/lib/Provider/TileProvider.d.ts +4 -0
  156. package/lib/Provider/URLBuilder.d.ts +28 -0
  157. package/lib/Renderer/Camera.d.ts +95 -0
  158. package/lib/Renderer/Color.d.ts +3 -0
  159. package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
  160. package/lib/Renderer/ColorLayersOrdering.js +2 -2
  161. package/lib/Renderer/CommonMaterial.d.ts +6 -0
  162. package/lib/Renderer/Label2DRenderer.d.ts +31 -0
  163. package/lib/Renderer/LayeredMaterial.d.ts +121 -0
  164. package/lib/Renderer/LayeredMaterial.js +221 -141
  165. package/lib/Renderer/OBB.d.ts +65 -0
  166. package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
  167. package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
  168. package/lib/Renderer/PointsMaterial.d.ts +226 -0
  169. package/lib/Renderer/PointsMaterial.js +60 -22
  170. package/lib/Renderer/RasterTile.d.ts +53 -0
  171. package/lib/Renderer/RasterTile.js +8 -9
  172. package/lib/Renderer/RenderMode.d.ts +11 -0
  173. package/lib/Renderer/RenderMode.js +1 -0
  174. package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
  175. package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
  176. package/lib/Renderer/WebXR.d.ts +33 -0
  177. package/lib/Renderer/WebXR.js +128 -47
  178. package/lib/Renderer/c3DEngine.d.ts +55 -0
  179. package/lib/Renderer/c3DEngine.js +5 -1
  180. package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
  181. package/lib/Source/C3DTilesIonSource.d.ts +31 -0
  182. package/lib/Source/C3DTilesSource.d.ts +17 -0
  183. package/lib/Source/CopcSource.d.ts +79 -0
  184. package/lib/Source/EntwinePointTileSource.d.ts +40 -0
  185. package/lib/Source/EntwinePointTileSource.js +0 -5
  186. package/lib/Source/FileSource.d.ts +118 -0
  187. package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
  188. package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
  189. package/lib/Source/OGC3DTilesSource.d.ts +21 -0
  190. package/lib/Source/OrientedImageSource.d.ts +48 -0
  191. package/lib/Source/Potree2Source.d.ts +157 -0
  192. package/lib/Source/PotreeSource.d.ts +69 -0
  193. package/lib/Source/Source.d.ts +122 -0
  194. package/lib/Source/TMSSource.d.ts +77 -0
  195. package/lib/Source/VectorTilesSource.d.ts +56 -0
  196. package/lib/Source/WFSSource.d.ts +110 -0
  197. package/lib/Source/WMSSource.d.ts +85 -0
  198. package/lib/Source/WMTSSource.d.ts +65 -0
  199. package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
  200. package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
  201. package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
  202. package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
  203. package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
  204. package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
  205. package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
  206. package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
  207. package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
  208. package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
  209. package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
  210. package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
  211. package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
  212. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
  213. package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
  214. package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
  215. package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
  216. package/lib/Utils/CameraUtils.d.ts +132 -0
  217. package/lib/Utils/DEMUtils.d.ts +84 -0
  218. package/lib/Utils/DEMUtils.js +2 -2
  219. package/lib/Utils/FeaturesUtils.d.ts +17 -0
  220. package/lib/Utils/Gradients.d.ts +13 -0
  221. package/lib/Utils/ThreeUtils.d.ts +14 -0
  222. package/lib/Utils/placeObjectOnGround.d.ts +28 -0
  223. package/lib/global.d.js +0 -0
  224. package/package.json +18 -15
@@ -0,0 +1,75 @@
1
+ export default C3DTExtensions;
2
+ /**
3
+ * Class for managing
4
+ * [3D Tiles extensions](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions).
5
+ * Extensions used in a 3D Tiles tileset must be registered in the iTowns' layer
6
+ * holding the tileset by the user with the {@link registerExtension}
7
+ * method. The extension must be registered together with a class holding the
8
+ * code to interpret the extension.
9
+ * An example of extension class is {@link C3DTBatchTableHierarchyExtension}.
10
+ * This extension has only one part situated in the batch table (but other
11
+ * extensions can have multiple parts, stored in different 3D Tiles classes
12
+ * such as tileset or bounding volume).
13
+ * @example
14
+ * // Create a C3DTExtensions object
15
+ * const extensions = new itowns.C3DTExtensions();
16
+ * // Register an extension to it named "3DTILES_batch_table_hierarchy" and
17
+ * // a class itowns.C3DTBatchTableHierarchyExtension to the batch table part
18
+ * // (with [itowns.C3DTilesTypes.batchtable]). see {@link C3DTilesTypes}
19
+ * extensions.registerExtension("3DTILES_batch_table_hierarchy",
20
+ * { [itowns.C3DTilesTypes.batchtable]: itowns.C3DTBatchTableHierarchyExtension });
21
+ *
22
+ * // Create a 3D Tiles layer with registered extensions
23
+ * var $3dTilesLayerBTHierarchy = new itowns.C3DTilesLayer('3d-tiles-bt-hierarchy', {
24
+ * name: 'BTHierarchy',
25
+ * source: new itowns.C3DTilesSource({
26
+ * url: 'https://raw.githubusercontent.com/AnalyticalGraphicsInc/cesium/master/Apps/SampleData/Cesium3DTiles/Hierarchy/BatchTableHierarchy/tileset.json',
27
+ * }),
28
+ * registeredExtensions: extensions,
29
+ * },
30
+ * view);
31
+ */
32
+ declare class C3DTExtensions {
33
+ /**
34
+ * Register a 3D Tiles extension: Maps an extension name to the
35
+ * extensionsManagers (i.e. one class per 3D Tiles class (e.g.
36
+ * batch table or bounding volume).
37
+ * @param {string} extensionName - Name of the extension
38
+ * @param {object} extensionManagers - An object mapping 3D Tiles
39
+ * classes names (see @link{C3DTilesTypes} to the extension managers
40
+ * corresponding to this class. These extension managers should be able
41
+ * to parse the extension fragment (done in the constructor) and should
42
+ * have a getInfoById method if they are related to the batch table class.
43
+ * See {@link C3DTBatchTableHierarchyExtension} for an example of
44
+ * extension class.
45
+ */
46
+ registerExtension(extensionName: string, extensionManagers: object): void;
47
+ /**
48
+ * Get an extension manager from its name and C3DTilesType
49
+ * @param {string} extensionName - name of the extension.
50
+ * @param {C3DTilesTypes} type - type of 3DTiles class (e.g. batch
51
+ * table, bounding volume, tileset, etc.)
52
+ * @returns {object} - the extension manager corresponding to the
53
+ * extensioNname and type.
54
+ */
55
+ getExtension(extensionName: string, type: C3DTilesTypes): object;
56
+ /**
57
+ * Test if an extension is registered
58
+ * @param {string} extensionName - Name of the extension
59
+ * @returns {boolean} - true if the extension is registered and false
60
+ * otherwise.
61
+ */
62
+ isExtensionRegistered(extensionName: string): boolean;
63
+ /**
64
+ * Parses the extensions from a given JSON (extensionsJSON) by
65
+ * instanciating the right class from the registered extensions.
66
+ * @param {object} extensionsJSON - the JSON to parse extensions from.
67
+ * @param {C3DTilesTypes} type - type of class asking for extensions parsing
68
+ * has been called. For instance, if {@link C3DTBatchTable} needs to
69
+ * parse its extensions, it will call parseExtension with the JSON to
70
+ * parse and C3DTilesTypes.batchtable as type.
71
+ * @returns {object} - An object with keys being the names of the
72
+ * extensions and values the instances of the extensions managers.
73
+ */
74
+ parseExtensions(extensionsJSON: object, type: C3DTilesTypes): object;
75
+ }
@@ -0,0 +1,47 @@
1
+ export default C3DTFeature;
2
+ /**
3
+ * C3DTFeature is a feature of a 3DTiles
4
+ *
5
+ * @class C3DTFeature
6
+ * @param {number} tileId - tileId
7
+ * @param {number} batchId - batch id
8
+ * @param {Array<{start:number,count:number}>} groups - groups in geometry.attributes matching batchId
9
+ * @param {object} [userData] - some userData
10
+ * @param {Object3D} object3d - object3d in which feature is present
11
+ * @property {number} tileId - tile id
12
+ * @property {Object3D} object3d - object3d in which feature is present
13
+ * @property {number} batchId - batch id
14
+ * @property {Array<{start:number,count:number}>} groups - groups in geometry.attributes matching batchId
15
+ * @property {object} [userData] - some userData
16
+ */
17
+ declare class C3DTFeature {
18
+ constructor(tileId: any, batchId: any, groups: any, userData: any, object3d: any);
19
+ /** @type {Object3D} */
20
+ object3d: Object3D;
21
+ /** @type {number} */
22
+ batchId: number;
23
+ /** @type {Array<{start:number,count:number}>} */
24
+ groups: Array<{
25
+ start: number;
26
+ count: number;
27
+ }>;
28
+ /** @type {object} */
29
+ userData: object;
30
+ /** @type {number} */
31
+ tileId: number;
32
+ /**
33
+ * Compute world box3 of this
34
+ *
35
+ * @param {Box3} target - target of the result
36
+ * @returns {Box3}
37
+ */
38
+ computeWorldBox3(target?: Box3): Box3;
39
+ /**
40
+ * Gets the information from the tile batch table for this C3DTFeature batch id.
41
+ * @returns {object} - batchTable info
42
+ */
43
+ getInfo(): object;
44
+ #private;
45
+ }
46
+ import { Object3D } from 'three';
47
+ import { Box3 } from 'three';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * C3DTilesTypes
3
+ */
4
+ export type C3DTilesTypes = Object;
5
+ export namespace C3DTilesTypes {
6
+ let tileset: string;
7
+ let batchtable: string;
8
+ let boundingVolume: string;
9
+ }
10
+ export namespace C3DTilesBoundingVolumeTypes {
11
+ let region: string;
12
+ let box: string;
13
+ let sphere: string;
14
+ }
@@ -0,0 +1,46 @@
1
+ export default C3DTileset;
2
+ /**
3
+ * A 3D Tiles
4
+ * [Tileset](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/tileset.schema.json).
5
+ * @property {C3DTilesTypes} type - Used by 3D Tiles extensions
6
+ * (e.g. {@link C3DTBatchTableHierarchyExtension}) to know in which context
7
+ * (i.e. for which 3D Tiles class) the parsing of the extension should be done.
8
+ * @property {object} asset - Generic information about the tileset, see
9
+ * [asset specification]https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/asset.schema.json
10
+ * @property {object} properties - Properties associated with the tileset, see
11
+ * [tileset specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L11)
12
+ * @property {number} geometricError - see [tileset
13
+ * specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L18)
14
+ * @property {string[]} extensionsUsed - see [tileset
15
+ * specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L27)
16
+ * @property {array} extensionsRequired - see [tileset specification](https://github.com/CesiumGS/3d-tiles/blob/master/specification/schema/tileset.schema.json#L36)
17
+ * @property {object[]} tiles - an array holding all the
18
+ * [tiles](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/tile.schema.json)
19
+ * (not their content which is stored in the attribute object3d of the
20
+ * layer). This list represents a flattened tileset.
21
+ * @property {object} extensions - Extensions of the tileset in the form:
22
+ * {extensioName1: extensionObject1, extensioName2: extensionObject2, ...}
23
+ */
24
+ declare class C3DTileset {
25
+ constructor(json: any, baseURL: any, registeredExtensions: any);
26
+ type: string;
27
+ asset: any;
28
+ properties: any;
29
+ geometricError: any;
30
+ extensionsUsed: any;
31
+ extensionsRequired: any;
32
+ tiles: any[];
33
+ extensions: any;
34
+ /**
35
+ * Recursion on the 3DTiles tileset (which is a tree) to parse the tiles
36
+ * (nodes of the tree).
37
+ * @param {object} tile - current tile
38
+ * @param {string} baseURL - url of the source tileset and tiles
39
+ * @param {object} parent - parent tile (used for computing the transform
40
+ * matrix from local to global coordinates)
41
+ * @param {object} registeredExtensions - 3D Tiles extensions registered
42
+ * in the C3DTilesLayer (see {@link C3DTExtensions}
43
+ */
44
+ parseTiles(tile: object, baseURL: string, parent: object, registeredExtensions: object): void;
45
+ extendTileset(tileset: any, nodeId: any, baseURL: any, registeredExtensions: any): void;
46
+ }
@@ -0,0 +1,14 @@
1
+ export default binaryPropertyAccessor;
2
+ /**
3
+ * Parses a 3D Tiles binary property. Used for batch table and feature table parsing. See the 3D Tiles spec for more
4
+ * information on how these values are encoded:
5
+ * [3D Tiles spec](https://github.com/CesiumGS/3d-tiles/blob/main/specification/TileFormats/BatchTable/README.md#binary-body))
6
+ * @param {ArrayBuffer} buffer The buffer to parse values from.
7
+ * @param {Number} batchLength number of objects in the batch (= number of elements to parse).
8
+ * @param {Number} byteOffset the offset in bytes into the buffer.
9
+ * @param {String} componentType the type of component to parse (one of componentTypeBytesSize keys)
10
+ * @param {String} type the type of element to parse (one of typeComponentsNumber keys)
11
+ * @returns {Array} an array of values parsed from the buffer. An array of componentType if type is SCALAR. An array
12
+ * of Threejs Vector2, Vector3 or Vector4 if type is VEC2, VEC3 or VEC4 respectively.
13
+ */
14
+ declare function binaryPropertyAccessor(buffer: ArrayBuffer, batchLength: number, byteOffset: number, componentType: string, type: string): any[];
@@ -0,0 +1,53 @@
1
+ export default AnimationPlayer;
2
+ /**
3
+ * It can play, pause or stop Animation or AnimationExpression (See below).
4
+ * AnimationPlayer is needed to use Animation or AnimationExpression
5
+ * AnimationPlayer emits events :
6
+ * - for each animation's frame;
7
+ * - when Animation is stopped
8
+ * - when Animation is ending
9
+ */
10
+ declare class AnimationPlayer extends THREE.EventDispatcher<any> {
11
+ constructor();
12
+ id: NodeJS.Timer | null;
13
+ keyframe: number;
14
+ duration: number;
15
+ state: number;
16
+ waitTimer: number | null;
17
+ callback: () => void;
18
+ isPlaying(): boolean;
19
+ isStopped(): boolean;
20
+ isEnded(): boolean;
21
+ /**
22
+ * Set the Player `callback` property. This callback is executed at each animation frame.
23
+ *
24
+ * @param {function} callback - The callback to execute at each animation frame.
25
+ */
26
+ setCallback(callback: Function): void;
27
+ /**
28
+ * Play one animation.
29
+ * If another animation is playing, it's stopped and the new animation is played.
30
+ *
31
+ * @param {number} duration - The duration to play
32
+ */
33
+ play(duration: number): void;
34
+ /**
35
+ * Play an animation after a number of frames.
36
+ *
37
+ * @param {number} duration The duration to play
38
+ * @param {number} waitingFrame The waiting time before start animation (time in frame)
39
+ */
40
+ playLater(duration: number, waitingFrame: number): void;
41
+ /**
42
+ * Stop the current animation.
43
+ *
44
+ */
45
+ stop(): void;
46
+ /**
47
+ * Executed for each frame.
48
+ *
49
+ * @private
50
+ */
51
+ private frame;
52
+ }
53
+ import * as THREE from 'three';
@@ -0,0 +1,68 @@
1
+ export default CopcNode;
2
+ /**
3
+ * @extends PointCloudNode
4
+ *
5
+ * @property {boolean} isCopcNode - Used to checkout whether this
6
+ * node is a CopcNode. Default is `true`. You should not change
7
+ * this, as it is used internally for optimisation.
8
+ * @property {number} entryOffset - Offset from the beginning of the file of
9
+ * the node entry
10
+ * @property {number} entryLength - Size of the node entry
11
+ * @property {CopcLayer} layer - COPC layer the node belongs to.
12
+ * @property {number} depth - Depth within the octree
13
+ * @property {number} x - X position within the octree
14
+ * @property {number} y - Y position within the octree
15
+ * @property {number} z - Z position within the octree
16
+ * @property {string} voxelKey - The id of the node, constituted of the four
17
+ * components: `depth-x-y-z`.
18
+ */
19
+ declare class CopcNode extends PointCloudNode {
20
+ /**
21
+ * Constructs a new instance of a COPC Octree node
22
+ *
23
+ * @param {number} depth - Depth within the octree
24
+ * @param {number} x - X position within the octree
25
+ * @param {number} y - Y position within the octree
26
+ * @param {number} z - Z position with the octree
27
+ * @param {number} entryOffset - Offset from the beginning of the file to
28
+ * the node entry
29
+ * @param {number} entryLength - Size of the node entry
30
+ * @param {CopcLayer} layer - Parent COPC layer
31
+ * @param {number} [numPoints=0] - Number of points given by this entry
32
+ */
33
+ constructor(depth: number, x: number, y: number, z: number, entryOffset: number, entryLength: number, layer: CopcLayer, numPoints?: number);
34
+ isCopcNode: boolean;
35
+ entryOffset: number;
36
+ entryLength: number;
37
+ depth: number;
38
+ x: number;
39
+ y: number;
40
+ z: number;
41
+ voxelKey: string;
42
+ get octreeIsLoaded(): boolean;
43
+ get id(): string;
44
+ /**
45
+ * @param {number} offset
46
+ * @param {number} size
47
+ */
48
+ _fetch(offset: number, size: number): Promise<any>;
49
+ loadOctree(): Promise<undefined>;
50
+ /**
51
+ * Create a CopcNode from the provided subtree and add it as child
52
+ * of the current node.
53
+ * @param {number} depth - Child node depth in the octree
54
+ * @param {number} x - Child node x position in the octree
55
+ * @param {number} y - Child node y position in the octree
56
+ * @param {number} z - Child node z position in the octree
57
+ * @param {Hierarchy.Subtree} hierarchy - Octree's subtree
58
+ * @param {CopcNode[]} stack - Stack of node candidates for traversal
59
+ */
60
+ findAndCreateChild(depth: number, x: number, y: number, z: number, hierarchy: Hierarchy.Subtree, stack: CopcNode[]): void;
61
+ /**
62
+ * Load the COPC Buffer geometry for this node.
63
+ * @returns {Promise<THREE.BufferGeometry>}
64
+ */
65
+ load(): Promise<THREE.BufferGeometry>;
66
+ }
67
+ import PointCloudNode from '../Core/PointCloudNode';
68
+ import { Hierarchy } from 'copc';
@@ -1,12 +1,26 @@
1
- import * as THREE from 'three';
2
1
  import { Hierarchy } from 'copc';
3
2
  import PointCloudNode from "./PointCloudNode.js";
4
- const size = new THREE.Vector3();
5
- const position = new THREE.Vector3();
6
- const translation = new THREE.Vector3();
7
- function buildId(depth, x, y, z) {
3
+ function buildVoxelKey(depth, x, y, z) {
8
4
  return `${depth}-${x}-${y}-${z}`;
9
5
  }
6
+
7
+ /**
8
+ * @extends PointCloudNode
9
+ *
10
+ * @property {boolean} isCopcNode - Used to checkout whether this
11
+ * node is a CopcNode. Default is `true`. You should not change
12
+ * this, as it is used internally for optimisation.
13
+ * @property {number} entryOffset - Offset from the beginning of the file of
14
+ * the node entry
15
+ * @property {number} entryLength - Size of the node entry
16
+ * @property {CopcLayer} layer - COPC layer the node belongs to.
17
+ * @property {number} depth - Depth within the octree
18
+ * @property {number} x - X position within the octree
19
+ * @property {number} y - Y position within the octree
20
+ * @property {number} z - Z position within the octree
21
+ * @property {string} voxelKey - The id of the node, constituted of the four
22
+ * components: `depth-x-y-z`.
23
+ */
10
24
  class CopcNode extends PointCloudNode {
11
25
  /**
12
26
  * Constructs a new instance of a COPC Octree node
@@ -15,7 +29,7 @@ class CopcNode extends PointCloudNode {
15
29
  * @param {number} x - X position within the octree
16
30
  * @param {number} y - Y position within the octree
17
31
  * @param {number} z - Z position with the octree
18
- * @param {number} entryOffset - Offset from the beginning of the file of
32
+ * @param {number} entryOffset - Offset from the beginning of the file to
19
33
  * the node entry
20
34
  * @param {number} entryLength - Size of the node entry
21
35
  * @param {CopcLayer} layer - Parent COPC layer
@@ -27,18 +41,18 @@ class CopcNode extends PointCloudNode {
27
41
  this.isCopcNode = true;
28
42
  this.entryOffset = entryOffset;
29
43
  this.entryLength = entryLength;
30
- this.layer = layer;
31
44
  this.depth = depth;
32
45
  this.x = x;
33
46
  this.y = y;
34
47
  this.z = z;
35
- }
36
- get id() {
37
- return buildId(this.depth, this.x, this.y, this.z);
48
+ this.voxelKey = buildVoxelKey(depth, x, y, z);
38
49
  }
39
50
  get octreeIsLoaded() {
40
51
  return this.numPoints >= 0;
41
52
  }
53
+ get id() {
54
+ return `${this.depth}${this.x}${this.y}${this.z}`;
55
+ }
42
56
 
43
57
  /**
44
58
  * @param {number} offset
@@ -53,36 +67,38 @@ class CopcNode extends PointCloudNode {
53
67
  }
54
68
  });
55
69
  }
70
+ async loadOctree() {
71
+ // Load hierarchy
72
+ const buffer = await this._fetch(this.entryOffset, this.entryLength);
73
+ const hierarchy = await Hierarchy.parse(new Uint8Array(buffer));
56
74
 
57
- /**
58
- * Create an (A)xis (A)ligned (B)ounding (B)ox for the given node given
59
- * `this` is its parent.
60
- * @param {CopcNode} node - The child node
61
- */
62
- createChildAABB(node) {
63
- // factor to apply, based on the depth difference (can be > 1)
64
- const f = 2 ** (node.depth - this.depth);
65
-
66
- // size of the child node bbox (Vector3), based on the size of the
67
- // parent node, and divided by the factor
68
- this.bbox.getSize(size).divideScalar(f);
69
-
70
- // initialize the child node bbox at the location of the parent node bbox
71
- node.bbox.min.copy(this.bbox.min);
72
-
73
- // position of the parent node, if it was at the same depth as the
74
- // child, found by multiplying the tree position by the factor
75
- position.copy(this).multiplyScalar(f);
76
-
77
- // difference in position between the two nodes, at child depth, and
78
- // scale it using the size
79
- translation.subVectors(node, position).multiply(size);
80
-
81
- // apply the translation to the child node bbox
82
- node.bbox.min.add(translation);
75
+ // Update current node entry from loaded subtree
76
+ const node = hierarchy.nodes[this.voxelKey];
77
+ if (!node) {
78
+ return Promise.reject('[CopcNode]: Ill-formed data, entry not found in hierarchy.');
79
+ }
80
+ this.numPoints = node.pointCount;
81
+ this.entryOffset = node.pointDataOffset;
82
+ this.entryLength = node.pointDataLength;
83
83
 
84
- // use the size computed above to set the max
85
- node.bbox.max.copy(node.bbox.min).add(size);
84
+ // Load subtree entries
85
+ const stack = [];
86
+ stack.push(this);
87
+ while (stack.length) {
88
+ const node = stack.shift();
89
+ const depth = node.depth + 1;
90
+ const x = node.x * 2;
91
+ const y = node.y * 2;
92
+ const z = node.z * 2;
93
+ node.findAndCreateChild(depth, x, y, z, hierarchy, stack);
94
+ node.findAndCreateChild(depth, x + 1, y, z, hierarchy, stack);
95
+ node.findAndCreateChild(depth, x, y + 1, z, hierarchy, stack);
96
+ node.findAndCreateChild(depth, x + 1, y + 1, z, hierarchy, stack);
97
+ node.findAndCreateChild(depth, x, y, z + 1, hierarchy, stack);
98
+ node.findAndCreateChild(depth, x + 1, y, z + 1, hierarchy, stack);
99
+ node.findAndCreateChild(depth, x, y + 1, z + 1, hierarchy, stack);
100
+ node.findAndCreateChild(depth, x + 1, y + 1, z + 1, hierarchy, stack);
101
+ }
86
102
  }
87
103
 
88
104
  /**
@@ -96,17 +112,17 @@ class CopcNode extends PointCloudNode {
96
112
  * @param {CopcNode[]} stack - Stack of node candidates for traversal
97
113
  */
98
114
  findAndCreateChild(depth, x, y, z, hierarchy, stack) {
99
- const id = buildId(depth, x, y, z);
115
+ const voxelKey = buildVoxelKey(depth, x, y, z);
100
116
  let pointCount;
101
117
  let offset;
102
118
  let byteSize;
103
- const node = hierarchy.nodes[id];
119
+ const node = hierarchy.nodes[voxelKey];
104
120
  if (node) {
105
121
  pointCount = node.pointCount;
106
122
  offset = node.pointDataOffset;
107
123
  byteSize = node.pointDataLength;
108
124
  } else {
109
- const page = hierarchy.pages[id];
125
+ const page = hierarchy.pages[voxelKey];
110
126
  if (!page) {
111
127
  return;
112
128
  }
@@ -118,39 +134,6 @@ class CopcNode extends PointCloudNode {
118
134
  this.add(child);
119
135
  stack.push(child);
120
136
  }
121
- async loadOctree() {
122
- // Load hierarchy
123
- const buffer = await this._fetch(this.entryOffset, this.entryLength);
124
- const hierarchy = await Hierarchy.parse(new Uint8Array(buffer));
125
-
126
- // Update current node entry from loaded subtree
127
- const node = hierarchy.nodes[this.id];
128
- if (!node) {
129
- return Promise.reject('[CopcNode]: Ill-formed data, entry not found in hierarchy.');
130
- }
131
- this.numPoints = node.pointCount;
132
- this.entryOffset = node.pointDataOffset;
133
- this.entryLength = node.pointDataLength;
134
-
135
- // Load subtree entries
136
- const stack = [];
137
- stack.push(this);
138
- while (stack.length) {
139
- const node = stack.shift();
140
- const depth = node.depth + 1;
141
- const x = node.x * 2;
142
- const y = node.y * 2;
143
- const z = node.z * 2;
144
- node.findAndCreateChild(depth, x, y, z, hierarchy, stack);
145
- node.findAndCreateChild(depth, x + 1, y, z, hierarchy, stack);
146
- node.findAndCreateChild(depth, x, y + 1, z, hierarchy, stack);
147
- node.findAndCreateChild(depth, x + 1, y + 1, z, hierarchy, stack);
148
- node.findAndCreateChild(depth, x, y, z + 1, hierarchy, stack);
149
- node.findAndCreateChild(depth, x + 1, y, z + 1, hierarchy, stack);
150
- node.findAndCreateChild(depth, x, y + 1, z + 1, hierarchy, stack);
151
- node.findAndCreateChild(depth, x + 1, y + 1, z + 1, hierarchy, stack);
152
- }
153
- }
154
137
 
155
138
  /**
156
139
  * Load the COPC Buffer geometry for this node.
@@ -0,0 +1,6 @@
1
+ export function deprecatedColorLayerOptions(options: any): any;
2
+ export function deprecatedParsingOptionsToNewOne(options: any): any;
3
+ export function deprecatedFeature2MeshOptions(options: any): void;
4
+ export function deprecatedC3DEngineWebGLOptions(options: any): void;
5
+ declare const _default: {};
6
+ export default _default;
@@ -0,0 +1,59 @@
1
+ export default EntwinePointTileNode;
2
+ /**
3
+ * @extends PointCloudNode
4
+ *
5
+ * @property {boolean} isEntwinePointTileNode - Used to checkout whether this
6
+ * node is a EntwinePointTileNode. Default is `true`. You should not change
7
+ * this, as it is used internally for optimisation.
8
+ * @property {number} depth - The depth of the node in the tree - see the
9
+ * [Entwine
10
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
11
+ * @property {number} x - The x coordinate of the node in the tree - see the
12
+ * [Entwine
13
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
14
+ * @property {number} y - The y coordinate of the node in the tree - see the
15
+ * [Entwine
16
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
17
+ * @property {number} z - The z coordinate of the node in the tree - see the
18
+ * [Entwine
19
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
20
+ * @property {string} voxelKey - The id of the node, constituted of the four
21
+ * components: `depth-x-y-z`.
22
+ */
23
+ declare class EntwinePointTileNode extends PointCloudNode {
24
+ /**
25
+ * Constructs a new instance of EntwinePointTileNode.
26
+ *
27
+ * @constructor
28
+ *
29
+ * @param {number} depth - The depth of the node in the tree - see the
30
+ * [Entwine
31
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
32
+ * @param {number} x - The x coordinate of the node in the tree - see the
33
+ * [Entwine
34
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
35
+ * @param {number} y - The y coordinate of the node in the tree - see the
36
+ * [Entwine
37
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
38
+ * @param {number} z - The z coordinate of the node in the tree - see the
39
+ * [Entwine
40
+ * documentation](https://entwine.io/entwine-point-tile.html#ept-data)
41
+ * @param {EntwinePointTileLayer} layer - The layer the node is attached to.
42
+ * @param {number} [numPoints=0] - The number of points in this node. If
43
+ * `-1`, it means that the octree hierarchy associated to this node needs to
44
+ * be loaded.
45
+ */
46
+ constructor(depth: number, x: number, y: number, z: number, layer: EntwinePointTileLayer, numPoints?: number);
47
+ isEntwinePointTileNode: boolean;
48
+ depth: number;
49
+ x: number;
50
+ y: number;
51
+ z: number;
52
+ voxelKey: string;
53
+ url: string;
54
+ get octreeIsLoaded(): boolean;
55
+ get id(): string;
56
+ loadOctree(): Promise<void>;
57
+ findAndCreateChild(depth: any, x: any, y: any, z: any, hierarchy: any, stack: any): void;
58
+ }
59
+ import PointCloudNode from '../Core/PointCloudNode';