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.
- package/dist/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +8 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_lasparser.js +1 -1
- package/dist/itowns_lasparser.js.map +1 -1
- package/dist/itowns_lasworker.js +1 -1
- package/dist/itowns_lasworker.js.map +1 -1
- package/dist/itowns_potree2worker.js +1 -1
- package/dist/itowns_potree2worker.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/copc_simple_loader.html +3 -3
- package/examples/entwine_3d_loader.html +2 -2
- package/examples/entwine_simple_loader.html +10 -6
- package/examples/potree2_25d_map.html +2 -2
- package/examples/potree_25d_map.html +2 -2
- package/examples/potree_3d_map.html +2 -2
- package/examples/view_3d_map_webxr.html +2 -5
- package/lib/Controls/FirstPersonControls.d.ts +90 -0
- package/lib/Controls/FlyControls.d.ts +36 -0
- package/lib/Controls/GlobeControls.d.ts +274 -0
- package/lib/Controls/PlanarControls.d.ts +339 -0
- package/lib/Controls/StateControl.d.ts +140 -0
- package/lib/Controls/StreetControls.d.ts +134 -0
- package/lib/Controls/VRControls.d.ts +56 -0
- package/lib/Controls/VRControls.js +409 -0
- package/lib/Converter/Feature2Mesh.d.ts +42 -0
- package/lib/Converter/Feature2Texture.d.ts +5 -0
- package/lib/Converter/convertToTile.d.ts +5 -0
- package/lib/Converter/convertToTile.js +2 -2
- package/lib/Converter/textureConverter.d.ts +4 -0
- package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
- package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
- package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
- package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
- package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
- package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
- package/lib/Core/AnimationPlayer.d.ts +53 -0
- package/lib/Core/CopcNode.d.ts +68 -0
- package/lib/Core/CopcNode.js +57 -74
- package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
- package/lib/Core/EntwinePointTileNode.d.ts +59 -0
- package/lib/Core/EntwinePointTileNode.js +16 -41
- package/lib/Core/Feature.d.ts +323 -0
- package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
- package/lib/Core/Label.d.ts +86 -0
- package/lib/Core/MainLoop.d.ts +23 -0
- package/lib/Core/Picking.d.ts +6 -0
- package/lib/Core/Picking.js +4 -0
- package/lib/Core/PointCloudNode.d.ts +16 -0
- package/lib/Core/PointCloudNode.js +34 -4
- package/lib/Core/Potree2Node.d.ts +11 -0
- package/lib/Core/Potree2Node.js +5 -60
- package/lib/Core/Potree2PointAttributes.d.ts +97 -0
- package/lib/Core/PotreeNode.d.ts +14 -0
- package/lib/Core/PotreeNode.js +28 -18
- package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
- package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
- package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
- package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
- package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
- package/lib/Core/Prefab/GlobeView.d.ts +65 -0
- package/lib/Core/Prefab/GlobeView.js +9 -0
- package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
- package/lib/Core/Prefab/PlanarView.d.ts +33 -0
- package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
- package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
- package/lib/Core/Scheduler/Cache.d.ts +25 -0
- package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
- package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
- package/lib/Core/Style.d.ts +248 -0
- package/lib/Core/StyleOptions.d.ts +455 -0
- package/lib/Core/System/Capabilities.d.ts +9 -0
- package/lib/Core/Tile/Tile.d.ts +70 -0
- package/lib/Core/Tile/TileGrid.d.ts +12 -0
- package/lib/Core/TileGeometry.d.ts +46 -0
- package/lib/Core/TileMesh.d.ts +50 -0
- package/lib/Core/TileMesh.js +2 -4
- package/lib/Core/View.d.ts +403 -0
- package/lib/Core/View.js +1 -7
- package/lib/Layer/C3DTilesLayer.d.ts +140 -0
- package/lib/Layer/ColorLayer.d.ts +128 -0
- package/lib/Layer/ColorLayer.js +4 -4
- package/lib/Layer/CopcLayer.d.ts +42 -0
- package/lib/Layer/CopcLayer.js +3 -6
- package/lib/Layer/ElevationLayer.d.ts +96 -0
- package/lib/Layer/ElevationLayer.js +3 -3
- package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
- package/lib/Layer/EntwinePointTileLayer.js +4 -3
- package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
- package/lib/Layer/GeoidLayer.d.ts +41 -0
- package/lib/Layer/GeometryLayer.d.ts +120 -0
- package/lib/Layer/InfoLayer.d.ts +24 -0
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/LabelLayer.d.ts +93 -0
- package/lib/Layer/LabelLayer.js +2 -2
- package/lib/Layer/Layer.d.ts +185 -0
- package/lib/Layer/LayerUpdateState.d.ts +24 -0
- package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
- package/lib/Layer/LayerUpdateStrategy.js +2 -7
- package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
- package/lib/Layer/OGC3DTilesLayer.js +21 -0
- package/lib/Layer/OrientedImageLayer.d.ts +53 -0
- package/lib/Layer/PointCloudLayer.d.ts +103 -0
- package/lib/Layer/PointCloudLayer.js +8 -11
- package/lib/Layer/Potree2Layer.d.ts +56 -0
- package/lib/Layer/Potree2Layer.js +0 -2
- package/lib/Layer/PotreeLayer.d.ts +55 -0
- package/lib/Layer/RasterLayer.d.ts +8 -0
- package/lib/Layer/RasterLayer.js +2 -2
- package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
- package/lib/Layer/ReferencingLayerProperties.js +0 -12
- package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
- package/lib/Layer/TiledGeometryLayer.js +4 -3
- package/lib/Main.d.ts +89 -0
- package/lib/Main.js +3 -1
- package/lib/Parser/B3dmParser.d.ts +26 -0
- package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
- package/lib/Parser/GDFParser.d.ts +24 -0
- package/lib/Parser/GTXParser.d.ts +28 -0
- package/lib/Parser/GeoJsonParser.d.ts +12 -0
- package/lib/Parser/GpxParser.d.ts +12 -0
- package/lib/Parser/ISGParser.d.ts +23 -0
- package/lib/Parser/KMLParser.d.ts +12 -0
- package/lib/Parser/LASParser.d.ts +61 -0
- package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
- package/lib/Parser/PntsParser.d.ts +4 -0
- package/lib/Parser/Potree2BinParser.d.ts +8 -0
- package/lib/Parser/PotreeBinParser.d.ts +4 -0
- package/lib/Parser/PotreeCinParser.d.ts +4 -0
- package/lib/Parser/ShapefileParser.d.ts +25 -0
- package/lib/Parser/VectorTileParser.d.ts +34 -0
- package/lib/Parser/XbilParser.d.ts +18 -0
- package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
- package/lib/Parser/iGLTFLoader.d.ts +104 -0
- package/lib/Process/3dTilesProcessing.d.ts +43 -0
- package/lib/Process/FeatureProcessing.d.ts +4 -0
- package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
- package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
- package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
- package/lib/Process/handlerNodeError.d.ts +1 -0
- package/lib/Provider/3dTilesProvider.d.ts +7 -0
- package/lib/Provider/DataSourceProvider.d.ts +4 -0
- package/lib/Provider/Fetcher.d.ts +101 -0
- package/lib/Provider/PointCloudProvider.d.ts +4 -0
- package/lib/Provider/TileProvider.d.ts +4 -0
- package/lib/Provider/URLBuilder.d.ts +28 -0
- package/lib/Renderer/Camera.d.ts +95 -0
- package/lib/Renderer/Color.d.ts +3 -0
- package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
- package/lib/Renderer/ColorLayersOrdering.js +2 -2
- package/lib/Renderer/CommonMaterial.d.ts +6 -0
- package/lib/Renderer/Label2DRenderer.d.ts +31 -0
- package/lib/Renderer/LayeredMaterial.d.ts +121 -0
- package/lib/Renderer/LayeredMaterial.js +221 -141
- package/lib/Renderer/OBB.d.ts +65 -0
- package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
- package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
- package/lib/Renderer/PointsMaterial.d.ts +226 -0
- package/lib/Renderer/PointsMaterial.js +60 -22
- package/lib/Renderer/RasterTile.d.ts +53 -0
- package/lib/Renderer/RasterTile.js +8 -9
- package/lib/Renderer/RenderMode.d.ts +11 -0
- package/lib/Renderer/RenderMode.js +1 -0
- package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
- package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
- package/lib/Renderer/WebXR.d.ts +33 -0
- package/lib/Renderer/WebXR.js +128 -47
- package/lib/Renderer/c3DEngine.d.ts +55 -0
- package/lib/Renderer/c3DEngine.js +5 -1
- package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
- package/lib/Source/C3DTilesIonSource.d.ts +31 -0
- package/lib/Source/C3DTilesSource.d.ts +17 -0
- package/lib/Source/CopcSource.d.ts +79 -0
- package/lib/Source/EntwinePointTileSource.d.ts +40 -0
- package/lib/Source/EntwinePointTileSource.js +0 -5
- package/lib/Source/FileSource.d.ts +118 -0
- package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
- package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
- package/lib/Source/OGC3DTilesSource.d.ts +21 -0
- package/lib/Source/OrientedImageSource.d.ts +48 -0
- package/lib/Source/Potree2Source.d.ts +157 -0
- package/lib/Source/PotreeSource.d.ts +69 -0
- package/lib/Source/Source.d.ts +122 -0
- package/lib/Source/TMSSource.d.ts +77 -0
- package/lib/Source/VectorTilesSource.d.ts +56 -0
- package/lib/Source/WFSSource.d.ts +110 -0
- package/lib/Source/WMSSource.d.ts +85 -0
- package/lib/Source/WMTSSource.d.ts +65 -0
- package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
- package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
- package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
- package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
- package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
- package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
- package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
- package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
- package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
- package/lib/Utils/CameraUtils.d.ts +132 -0
- package/lib/Utils/DEMUtils.d.ts +84 -0
- package/lib/Utils/DEMUtils.js +2 -2
- package/lib/Utils/FeaturesUtils.d.ts +17 -0
- package/lib/Utils/Gradients.d.ts +13 -0
- package/lib/Utils/ThreeUtils.d.ts +14 -0
- package/lib/Utils/placeObjectOnGround.d.ts +28 -0
- package/lib/global.d.js +0 -0
- package/package.json +18 -15
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export default OrientedImageLayer;
|
|
2
|
+
/**
|
|
3
|
+
* OrientedImageLayer loads oriented images, and project these textures on the scene.
|
|
4
|
+
* It is design to create an immersive view. </br>
|
|
5
|
+
* It loads a set of panoramic position and orientation,
|
|
6
|
+
* a set of camera calibration file (it's the same set of camera for each panoramic),
|
|
7
|
+
* and a set of texture (each image for each camera for each panoramic), all organised in an {@link OrientedImageSource}. </br>
|
|
8
|
+
* It creates an {@link OrientedImageMaterial} used to do projective texture mapping on the scene.
|
|
9
|
+
* @extends GeometryLayer
|
|
10
|
+
*/
|
|
11
|
+
declare class OrientedImageLayer extends GeometryLayer {
|
|
12
|
+
/**
|
|
13
|
+
* @param { string } id - The id of the layer, a unique name.
|
|
14
|
+
* @param { Object } config - configuration of the layer
|
|
15
|
+
* @param { number } config.backgroundDistance - Radius in meter of the sphere used as a background
|
|
16
|
+
* @param { function } config.onPanoChanged - callback fired when current panoramic changes
|
|
17
|
+
* @param { string } config.crs - crs projection of the view
|
|
18
|
+
* @param { string } config.orientation - Json object, using GeoJSon format to represent points,
|
|
19
|
+
* it's a set of panoramic position and orientation.
|
|
20
|
+
* @param { string } config.calibrations - Json object, representing a set of camera.
|
|
21
|
+
* see {@link CameraCalibrationParser}
|
|
22
|
+
* @param { OrientedImageSource } config.source - Source used to build url of texture for each oriented image,
|
|
23
|
+
* a tecture is need for each camera, for each panoramic.
|
|
24
|
+
*/
|
|
25
|
+
constructor(id: string, config?: {
|
|
26
|
+
backgroundDistance: number;
|
|
27
|
+
onPanoChanged: Function;
|
|
28
|
+
crs: string;
|
|
29
|
+
orientation: string;
|
|
30
|
+
calibrations: string;
|
|
31
|
+
source: OrientedImageSource;
|
|
32
|
+
});
|
|
33
|
+
isOrientedImageLayer: boolean;
|
|
34
|
+
background: any;
|
|
35
|
+
currentPano: any;
|
|
36
|
+
onPanoChanged: Function;
|
|
37
|
+
getCamerasNameFromFeature: any;
|
|
38
|
+
mergeFeatures: boolean;
|
|
39
|
+
accurate: boolean;
|
|
40
|
+
panos: any;
|
|
41
|
+
cameras: any;
|
|
42
|
+
material: OrientedImageMaterial;
|
|
43
|
+
update(): void;
|
|
44
|
+
set boostLight(value: any);
|
|
45
|
+
get boostLight(): any;
|
|
46
|
+
preUpdate(context: any): void;
|
|
47
|
+
getNextPano(): any;
|
|
48
|
+
getCurrentPano(): any;
|
|
49
|
+
getPreviousPano(): any;
|
|
50
|
+
mostNearPano(position: any): any;
|
|
51
|
+
}
|
|
52
|
+
import GeometryLayer from '../Layer/GeometryLayer';
|
|
53
|
+
import OrientedImageMaterial from '../Renderer/OrientedImageMaterial';
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export default PointCloudLayer;
|
|
2
|
+
/**
|
|
3
|
+
* The basis for all point clouds related layers.
|
|
4
|
+
*
|
|
5
|
+
* @property {boolean} isPointCloudLayer - Used to checkout whether this layer
|
|
6
|
+
* is a PointCloudLayer. Default is `true`. You should not change this, as it is
|
|
7
|
+
* used internally for optimisation.
|
|
8
|
+
* @property {THREE.Group|THREE.Object3D} group - Contains the created
|
|
9
|
+
* `THREE.Points` meshes, usually with an instance of a `THREE.Points` per node.
|
|
10
|
+
* @property {THREE.Group|THREE.Object3D} bboxes - Contains the bounding boxes
|
|
11
|
+
* (`THREE.Box3`) of the tree, usually one per node.
|
|
12
|
+
* @property {number} octreeDepthLimit - The depth limit at which to stop
|
|
13
|
+
* browsing the octree. Can be used to limit the browsing, without having to
|
|
14
|
+
* edit manually the source of the point cloud. No limit by default (`-1`).
|
|
15
|
+
* @property {number} [pointBudget=2000000] - Maximum number of points to
|
|
16
|
+
* display at the same time. This influences the performance of rendering.
|
|
17
|
+
* Default to two millions points.
|
|
18
|
+
* @property {number} [sseThreshold=2] - Threshold of the **S**creen **S**pace
|
|
19
|
+
* **E**rror. Default to `2`.
|
|
20
|
+
* @property {number} [pointSize=4] - The size (in pixels) of the points.
|
|
21
|
+
* Default to `4`.
|
|
22
|
+
* @property {THREE.Material|PointsMaterial} [material=new PointsMaterial] - The
|
|
23
|
+
* material to use to display the points of the cloud. Be default it is a new
|
|
24
|
+
* `PointsMaterial`.
|
|
25
|
+
* @property {number} [mode=PNTS_MODE.COLOR] - The displaying mode of the points.
|
|
26
|
+
* Values are specified in `PointsMaterial`.
|
|
27
|
+
* @property {number} [minIntensityRange=0] - The minimal intensity of the
|
|
28
|
+
* layer. Changing this value will affect the material, if it has the
|
|
29
|
+
* corresponding uniform. The value is normalized between 0 and 1.
|
|
30
|
+
* @property {number} [maxIntensityRange=1] - The maximal intensity of the
|
|
31
|
+
* layer. Changing this value will affect the material, if it has the
|
|
32
|
+
* corresponding uniform. The value is normalized between 0 and 1.
|
|
33
|
+
*
|
|
34
|
+
* @extends GeometryLayer
|
|
35
|
+
*/
|
|
36
|
+
declare class PointCloudLayer extends GeometryLayer {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new instance of point cloud layer.
|
|
39
|
+
* Constructs a new instance of a Point Cloud Layer. This should not be used
|
|
40
|
+
* directly, but rather implemented using `extends`.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
43
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
44
|
+
* {@link View} that already has a layer going by that id.
|
|
45
|
+
* @param {Object} [config] - Optional configuration, all elements in it
|
|
46
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
47
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
48
|
+
* available using `layer.name` or something else depending on the property
|
|
49
|
+
* name. See the list of properties to know which one can be specified.
|
|
50
|
+
* @param {Source} config.source - Description and options of the source See @Layer.
|
|
51
|
+
* @param {number} [options.minElevationRange] - Min value for the elevation range (default value will be taken from the source.metadata).
|
|
52
|
+
* @param {number} [options.maxElevationRange] - Max value for the elevation range (default value will be taken from the source.metadata).
|
|
53
|
+
*/
|
|
54
|
+
constructor(id: string, config?: {
|
|
55
|
+
source: Source;
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @readonly
|
|
60
|
+
*/
|
|
61
|
+
readonly isPointCloudLayer: boolean;
|
|
62
|
+
protocol: string;
|
|
63
|
+
group: any;
|
|
64
|
+
bboxes: any;
|
|
65
|
+
/**
|
|
66
|
+
* @type {number}
|
|
67
|
+
*/
|
|
68
|
+
octreeDepthLimit: number;
|
|
69
|
+
/**
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
pointBudget: number;
|
|
73
|
+
/**
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
pointSize: number;
|
|
77
|
+
/**
|
|
78
|
+
* @type {number}
|
|
79
|
+
*/
|
|
80
|
+
sseThreshold: number;
|
|
81
|
+
/**
|
|
82
|
+
* @type {THREE.Material}
|
|
83
|
+
*/
|
|
84
|
+
material: THREE.Material;
|
|
85
|
+
mode: any;
|
|
86
|
+
/**
|
|
87
|
+
* @type {PointCloudNode | undefined}
|
|
88
|
+
*/
|
|
89
|
+
root: PointCloudNode | undefined;
|
|
90
|
+
preUpdate(context: any, changeSources: any): any[];
|
|
91
|
+
update(context: any, layer: any, elt: any): any;
|
|
92
|
+
displayedCount: number | undefined;
|
|
93
|
+
pickObjectsAt(view: any, mouse: any, radius: any, target?: any[]): any[] | undefined;
|
|
94
|
+
getObjectToUpdateForAttachedLayers(meta: any): {
|
|
95
|
+
element: any;
|
|
96
|
+
parent: any;
|
|
97
|
+
} | {
|
|
98
|
+
element: any;
|
|
99
|
+
parent?: undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
}
|
|
102
|
+
import GeometryLayer from '../Layer/GeometryLayer';
|
|
103
|
+
import * as THREE from 'three';
|
|
@@ -26,11 +26,10 @@ function initBoundingBox(elt, layer) {
|
|
|
26
26
|
elt.obj.boxHelper.updateMatrix();
|
|
27
27
|
elt.obj.boxHelper.updateMatrixWorld();
|
|
28
28
|
}
|
|
29
|
-
function computeSSEPerspective(context, pointSize,
|
|
29
|
+
function computeSSEPerspective(context, pointSize, pointSpacing, distance) {
|
|
30
30
|
if (distance <= 0) {
|
|
31
31
|
return Infinity;
|
|
32
32
|
}
|
|
33
|
-
const pointSpacing = spacing / 2 ** elt.depth;
|
|
34
33
|
// Estimate the onscreen distance between 2 points
|
|
35
34
|
const onScreenSpacing = context.camera.preSSE * pointSpacing / distance;
|
|
36
35
|
// [ P1 ]--------------[ P2 ]
|
|
@@ -39,9 +38,7 @@ function computeSSEPerspective(context, pointSize, spacing, elt, distance) {
|
|
|
39
38
|
// <------> = pointSize (in pixels)
|
|
40
39
|
return Math.max(0.0, onScreenSpacing - pointSize);
|
|
41
40
|
}
|
|
42
|
-
function computeSSEOrthographic(context, pointSize,
|
|
43
|
-
const pointSpacing = spacing / 2 ** elt.depth;
|
|
44
|
-
|
|
41
|
+
function computeSSEOrthographic(context, pointSize, pointSpacing) {
|
|
45
42
|
// Given an identity view matrix, project pointSpacing from world space to
|
|
46
43
|
// clip space. v' = vVP = vP
|
|
47
44
|
const v = new THREE.Vector4(pointSpacing);
|
|
@@ -53,11 +50,11 @@ function computeSSEOrthographic(context, pointSize, spacing, elt) {
|
|
|
53
50
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
54
51
|
return Math.max(0.0, distance - pointSize);
|
|
55
52
|
}
|
|
56
|
-
function computeScreenSpaceError(context, pointSize,
|
|
53
|
+
function computeScreenSpaceError(context, pointSize, pointSpacing, distance) {
|
|
57
54
|
if (context.camera.camera3D.isOrthographicCamera) {
|
|
58
|
-
return computeSSEOrthographic(context, pointSize,
|
|
55
|
+
return computeSSEOrthographic(context, pointSize, pointSpacing);
|
|
59
56
|
}
|
|
60
|
-
return computeSSEPerspective(context, pointSize,
|
|
57
|
+
return computeSSEPerspective(context, pointSize, pointSpacing, distance);
|
|
61
58
|
}
|
|
62
59
|
function markForDeletion(elt) {
|
|
63
60
|
if (elt.obj) {
|
|
@@ -220,7 +217,7 @@ class PointCloudLayer extends GeometryLayer {
|
|
|
220
217
|
if (this.material) {
|
|
221
218
|
this.material.visible = this.visible;
|
|
222
219
|
this.material.opacity = this.opacity;
|
|
223
|
-
this.material.
|
|
220
|
+
this.material.depthWrite = false;
|
|
224
221
|
this.material.size = this.pointSize;
|
|
225
222
|
this.material.scale = context.camera.preSSE;
|
|
226
223
|
if (this.material.updateUniforms) {
|
|
@@ -284,7 +281,7 @@ class PointCloudLayer extends GeometryLayer {
|
|
|
284
281
|
} else if (!elt.promise) {
|
|
285
282
|
const distance = Math.max(0.001, bbox.distanceToPoint(point));
|
|
286
283
|
// Increase priority of nearest node
|
|
287
|
-
const priority = computeScreenSpaceError(context, layer.pointSize,
|
|
284
|
+
const priority = computeScreenSpaceError(context, layer.pointSize, elt.pointSpacing, distance) / distance;
|
|
288
285
|
elt.promise = context.scheduler.execute({
|
|
289
286
|
layer,
|
|
290
287
|
requester: elt,
|
|
@@ -312,7 +309,7 @@ class PointCloudLayer extends GeometryLayer {
|
|
|
312
309
|
}
|
|
313
310
|
if (elt.children && elt.children.length) {
|
|
314
311
|
const distance = bbox.distanceToPoint(point);
|
|
315
|
-
elt.sse = computeScreenSpaceError(context, layer.pointSize,
|
|
312
|
+
elt.sse = computeScreenSpaceError(context, layer.pointSize, elt.pointSpacing, distance) / this.sseThreshold;
|
|
316
313
|
if (elt.sse >= 1) {
|
|
317
314
|
return elt.children;
|
|
318
315
|
} else {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export default Potree2Layer;
|
|
2
|
+
/**
|
|
3
|
+
* @property {boolean} isPotreeLayer - Used to checkout whether this layer
|
|
4
|
+
* is a Potree2Layer. Default is `true`. You should not change this, as it is
|
|
5
|
+
* used internally for optimisation.
|
|
6
|
+
*
|
|
7
|
+
* @extends PointCloudLayer
|
|
8
|
+
*/
|
|
9
|
+
declare class Potree2Layer extends PointCloudLayer {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new instance of Potree2 layer.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Create a new point cloud layer
|
|
15
|
+
* const points = new Potree2Layer('points',
|
|
16
|
+
* {
|
|
17
|
+
* source: new Potree2Source({
|
|
18
|
+
* url: 'https://pointsClouds/',
|
|
19
|
+
* file: 'metadata.json',
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* View.prototype.addLayer.call(view, points);
|
|
24
|
+
*
|
|
25
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
26
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
27
|
+
* {@link View} that already has a layer going by that id.
|
|
28
|
+
* @param {Object} config - Configuration, all elements in it
|
|
29
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
30
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
31
|
+
* available using `layer.name` or something else depending on the property
|
|
32
|
+
* name. See the list of properties to know which one can be specified.
|
|
33
|
+
* @param {string} [config.crs=ESPG:4326] - The CRS of the {@link View} this
|
|
34
|
+
* layer will be attached to. This is used to determine the extent of this
|
|
35
|
+
* layer. Default to `EPSG:4326`.
|
|
36
|
+
*/
|
|
37
|
+
constructor(id: string, config: {
|
|
38
|
+
crs?: string | undefined;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
readonly isPotreeLayer: boolean;
|
|
45
|
+
scale: THREE.Vector3;
|
|
46
|
+
metadata: any;
|
|
47
|
+
pointAttributes: Potree2PointAttributes;
|
|
48
|
+
spacing: any;
|
|
49
|
+
minElevationRange: any;
|
|
50
|
+
maxElevationRange: any;
|
|
51
|
+
extent: Extent;
|
|
52
|
+
}
|
|
53
|
+
import PointCloudLayer from '../Layer/PointCloudLayer';
|
|
54
|
+
import * as THREE from 'three';
|
|
55
|
+
import { Potree2PointAttributes } from '../Core/Potree2PointAttributes';
|
|
56
|
+
import { Extent } from '@itowns/geographic';
|
|
@@ -156,8 +156,6 @@ class Potree2Layer extends PointCloudLayer {
|
|
|
156
156
|
root.boundingSphere = boundingBox.getBoundingSphere(new THREE.Sphere());
|
|
157
157
|
this.minElevationRange = this.minElevationRange ?? metadata.boundingBox.min[2];
|
|
158
158
|
this.maxElevationRange = this.maxElevationRange ?? metadata.boundingBox.max[2];
|
|
159
|
-
root.id = 'r';
|
|
160
|
-
root.depth = 0;
|
|
161
159
|
root.nodeType = 2;
|
|
162
160
|
root.hierarchyByteOffset = 0n;
|
|
163
161
|
root.hierarchyByteSize = BigInt(metadata.hierarchy.firstChunkSize);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export default PotreeLayer;
|
|
2
|
+
/**
|
|
3
|
+
* @property {boolean} isPotreeLayer - Used to checkout whether this layer
|
|
4
|
+
* is a PotreeLayer. Default is `true`. You should not change this, as it is
|
|
5
|
+
* used internally for optimisation.
|
|
6
|
+
*
|
|
7
|
+
* @extends PointCloudLayer
|
|
8
|
+
*/
|
|
9
|
+
declare class PotreeLayer extends PointCloudLayer {
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new instance of Potree layer.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Create a new point cloud layer
|
|
15
|
+
* const points = new PotreeLayer('points',
|
|
16
|
+
* {
|
|
17
|
+
* source: new PotreeLayer({
|
|
18
|
+
* url: 'https://pointsClouds/',
|
|
19
|
+
* file: 'points.js',
|
|
20
|
+
* }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* View.prototype.addLayer.call(view, points);
|
|
24
|
+
*
|
|
25
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
26
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
27
|
+
* {@link View} that already has a layer going by that id.
|
|
28
|
+
* @param {Object} config - Configuration, all elements in it
|
|
29
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
30
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
31
|
+
* available using `layer.name` or something else depending on the property
|
|
32
|
+
* name. See the list of properties to know which one can be specified.
|
|
33
|
+
* @param {string} [config.crs='ESPG:4326'] - The CRS of the {@link View} this
|
|
34
|
+
* layer will be attached to. This is used to determine the extent of this
|
|
35
|
+
* layer. Default to `EPSG:4326`.
|
|
36
|
+
*/
|
|
37
|
+
constructor(id: string, config: {
|
|
38
|
+
crs?: string | undefined;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* @type {boolean}
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
readonly isPotreeLayer: boolean;
|
|
45
|
+
scale: THREE.Vector3;
|
|
46
|
+
spacing: any;
|
|
47
|
+
hierarchyStepSize: any;
|
|
48
|
+
supportsProgressiveDisplay: boolean;
|
|
49
|
+
minElevationRange: any;
|
|
50
|
+
maxElevationRange: any;
|
|
51
|
+
extent: Extent;
|
|
52
|
+
}
|
|
53
|
+
import PointCloudLayer from '../Layer/PointCloudLayer';
|
|
54
|
+
import * as THREE from 'three';
|
|
55
|
+
import { Extent } from '@itowns/geographic';
|
package/lib/Layer/RasterLayer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Layer from "./Layer.js";
|
|
2
|
-
import {
|
|
2
|
+
import { removeLayeredMaterialNodeTile } from "../Process/LayeredMaterialNodeProcessing.js";
|
|
3
3
|
import textureConverter from "../Converter/textureConverter.js";
|
|
4
4
|
import { CACHE_POLICIES } from "../Core/Scheduler/Cache.js";
|
|
5
5
|
class RasterLayer extends Layer {
|
|
@@ -30,7 +30,7 @@ class RasterLayer extends Layer {
|
|
|
30
30
|
this.cache.clear();
|
|
31
31
|
}
|
|
32
32
|
for (const root of this.parent.level0Nodes) {
|
|
33
|
-
root.traverse(
|
|
33
|
+
root.traverse(removeLayeredMaterialNodeTile(this.id));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// next step is move these properties to Style class
|
|
2
|
-
// and hide transparent mechanism
|
|
3
2
|
function ReferLayerProperties(material, layer) {
|
|
4
3
|
if (layer && layer.isGeometryLayer) {
|
|
5
|
-
let transparent = material.transparent;
|
|
6
4
|
material.layer = layer;
|
|
7
5
|
if (material.uniforms && material.uniforms.opacity != undefined) {
|
|
8
6
|
Object.defineProperty(material.uniforms.opacity, 'value', {
|
|
@@ -46,16 +44,6 @@ function ReferLayerProperties(material, layer) {
|
|
|
46
44
|
Object.defineProperty(material, 'wireframe', {
|
|
47
45
|
get: () => material.layer.wireframe
|
|
48
46
|
});
|
|
49
|
-
Object.defineProperty(material, 'transparent', {
|
|
50
|
-
get: () => {
|
|
51
|
-
const needTransparency = material.userData.needTransparency?.[material.mode] || material.layer.opacity < 1.0;
|
|
52
|
-
if (transparent != needTransparency) {
|
|
53
|
-
material.needsUpdate = true;
|
|
54
|
-
transparent = needTransparency;
|
|
55
|
-
}
|
|
56
|
-
return transparent;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
47
|
}
|
|
60
48
|
return material;
|
|
61
49
|
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
export default TiledGeometryLayer;
|
|
2
|
+
/**
|
|
3
|
+
* @property {InfoTiledGeometryLayer} info - Status information of layer
|
|
4
|
+
* @property {boolean} isTiledGeometryLayer - Used to checkout whether this
|
|
5
|
+
* layer is a TiledGeometryLayer. Default is true. You should not change this,
|
|
6
|
+
* as it is used internally for optimisation.
|
|
7
|
+
* @property {boolean} hideSkirt (default false) - Used to hide the skirt (tile borders).
|
|
8
|
+
* Useful when the layer opacity < 1
|
|
9
|
+
*
|
|
10
|
+
* @extends GeometryLayer
|
|
11
|
+
*/
|
|
12
|
+
declare class TiledGeometryLayer extends GeometryLayer {
|
|
13
|
+
/**
|
|
14
|
+
* Tell if a node has enough elevation or color textures to subdivide.
|
|
15
|
+
* Subdivision is prevented if:
|
|
16
|
+
* <ul>
|
|
17
|
+
* <li>the node is covered by at least one elevation layer and if the node
|
|
18
|
+
* doesn't have an elevation texture yet</li>
|
|
19
|
+
* <li>a color texture is missing</li>
|
|
20
|
+
* </ul>
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} context - The context of the update; see the {@link
|
|
23
|
+
* MainLoop} for more informations.
|
|
24
|
+
* @param {TileMesh} node - The node to subdivide.
|
|
25
|
+
*
|
|
26
|
+
* @returns {boolean} False if the node can not be subdivided, true
|
|
27
|
+
* otherwise.
|
|
28
|
+
*/
|
|
29
|
+
static hasEnoughTexturesToSubdivide(context: Object, node: TileMesh): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A layer extending the {@link GeometryLayer}, but with a tiling notion.
|
|
32
|
+
*
|
|
33
|
+
* `TiledGeometryLayer` is the ground where `ColorLayer` and `ElevationLayer` are attached.
|
|
34
|
+
* `TiledGeometryLayer` is a quadtree data structure. At zoom 0,
|
|
35
|
+
* there is a single tile for the whole earth. At zoom level 1,
|
|
36
|
+
* the single tile splits into 4 tiles (2x2 tile square).
|
|
37
|
+
* Each zoom level quadtree divides the geometry tiles of the one before it.
|
|
38
|
+
* The camera distance determines how the tiles are subdivided for optimal data display.
|
|
39
|
+
*
|
|
40
|
+
* Some `GeometryLayer` can also be attached to the `TiledGeometryLayer` if they want to take advantage of the quadtree.
|
|
41
|
+
*
|
|
42
|
+
* 
|
|
43
|
+
* _In `GlobeView`, **red lines** represents the **WGS84 grid** and **orange lines** the **Pseudo-mercator grid**._
|
|
44
|
+
* _In this picture, there are tiles with 3 different zoom/levels._
|
|
45
|
+
*
|
|
46
|
+
* The zoom/level is based on [tiled web map](https://en.wikipedia.org/wiki/Tiled_web_map).
|
|
47
|
+
* It corresponds at meters by pixel. If the projection tile exceeds a certain pixel size (on screen)
|
|
48
|
+
* then it is subdivided into 4 tiles with a zoom greater than 1.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} id - The id of the layer, that should be unique. It is
|
|
51
|
+
* not mandatory, but an error will be emitted if this layer is added a
|
|
52
|
+
* {@link View} that already has a layer going by that id.
|
|
53
|
+
* @param {THREE.Object3D} object3d - The object3d used to contain the
|
|
54
|
+
* geometry of the TiledGeometryLayer. It is usually a `THREE.Group`, but it
|
|
55
|
+
* can be anything inheriting from a `THREE.Object3d`.
|
|
56
|
+
* @param {Array} schemeTile - extents Array of root tiles
|
|
57
|
+
* @param {Object} builder - builder geometry object
|
|
58
|
+
* @param {Object} [config] - Optional configuration, all elements in it
|
|
59
|
+
* will be merged as is in the layer. For example, if the configuration
|
|
60
|
+
* contains three elements `name, protocol, extent`, these elements will be
|
|
61
|
+
* available using `layer.name` or something else depending on the property
|
|
62
|
+
* name.
|
|
63
|
+
* @param {Source} [config.source] - Description and options of the source.
|
|
64
|
+
*
|
|
65
|
+
* @throws {Error} `object3d` must be a valid `THREE.Object3d`.
|
|
66
|
+
*/
|
|
67
|
+
constructor(id: string, object3d: THREE.Object3D, schemeTile: any[], builder: Object, config?: {
|
|
68
|
+
source?: any;
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* @type {boolean}
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
74
|
+
readonly isTiledGeometryLayer: boolean;
|
|
75
|
+
protocol: string;
|
|
76
|
+
/**
|
|
77
|
+
* @type {boolean}
|
|
78
|
+
*/
|
|
79
|
+
disableSkirt: boolean;
|
|
80
|
+
_hideSkirt: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
sseSubdivisionThreshold: number;
|
|
85
|
+
/**
|
|
86
|
+
* @type {number}
|
|
87
|
+
*/
|
|
88
|
+
minSubdivisionLevel: number;
|
|
89
|
+
/**
|
|
90
|
+
* @type {number}
|
|
91
|
+
*/
|
|
92
|
+
maxSubdivisionLevel: number;
|
|
93
|
+
/**
|
|
94
|
+
* @type {number}
|
|
95
|
+
* @deprecated
|
|
96
|
+
*/
|
|
97
|
+
maxDeltaElevationLevel: number;
|
|
98
|
+
segments: any;
|
|
99
|
+
schemeTile: any[];
|
|
100
|
+
builder: Object;
|
|
101
|
+
info: InfoTiledGeometryLayer;
|
|
102
|
+
maxScreenSizeNode: number;
|
|
103
|
+
tileMatrixSets: any;
|
|
104
|
+
materialOptions: any;
|
|
105
|
+
showOutline: any;
|
|
106
|
+
/**
|
|
107
|
+
* @type {THREE.Vector3 | undefined}
|
|
108
|
+
*/
|
|
109
|
+
diffuse: THREE.Vector3 | undefined;
|
|
110
|
+
level0Nodes: any[];
|
|
111
|
+
set hideSkirt(value: boolean);
|
|
112
|
+
get hideSkirt(): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Does pre-update work on the context:
|
|
115
|
+
* <ul>
|
|
116
|
+
* <li>update the `colorLayers` and `elevationLayers`</li>
|
|
117
|
+
* <li>update the `maxElevationLevel`</li>
|
|
118
|
+
* </ul>
|
|
119
|
+
*
|
|
120
|
+
* Once this work is done, it returns a list of nodes to update. Depending
|
|
121
|
+
* on the origin of `sources`, it can return a few things:
|
|
122
|
+
* <ul>
|
|
123
|
+
* <li>if `sources` is empty, it returns the first node of the layer
|
|
124
|
+
* (stored as `level0Nodes`), which will trigger the update of the whole
|
|
125
|
+
* tree</li>
|
|
126
|
+
* <li>if the update is triggered by a camera move, the whole tree is
|
|
127
|
+
* returned too</li>
|
|
128
|
+
* <li>if `source.layer` is this layer, it means that `source` is a node; a
|
|
129
|
+
* common ancestor will be found if there are multiple sources, with the
|
|
130
|
+
* default common ancestor being the first source itself</li>
|
|
131
|
+
* <li>else it returns the whole tree</li>
|
|
132
|
+
* </ul>
|
|
133
|
+
*
|
|
134
|
+
* @param {Object} context - The context of the update; see the {@link
|
|
135
|
+
* MainLoop} for more informations.
|
|
136
|
+
* @param {Set<GeometryLayer|TileMesh>} sources - A list of sources to
|
|
137
|
+
* generate a list of nodes to update.
|
|
138
|
+
*
|
|
139
|
+
* @return {TileMesh[]} The array of nodes to update.
|
|
140
|
+
*/
|
|
141
|
+
preUpdate(context: Object, sources: Set<GeometryLayer | TileMesh>): TileMesh[];
|
|
142
|
+
_latestUpdateStartingLevel: any;
|
|
143
|
+
colorLayersOrder: any[] | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Update a node of this layer. The node will not be updated if:
|
|
146
|
+
* <ul>
|
|
147
|
+
* <li>it does not have a parent, then it is removed</li>
|
|
148
|
+
* <li>its parent is being subdivided</li>
|
|
149
|
+
* <li>is not visible in the camera</li>
|
|
150
|
+
* </ul>
|
|
151
|
+
*
|
|
152
|
+
* @param {Object} context - The context of the update; see the {@link
|
|
153
|
+
* MainLoop} for more informations.
|
|
154
|
+
* @param {Layer} layer - Parameter to be removed once all update methods
|
|
155
|
+
* have been aligned.
|
|
156
|
+
* @param {TileMesh} node - The node to update.
|
|
157
|
+
*
|
|
158
|
+
* @returns {Object}
|
|
159
|
+
*/
|
|
160
|
+
update(context: Object, layer: Layer, node: TileMesh): Object;
|
|
161
|
+
convert(requester: any, extent: any): Promise<import("../Core/TileMesh").default>;
|
|
162
|
+
countColorLayersTextures(...layers: any[]): number;
|
|
163
|
+
culling(node: any, camera: any): boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Subdivides a node of this layer. If the node is currently in the process
|
|
166
|
+
* of subdivision, it will not do anything here. The subdivision of a node
|
|
167
|
+
* will occur in four part, to create a quadtree. The extent of the node
|
|
168
|
+
* will be divided in four parts: north-west, north-east, south-west and
|
|
169
|
+
* south-east. Once all four nodes are created, they will be added to the
|
|
170
|
+
* current node and the view of the context will be notified of this change.
|
|
171
|
+
*
|
|
172
|
+
* @param {Object} context - The context of the update; see the {@link
|
|
173
|
+
* MainLoop} for more informations.
|
|
174
|
+
* @param {TileMesh} node - The node to subdivide.
|
|
175
|
+
* @return {Promise} { description_of_the_return_value }
|
|
176
|
+
*/
|
|
177
|
+
subdivideNode(context: Object, node: TileMesh): Promise<any>;
|
|
178
|
+
/**
|
|
179
|
+
* Test the subdvision of a node, compared to this layer.
|
|
180
|
+
*
|
|
181
|
+
* @param {Object} context - The context of the update; see the {@link
|
|
182
|
+
* MainLoop} for more informations.
|
|
183
|
+
* @param {PlanarLayer} layer - This layer, parameter to be removed.
|
|
184
|
+
* @param {TileMesh} node - The node to test.
|
|
185
|
+
*
|
|
186
|
+
* @return {boolean} - True if the node is subdivisable, otherwise false.
|
|
187
|
+
*/
|
|
188
|
+
subdivision(context: Object, layer: PlanarLayer, node: TileMesh): boolean;
|
|
189
|
+
}
|
|
190
|
+
import GeometryLayer from '../Layer/GeometryLayer';
|
|
191
|
+
import { InfoTiledGeometryLayer } from '../Layer/InfoLayer';
|
|
192
|
+
import * as THREE from 'three';
|
|
@@ -68,7 +68,7 @@ class TiledGeometryLayer extends GeometryLayer {
|
|
|
68
68
|
showOutline = false,
|
|
69
69
|
segments,
|
|
70
70
|
disableSkirt = false,
|
|
71
|
-
materialOptions,
|
|
71
|
+
materialOptions = {},
|
|
72
72
|
...configGeometryLayer
|
|
73
73
|
} = config;
|
|
74
74
|
super(id, object3d, {
|
|
@@ -126,6 +126,7 @@ class TiledGeometryLayer extends GeometryLayer {
|
|
|
126
126
|
}
|
|
127
127
|
this.maxScreenSizeNode = this.sseSubdivisionThreshold * (this.sizeDiagonalTexture * 2);
|
|
128
128
|
this.tileMatrixSets = tileMatrixSets;
|
|
129
|
+
materialOptions.transparent = materialOptions.transparent ?? true;
|
|
129
130
|
this.materialOptions = materialOptions;
|
|
130
131
|
|
|
131
132
|
/*
|
|
@@ -340,7 +341,7 @@ class TiledGeometryLayer extends GeometryLayer {
|
|
|
340
341
|
*/
|
|
341
342
|
static hasEnoughTexturesToSubdivide(context, node) {
|
|
342
343
|
const layerUpdateState = node.layerUpdateState || {};
|
|
343
|
-
let nodeLayer = node.material.
|
|
344
|
+
let nodeLayer = node.material.getElevationTile();
|
|
344
345
|
for (const e of context.elevationLayers) {
|
|
345
346
|
const extents = node.getExtentsByProjection(e.crs);
|
|
346
347
|
const zoom = extents[0].zoom;
|
|
@@ -368,7 +369,7 @@ class TiledGeometryLayer extends GeometryLayer {
|
|
|
368
369
|
if (layerUpdateState[c.id] && layerUpdateState[c.id].inError()) {
|
|
369
370
|
continue;
|
|
370
371
|
}
|
|
371
|
-
nodeLayer = node.material.
|
|
372
|
+
nodeLayer = node.material.getColorTile(c.id);
|
|
372
373
|
if (c.source.extentInsideLimit(node.extent, zoom) && (!nodeLayer || nodeLayer.level < 0)) {
|
|
373
374
|
return false;
|
|
374
375
|
}
|