itowns 2.45.1 → 2.45.2-next.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.
Files changed (220) 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/view_3d_map_webxr.html +2 -5
  21. package/lib/Controls/FirstPersonControls.d.ts +90 -0
  22. package/lib/Controls/FlyControls.d.ts +36 -0
  23. package/lib/Controls/GlobeControls.d.ts +274 -0
  24. package/lib/Controls/PlanarControls.d.ts +339 -0
  25. package/lib/Controls/StateControl.d.ts +140 -0
  26. package/lib/Controls/StreetControls.d.ts +134 -0
  27. package/lib/Controls/VRControls.d.ts +56 -0
  28. package/lib/Controls/VRControls.js +409 -0
  29. package/lib/Converter/Feature2Mesh.d.ts +42 -0
  30. package/lib/Converter/Feature2Texture.d.ts +5 -0
  31. package/lib/Converter/convertToTile.d.ts +5 -0
  32. package/lib/Converter/convertToTile.js +2 -2
  33. package/lib/Converter/textureConverter.d.ts +4 -0
  34. package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
  35. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
  36. package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
  37. package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
  38. package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
  39. package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
  40. package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
  41. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
  42. package/lib/Core/AnimationPlayer.d.ts +53 -0
  43. package/lib/Core/CopcNode.d.ts +67 -0
  44. package/lib/Core/CopcNode.js +50 -69
  45. package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
  46. package/lib/Core/EntwinePointTileNode.d.ts +58 -0
  47. package/lib/Core/EntwinePointTileNode.js +6 -34
  48. package/lib/Core/Feature.d.ts +323 -0
  49. package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
  50. package/lib/Core/Label.d.ts +86 -0
  51. package/lib/Core/MainLoop.d.ts +23 -0
  52. package/lib/Core/Picking.d.ts +6 -0
  53. package/lib/Core/Picking.js +4 -0
  54. package/lib/Core/PointCloudNode.d.ts +14 -0
  55. package/lib/Core/PointCloudNode.js +28 -0
  56. package/lib/Core/Potree2Node.d.ts +11 -0
  57. package/lib/Core/Potree2Node.js +3 -57
  58. package/lib/Core/Potree2PointAttributes.d.ts +97 -0
  59. package/lib/Core/PotreeNode.d.ts +13 -0
  60. package/lib/Core/PotreeNode.js +17 -17
  61. package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
  62. package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
  63. package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
  64. package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
  65. package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
  66. package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
  67. package/lib/Core/Prefab/GlobeView.d.ts +65 -0
  68. package/lib/Core/Prefab/GlobeView.js +9 -0
  69. package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
  70. package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
  71. package/lib/Core/Prefab/PlanarView.d.ts +33 -0
  72. package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
  73. package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
  74. package/lib/Core/Scheduler/Cache.d.ts +25 -0
  75. package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
  76. package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
  77. package/lib/Core/Style.d.ts +248 -0
  78. package/lib/Core/StyleOptions.d.ts +455 -0
  79. package/lib/Core/System/Capabilities.d.ts +9 -0
  80. package/lib/Core/Tile/Tile.d.ts +70 -0
  81. package/lib/Core/Tile/TileGrid.d.ts +12 -0
  82. package/lib/Core/TileGeometry.d.ts +46 -0
  83. package/lib/Core/TileMesh.d.ts +50 -0
  84. package/lib/Core/TileMesh.js +2 -4
  85. package/lib/Core/View.d.ts +403 -0
  86. package/lib/Core/View.js +1 -7
  87. package/lib/Layer/C3DTilesLayer.d.ts +140 -0
  88. package/lib/Layer/ColorLayer.d.ts +128 -0
  89. package/lib/Layer/ColorLayer.js +4 -4
  90. package/lib/Layer/CopcLayer.d.ts +42 -0
  91. package/lib/Layer/CopcLayer.js +3 -6
  92. package/lib/Layer/ElevationLayer.d.ts +96 -0
  93. package/lib/Layer/ElevationLayer.js +3 -3
  94. package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
  95. package/lib/Layer/EntwinePointTileLayer.js +4 -3
  96. package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
  97. package/lib/Layer/GeoidLayer.d.ts +41 -0
  98. package/lib/Layer/GeometryLayer.d.ts +120 -0
  99. package/lib/Layer/InfoLayer.d.ts +24 -0
  100. package/lib/Layer/InfoLayer.js +1 -1
  101. package/lib/Layer/LabelLayer.d.ts +93 -0
  102. package/lib/Layer/LabelLayer.js +2 -2
  103. package/lib/Layer/Layer.d.ts +185 -0
  104. package/lib/Layer/LayerUpdateState.d.ts +24 -0
  105. package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
  106. package/lib/Layer/LayerUpdateStrategy.js +2 -7
  107. package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
  108. package/lib/Layer/OGC3DTilesLayer.js +21 -0
  109. package/lib/Layer/OrientedImageLayer.d.ts +53 -0
  110. package/lib/Layer/PointCloudLayer.d.ts +103 -0
  111. package/lib/Layer/PointCloudLayer.js +1 -1
  112. package/lib/Layer/Potree2Layer.d.ts +56 -0
  113. package/lib/Layer/PotreeLayer.d.ts +55 -0
  114. package/lib/Layer/RasterLayer.d.ts +8 -0
  115. package/lib/Layer/RasterLayer.js +2 -2
  116. package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
  117. package/lib/Layer/ReferencingLayerProperties.js +0 -12
  118. package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
  119. package/lib/Layer/TiledGeometryLayer.js +4 -3
  120. package/lib/Main.d.ts +89 -0
  121. package/lib/Main.js +3 -1
  122. package/lib/Parser/B3dmParser.d.ts +26 -0
  123. package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
  124. package/lib/Parser/GDFParser.d.ts +24 -0
  125. package/lib/Parser/GTXParser.d.ts +28 -0
  126. package/lib/Parser/GeoJsonParser.d.ts +12 -0
  127. package/lib/Parser/GpxParser.d.ts +12 -0
  128. package/lib/Parser/ISGParser.d.ts +23 -0
  129. package/lib/Parser/KMLParser.d.ts +12 -0
  130. package/lib/Parser/LASParser.d.ts +61 -0
  131. package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
  132. package/lib/Parser/PntsParser.d.ts +4 -0
  133. package/lib/Parser/Potree2BinParser.d.ts +8 -0
  134. package/lib/Parser/PotreeBinParser.d.ts +4 -0
  135. package/lib/Parser/PotreeCinParser.d.ts +4 -0
  136. package/lib/Parser/ShapefileParser.d.ts +25 -0
  137. package/lib/Parser/VectorTileParser.d.ts +34 -0
  138. package/lib/Parser/XbilParser.d.ts +18 -0
  139. package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
  140. package/lib/Parser/iGLTFLoader.d.ts +104 -0
  141. package/lib/Process/3dTilesProcessing.d.ts +43 -0
  142. package/lib/Process/FeatureProcessing.d.ts +4 -0
  143. package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
  144. package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
  145. package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
  146. package/lib/Process/handlerNodeError.d.ts +1 -0
  147. package/lib/Provider/3dTilesProvider.d.ts +7 -0
  148. package/lib/Provider/DataSourceProvider.d.ts +4 -0
  149. package/lib/Provider/Fetcher.d.ts +101 -0
  150. package/lib/Provider/PointCloudProvider.d.ts +4 -0
  151. package/lib/Provider/TileProvider.d.ts +4 -0
  152. package/lib/Provider/URLBuilder.d.ts +28 -0
  153. package/lib/Renderer/Camera.d.ts +95 -0
  154. package/lib/Renderer/Color.d.ts +3 -0
  155. package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
  156. package/lib/Renderer/ColorLayersOrdering.js +2 -2
  157. package/lib/Renderer/CommonMaterial.d.ts +6 -0
  158. package/lib/Renderer/Label2DRenderer.d.ts +31 -0
  159. package/lib/Renderer/LayeredMaterial.d.ts +121 -0
  160. package/lib/Renderer/LayeredMaterial.js +221 -141
  161. package/lib/Renderer/OBB.d.ts +65 -0
  162. package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
  163. package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
  164. package/lib/Renderer/PointsMaterial.d.ts +226 -0
  165. package/lib/Renderer/PointsMaterial.js +60 -22
  166. package/lib/Renderer/RasterTile.d.ts +53 -0
  167. package/lib/Renderer/RasterTile.js +8 -9
  168. package/lib/Renderer/RenderMode.d.ts +11 -0
  169. package/lib/Renderer/RenderMode.js +1 -0
  170. package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
  171. package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
  172. package/lib/Renderer/WebXR.d.ts +33 -0
  173. package/lib/Renderer/WebXR.js +128 -47
  174. package/lib/Renderer/c3DEngine.d.ts +55 -0
  175. package/lib/Renderer/c3DEngine.js +5 -1
  176. package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
  177. package/lib/Source/C3DTilesIonSource.d.ts +31 -0
  178. package/lib/Source/C3DTilesSource.d.ts +17 -0
  179. package/lib/Source/CopcSource.d.ts +79 -0
  180. package/lib/Source/EntwinePointTileSource.d.ts +40 -0
  181. package/lib/Source/EntwinePointTileSource.js +0 -5
  182. package/lib/Source/FileSource.d.ts +118 -0
  183. package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
  184. package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
  185. package/lib/Source/OGC3DTilesSource.d.ts +21 -0
  186. package/lib/Source/OrientedImageSource.d.ts +48 -0
  187. package/lib/Source/Potree2Source.d.ts +157 -0
  188. package/lib/Source/PotreeSource.d.ts +69 -0
  189. package/lib/Source/Source.d.ts +122 -0
  190. package/lib/Source/TMSSource.d.ts +77 -0
  191. package/lib/Source/VectorTilesSource.d.ts +56 -0
  192. package/lib/Source/WFSSource.d.ts +110 -0
  193. package/lib/Source/WMSSource.d.ts +85 -0
  194. package/lib/Source/WMTSSource.d.ts +65 -0
  195. package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
  196. package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
  197. package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
  198. package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
  199. package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
  200. package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
  201. package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
  202. package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
  203. package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
  204. package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
  205. package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
  206. package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
  207. package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
  208. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
  209. package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
  210. package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
  211. package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
  212. package/lib/Utils/CameraUtils.d.ts +132 -0
  213. package/lib/Utils/DEMUtils.d.ts +84 -0
  214. package/lib/Utils/DEMUtils.js +2 -2
  215. package/lib/Utils/FeaturesUtils.d.ts +17 -0
  216. package/lib/Utils/Gradients.d.ts +13 -0
  217. package/lib/Utils/ThreeUtils.d.ts +14 -0
  218. package/lib/Utils/placeObjectOnGround.d.ts +28 -0
  219. package/lib/global.d.js +0 -0
  220. package/package.json +18 -15
@@ -0,0 +1,32 @@
1
+ declare namespace _default {
2
+ /**
3
+ * Cleanup obj to release three.js allocated resources
4
+ * @param {Object3D} obj object to release
5
+ */
6
+ function cleanup(obj: Object3D): void;
7
+ /**
8
+ * Remove obj's children belonging to a layer.
9
+ * Neither obj nor its children will be disposed!
10
+ * @param {Layer} layer The layer that objects must belong to. Other object are ignored
11
+ * @param {Object3D} obj The Object3D we want to clean
12
+ * @return {Array} an array of removed Object3D from obj (not including the recursive removals)
13
+ */
14
+ function removeChildren(layer: Layer, obj: Object3D): any[];
15
+ /**
16
+ * Remove an obj and all its children belonging to a layer and only cleanup the obj (and not its children).
17
+ * obj will be disposed but its children **won't**!
18
+ * @param {Layer} layer The layer that objects must belong to. Other object are ignored
19
+ * @param {Object3D} obj The Object3D we want to clean
20
+ * @return {Array} an array of removed Object3D from obj (not including the recursive removals)
21
+ */
22
+ function removeChildrenAndCleanup(layer: Layer, obj: Object3D): any[];
23
+ /**
24
+ * Recursively remove an obj and all its children belonging to a layer.
25
+ * All removed obj will have their geometry/material disposed.
26
+ * @param {Layer} layer The layer that objects must belong to. Other object are ignored
27
+ * @param {Object3D} obj The Object3D we want to clean
28
+ * @return {Array} an array of removed Object3D from obj (not including the recursive removals)
29
+ */
30
+ function removeChildrenAndCleanupRecursively(layer: Layer, obj: Object3D): any[];
31
+ }
32
+ export default _default;
@@ -0,0 +1 @@
1
+ export default function handlingError(err: any, node: any, layer: any, targetLevel: any, view: any): void;
@@ -0,0 +1,7 @@
1
+ export function configureTile(tile: any, layer: any, metadata: any, parent: any): void;
2
+ declare namespace _default {
3
+ export { executeCommand };
4
+ }
5
+ export default _default;
6
+ declare function executeCommand(command: any): Promise<THREE.Object3D<THREE.Object3DEventMap>>;
7
+ import * as THREE from 'three';
@@ -0,0 +1,4 @@
1
+ declare namespace _default {
2
+ function executeCommand(command: any): Promise<any[]>;
3
+ }
4
+ export default _default;
@@ -0,0 +1,101 @@
1
+ declare namespace _default {
2
+ /**
3
+ * Wrapper over fetch to get some text.
4
+ *
5
+ * @param {string} url - The URL of the resources to fetch.
6
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
7
+ * see [the syntax for more information](
8
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
9
+ *
10
+ * @return {Promise<string>} Promise containing the text.
11
+ */
12
+ export function text(url: string, options?: Object): Promise<string>;
13
+ /**
14
+ * Little wrapper over fetch to get some JSON.
15
+ *
16
+ * @param {string} url - The URL of the resources to fetch.
17
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
18
+ * see [the syntax for more information](
19
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
20
+ *
21
+ * @return {Promise<Object>} Promise containing the JSON object.
22
+ */
23
+ export function json(url: string, options?: Object): Promise<Object>;
24
+ /**
25
+ * Wrapper over fetch to get some XML.
26
+ *
27
+ * @param {string} url - The URL of the resources to fetch.
28
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
29
+ * see [the syntax for more information](
30
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
31
+ *
32
+ * @return {Promise<Document>} Promise containing the XML Document.
33
+ */
34
+ export function xml(url: string, options?: Object): Promise<Document>;
35
+ /**
36
+ * Wrapper around [THREE.TextureLoader](https://threejs.org/docs/#api/en/loaders/TextureLoader).
37
+ *
38
+ * @param {string} url - The URL of the resources to fetch.
39
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
40
+ * see [the syntax for more information](
41
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
42
+ * Note that THREE.js docs mentions `withCredentials`, but it is not
43
+ * actually used in [THREE.TextureLoader](https://threejs.org/docs/#api/en/loaders/TextureLoader).
44
+ *
45
+ * @return {Promise<THREE.Texture>} Promise containing the
46
+ * [THREE.Texture](https://threejs.org/docs/api/en/textures/Texture.html).
47
+ */
48
+ export function texture(url: string, options?: Object): Promise<THREE.Texture>;
49
+ export { arrayBuffer };
50
+ /**
51
+ * Wrapper over fetch to get some
52
+ * [THREE.DataTexture](https://threejs.org/docs/#api/en/textures/DataTexture).
53
+ *
54
+ * @param {string} url - The URL of the resources to fetch.
55
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
56
+ * see [the syntax for more information](
57
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
58
+ *
59
+ * @return {Promise<THREE.DataTexture>} Promise containing the DataTexture.
60
+ */
61
+ export function textureFloat(url: string, options?: Object): Promise<THREE.DataTexture>;
62
+ /**
63
+ * Wrapper over fetch to get a bunch of files sharing the same name, but
64
+ * different extensions.
65
+ *
66
+ * @param {string} baseUrl - The shared URL of the resources to fetch.
67
+ * @param {Object} extensions - An object containing arrays. The keys of
68
+ * each of this array are available fetch type, such as `text`, `json` or
69
+ * even `arrayBuffer`. The arrays contains the extensions to append after
70
+ * the `baseUrl` (see example below).
71
+ * @param {Object} options - Fetch options (passed directly to `fetch()`),
72
+ * see [the syntax for more information](
73
+ * https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Syntax).
74
+ *
75
+ * @return {Promise[]} An array of promises, containing all the files,
76
+ * organized by their extensions (see the example below).
77
+ *
78
+ * @example
79
+ * itowns.Fetcher.multiple('http://geo.server/shapefile', {
80
+ * // will fetch:
81
+ * // - http://geo.server/shapefile.shp
82
+ * // - http://geo.server/shapefile.dbf
83
+ * // - http://geo.server/shapefile.shx
84
+ * // - http://geo.server/shapefile.prj
85
+ * arrayBuffer: ['shp', 'dbf', 'shx'],
86
+ * text: ['prj'],
87
+ * }).then(function _(result) {
88
+ * // result looks like:
89
+ * result = {
90
+ * shp: ArrayBuffer
91
+ * dbf: ArrayBuffer
92
+ * shx: ArrayBuffer
93
+ * prj: string
94
+ * };
95
+ * });
96
+ */
97
+ export function multiple(baseUrl: string, extensions: Object, options?: Object): Promise<any>[];
98
+ export function get(format?: string): (url: string, options?: Object) => Promise<THREE.Texture>;
99
+ }
100
+ export default _default;
101
+ declare function arrayBuffer(url: any, options?: {}): Promise<ArrayBuffer>;
@@ -0,0 +1,4 @@
1
+ declare namespace _default {
2
+ function executeCommand(command: any): any;
3
+ }
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ declare namespace _default {
2
+ function executeCommand(command: any): Promise<any[]>;
3
+ }
4
+ export default _default;
@@ -0,0 +1,28 @@
1
+ declare namespace _default {
2
+ export { subDomains };
3
+ export function xyz(coords: {
4
+ row: number;
5
+ col: number;
6
+ zoom: number;
7
+ }, source: {
8
+ url: string;
9
+ tileMatrixCallback: Function;
10
+ }): string;
11
+ export function bbox(bbox: {
12
+ west: number;
13
+ south: number;
14
+ east: number;
15
+ north: number;
16
+ }, source: {
17
+ crs: string;
18
+ bboxDigits: number;
19
+ url: string;
20
+ axisOrder: string;
21
+ }): string;
22
+ }
23
+ export default _default;
24
+ /**
25
+ * @param {string} url
26
+ * @returns {string}
27
+ */
28
+ declare function subDomains(url: string): string;
@@ -0,0 +1,95 @@
1
+ export namespace CAMERA_TYPE {
2
+ let PERSPECTIVE: number;
3
+ let ORTHOGRAPHIC: number;
4
+ }
5
+ export default Camera;
6
+ /**
7
+ * ~CAMERA_TYPE
8
+ * Stores the different types of camera usable in iTowns.
9
+ */
10
+ export type Camera = {
11
+ /**
12
+ * Perspective type of camera
13
+ */
14
+ PERSPECTIVE: number;
15
+ /**
16
+ * Orthographic type of camera
17
+ */
18
+ ORTHOGRAPHIC: number;
19
+ };
20
+ /**
21
+ * Wrapper around Three.js camera to expose some geographic helpers.
22
+ *
23
+ * @property {string} crs The camera's coordinate projection system.
24
+ * @property {THREE.Camera} camera3D The Three.js camera that is wrapped around.
25
+ * @property {number} width The width of the camera.
26
+ * @property {number} height The height of the camera.
27
+ * @property {number} _preSSE The precomputed constant part of the screen space error.
28
+ */
29
+ declare class Camera {
30
+ /**
31
+ * @param {string} crs The camera's coordinate projection system.
32
+ * @param {number} width The width (in pixels) of the view the
33
+ * camera is associated to.
34
+ * @param {number} height The height (in pixels) of the view the
35
+ * camera is associated to.
36
+ * @param {Object} [options] Options for the camera.
37
+ * @param {THREE.Camera} [options.cameraThree] A custom Three.js camera object to wrap
38
+ * around.
39
+ * @param {Camera~CAMERA_TYPE} [options.type=CAMERA_TYPE.PERSPECTIVE] The type of the camera. See {@link
40
+ * CAMERA_TYPE}.
41
+ * @constructor
42
+ */
43
+ constructor(crs: string, width: number, height: number, options?: {
44
+ cameraThree?: THREE.Camera | undefined;
45
+ });
46
+ crs: string;
47
+ camera3D: {
48
+ cameraThree?: THREE.Camera | undefined;
49
+ } | THREE.Camera;
50
+ width: number;
51
+ height: number;
52
+ _preSSE: number;
53
+ /**
54
+ * Resize the camera to a given width and height.
55
+ *
56
+ * @param {number} width The width to resize the camera to. Must be strictly positive, won't resize otherwise.
57
+ * @param {number} height The height to resize the camera to. Must be strictly positive, won't resize otherwise.
58
+ */
59
+ resize(width: number, height: number): void;
60
+ update(): void;
61
+ /**
62
+ * Return the position in the requested CRS, or in camera's CRS if undefined.
63
+ *
64
+ * @param {string} [crs] If defined (e.g 'EPSG:4326'), the camera position will be returned in this CRS.
65
+ *
66
+ * @return {Coordinates} Coordinates object holding camera's position.
67
+ */
68
+ position(crs?: string): Coordinates;
69
+ /**
70
+ * Set the position of the camera using a Coordinates object.
71
+ * If you want to modify the position directly using x,y,z values then use `camera.camera3D.position.set(x, y, z)`
72
+ *
73
+ * @param {Coordinates} position The new position of the camera.
74
+ */
75
+ setPosition(position: Coordinates): void;
76
+ isBox3Visible(box3: any, matrixWorld: any): boolean;
77
+ isSphereVisible(sphere: any, matrixWorld: any): boolean;
78
+ box3SizeOnScreen(box3: any, matrixWorld: any): THREE.Box3;
79
+ /**
80
+ * Test for collision between camera and a geometry layer (DTM/DSM) to adjust camera position.
81
+ * It could be modified later to handle an array of geometry layers.
82
+ * TODO Improve Coordinates class to handle altitude for any coordinate system (even projected one)
83
+ *
84
+ * @param {View} view The view where we test the collision between geometry layers
85
+ * and the camera
86
+ * @param {ElevationLayer} elevationLayer The elevation layer (DTM/DSM) used to test the collision
87
+ * with the camera. Could be another geometry layer.
88
+ * @param {number} minDistanceCollision The minimum distance allowed between the camera and the
89
+ * surface.
90
+ */
91
+ adjustAltitudeToAvoidCollisionWithLayer(view: View, elevationLayer: ElevationLayer, minDistanceCollision: number): void;
92
+ #private;
93
+ }
94
+ import * as THREE from 'three';
95
+ import { Coordinates } from '@itowns/geographic';
@@ -0,0 +1,3 @@
1
+ export function lab2rgb(lab: any): number[];
2
+ export function rgb2lab(rgb: any): number[];
3
+ export function deltaE(rgbA: any, rgbB: any): number;
@@ -0,0 +1,38 @@
1
+ export const COLOR_LAYERS_ORDER_CHANGED: "layers-order-changed";
2
+ declare namespace _default {
3
+ /**
4
+ * Moves up in the layer list. This function has no effect if the layer is
5
+ * moved to its current index.
6
+ *
7
+ * @param {View} view - The view in which the layer is moved up.
8
+ * @param {string} layerId - The ID of the layer to move.
9
+ *
10
+ * @example
11
+ * itowns.ColorLayersOrdering.moveLayerUp(viewer, 'idLayerToUp');
12
+ */
13
+ function moveLayerUp(view: View, layerId: string): void;
14
+ /**
15
+ * Moves down in the layer list. This function has no effect if the layer is
16
+ * moved to its current index.
17
+ *
18
+ * @param {View} view - The view in which the layer is moved down.
19
+ * @param {string} layerId - The ID of the layer to move.
20
+ *
21
+ * @example
22
+ * itowns.ColorLayersOrdering.moveLayerDown(viewer, 'idLayerToDown');
23
+ */
24
+ function moveLayerDown(view: View, layerId: string): void;
25
+ /**
26
+ * Moves a specific layer to a specific index in the layer list. This
27
+ * function has no effect if the layer is moved to its current index.
28
+ *
29
+ * @param {View} view - The view in which the layer is moved.
30
+ * @param {string} layerId - The ID of the layer to move.
31
+ * @param {number} index - The index to move the layer to.
32
+ *
33
+ * @example
34
+ * itowns.ColorLayersOrdering.moveLayerToIndex(viewer, 'idLayerToChangeIndex', 2);
35
+ */
36
+ function moveLayerToIndex(view: View, layerId: string, index: number): void;
37
+ }
38
+ export default _default;
@@ -2,8 +2,8 @@ import { ImageryLayers } from "../Layer/Layer.js";
2
2
  function updateLayersOrdering(geometryLayer, imageryLayers) {
3
3
  const sequence = ImageryLayers.getColorLayersIdOrderedBySequence(imageryLayers);
4
4
  const cO = function (object) {
5
- if (object.material?.setSequence) {
6
- object.material.setSequence(sequence);
5
+ if (object.material?.setColorTileIds) {
6
+ object.material.setColorTileIds(sequence);
7
7
  }
8
8
  };
9
9
  for (const node of geometryLayer.level0Nodes) {
@@ -0,0 +1,6 @@
1
+ declare namespace _default {
2
+ function setDefineMapping(object: any, PROPERTY: any, mapping: any): void;
3
+ function setDefineProperty(object: any, property: any, PROPERTY: any, initValue: any): void;
4
+ function setUniformProperty(object: any, property: any, initValue: any): void;
5
+ }
6
+ export default _default;
@@ -0,0 +1,31 @@
1
+ export class ScreenGrid {
2
+ constructor(x: number | undefined, y: number | undefined, width: any, height: any);
3
+ x: number;
4
+ y: number;
5
+ grid: any[];
6
+ visible: any[];
7
+ width: any;
8
+ height: any;
9
+ reset(): void;
10
+ resize(): void;
11
+ insert(obj: any): boolean;
12
+ }
13
+ export default Label2DRenderer;
14
+ /**
15
+ * This renderer is inspired by the
16
+ * [`THREE.CSS2DRenderer`](https://threejs.org/docs/#examples/en/renderers/CSS2DRenderer).
17
+ * It is instanciated in `c3DEngine`, as another renderer to handles Labels.
18
+ */
19
+ declare class Label2DRenderer {
20
+ domElement: HTMLDivElement;
21
+ garbage: HTMLDivElement;
22
+ halfWidth: number;
23
+ halfHeight: number;
24
+ grid: ScreenGrid;
25
+ infoTileLayer: any;
26
+ setSize(width: any, height: any): void;
27
+ registerLayer(layer: any): void;
28
+ render(scene: any, camera: any): void;
29
+ culling(label: any, camera: any): void;
30
+ removeLabelDOM(label: any): void;
31
+ }
@@ -0,0 +1,121 @@
1
+ import * as THREE from 'three';
2
+ import RenderMode from '../Renderer/RenderMode';
3
+ import { RasterTile, RasterElevationTile, RasterColorTile } from './RasterTile';
4
+ export declare function unpack1K(color: THREE.Vector4Like, factor: number): number;
5
+ export declare function getMaxColorSamplerUnitsCount(): number;
6
+ export declare const colorLayerEffects: {
7
+ readonly noEffect: 0;
8
+ readonly removeLightColor: 1;
9
+ readonly removeWhiteColor: 2;
10
+ readonly customEffect: 3;
11
+ };
12
+ /** GPU struct for color layers */
13
+ interface StructColorLayer {
14
+ textureOffset: number;
15
+ crs: number;
16
+ opacity: number;
17
+ effect_parameter: number;
18
+ effect_type: number;
19
+ transparent: boolean;
20
+ }
21
+ /** GPU struct for elevation layers */
22
+ interface StructElevationLayer {
23
+ scale: number;
24
+ bias: number;
25
+ mode: number;
26
+ zmin: number;
27
+ zmax: number;
28
+ }
29
+ export declare const ELEVATION_MODES: {
30
+ readonly RGBA: 0;
31
+ readonly COLOR: 1;
32
+ readonly DATA: 2;
33
+ };
34
+ /**
35
+ * Convenience type that wraps all of the generic type's fields in
36
+ * [THREE.IUniform]s.
37
+ */
38
+ type MappedUniforms<Uniforms> = {
39
+ [name in keyof Uniforms]: THREE.IUniform<Uniforms[name]>;
40
+ };
41
+ /** List of the uniform types required for a LayeredMaterial. */
42
+ interface LayeredMaterialRawUniforms {
43
+ diffuse: THREE.Color;
44
+ opacity: number;
45
+ lightingEnabled: boolean;
46
+ lightPosition: THREE.Vector3;
47
+ fogDistance: number;
48
+ fogColor: THREE.Color;
49
+ overlayAlpha: number;
50
+ overlayColor: THREE.Color;
51
+ objectId: number;
52
+ geoidHeight: number;
53
+ minBorderDistance: number;
54
+ showOutline: boolean;
55
+ outlineWidth: number;
56
+ outlineColors: THREE.Color[];
57
+ elevationLayers: Array<StructElevationLayer>;
58
+ elevationTextures: Array<THREE.Texture>;
59
+ elevationOffsetScales: Array<THREE.Vector4>;
60
+ elevationTextureCount: number;
61
+ colorLayers: Array<StructColorLayer>;
62
+ colorTextures: Array<THREE.Texture>;
63
+ colorOffsetScales: Array<THREE.Vector4>;
64
+ colorTextureCount: number;
65
+ }
66
+ /** Replacing the default uniforms dynamic type with our own static map. */
67
+ export interface LayeredMaterialParameters extends THREE.ShaderMaterialParameters {
68
+ uniforms?: MappedUniforms<LayeredMaterialRawUniforms>;
69
+ }
70
+ type DefineMapping<Prefix extends string, Mapping extends Record<string, unknown>> = {
71
+ [Name in Extract<keyof Mapping, string> as `${Prefix}_${Name}`]: Mapping[Name];
72
+ };
73
+ type ElevationModeDefines = DefineMapping<'ELEVATION', typeof ELEVATION_MODES>;
74
+ type RenderModeDefines = DefineMapping<'MODE', typeof RenderMode.MODES>;
75
+ type LayeredMaterialDefines = {
76
+ NUM_VS_TEXTURES: number;
77
+ NUM_FS_TEXTURES: number;
78
+ USE_FOG: number;
79
+ NUM_CRS: number;
80
+ DEBUG: number;
81
+ MODE: number;
82
+ } & ElevationModeDefines & RenderModeDefines;
83
+ /** Material that handles the overlap of multiple raster tiles. */
84
+ export declare class LayeredMaterial extends THREE.ShaderMaterial {
85
+ private _visible;
86
+ colorTiles: RasterColorTile[];
87
+ elevationTile: RasterElevationTile | undefined;
88
+ colorTileIds: string[];
89
+ elevationTileId: string | undefined;
90
+ layersNeedUpdate: boolean;
91
+ defines: LayeredMaterialDefines;
92
+ constructor(options: LayeredMaterialParameters | undefined, crsCount: number);
93
+ get mode(): number;
94
+ set mode(mode: number);
95
+ getUniform<Name extends keyof LayeredMaterialRawUniforms>(name: Name): LayeredMaterialRawUniforms[Name] | undefined;
96
+ setUniform<Name extends keyof LayeredMaterialRawUniforms, Value extends LayeredMaterialRawUniforms[Name]>(name: Name, value: Value): void;
97
+ initUniforms(uniforms: {
98
+ [Name in keyof LayeredMaterialRawUniforms]?: LayeredMaterialRawUniforms[Name];
99
+ }): void;
100
+ setUniforms(uniforms: {
101
+ [Name in keyof LayeredMaterialRawUniforms]?: LayeredMaterialRawUniforms[Name];
102
+ }): void;
103
+ getLayerUniforms<Type extends 'color' | 'elevation'>(type: Type): MappedUniforms<{
104
+ layers: Array<Type extends 'color' ? StructColorLayer : StructElevationLayer>;
105
+ textures: Array<THREE.Texture>;
106
+ offsetScales: Array<THREE.Vector4>;
107
+ textureCount: number;
108
+ }>;
109
+ updateLayersUniforms(): void;
110
+ dispose(): void;
111
+ setColorTileIds(ids: string[]): void;
112
+ setElevationTileId(id: string): void;
113
+ removeTile(tileId: string): void;
114
+ addColorTile(rasterTile: RasterColorTile): void;
115
+ setElevationTile(rasterTile: RasterElevationTile): void;
116
+ getColorTile(id: string): RasterColorTile | undefined;
117
+ getElevationTile(): RasterElevationTile | undefined;
118
+ getTile(id: string): RasterTile | undefined;
119
+ getTiles(ids: string[]): RasterTile[];
120
+ }
121
+ export {};