itowns 2.44.3-next.40 → 2.44.3-next.42

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 (199) hide show
  1. package/README.md +3 -129
  2. package/package.json +16 -72
  3. package/CODING.md +0 -120
  4. package/CONTRIBUTING.md +0 -150
  5. package/CONTRIBUTORS.md +0 -56
  6. package/LICENSE.md +0 -44
  7. package/changelog.md +0 -1361
  8. package/dist/455.js +0 -2
  9. package/dist/455.js.map +0 -1
  10. package/dist/debug.js +0 -3
  11. package/dist/debug.js.LICENSE.txt +0 -13
  12. package/dist/debug.js.map +0 -1
  13. package/dist/itowns.js +0 -3
  14. package/dist/itowns.js.LICENSE.txt +0 -5
  15. package/dist/itowns.js.map +0 -1
  16. package/dist/itowns_lasparser.js +0 -2
  17. package/dist/itowns_lasparser.js.map +0 -1
  18. package/dist/itowns_lasworker.js +0 -2
  19. package/dist/itowns_lasworker.js.map +0 -1
  20. package/dist/itowns_potree2worker.js +0 -2
  21. package/dist/itowns_potree2worker.js.map +0 -1
  22. package/dist/itowns_widgets.js +0 -2
  23. package/dist/itowns_widgets.js.map +0 -1
  24. package/examples/.eslintrc.cjs +0 -35
  25. package/examples/jsm/.eslintrc.cjs +0 -38
  26. package/lib/Controls/FirstPersonControls.js +0 -308
  27. package/lib/Controls/FlyControls.js +0 -175
  28. package/lib/Controls/GlobeControls.js +0 -1179
  29. package/lib/Controls/PlanarControls.js +0 -1025
  30. package/lib/Controls/StateControl.js +0 -432
  31. package/lib/Controls/StreetControls.js +0 -392
  32. package/lib/Converter/Feature2Mesh.js +0 -614
  33. package/lib/Converter/Feature2Texture.js +0 -175
  34. package/lib/Converter/convertToTile.js +0 -70
  35. package/lib/Converter/textureConverter.js +0 -43
  36. package/lib/Core/3DTiles/C3DTBatchTable.js +0 -131
  37. package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +0 -96
  38. package/lib/Core/3DTiles/C3DTBoundingVolume.js +0 -157
  39. package/lib/Core/3DTiles/C3DTExtensions.js +0 -97
  40. package/lib/Core/3DTiles/C3DTFeature.js +0 -110
  41. package/lib/Core/3DTiles/C3DTilesEnums.js +0 -20
  42. package/lib/Core/3DTiles/C3DTileset.js +0 -99
  43. package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +0 -100
  44. package/lib/Core/AnimationPlayer.js +0 -142
  45. package/lib/Core/CopcNode.js +0 -174
  46. package/lib/Core/Deprecated/Undeprecator.js +0 -74
  47. package/lib/Core/EntwinePointTileNode.js +0 -126
  48. package/lib/Core/Feature.js +0 -489
  49. package/lib/Core/Geographic/CoordStars.js +0 -80
  50. package/lib/Core/Geographic/Coordinates.js +0 -331
  51. package/lib/Core/Geographic/Crs.js +0 -170
  52. package/lib/Core/Geographic/Extent.js +0 -550
  53. package/lib/Core/Geographic/GeoidGrid.js +0 -109
  54. package/lib/Core/Label.js +0 -222
  55. package/lib/Core/MainLoop.js +0 -209
  56. package/lib/Core/Math/Ellipsoid.js +0 -185
  57. package/lib/Core/Picking.js +0 -255
  58. package/lib/Core/PointCloudNode.js +0 -42
  59. package/lib/Core/Potree2Node.js +0 -206
  60. package/lib/Core/Potree2PointAttributes.js +0 -139
  61. package/lib/Core/PotreeNode.js +0 -101
  62. package/lib/Core/Prefab/Globe/Atmosphere.js +0 -295
  63. package/lib/Core/Prefab/Globe/GlobeLayer.js +0 -152
  64. package/lib/Core/Prefab/Globe/GlobeTileBuilder.js +0 -111
  65. package/lib/Core/Prefab/Globe/SkyShader.js +0 -78
  66. package/lib/Core/Prefab/GlobeView.js +0 -156
  67. package/lib/Core/Prefab/Planar/PlanarLayer.js +0 -59
  68. package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +0 -72
  69. package/lib/Core/Prefab/PlanarView.js +0 -62
  70. package/lib/Core/Prefab/TileBuilder.js +0 -82
  71. package/lib/Core/Prefab/computeBufferTileGeometry.js +0 -248
  72. package/lib/Core/Scheduler/Cache.js +0 -17
  73. package/lib/Core/Scheduler/CancelledCommandException.js +0 -15
  74. package/lib/Core/Scheduler/Scheduler.js +0 -294
  75. package/lib/Core/Style.js +0 -660
  76. package/lib/Core/StyleOptions.js +0 -486
  77. package/lib/Core/System/Capabilities.js +0 -63
  78. package/lib/Core/Tile/Tile.js +0 -207
  79. package/lib/Core/Tile/TileGrid.js +0 -49
  80. package/lib/Core/TileGeometry.js +0 -124
  81. package/lib/Core/TileMesh.js +0 -108
  82. package/lib/Core/View.js +0 -1116
  83. package/lib/Layer/C3DTilesLayer.js +0 -459
  84. package/lib/Layer/ColorLayer.js +0 -154
  85. package/lib/Layer/CopcLayer.js +0 -63
  86. package/lib/Layer/ElevationLayer.js +0 -139
  87. package/lib/Layer/EntwinePointTileLayer.js +0 -71
  88. package/lib/Layer/FeatureGeometryLayer.js +0 -77
  89. package/lib/Layer/GeoidLayer.js +0 -80
  90. package/lib/Layer/GeometryLayer.js +0 -233
  91. package/lib/Layer/InfoLayer.js +0 -64
  92. package/lib/Layer/LabelLayer.js +0 -470
  93. package/lib/Layer/Layer.js +0 -335
  94. package/lib/Layer/LayerUpdateState.js +0 -89
  95. package/lib/Layer/LayerUpdateStrategy.js +0 -80
  96. package/lib/Layer/OGC3DTilesLayer.js +0 -543
  97. package/lib/Layer/OrientedImageLayer.js +0 -228
  98. package/lib/Layer/PointCloudLayer.js +0 -405
  99. package/lib/Layer/Potree2Layer.js +0 -171
  100. package/lib/Layer/PotreeLayer.js +0 -72
  101. package/lib/Layer/RasterLayer.js +0 -37
  102. package/lib/Layer/ReferencingLayerProperties.js +0 -62
  103. package/lib/Layer/TiledGeometryLayer.js +0 -459
  104. package/lib/Loader/LASLoader.js +0 -193
  105. package/lib/Loader/Potree2BrotliLoader.js +0 -261
  106. package/lib/Loader/Potree2Loader.js +0 -207
  107. package/lib/Main.js +0 -115
  108. package/lib/MainBundle.js +0 -4
  109. package/lib/Parser/B3dmParser.js +0 -174
  110. package/lib/Parser/CameraCalibrationParser.js +0 -94
  111. package/lib/Parser/GDFParser.js +0 -72
  112. package/lib/Parser/GTXParser.js +0 -75
  113. package/lib/Parser/GeoJsonParser.js +0 -212
  114. package/lib/Parser/GpxParser.js +0 -25
  115. package/lib/Parser/ISGParser.js +0 -71
  116. package/lib/Parser/KMLParser.js +0 -25
  117. package/lib/Parser/LASParser.js +0 -137
  118. package/lib/Parser/MapBoxUrlParser.js +0 -83
  119. package/lib/Parser/PntsParser.js +0 -131
  120. package/lib/Parser/Potree2BinParser.js +0 -92
  121. package/lib/Parser/PotreeBinParser.js +0 -106
  122. package/lib/Parser/PotreeCinParser.js +0 -29
  123. package/lib/Parser/ShapefileParser.js +0 -78
  124. package/lib/Parser/VectorTileParser.js +0 -215
  125. package/lib/Parser/XbilParser.js +0 -120
  126. package/lib/Parser/deprecated/LegacyGLTFLoader.js +0 -1386
  127. package/lib/Parser/iGLTFLoader.js +0 -168
  128. package/lib/Process/3dTilesProcessing.js +0 -304
  129. package/lib/Process/FeatureProcessing.js +0 -76
  130. package/lib/Process/LayeredMaterialNodeProcessing.js +0 -221
  131. package/lib/Process/ObjectRemovalHelper.js +0 -97
  132. package/lib/Process/handlerNodeError.js +0 -23
  133. package/lib/Provider/3dTilesProvider.js +0 -149
  134. package/lib/Provider/DataSourceProvider.js +0 -8
  135. package/lib/Provider/Fetcher.js +0 -233
  136. package/lib/Provider/PointCloudProvider.js +0 -45
  137. package/lib/Provider/TileProvider.js +0 -16
  138. package/lib/Provider/URLBuilder.js +0 -116
  139. package/lib/Renderer/Camera.js +0 -281
  140. package/lib/Renderer/Color.js +0 -56
  141. package/lib/Renderer/ColorLayersOrdering.js +0 -115
  142. package/lib/Renderer/CommonMaterial.js +0 -31
  143. package/lib/Renderer/Label2DRenderer.js +0 -192
  144. package/lib/Renderer/LayeredMaterial.js +0 -243
  145. package/lib/Renderer/OBB.js +0 -151
  146. package/lib/Renderer/OrientedImageCamera.js +0 -118
  147. package/lib/Renderer/OrientedImageMaterial.js +0 -167
  148. package/lib/Renderer/PointsMaterial.js +0 -485
  149. package/lib/Renderer/RasterTile.js +0 -208
  150. package/lib/Renderer/RenderMode.js +0 -31
  151. package/lib/Renderer/Shader/ShaderChunk.js +0 -160
  152. package/lib/Renderer/Shader/ShaderUtils.js +0 -47
  153. package/lib/Renderer/SphereHelper.js +0 -17
  154. package/lib/Renderer/WebXR.js +0 -51
  155. package/lib/Renderer/c3DEngine.js +0 -214
  156. package/lib/Source/C3DTilesGoogleSource.js +0 -74
  157. package/lib/Source/C3DTilesIonSource.js +0 -54
  158. package/lib/Source/C3DTilesSource.js +0 -30
  159. package/lib/Source/CopcSource.js +0 -126
  160. package/lib/Source/EntwinePointTileSource.js +0 -72
  161. package/lib/Source/FileSource.js +0 -188
  162. package/lib/Source/OGC3DTilesGoogleSource.js +0 -29
  163. package/lib/Source/OGC3DTilesIonSource.js +0 -34
  164. package/lib/Source/OGC3DTilesSource.js +0 -21
  165. package/lib/Source/OrientedImageSource.js +0 -59
  166. package/lib/Source/Potree2Source.js +0 -167
  167. package/lib/Source/PotreeSource.js +0 -82
  168. package/lib/Source/Source.js +0 -203
  169. package/lib/Source/TMSSource.js +0 -144
  170. package/lib/Source/VectorTilesSource.js +0 -182
  171. package/lib/Source/WFSSource.js +0 -170
  172. package/lib/Source/WMSSource.js +0 -168
  173. package/lib/Source/WMTSSource.js +0 -92
  174. package/lib/ThreeExtended/capabilities/WebGL.js +0 -69
  175. package/lib/ThreeExtended/libs/ktx-parse.module.js +0 -506
  176. package/lib/ThreeExtended/libs/zstddec.module.js +0 -29
  177. package/lib/ThreeExtended/loaders/DDSLoader.js +0 -200
  178. package/lib/ThreeExtended/loaders/DRACOLoader.js +0 -400
  179. package/lib/ThreeExtended/loaders/GLTFLoader.js +0 -2879
  180. package/lib/ThreeExtended/loaders/KTX2Loader.js +0 -709
  181. package/lib/ThreeExtended/math/ColorSpaces.js +0 -59
  182. package/lib/ThreeExtended/utils/BufferGeometryUtils.js +0 -846
  183. package/lib/ThreeExtended/utils/WorkerPool.js +0 -70
  184. package/lib/Utils/CameraUtils.js +0 -555
  185. package/lib/Utils/DEMUtils.js +0 -350
  186. package/lib/Utils/FeaturesUtils.js +0 -156
  187. package/lib/Utils/Gradients.js +0 -16
  188. package/lib/Utils/OrientationUtils.js +0 -457
  189. package/lib/Utils/ThreeUtils.js +0 -115
  190. package/lib/Utils/gui/C3DTilesStyle.js +0 -215
  191. package/lib/Utils/gui/Main.js +0 -7
  192. package/lib/Utils/gui/Minimap.js +0 -154
  193. package/lib/Utils/gui/Navigation.js +0 -245
  194. package/lib/Utils/gui/Scale.js +0 -107
  195. package/lib/Utils/gui/Searchbar.js +0 -234
  196. package/lib/Utils/gui/Widget.js +0 -80
  197. package/lib/Utils/placeObjectOnGround.js +0 -136
  198. package/lib/Worker/LASLoaderWorker.js +0 -19
  199. package/lib/Worker/Potree2Worker.js +0 -21
@@ -1,171 +0,0 @@
1
- /*
2
- ============
3
- == POTREE ==
4
- ============
5
-
6
- http://potree.org
7
-
8
- Copyright (c) 2011-2020, Markus Schütz
9
- All rights reserved.
10
-
11
- Redistribution and use in source and binary forms, with or without
12
- modification, are permitted provided that the following conditions are met:
13
-
14
- 1. Redistributions of source code must retain the above copyright notice, this
15
- list of conditions and the following disclaimer.
16
- 2. Redistributions in binary form must reproduce the above copyright notice,
17
- this list of conditions and the following disclaimer in the documentation
18
- and/or other materials provided with the distribution.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
-
31
- The views and conclusions contained in the software and documentation are those
32
- of the authors and should not be interpreted as representing official policies,
33
- either expressed or implied, of the FreeBSD Project.
34
- */
35
-
36
- import * as THREE from 'three';
37
- import PointCloudLayer from "./PointCloudLayer.js";
38
- import Potree2Node from "../Core/Potree2Node.js";
39
- import Extent from "../Core/Geographic/Extent.js";
40
- import { PointAttribute, Potree2PointAttributes, PointAttributeTypes } from "../Core/Potree2PointAttributes.js";
41
- const bboxMesh = new THREE.Mesh();
42
- const box3 = new THREE.Box3();
43
- bboxMesh.geometry.boundingBox = box3;
44
- const typeNameAttributeMap = {
45
- double: PointAttributeTypes.DATA_TYPE_DOUBLE,
46
- float: PointAttributeTypes.DATA_TYPE_FLOAT,
47
- int8: PointAttributeTypes.DATA_TYPE_INT8,
48
- uint8: PointAttributeTypes.DATA_TYPE_UINT8,
49
- int16: PointAttributeTypes.DATA_TYPE_INT16,
50
- uint16: PointAttributeTypes.DATA_TYPE_UINT16,
51
- int32: PointAttributeTypes.DATA_TYPE_INT32,
52
- uint32: PointAttributeTypes.DATA_TYPE_UINT32,
53
- int64: PointAttributeTypes.DATA_TYPE_INT64,
54
- uint64: PointAttributeTypes.DATA_TYPE_UINT64
55
- };
56
- function parseAttributes(jsonAttributes) {
57
- const attributes = new Potree2PointAttributes();
58
- const replacements = {
59
- rgb: 'rgba'
60
- };
61
- for (const jsonAttribute of jsonAttributes) {
62
- const {
63
- name,
64
- numElements,
65
- min,
66
- max
67
- } = jsonAttribute;
68
- const type = typeNameAttributeMap[jsonAttribute.type];
69
- const potreeAttributeName = replacements[name] ? replacements[name] : name;
70
- const attribute = new PointAttribute(potreeAttributeName, type, numElements);
71
- if (numElements === 1) {
72
- attribute.range = [min[0], max[0]];
73
- } else {
74
- attribute.range = [min, max];
75
- }
76
- if (name === 'gps-time') {
77
- // HACK: Guard against bad gpsTime range in metadata, see potree/potree#909
78
- if (attribute.range[0] === attribute.range[1]) {
79
- attribute.range[1] += 1;
80
- }
81
- }
82
- attribute.initialRange = attribute.range;
83
- attributes.add(attribute);
84
- }
85
- {
86
- // check if it has normals
87
- const hasNormals = attributes.attributes.find(a => a.name === 'NormalX') !== undefined && attributes.attributes.find(a => a.name === 'NormalY') !== undefined && attributes.attributes.find(a => a.name === 'NormalZ') !== undefined;
88
- if (hasNormals) {
89
- attributes.addVector({
90
- name: 'NORMAL',
91
- attributes: ['NormalX', 'NormalY', 'NormalZ']
92
- });
93
- }
94
- }
95
- return attributes;
96
- }
97
-
98
- /**
99
- * @property {boolean} isPotreeLayer - Used to checkout whether this layer
100
- * is a Potree2Layer. Default is `true`. You should not change this, as it is
101
- * used internally for optimisation.
102
- *
103
- * @extends PointCloudLayer
104
- */
105
- class Potree2Layer extends PointCloudLayer {
106
- /**
107
- * Constructs a new instance of Potree2 layer.
108
- *
109
- * @example
110
- * // Create a new point cloud layer
111
- * const points = new Potree2Layer('points',
112
- * {
113
- * source: new Potree2Source({
114
- * url: 'https://pointsClouds/',
115
- * file: 'metadata.json',
116
- * }
117
- * });
118
- *
119
- * View.prototype.addLayer.call(view, points);
120
- *
121
- * @param {string} id - The id of the layer, that should be unique. It is
122
- * not mandatory, but an error will be emitted if this layer is added a
123
- * {@link View} that already has a layer going by that id.
124
- * @param {Object} config - Configuration, all elements in it
125
- * will be merged as is in the layer. For example, if the configuration
126
- * contains three elements `name, protocol, extent`, these elements will be
127
- * available using `layer.name` or something else depending on the property
128
- * name. See the list of properties to know which one can be specified.
129
- * @param {string} [config.crs=ESPG:4326] - The CRS of the {@link View} this
130
- * layer will be attached to. This is used to determine the extent of this
131
- * layer. Default to `EPSG:4326`.
132
- */
133
- constructor(id, config) {
134
- super(id, config);
135
-
136
- /**
137
- * @type {boolean}
138
- * @readonly
139
- */
140
- this.isPotreeLayer = true;
141
- const resolve = this.addInitializationStep();
142
- this.source.whenReady.then(metadata => {
143
- this.scale = new THREE.Vector3(1, 1, 1);
144
- this.metadata = metadata;
145
- this.pointAttributes = parseAttributes(metadata.attributes);
146
- this.spacing = metadata.spacing;
147
- const normal = Array.isArray(this.pointAttributes.attributes) && this.pointAttributes.attributes.find(elem => elem.name.startsWith('NORMAL'));
148
- if (normal) {
149
- this.material.defines[normal.name] = 1;
150
- }
151
- const min = new THREE.Vector3(...metadata.boundingBox.min);
152
- const max = new THREE.Vector3(...metadata.boundingBox.max);
153
- const boundingBox = new THREE.Box3(min, max);
154
- const root = new Potree2Node(0, 0, this);
155
- root.bbox = boundingBox;
156
- root.boundingSphere = boundingBox.getBoundingSphere(new THREE.Sphere());
157
- this.minElevationRange = this.minElevationRange ?? metadata.boundingBox.min[2];
158
- this.maxElevationRange = this.maxElevationRange ?? metadata.boundingBox.max[2];
159
- root.id = 'r';
160
- root.depth = 0;
161
- root.nodeType = 2;
162
- root.hierarchyByteOffset = 0n;
163
- root.hierarchyByteSize = BigInt(metadata.hierarchy.firstChunkSize);
164
- root.byteOffset = 0;
165
- this.root = root;
166
- this.extent = Extent.fromBox3(this.source.crs || 'EPSG:4326', boundingBox);
167
- return this.root.loadOctree().then(resolve);
168
- });
169
- }
170
- }
171
- export default Potree2Layer;
@@ -1,72 +0,0 @@
1
- import * as THREE from 'three';
2
- import PointCloudLayer from "./PointCloudLayer.js";
3
- import PotreeNode from "../Core/PotreeNode.js";
4
- import Extent from "../Core/Geographic/Extent.js";
5
- const bboxMesh = new THREE.Mesh();
6
- const box3 = new THREE.Box3();
7
- bboxMesh.geometry.boundingBox = box3;
8
-
9
- /**
10
- * @property {boolean} isPotreeLayer - Used to checkout whether this layer
11
- * is a PotreeLayer. Default is `true`. You should not change this, as it is
12
- * used internally for optimisation.
13
- *
14
- * @extends PointCloudLayer
15
- */
16
- class PotreeLayer extends PointCloudLayer {
17
- /**
18
- * Constructs a new instance of Potree layer.
19
- *
20
- * @example
21
- * // Create a new point cloud layer
22
- * const points = new PotreeLayer('points',
23
- * {
24
- * source: new PotreeLayer({
25
- * url: 'https://pointsClouds/',
26
- * file: 'points.js',
27
- * }
28
- * });
29
- *
30
- * View.prototype.addLayer.call(view, points);
31
- *
32
- * @param {string} id - The id of the layer, that should be unique. It is
33
- * not mandatory, but an error will be emitted if this layer is added a
34
- * {@link View} that already has a layer going by that id.
35
- * @param {Object} config - Configuration, all elements in it
36
- * will be merged as is in the layer. For example, if the configuration
37
- * contains three elements `name, protocol, extent`, these elements will be
38
- * available using `layer.name` or something else depending on the property
39
- * name. See the list of properties to know which one can be specified.
40
- * @param {string} [config.crs='ESPG:4326'] - The CRS of the {@link View} this
41
- * layer will be attached to. This is used to determine the extent of this
42
- * layer. Default to `EPSG:4326`.
43
- */
44
- constructor(id, config) {
45
- super(id, config);
46
-
47
- /**
48
- * @type {boolean}
49
- * @readonly
50
- */
51
- this.isPotreeLayer = true;
52
- const resolve = this.addInitializationStep();
53
- this.source.whenReady.then(cloud => {
54
- this.scale = new THREE.Vector3().addScalar(cloud.scale);
55
- this.spacing = cloud.spacing;
56
- this.hierarchyStepSize = cloud.hierarchyStepSize;
57
- const normal = Array.isArray(cloud.pointAttributes) && cloud.pointAttributes.find(elem => elem.startsWith('NORMAL'));
58
- if (normal) {
59
- this.material.defines[normal] = 1;
60
- }
61
- this.supportsProgressiveDisplay = this.source.extension === 'cin';
62
- this.root = new PotreeNode(0, 0, this);
63
- this.root.bbox.min.set(cloud.boundingBox.lx, cloud.boundingBox.ly, cloud.boundingBox.lz);
64
- this.root.bbox.max.set(cloud.boundingBox.ux, cloud.boundingBox.uy, cloud.boundingBox.uz);
65
- this.minElevationRange = this.minElevationRange ?? cloud.boundingBox.lz;
66
- this.maxElevationRange = this.maxElevationRange ?? cloud.boundingBox.uz;
67
- this.extent = Extent.fromBox3(this.source.crs || 'EPSG:4326', this.root.bbox);
68
- return this.root.loadOctree().then(resolve);
69
- });
70
- }
71
- }
72
- export default PotreeLayer;
@@ -1,37 +0,0 @@
1
- import Layer from "./Layer.js";
2
- import { removeLayeredMaterialNodeLayer } from "../Process/LayeredMaterialNodeProcessing.js";
3
- import textureConverter from "../Converter/textureConverter.js";
4
- import { CACHE_POLICIES } from "../Core/Scheduler/Cache.js";
5
- class RasterLayer extends Layer {
6
- constructor(id, config) {
7
- const {
8
- cacheLifeTime = CACHE_POLICIES.TEXTURE,
9
- minFilter,
10
- magFilter,
11
- ...layerConfig
12
- } = config;
13
- super(id, {
14
- ...layerConfig,
15
- cacheLifeTime
16
- });
17
- this.minFilter = minFilter;
18
- this.magFilter = magFilter;
19
- }
20
- convert(data, extentDestination) {
21
- return textureConverter.convert(data, extentDestination, this);
22
- }
23
-
24
- /**
25
- * All layer's textures are removed from scene and disposed from video device.
26
- * @param {boolean} [clearCache=false] Whether to clear the layer cache or not
27
- */
28
- delete(clearCache) {
29
- if (clearCache) {
30
- this.cache.clear();
31
- }
32
- for (const root of this.parent.level0Nodes) {
33
- root.traverse(removeLayeredMaterialNodeLayer(this.id));
34
- }
35
- }
36
- }
37
- export default RasterLayer;
@@ -1,62 +0,0 @@
1
- // next step is move these properties to Style class
2
- // and hide transparent mechanism
3
- function ReferLayerProperties(material, layer) {
4
- if (layer && layer.isGeometryLayer) {
5
- let transparent = material.transparent;
6
- material.layer = layer;
7
- if (material.uniforms && material.uniforms.opacity != undefined) {
8
- Object.defineProperty(material.uniforms.opacity, 'value', {
9
- get: () => material.layer.opacity
10
- });
11
- } else if (material.opacity != undefined) {
12
- Object.defineProperty(material, 'opacity', {
13
- get: () => material.layer.opacity
14
- });
15
- }
16
- if (material.uniforms && material.uniforms.mode != undefined) {
17
- Object.defineProperty(material.uniforms.mode, 'value', {
18
- get: () => material.layer.pntsMode
19
- });
20
- }
21
- if (material.uniforms && material.uniforms.shape != undefined) {
22
- Object.defineProperty(material.uniforms.shape, 'value', {
23
- get: () => material.layer.pntsShape
24
- });
25
- }
26
- if (material.uniforms && material.uniforms.sizeMode != undefined) {
27
- Object.defineProperty(material.uniforms.sizeMode, 'value', {
28
- get: () => material.layer.pntsSizeMode
29
- });
30
- }
31
- if (material.uniforms && material.uniforms.minAttenuatedSize != undefined) {
32
- Object.defineProperty(material.uniforms.minAttenuatedSize, 'value', {
33
- get: () => material.layer.pntsMinAttenuatedSize
34
- });
35
- }
36
- if (material.uniforms && material.uniforms.maxAttenuatedSize != undefined) {
37
- Object.defineProperty(material.uniforms.maxAttenuatedSize, 'value', {
38
- get: () => material.layer.pntsMaxAttenuatedSize
39
- });
40
- }
41
- if (material.uniforms && material.uniforms.scale != undefined) {
42
- Object.defineProperty(material.uniforms.scale, 'value', {
43
- get: () => material.layer.scale
44
- });
45
- }
46
- Object.defineProperty(material, 'wireframe', {
47
- get: () => material.layer.wireframe
48
- });
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
- }
60
- return material;
61
- }
62
- export default ReferLayerProperties;