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,65 @@
1
+ export namespace GLOBE_VIEW_EVENTS {
2
+ let GLOBE_INITIALIZED: string;
3
+ let LAYER_ADDED: string;
4
+ let LAYER_REMOVED: string;
5
+ let COLOR_LAYERS_ORDER_CHANGED: string;
6
+ }
7
+ export default GlobeView;
8
+ declare class GlobeView extends View {
9
+ /**
10
+ * Creates a view of a globe.
11
+ *
12
+ * @extends View
13
+ *
14
+ * @example <caption><b>Instance GlobeView.</b></caption>
15
+ * var viewerDiv = document.getElementById('viewerDiv');
16
+ * const placement = {
17
+ * coord: new itowns.Coordinates('EPSG:4326', 2.351323, 48.856712),
18
+ * range: 25000000,
19
+ * }
20
+ * var view = new itowns.GlobeView(viewerDiv, placement);
21
+ *
22
+ * @param {HTMLDivElement} viewerDiv - Where to attach the view and display it
23
+ * in the DOM.
24
+ * @param {CameraTransformOptions|Extent} placement - An object to place view
25
+ * @param {object} [options] - See options of {@link View}.
26
+ * @param {Object} [options.controls] - See options of {@link GlobeControls}
27
+ * @param {Object} [options.webXR] - WebXR configuration - its presence alone
28
+ * enable WebXR to switch on VR visualization. (optional).
29
+ * @param {function} [options.webXR.callback] - WebXR rendering callback (optional).
30
+ * @param {boolean} [options.webXR.controllers] - Enable the webXR controllers handling (optional).
31
+ */
32
+ constructor(viewerDiv: HTMLDivElement, placement?: CameraTransformOptions | Extent, options?: {
33
+ controls?: Object | undefined;
34
+ webXR?: {
35
+ callback?: Function | undefined;
36
+ controllers?: boolean | undefined;
37
+ } | undefined;
38
+ });
39
+ isGlobeView: boolean;
40
+ tileLayer: GlobeLayer;
41
+ controls: GlobeControls | undefined;
42
+ webXR: WebXR | undefined;
43
+ /**
44
+ * Add layer in viewer.
45
+ * The layer id must be unique.
46
+ *
47
+ * The `layer.whenReady` is a promise that resolves when
48
+ * the layer is done. This promise is also returned by
49
+ * `addLayer` allowing to chain call.
50
+ *
51
+ * The layer added is attached, by default to `GlobeLayer` (`GlobeView.tileLayer`).
52
+ * If you want add a unattached layer use `View#addLayer` parent method.
53
+ *
54
+ * @param {LayerOptions|Layer|GeometryLayer} layer The layer to add in view.
55
+ * @return {Promise} a promise resolved with the new layer object when it is fully initialized or rejected if any error occurred.
56
+ */
57
+ addLayer(layer: LayerOptions | Layer | GeometryLayer): Promise<any>;
58
+ getPixelsToDegrees(pixels: number | undefined, screenCoord: any): number;
59
+ getPixelsToDegreesFromDistance(pixels?: number, distance?: number): number;
60
+ getMetersToDegrees(meters?: number): number;
61
+ }
62
+ import View from '../../Core/View';
63
+ import GlobeLayer from '../../Core/Prefab/Globe/GlobeLayer';
64
+ import GlobeControls from '../../Controls/GlobeControls';
65
+ import WebXR from '../../Renderer/WebXR';
@@ -5,6 +5,7 @@ import { Coordinates, ellipsoidSizes } from '@itowns/geographic';
5
5
  import GlobeLayer from "./Globe/GlobeLayer.js";
6
6
  import Atmosphere from "./Globe/Atmosphere.js";
7
7
  import CameraUtils from "../../Utils/CameraUtils.js";
8
+ import WebXR from "../../Renderer/WebXR.js";
8
9
 
9
10
  /**
10
11
  * Fires when the view is completely loaded. Controls and view's functions can be called then.
@@ -76,6 +77,10 @@ class GlobeView extends View {
76
77
  * @param {CameraTransformOptions|Extent} placement - An object to place view
77
78
  * @param {object} [options] - See options of {@link View}.
78
79
  * @param {Object} [options.controls] - See options of {@link GlobeControls}
80
+ * @param {Object} [options.webXR] - WebXR configuration - its presence alone
81
+ * enable WebXR to switch on VR visualization. (optional).
82
+ * @param {function} [options.webXR.callback] - WebXR rendering callback (optional).
83
+ * @param {boolean} [options.webXR.controllers] - Enable the webXR controllers handling (optional).
79
84
  */
80
85
  constructor(viewerDiv) {
81
86
  let placement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -106,6 +111,10 @@ class GlobeView extends View {
106
111
 
107
112
  // GlobeView needs this.camera.resize to set perpsective matrix camera
108
113
  this.camera.resize(viewerDiv.clientWidth, viewerDiv.clientHeight);
114
+ if (options.webXR) {
115
+ this.webXR = new WebXR(this, typeof options.webXR === 'boolean' ? {} : options.webXR);
116
+ this.webXR.initializeWebXR();
117
+ }
109
118
  }
110
119
 
111
120
  /**
@@ -0,0 +1,38 @@
1
+ export default PlanarLayer;
2
+ /**
3
+ * @property {boolean} isPlanarLayer - Used to checkout whether this layer is a
4
+ * PlanarLayer. Default is true. You should not change this, as it is used
5
+ * internally for optimisation.
6
+ * @extends TiledGeometryLayer
7
+ */
8
+ declare class PlanarLayer extends TiledGeometryLayer {
9
+ /**
10
+ * A {@link TiledGeometryLayer} to use with a {@link PlanarView}. It has
11
+ * specific method for updating and subdivising its grid.
12
+ *
13
+ * @param {string} id - The id of the layer, that should be unique. It is
14
+ * not mandatory, but an error will be emitted if this layer is added a
15
+ * {@link View} that already has a layer going by that id.
16
+ * @param {Extent} extent - The extent to define the layer within.
17
+ * @param {THREE.Object3d} [object3d=THREE.Group] - The object3d used to
18
+ * contain the geometry of the TiledGeometryLayer. It is usually a
19
+ * `THREE.Group`, but it can be anything inheriting from a `THREE.Object3d`.
20
+ * @param {Object} [config] - Optional configuration, all elements in it
21
+ * will be merged as is in the layer. For example, if the configuration
22
+ * contains three elements `name, protocol, extent`, these elements will be
23
+ * available using `layer.name` or something else depending on the property
24
+ * name.
25
+ * @param {number} [config.maxSubdivisionLevel=5] - Maximum subdivision
26
+ * level for this tiled layer.
27
+ *
28
+ * @throws {Error} `object3d` must be a valid `THREE.Object3d`.
29
+ */
30
+ constructor(id: string, extent: Extent, object3d?: THREE.Object3d, config?: {
31
+ maxSubdivisionLevel?: number | undefined;
32
+ });
33
+ isPlanarLayer: boolean;
34
+ extent: Extent;
35
+ minSubdivisionLevel: any;
36
+ }
37
+ import TiledGeometryLayer from '../../../Layer/TiledGeometryLayer';
38
+ import * as THREE from 'three';
@@ -0,0 +1,32 @@
1
+ import * as THREE from 'three';
2
+ import { Coordinates, Extent } from '@itowns/geographic';
3
+ import { ShareableExtent, TileBuilder, TileBuilderParams } from '../TileBuilder';
4
+ /** Specialized parameters for the [PlanarTileBuilder]. */
5
+ export interface PlanarTileBuilderParams extends TileBuilderParams {
6
+ crs: string;
7
+ uvCount?: number;
8
+ nbRow: number;
9
+ }
10
+ /**
11
+ * TileBuilder implementation for the purpose of generating planar
12
+ * tile arrangements.
13
+ */
14
+ export declare class PlanarTileBuilder implements TileBuilder<PlanarTileBuilderParams> {
15
+ private _uvCount;
16
+ private _transform;
17
+ private _crs;
18
+ constructor(options: {
19
+ projection?: string;
20
+ crs: string;
21
+ uvCount?: number;
22
+ });
23
+ get uvCount(): number;
24
+ get crs(): string;
25
+ prepare(params: TileBuilderParams): PlanarTileBuilderParams;
26
+ center(extent: Extent): THREE.Vector3;
27
+ vertexPosition(coordinates: Coordinates): THREE.Vector3;
28
+ vertexNormal(): THREE.Vector3;
29
+ uProject(u: number, extent: Extent): number;
30
+ vProject(v: number, extent: Extent): number;
31
+ computeShareableExtent(extent: Extent): ShareableExtent;
32
+ }
@@ -0,0 +1,33 @@
1
+ export default PlanarView;
2
+ declare class PlanarView extends View {
3
+ /**
4
+ * @extends View
5
+ *
6
+ * @example <caption><b>Instance with placement on the ground.</b></caption>
7
+ * var viewerDiv = document.getElementById('viewerDiv');
8
+ * const extent = new Extent('EPSG:3946', 1837816.94334, 1847692.32501, 5170036.4587, 5178412.82698);
9
+ * var view = new itowns.PlanarView(viewerDiv, extent, { placement: { heading: -49.6, range: 6200, tilt: 17 } });
10
+ *
11
+ * @param {HTMLDivElement} viewerDiv - Where to attach the view and display it
12
+ * in the DOM.
13
+ * @param {Extent} extent - The ground extent.
14
+ * @param {Object} [options] - See options of {@link View}.
15
+ * @param {boolean} [options.noControls=false] - If true, no controls are associated to the view.
16
+ * @param {Object} [options.controls] - options for the {@link PlanarControls} associated to the view, if
17
+ * `options.noControls` is false.
18
+ * @param {CameraUtils~CameraTransformOptions|Extent} [options.placement] - The
19
+ * {@link CameraUtils~CameraTransformOptions} to apply to view's camera or the extent it must display at
20
+ * initialization. By default, camera will display the view's extent (given in `extent` parameter).
21
+ */
22
+ constructor(viewerDiv: HTMLDivElement, extent: Extent, options?: {
23
+ noControls?: boolean | undefined;
24
+ controls?: Object | undefined;
25
+ });
26
+ isPlanarView: boolean;
27
+ controls: PlanarControls | undefined;
28
+ tileLayer: PlanarLayer;
29
+ addLayer(layer: any): Promise<any>;
30
+ }
31
+ import View from '../../Core/View';
32
+ import PlanarControls from '../../Controls/PlanarControls';
33
+ import PlanarLayer from './Planar/PlanarLayer';
@@ -0,0 +1,63 @@
1
+ import * as THREE from 'three';
2
+ import { TileGeometry } from '../../Core/TileGeometry';
3
+ import type { Extent } from '@itowns/geographic';
4
+ import { Coordinates } from '@itowns/geographic';
5
+ export type GpuBufferAttributes = {
6
+ index: THREE.BufferAttribute | null;
7
+ position: THREE.BufferAttribute;
8
+ normal: THREE.BufferAttribute;
9
+ uvs: THREE.BufferAttribute[];
10
+ };
11
+ /**
12
+ * Reference to a tile's extent with rigid transformations.
13
+ * Enables reuse of geometry, saving a bit of memory.
14
+ */
15
+ export type ShareableExtent = {
16
+ shareableExtent: Extent;
17
+ quaternion: THREE.Quaternion;
18
+ position: THREE.Vector3;
19
+ };
20
+ export interface TileBuilderParams {
21
+ /** Whether to build the skirt. */
22
+ disableSkirt: boolean;
23
+ /** Whether to render the skirt. */
24
+ hideSkirt: boolean;
25
+ /** Number of segments (edge loops) inside tiles. */
26
+ segments: number;
27
+ /** Buffer for projected points. */
28
+ coordinates: Coordinates;
29
+ extent: Extent;
30
+ level: number;
31
+ center: THREE.Vector3;
32
+ }
33
+ export interface TileBuilder<SpecializedParams extends TileBuilderParams> {
34
+ crs: string;
35
+ /** Convert builder-agnostic params to specialized ones. */
36
+ prepare(params: TileBuilderParams): SpecializedParams;
37
+ /**
38
+ * Computes final offset of the second texture set.
39
+ * Only relevant in the case of more than one texture sets.
40
+ */
41
+ computeExtraOffset?: (params: SpecializedParams) => number;
42
+ /** Get the center of the current tile as a 3D vector. */
43
+ center(extent: Extent): THREE.Vector3;
44
+ /** Converts an x/y tile-space position to its equivalent in 3D space. */
45
+ vertexPosition(coordinates: Coordinates): THREE.Vector3;
46
+ /** Gets the geodesic normal of the last processed vertex. */
47
+ vertexNormal(): THREE.Vector3;
48
+ /** Project horizontal texture coordinate to world space. */
49
+ uProject(u: number, extent: Extent): number;
50
+ /** Project vertical texture coordinate to world space. */
51
+ vProject(v: number, extent: Extent): number;
52
+ /**
53
+ * Compute shareable extent to pool geometries together.
54
+ * The geometry of tiles on the same latitude is the same with an added
55
+ * rigid transform.
56
+ */
57
+ computeShareableExtent(extent: Extent): ShareableExtent;
58
+ }
59
+ export declare function newTileGeometry(builder: TileBuilder<TileBuilderParams>, params: TileBuilderParams): Promise<{
60
+ geometry: TileGeometry;
61
+ quaternion: THREE.Quaternion;
62
+ position: THREE.Vector3;
63
+ }>;
@@ -0,0 +1,17 @@
1
+ import type { TileBuilder, TileBuilderParams } from '../../Core/Prefab/TileBuilder';
2
+ export declare function getBufferIndexSize(segments: number, noSkirt: boolean): number;
3
+ type Option<T> = T | undefined;
4
+ type IndexArray = Option<Uint8Array | Uint16Array | Uint32Array>;
5
+ export type Buffers = {
6
+ index: IndexArray;
7
+ position: Float32Array;
8
+ normal: Float32Array;
9
+ uvs: [Option<Float32Array>, Option<Float32Array>];
10
+ };
11
+ type BufferCache = {
12
+ index: Exclude<IndexArray, undefined>;
13
+ uv: Float32Array;
14
+ };
15
+ /** Compute buffers describing a tile according to a builder and its params. */
16
+ export declare function computeBuffers(builder: TileBuilder<TileBuilderParams>, params: TileBuilderParams, cache?: BufferCache): Buffers;
17
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Cache policies for flushing. Those policies can be used when something is
3
+ * [set]{@link Cache.set} into the Cache, as the lifetime property.
4
+ */
5
+ export type CACHE_POLICIES = {
6
+ /**
7
+ * - The entry is never flushed, except when the
8
+ * `all` flag is set to `true` when calling {@link Cache.flush}.
9
+ */
10
+ INFINITE: number;
11
+ /**
12
+ * - Shortcut for texture resources. Time is 15 minutes.
13
+ */
14
+ TEXTURE: number;
15
+ /**
16
+ * - Shortcut for geometry resources. Time is 15 minutes.
17
+ * minutes.
18
+ */
19
+ GEOMETRY: number;
20
+ };
21
+ export namespace CACHE_POLICIES {
22
+ let INFINITE: number;
23
+ let TEXTURE: number;
24
+ let GEOMETRY: number;
25
+ }
@@ -0,0 +1,12 @@
1
+ export default CancelledCommandException;
2
+ /**
3
+ * Custom error thrown when cancelling commands. Allows the caller to act differently if needed.
4
+ * @class
5
+ * @param {Command} command
6
+ */
7
+ declare class CancelledCommandException {
8
+ constructor(command: any);
9
+ command: any;
10
+ isCancelledCommandException: boolean;
11
+ toString(): string;
12
+ }
@@ -0,0 +1,106 @@
1
+ export default Scheduler;
2
+ /**
3
+ * The Scheduler is in charge of managing the [Providers]{@link Provider} that
4
+ * are used to gather resources needed to display the layers on a {@link View}.
5
+ * There is only one instance of a Scheduler per webview, and it is instanciated
6
+ * with the creation of the first view.
7
+ *
8
+ * @constructor
9
+ */
10
+ declare function Scheduler(): void;
11
+ declare class Scheduler {
12
+ defaultQueue: {
13
+ queue(command: any): void;
14
+ storages: Map<any, any>;
15
+ counters: {
16
+ executing: number;
17
+ executed: number;
18
+ failed: number;
19
+ cancelled: number;
20
+ pending: number;
21
+ };
22
+ execute(cmd: any, provider: any): any;
23
+ };
24
+ hostQueues: Map<any, any>;
25
+ providers: {};
26
+ maxCommandsPerHost: number;
27
+ initDefaultProviders(): void;
28
+ runCommand(command: any, queue: any, executingCounterUpToDate: any): void;
29
+ execute(command: any): any;
30
+ /**
31
+ * A Provider has the responsability to handle protocols and datablobs. Given a
32
+ * data request (see {@link Provider#executeCommand} for details about this
33
+ * request), it fetches serialized datasets, file content or even file chunks.
34
+ *
35
+ * @interface Provider
36
+ */
37
+ /**
38
+ * When adding a layer to a view, some preprocessing can be done on it, before
39
+ * fetching or creating resources attached to it. For example, in the WMTS and
40
+ * WFS providers (included in iTowns), default options to the layer are added if
41
+ * some are missing.
42
+ *
43
+ * @param {Layer} layer
44
+ * @param {View} [view]
45
+ * @param {Scheduler} [scheduler]
46
+ * @param {Layer} [parentLayer]
47
+ */
48
+ /**
49
+ * In the {@link Scheduler} loop, this function is called every time the layer
50
+ * needs new information about itself. For tiled layers, it gets the necessary
51
+ * tiles, given the current position of the camera on the map. For simple layers
52
+ * like a GPX trace, it gets the data once.
53
+ * <br><br>
54
+ * It passes a `command` object as a parameter, with the `view` and the `layer`
55
+ * always present. The other parameters are optional.
56
+ *
57
+ * @function
58
+ * @name Provider#executeCommand
59
+ *
60
+ * @param {Object} command
61
+ * @param {View} command.view
62
+ * @param {Layer} command.layer
63
+ * @param {TileMesh} [command.requester] - Every layer is attached to a tile.
64
+ * @param {number} [command.targetLevel] - The target level is used when there
65
+ * is a tiled layer, such as WMTS or TMS, but not in case like a GPX layer.
66
+ *
67
+ * @return {Promise} The {@link Scheduler} always expect a Promise as a result,
68
+ * resolving to an object containing sufficient information for the associated
69
+ * processing to the current layer. For example, see the
70
+ * [LayeredMaterialNodeProcessing#updateLayeredMaterialNodeElevation]{@link
71
+ * https://github.com/iTowns/itowns/blob/master/src/Process/LayeredMaterialNodeProcessing.js}
72
+ * class or other processing class.
73
+ */
74
+ /**
75
+ * Adds a provider for a specified protocol. The provider will be used when
76
+ * executing the queue to provide resources. See {@link Provider} for more
77
+ * informations.
78
+ * By default, some protocols are already set in iTowns: WMTS, WMS, WFS, TMS,
79
+ * XYZ, PotreeConverter, Rasterizer, 3D-Tiles and Static.
80
+ * <br><br>
81
+ * Warning: if the specified protocol has already a provider attached to it, the
82
+ * current provider will be overwritten by the given provider.
83
+ *
84
+ * @param {string} protocol - The name of the protocol to add. This is the
85
+ * `protocol` parameter put inside the configuration when adding a layer. The
86
+ * capitalization of the name is not taken into account here.
87
+ * @param {Provider} provider - The provider to link to the protocol, that must
88
+ * respect the {@link Provider} interface description.
89
+ *
90
+ * @throws {Error} an error if any method of the {@link Provider} is not present
91
+ * in the provider.
92
+ */
93
+ addProtocolProvider(protocol: string, provider: Provider): void;
94
+ /**
95
+ * Get a specific {@link Provider} given a particular protocol.
96
+ *
97
+ * @param {string} protocol
98
+ *
99
+ * @return {Provider}
100
+ */
101
+ getProtocolProvider(protocol: string): Provider;
102
+ commandsWaitingExecutionCount(): number;
103
+ commandsRunningCount(): number;
104
+ resetCommandsCount(type: any): any;
105
+ deQueue(queue: any): any;
106
+ }