itowns 2.42.1-next.2 → 2.42.1-next.21
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/debug.js +1 -1
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/{.eslintrc.js → .eslintrc.cjs} +1 -1
- package/examples/effects_stereo.html +2 -2
- package/examples/entwine_simple_loader.html +24 -8
- package/examples/misc_collada.html +2 -2
- package/examples/misc_instancing.html +1 -1
- package/examples/source_file_gpx_3d.html +2 -2
- package/examples/source_stream_wfs_25d.html +11 -11
- package/examples/source_stream_wfs_3d.html +1 -1
- package/examples/vector_tile_3d_mesh.html +2 -2
- package/examples/vector_tile_raster_2d.html +1 -1
- package/examples/vector_tile_raster_3d.html +1 -1
- package/examples/view_25d_map.html +2 -2
- package/examples/view_3d_map.html +3 -3
- package/examples/view_3d_map_webxr.html +1 -1
- package/examples/view_3d_mns_map.html +3 -3
- package/examples/view_immersive.html +1 -1
- package/examples/view_multi_25d.html +2 -2
- package/examples/widgets_minimap.html +1 -1
- package/examples/widgets_searchbar.html +2 -2
- package/lib/Controls/FirstPersonControls.js +5 -12
- package/lib/Controls/FlyControls.js +4 -13
- package/lib/Controls/GlobeControls.js +33 -43
- package/lib/Controls/PlanarControls.js +9 -20
- package/lib/Controls/StateControl.js +2 -11
- package/lib/Controls/StreetControls.js +14 -24
- package/lib/Converter/Feature2Mesh.js +77 -70
- package/lib/Converter/Feature2Texture.js +15 -25
- package/lib/Converter/convertToTile.js +16 -26
- package/lib/Converter/textureConverter.js +9 -19
- package/lib/Core/3DTiles/C3DTBatchTable.js +5 -13
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +1 -8
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +17 -27
- package/lib/Core/3DTiles/C3DTExtensions.js +1 -8
- package/lib/Core/3DTiles/C3DTFeature.js +3 -10
- package/lib/Core/3DTiles/C3DTilesEnums.js +3 -11
- package/lib/Core/3DTiles/C3DTileset.js +7 -16
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +5 -11
- package/lib/Core/AnimationPlayer.js +2 -11
- package/lib/Core/Deprecated/Undeprecator.js +9 -20
- package/lib/Core/EntwinePointTileNode.js +6 -16
- package/lib/Core/Feature.js +16 -30
- package/lib/Core/Geographic/CoordStars.js +3 -12
- package/lib/Core/Geographic/Coordinates.js +12 -22
- package/lib/Core/Geographic/Crs.js +7 -15
- package/lib/Core/Geographic/Extent.js +36 -47
- package/lib/Core/Geographic/GeoidGrid.js +6 -16
- package/lib/Core/Label.js +7 -17
- package/lib/Core/MainLoop.js +7 -16
- package/lib/Core/Math/Ellipsoid.js +6 -17
- package/lib/Core/Picking.js +10 -20
- package/lib/Core/PointCloudNode.js +2 -11
- package/lib/Core/PotreeNode.js +4 -13
- package/lib/Core/Prefab/Globe/Atmosphere.js +17 -26
- package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +6 -16
- package/lib/Core/Prefab/Globe/GlobeLayer.js +19 -28
- package/lib/Core/Prefab/Globe/SkyShader.js +2 -11
- package/lib/Core/Prefab/GlobeView.js +27 -45
- package/lib/Core/Prefab/Planar/PlanarLayer.js +11 -20
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +6 -16
- package/lib/Core/Prefab/PlanarView.js +10 -25
- package/lib/Core/Prefab/TileBuilder.js +13 -22
- package/lib/Core/Prefab/computeBufferTileGeometry.js +12 -16
- package/lib/Core/Scheduler/Cache.js +2 -10
- package/lib/Core/Scheduler/CancelledCommandException.js +1 -8
- package/lib/Core/Scheduler/Scheduler.js +15 -23
- package/lib/Core/Style.js +26 -40
- package/lib/Core/System/Capabilities.js +2 -13
- package/lib/Core/TileGeometry.js +13 -15
- package/lib/Core/TileMesh.js +6 -15
- package/lib/Core/View.js +43 -58
- package/lib/Layer/C3DTilesLayer.js +29 -41
- package/lib/Layer/ColorLayer.js +10 -16
- package/lib/Layer/ElevationLayer.js +7 -14
- package/lib/Layer/EntwinePointTileLayer.js +11 -18
- package/lib/Layer/FeatureGeometryLayer.js +9 -16
- package/lib/Layer/GeoidLayer.js +6 -15
- package/lib/Layer/GeometryLayer.js +11 -17
- package/lib/Layer/InfoLayer.js +5 -14
- package/lib/Layer/LabelLayer.js +22 -32
- package/lib/Layer/Layer.js +16 -26
- package/lib/Layer/LayerUpdateState.js +1 -8
- package/lib/Layer/LayerUpdateStrategy.js +7 -18
- package/lib/Layer/OrientedImageLayer.js +15 -25
- package/lib/Layer/PointCloudLayer.js +27 -24
- package/lib/Layer/PotreeLayer.js +8 -18
- package/lib/Layer/RasterLayer.js +9 -17
- package/lib/Layer/ReferencingLayerProperties.js +1 -8
- package/lib/Layer/TiledGeometryLayer.js +37 -33
- package/lib/Main.js +86 -707
- package/lib/MainBundle.js +4 -34
- package/lib/Parser/B3dmParser.js +80 -131
- package/lib/Parser/CameraCalibrationParser.js +5 -14
- package/lib/Parser/GDFParser.js +11 -22
- package/lib/Parser/GLTFParser.js +88 -0
- package/lib/Parser/GTXParser.js +9 -21
- package/lib/Parser/GeoJsonParser.js +14 -22
- package/lib/Parser/GpxParser.js +7 -14
- package/lib/Parser/ISGParser.js +19 -28
- package/lib/Parser/KMLParser.js +7 -14
- package/lib/Parser/LASLoader.js +31 -21
- package/lib/Parser/LASParser.js +10 -17
- package/lib/Parser/MapBoxUrlParser.js +2 -9
- package/lib/Parser/PntsParser.js +4 -14
- package/lib/Parser/PotreeBinParser.js +8 -16
- package/lib/Parser/PotreeCinParser.js +3 -12
- package/lib/Parser/ShapefileParser.js +11 -18
- package/lib/Parser/VectorTileParser.js +23 -31
- package/lib/Parser/XbilParser.js +5 -13
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +2 -12
- package/lib/Process/3dTilesProcessing.js +14 -27
- package/lib/Process/FeatureProcessing.js +14 -22
- package/lib/Process/LayeredMaterialNodeProcessing.js +19 -28
- package/lib/Process/ObjectRemovalHelper.js +2 -9
- package/lib/Process/handlerNodeError.js +1 -7
- package/lib/Provider/3dTilesProvider.js +32 -29
- package/lib/Provider/DataSourceProvider.js +2 -9
- package/lib/Provider/Fetcher.js +40 -22
- package/lib/Provider/PointCloudProvider.js +7 -19
- package/lib/Provider/TileProvider.js +4 -12
- package/lib/Provider/URLBuilder.js +4 -12
- package/lib/Renderer/Camera.js +7 -17
- package/lib/Renderer/Color.js +3 -11
- package/lib/Renderer/ColorLayersOrdering.js +14 -22
- package/lib/Renderer/CommonMaterial.js +3 -12
- package/lib/Renderer/Label2DRenderer.js +5 -16
- package/lib/Renderer/LayeredMaterial.js +33 -53
- package/lib/Renderer/OBB.js +12 -21
- package/lib/Renderer/OrientedImageCamera.js +2 -11
- package/lib/Renderer/OrientedImageMaterial.js +17 -35
- package/lib/Renderer/PointsMaterial.js +224 -94
- package/lib/Renderer/RasterTile.js +18 -30
- package/lib/Renderer/RenderMode.js +2 -9
- package/lib/Renderer/Shader/ShaderChunk.js +5 -23
- package/lib/Renderer/Shader/ShaderUtils.js +2 -9
- package/lib/Renderer/SphereHelper.js +2 -11
- package/lib/Renderer/WebXR.js +2 -11
- package/lib/Renderer/c3DEngine.js +20 -53
- package/lib/Source/C3DTilesGoogleSource.js +76 -0
- package/lib/Source/C3DTilesIonSource.js +6 -13
- package/lib/Source/C3DTilesSource.js +5 -12
- package/lib/Source/EntwinePointTileSource.js +12 -19
- package/lib/Source/FileSource.js +7 -14
- package/lib/Source/OrientedImageSource.js +6 -14
- package/lib/Source/PotreeSource.js +9 -16
- package/lib/Source/Source.js +26 -39
- package/lib/Source/TMSSource.js +11 -22
- package/lib/Source/VectorTilesSource.js +75 -34
- package/lib/Source/WFSSource.js +7 -14
- package/lib/Source/WMSSource.js +5 -12
- package/lib/Source/WMTSSource.js +3 -10
- package/lib/ThreeExtended/capabilities/WebGL.js +1 -8
- package/lib/ThreeExtended/libs/ktx-parse.module.js +2 -256
- package/lib/ThreeExtended/libs/zstddec.module.js +2 -8
- package/lib/ThreeExtended/loaders/DDSLoader.js +10 -16
- package/lib/ThreeExtended/loaders/DRACOLoader.js +14 -19
- package/lib/ThreeExtended/loaders/GLTFLoader.js +124 -129
- package/lib/ThreeExtended/loaders/KTX2Loader.js +73 -78
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +40 -59
- package/lib/ThreeExtended/utils/WorkerPool.js +2 -9
- package/lib/Utils/CameraUtils.js +32 -44
- package/lib/Utils/DEMUtils.js +8 -19
- package/lib/Utils/FeaturesUtils.js +8 -16
- package/lib/Utils/Gradients.js +16 -0
- package/lib/Utils/OrientationUtils.js +8 -18
- package/lib/Utils/ThreeUtils.js +2 -9
- package/lib/Utils/gui/C3DTilesStyle.js +7 -15
- package/lib/Utils/gui/Main.js +7 -48
- package/lib/Utils/gui/Minimap.js +12 -20
- package/lib/Utils/gui/Navigation.js +6 -14
- package/lib/Utils/gui/Scale.js +11 -19
- package/lib/Utils/gui/Searchbar.js +5 -13
- package/lib/Utils/gui/Widget.js +1 -8
- package/lib/Utils/placeObjectOnGround.js +13 -23
- package/package.json +13 -8
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _proj = _interopRequireDefault(require("proj4"));
|
|
9
|
-
_proj.default.defs('EPSG:4978', '+proj=geocent +datum=WGS84 +units=m +no_defs');
|
|
1
|
+
import proj4 from 'proj4';
|
|
2
|
+
proj4.defs('EPSG:4978', '+proj=geocent +datum=WGS84 +units=m +no_defs');
|
|
10
3
|
function isString(s) {
|
|
11
4
|
return typeof s === 'string' || s instanceof String;
|
|
12
5
|
}
|
|
@@ -38,7 +31,7 @@ function is4326(crs) {
|
|
|
38
31
|
}
|
|
39
32
|
function isGeocentric(crs) {
|
|
40
33
|
mustBeString(crs);
|
|
41
|
-
const projection =
|
|
34
|
+
const projection = proj4.defs(crs);
|
|
42
35
|
return !projection ? false : projection.projName == 'geocent';
|
|
43
36
|
}
|
|
44
37
|
function _unitFromProj4Unit(projunit) {
|
|
@@ -59,7 +52,7 @@ function toUnit(crs) {
|
|
|
59
52
|
return UNIT.METER;
|
|
60
53
|
default:
|
|
61
54
|
{
|
|
62
|
-
const p =
|
|
55
|
+
const p = proj4.defs(formatToEPSG(crs));
|
|
63
56
|
if (!p) {
|
|
64
57
|
return undefined;
|
|
65
58
|
}
|
|
@@ -81,7 +74,7 @@ function toUnitWithError(crs) {
|
|
|
81
74
|
*
|
|
82
75
|
* @module CRS
|
|
83
76
|
*/
|
|
84
|
-
|
|
77
|
+
export default {
|
|
85
78
|
/**
|
|
86
79
|
* Units that can be used for a CRS.
|
|
87
80
|
*
|
|
@@ -178,6 +171,5 @@ var _default = {
|
|
|
178
171
|
* @param {string} proj4def is the Proj4 definition string for the projection to use
|
|
179
172
|
* @return {undefined}
|
|
180
173
|
*/
|
|
181
|
-
defs: (code, proj4def) =>
|
|
182
|
-
};
|
|
183
|
-
exports.default = _default;
|
|
174
|
+
defs: (code, proj4def) => proj4.defs(code, proj4def)
|
|
175
|
+
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.schemeTiles = exports.globalExtentTMS = exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _Coordinates = _interopRequireDefault(require("./Coordinates"));
|
|
10
|
-
var _Crs = _interopRequireDefault(require("./Crs"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Coordinates from "./Coordinates.js";
|
|
3
|
+
import CRS from "./Crs.js";
|
|
4
|
+
|
|
13
5
|
/**
|
|
14
6
|
* Extent is a SIG-area (so 2D)
|
|
15
7
|
* It can use explicit coordinates (e.g: lon/lat) or implicit (WMTS coordinates)
|
|
@@ -27,9 +19,9 @@ const r = {
|
|
|
27
19
|
col: 0,
|
|
28
20
|
invDiff: 0
|
|
29
21
|
};
|
|
30
|
-
const cNorthWest = new
|
|
31
|
-
const cSouthWest = new
|
|
32
|
-
const cNorthEast = new
|
|
22
|
+
const cNorthWest = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
23
|
+
const cSouthWest = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
24
|
+
const cNorthEast = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
33
25
|
const southWest = new THREE.Vector3();
|
|
34
26
|
const northEast = new THREE.Vector3();
|
|
35
27
|
function _rowColfromParent(extent, zoom) {
|
|
@@ -44,18 +36,16 @@ let _extent;
|
|
|
44
36
|
let _extent2;
|
|
45
37
|
const cardinals = new Array(8);
|
|
46
38
|
for (let i = cardinals.length - 1; i >= 0; i--) {
|
|
47
|
-
cardinals[i] = new
|
|
39
|
+
cardinals[i] = new Coordinates('EPSG:4326', 0, 0, 0, 0);
|
|
48
40
|
}
|
|
49
|
-
const _c = new
|
|
50
|
-
const globalExtentTMS = new Map();
|
|
51
|
-
|
|
52
|
-
const schemeTiles = new Map();
|
|
53
|
-
exports.schemeTiles = schemeTiles;
|
|
41
|
+
const _c = new Coordinates('EPSG:4326', 0, 0);
|
|
42
|
+
export const globalExtentTMS = new Map();
|
|
43
|
+
export const schemeTiles = new Map();
|
|
54
44
|
function getInfoTms(crs) {
|
|
55
|
-
const epsg =
|
|
45
|
+
const epsg = CRS.formatToEPSG(crs);
|
|
56
46
|
const globalExtent = globalExtentTMS.get(epsg);
|
|
57
47
|
const globalDimension = globalExtent.planarDimensions(_dim2);
|
|
58
|
-
const tms =
|
|
48
|
+
const tms = CRS.formatToTms(crs);
|
|
59
49
|
const sTs = schemeTiles.get(tms) || schemeTiles.get('default');
|
|
60
50
|
// The isInverted parameter is to be set to the correct value, true or false
|
|
61
51
|
// (default being false) if the computation of the coordinates needs to be
|
|
@@ -73,7 +63,7 @@ function getInfoTms(crs) {
|
|
|
73
63
|
};
|
|
74
64
|
}
|
|
75
65
|
function getCountTiles(crs, zoom) {
|
|
76
|
-
const sTs = schemeTiles.get(
|
|
66
|
+
const sTs = schemeTiles.get(CRS.formatToTms(crs)) || schemeTiles.get('default');
|
|
77
67
|
const count = 2 ** zoom;
|
|
78
68
|
_countTiles.set(count, count).multiply(sTs);
|
|
79
69
|
return _countTiles;
|
|
@@ -95,14 +85,14 @@ class Extent {
|
|
|
95
85
|
* @param {number} [v3] north value
|
|
96
86
|
*/
|
|
97
87
|
constructor(crs, v0, v1, v2, v3) {
|
|
98
|
-
if (
|
|
88
|
+
if (CRS.isGeocentric(crs)) {
|
|
99
89
|
throw new Error(`${crs} is a geocentric projection, it doesn't make sense with a geographical extent`);
|
|
100
90
|
}
|
|
101
91
|
this.isExtent = true;
|
|
102
92
|
this.crs = crs;
|
|
103
93
|
// Scale/zoom
|
|
104
94
|
this.zoom = 0;
|
|
105
|
-
if (
|
|
95
|
+
if (CRS.isTms(this.crs)) {
|
|
106
96
|
this.row = 0;
|
|
107
97
|
this.col = 0;
|
|
108
98
|
} else {
|
|
@@ -119,7 +109,7 @@ class Extent {
|
|
|
119
109
|
* @return {Extent} cloned extent
|
|
120
110
|
*/
|
|
121
111
|
clone() {
|
|
122
|
-
if (
|
|
112
|
+
if (CRS.isTms(this.crs)) {
|
|
123
113
|
return new Extent(this.crs, this.zoom, this.row, this.col);
|
|
124
114
|
} else {
|
|
125
115
|
return new Extent(this.crs, this.west, this.east, this.south, this.north);
|
|
@@ -133,14 +123,14 @@ class Extent {
|
|
|
133
123
|
* @return {Array<Extent>} array of extents covering
|
|
134
124
|
*/
|
|
135
125
|
tiledCovering(crs) {
|
|
136
|
-
if (this.crs == 'EPSG:4326' && crs ==
|
|
126
|
+
if (this.crs == 'EPSG:4326' && crs == CRS.tms_3857) {
|
|
137
127
|
const extents_WMTS_PM = [];
|
|
138
|
-
const extent = _extent.copy(this).as(
|
|
128
|
+
const extent = _extent.copy(this).as(CRS.formatToEPSG(crs), _extent2);
|
|
139
129
|
const {
|
|
140
130
|
globalExtent,
|
|
141
131
|
globalDimension,
|
|
142
132
|
sTs
|
|
143
|
-
} = getInfoTms(
|
|
133
|
+
} = getInfoTms(CRS.formatToEPSG(crs));
|
|
144
134
|
extent.clampByExtent(globalExtent);
|
|
145
135
|
extent.planarDimensions(dimensionTile);
|
|
146
136
|
const zoom = this.zoom + 1 || Math.floor(Math.log2(Math.round(globalDimension.x / (dimensionTile.x * sTs.x))));
|
|
@@ -188,9 +178,9 @@ class Extent {
|
|
|
188
178
|
* @return {Extent}
|
|
189
179
|
*/
|
|
190
180
|
as(crs, target) {
|
|
191
|
-
|
|
181
|
+
CRS.isValid(crs);
|
|
192
182
|
target = target || new Extent('EPSG:4326', [0, 0, 0, 0]);
|
|
193
|
-
if (
|
|
183
|
+
if (CRS.isTms(this.crs)) {
|
|
194
184
|
const {
|
|
195
185
|
epsg,
|
|
196
186
|
globalExtent,
|
|
@@ -205,7 +195,7 @@ class Extent {
|
|
|
205
195
|
target.crs = epsg;
|
|
206
196
|
target.zoom = this.zoom;
|
|
207
197
|
return crs == epsg ? target : target.as(crs, target);
|
|
208
|
-
} else if (
|
|
198
|
+
} else if (CRS.isEpsg(crs)) {
|
|
209
199
|
if (this.crs != crs) {
|
|
210
200
|
// Compute min/max in x/y by projecting 8 cardinal points,
|
|
211
201
|
// and then taking the min/max of each coordinates.
|
|
@@ -247,8 +237,8 @@ class Extent {
|
|
|
247
237
|
* @return {Coordinates}
|
|
248
238
|
*/
|
|
249
239
|
center() {
|
|
250
|
-
let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new
|
|
251
|
-
if (
|
|
240
|
+
let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Coordinates(this.crs);
|
|
241
|
+
if (CRS.isTms(this.crs)) {
|
|
252
242
|
throw new Error('Invalid operation for WMTS bbox');
|
|
253
243
|
}
|
|
254
244
|
this.planarDimensions(_dim);
|
|
@@ -359,7 +349,7 @@ class Extent {
|
|
|
359
349
|
* @return {boolean}
|
|
360
350
|
*/
|
|
361
351
|
isInside(extent, epsilon) {
|
|
362
|
-
if (
|
|
352
|
+
if (CRS.isTms(this.crs)) {
|
|
363
353
|
if (this.zoom == extent.zoom) {
|
|
364
354
|
return this.row == extent.row && this.col == extent.col;
|
|
365
355
|
} else if (this.zoom < extent.zoom) {
|
|
@@ -370,7 +360,7 @@ class Extent {
|
|
|
370
360
|
}
|
|
371
361
|
} else {
|
|
372
362
|
extent.as(this.crs, _extent);
|
|
373
|
-
epsilon = epsilon == undefined ?
|
|
363
|
+
epsilon = epsilon == undefined ? CRS.reasonnableEpsilon(this.crs) : epsilon;
|
|
374
364
|
return this.east - _extent.east <= epsilon && _extent.west - this.west <= epsilon && this.north - _extent.north <= epsilon && _extent.south - this.south <= epsilon;
|
|
375
365
|
}
|
|
376
366
|
}
|
|
@@ -387,7 +377,7 @@ class Extent {
|
|
|
387
377
|
if (this.crs != extent.crs) {
|
|
388
378
|
throw new Error('unsupported mix');
|
|
389
379
|
}
|
|
390
|
-
if (
|
|
380
|
+
if (CRS.isTms(this.crs)) {
|
|
391
381
|
_rowColfromParent(this, extent.zoom);
|
|
392
382
|
return target.set(this.col * r.invDiff - r.col, this.row * r.invDiff - r.row, r.invDiff, r.invDiff);
|
|
393
383
|
}
|
|
@@ -464,7 +454,7 @@ class Extent {
|
|
|
464
454
|
throw new Error('No values to set in the extent');
|
|
465
455
|
}
|
|
466
456
|
if (v0.isExtent) {
|
|
467
|
-
if (
|
|
457
|
+
if (CRS.isTms(v0.crs)) {
|
|
468
458
|
v1 = v0.row;
|
|
469
459
|
v2 = v0.col;
|
|
470
460
|
v0 = v0.zoom;
|
|
@@ -475,7 +465,7 @@ class Extent {
|
|
|
475
465
|
v0 = v0.west;
|
|
476
466
|
}
|
|
477
467
|
}
|
|
478
|
-
if (
|
|
468
|
+
if (CRS.isTms(this.crs)) {
|
|
479
469
|
this.zoom = v0;
|
|
480
470
|
this.row = v1;
|
|
481
471
|
this.col = v2;
|
|
@@ -588,7 +578,7 @@ class Extent {
|
|
|
588
578
|
* @return {Extent}
|
|
589
579
|
*/
|
|
590
580
|
static fromBox3(crs, box) {
|
|
591
|
-
if (
|
|
581
|
+
if (CRS.isGeocentric(crs)) {
|
|
592
582
|
// if geocentric reproject box on 'EPSG:4326'
|
|
593
583
|
crs = 'EPSG:4326';
|
|
594
584
|
box = _box.copy(box);
|
|
@@ -612,7 +602,7 @@ class Extent {
|
|
|
612
602
|
*/
|
|
613
603
|
toString() {
|
|
614
604
|
let separator = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
615
|
-
if (
|
|
605
|
+
if (CRS.isTms(this.crs)) {
|
|
616
606
|
return `${this.zoom}${separator}${this.row}${separator}${this.col}`;
|
|
617
607
|
} else {
|
|
618
608
|
return `${this.east}${separator}${this.north}${separator}${this.west}${separator}${this.south}`;
|
|
@@ -656,7 +646,7 @@ class Extent {
|
|
|
656
646
|
* @return {Extent} return this extent instance.
|
|
657
647
|
*/
|
|
658
648
|
applyMatrix4(matrix) {
|
|
659
|
-
if (!
|
|
649
|
+
if (!CRS.isTms(this.crs)) {
|
|
660
650
|
southWest.set(this.west, this.south, 0).applyMatrix4(matrix);
|
|
661
651
|
northEast.set(this.east, this.north, 0).applyMatrix4(matrix);
|
|
662
652
|
this.west = southWest.x;
|
|
@@ -728,7 +718,6 @@ const extent3857 = globalExtentTMS.get('EPSG:4326').as('EPSG:3857');
|
|
|
728
718
|
extent3857.clampSouthNorth(extent3857.west, extent3857.east);
|
|
729
719
|
globalExtentTMS.set('EPSG:3857', extent3857);
|
|
730
720
|
schemeTiles.set('default', new THREE.Vector2(1, 1));
|
|
731
|
-
schemeTiles.set(
|
|
732
|
-
schemeTiles.set(
|
|
733
|
-
|
|
734
|
-
exports.default = _default;
|
|
721
|
+
schemeTiles.set(CRS.tms_3857, schemeTiles.get('default'));
|
|
722
|
+
schemeTiles.set(CRS.tms_4326, new THREE.Vector2(2, 1));
|
|
723
|
+
export default Extent;
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _Coordinates = _interopRequireDefault(require("./Coordinates"));
|
|
10
|
-
var _Crs = _interopRequireDefault(require("./Crs"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
const coord = new _Coordinates.default('EPSG:4326');
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Coordinates from "./Coordinates.js";
|
|
3
|
+
import CRS from "./Crs.js";
|
|
4
|
+
const coord = new Coordinates('EPSG:4326');
|
|
14
5
|
const indexes = new THREE.Vector2();
|
|
15
6
|
function biLinearInterpolation(indexes, getData) {
|
|
16
7
|
const j = Math.floor(indexes.x);
|
|
@@ -87,7 +78,7 @@ class GeoidGrid {
|
|
|
87
78
|
* the NORTH-EAST corner of your data extent.
|
|
88
79
|
*/
|
|
89
80
|
constructor(extent, step, getData) {
|
|
90
|
-
|
|
81
|
+
CRS.isGeographic(extent.crs);
|
|
91
82
|
this.extent = extent;
|
|
92
83
|
this.step = new THREE.Vector2(step.x, step.y || step.x);
|
|
93
84
|
this.dimensions = this.extent.planarDimensions();
|
|
@@ -115,5 +106,4 @@ class GeoidGrid {
|
|
|
115
106
|
return biLinearInterpolation(indexes, this.getData);
|
|
116
107
|
}
|
|
117
108
|
}
|
|
118
|
-
|
|
119
|
-
exports.default = _default;
|
|
109
|
+
export default GeoidGrid;
|
package/lib/Core/Label.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _DEMUtils = _interopRequireDefault(require("../Utils/DEMUtils"));
|
|
10
|
-
var _Coordinates = _interopRequireDefault(require("./Geographic/Coordinates"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
const coord = new _Coordinates.default('EPSG:4326');
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import DEMUtils from "../Utils/DEMUtils.js";
|
|
3
|
+
import Coordinates from "./Geographic/Coordinates.js";
|
|
4
|
+
const coord = new Coordinates('EPSG:4326');
|
|
14
5
|
let rect;
|
|
15
6
|
|
|
16
7
|
// set it once
|
|
@@ -215,9 +206,9 @@ class Label extends THREE.Object3D {
|
|
|
215
206
|
if (layer.attachedLayers.filter(l => l.isElevationLayer).length == 0) {
|
|
216
207
|
return;
|
|
217
208
|
}
|
|
218
|
-
let elevation = Math.max(0,
|
|
209
|
+
let elevation = Math.max(0, DEMUtils.getElevationValueAt(layer, this.coordinates, DEMUtils.FAST_READ_Z, nodes));
|
|
219
210
|
if (isNaN(elevation)) {
|
|
220
|
-
elevation = Math.max(0,
|
|
211
|
+
elevation = Math.max(0, DEMUtils.getElevationValueAt(layer, this.coordinates, DEMUtils.FAST_READ_Z));
|
|
221
212
|
}
|
|
222
213
|
if (!isNaN(elevation) && elevation != this.coordinates.z) {
|
|
223
214
|
this.coordinates.z = elevation;
|
|
@@ -229,5 +220,4 @@ class Label extends THREE.Object3D {
|
|
|
229
220
|
}
|
|
230
221
|
}
|
|
231
222
|
}
|
|
232
|
-
|
|
233
|
-
exports.default = _default;
|
|
223
|
+
export default Label;
|
package/lib/Core/MainLoop.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.RENDERING_SCHEDULED = exports.RENDERING_PAUSED = exports.MAIN_LOOP_EVENTS = void 0;
|
|
7
|
-
var _three = require("three");
|
|
8
|
-
const RENDERING_PAUSED = 0;
|
|
9
|
-
exports.RENDERING_PAUSED = RENDERING_PAUSED;
|
|
10
|
-
const RENDERING_SCHEDULED = 1;
|
|
1
|
+
import { EventDispatcher } from 'three';
|
|
2
|
+
export const RENDERING_PAUSED = 0;
|
|
3
|
+
export const RENDERING_SCHEDULED = 1;
|
|
11
4
|
|
|
12
5
|
/**
|
|
13
6
|
* MainLoop's update events list that are fired using
|
|
@@ -22,8 +15,8 @@ const RENDERING_SCHEDULED = 1;
|
|
|
22
15
|
* @property AFTER_RENDER {string} fired after the render
|
|
23
16
|
* @property UPDATE_END {string} fired at the end of the update
|
|
24
17
|
*/
|
|
25
|
-
|
|
26
|
-
const MAIN_LOOP_EVENTS = {
|
|
18
|
+
|
|
19
|
+
export const MAIN_LOOP_EVENTS = {
|
|
27
20
|
UPDATE_START: 'update_start',
|
|
28
21
|
BEFORE_CAMERA_UPDATE: 'before_camera_update',
|
|
29
22
|
AFTER_CAMERA_UPDATE: 'after_camera_update',
|
|
@@ -33,7 +26,6 @@ const MAIN_LOOP_EVENTS = {
|
|
|
33
26
|
AFTER_RENDER: 'after_render',
|
|
34
27
|
UPDATE_END: 'update_end'
|
|
35
28
|
};
|
|
36
|
-
exports.MAIN_LOOP_EVENTS = MAIN_LOOP_EVENTS;
|
|
37
29
|
function updateElements(context, geometryLayer, elements) {
|
|
38
30
|
if (!elements) {
|
|
39
31
|
return;
|
|
@@ -86,7 +78,7 @@ function filterChangeSources(updateSources, geometryLayer) {
|
|
|
86
78
|
});
|
|
87
79
|
return fullUpdate ? new Set([geometryLayer]) : filtered;
|
|
88
80
|
}
|
|
89
|
-
class MainLoop extends
|
|
81
|
+
class MainLoop extends EventDispatcher {
|
|
90
82
|
#needsRedraw = false;
|
|
91
83
|
#updateLoopRestarted = true;
|
|
92
84
|
#lastTimestamp = 0;
|
|
@@ -217,5 +209,4 @@ class MainLoop extends _three.EventDispatcher {
|
|
|
217
209
|
view.execFrameRequesters(MAIN_LOOP_EVENTS.AFTER_RENDER, dt, this.#updateLoopRestarted);
|
|
218
210
|
}
|
|
219
211
|
}
|
|
220
|
-
|
|
221
|
-
exports.default = _default;
|
|
212
|
+
export default MainLoop;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ellipsoidSizes = exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _proj = _interopRequireDefault(require("proj4"));
|
|
10
|
-
var _Coordinates = _interopRequireDefault(require("../Geographic/Coordinates"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
const ellipsoidSizes = new THREE.Vector3(_proj.default.WGS84.a, _proj.default.WGS84.a, _proj.default.WGS84.b);
|
|
14
|
-
exports.ellipsoidSizes = ellipsoidSizes;
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import proj4 from 'proj4';
|
|
3
|
+
import Coordinates from "../Geographic/Coordinates.js";
|
|
4
|
+
export const ellipsoidSizes = new THREE.Vector3(proj4.WGS84.a, proj4.WGS84.a, proj4.WGS84.b);
|
|
15
5
|
const normal = new THREE.Vector3();
|
|
16
6
|
class Ellipsoid {
|
|
17
7
|
constructor() {
|
|
@@ -61,7 +51,7 @@ class Ellipsoid {
|
|
|
61
51
|
* @returns {Coordinate} an object describing the coordinates on the reference ellipsoid, angles are in degree
|
|
62
52
|
*/
|
|
63
53
|
cartesianToCartographic(position) {
|
|
64
|
-
let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new
|
|
54
|
+
let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Coordinates('EPSG:4326', 0, 0, 0);
|
|
65
55
|
// for details, see for example http://www.linz.govt.nz/data/geodetic-system/coordinate-conversion/geodetic-datum-conversions/equations-used-datum
|
|
66
56
|
// TODO the following is only valable for oblate ellipsoid of revolution. do we want to support triaxial ellipsoid?
|
|
67
57
|
const R = Math.sqrt(position.x * position.x + position.y * position.y + position.z * position.z);
|
|
@@ -151,5 +141,4 @@ class Ellipsoid {
|
|
|
151
141
|
return distRad * Math.sqrt(rho * N);
|
|
152
142
|
}
|
|
153
143
|
}
|
|
154
|
-
|
|
155
|
-
exports.default = _default;
|
|
144
|
+
export default Ellipsoid;
|
package/lib/Core/Picking.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _RenderMode = _interopRequireDefault(require("../Renderer/RenderMode"));
|
|
10
|
-
var _LayeredMaterial = require("../Renderer/LayeredMaterial");
|
|
11
|
-
var _Coordinates = _interopRequireDefault(require("./Geographic/Coordinates"));
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import RenderMode from "../Renderer/RenderMode.js";
|
|
3
|
+
import { unpack1K } from "../Renderer/LayeredMaterial.js";
|
|
4
|
+
import Coordinates from "./Geographic/Coordinates.js";
|
|
14
5
|
const depthRGBA = new THREE.Vector4();
|
|
15
6
|
// TileMesh picking support function
|
|
16
7
|
function screenCoordsToNodeId(view, tileLayer, viewCoords) {
|
|
17
8
|
let radius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
18
9
|
const dim = view.mainLoop.gfxEngine.getWindowSize();
|
|
19
10
|
viewCoords = viewCoords || new THREE.Vector2(Math.floor(dim.x / 2), Math.floor(dim.y / 2));
|
|
20
|
-
const restore = tileLayer.level0Nodes.map(n =>
|
|
11
|
+
const restore = tileLayer.level0Nodes.map(n => RenderMode.push(n, RenderMode.MODES.ID));
|
|
21
12
|
const buffer = view.mainLoop.gfxEngine.renderViewToBuffer({
|
|
22
13
|
camera: view.camera,
|
|
23
14
|
scene: tileLayer.object3d
|
|
@@ -33,7 +24,7 @@ function screenCoordsToNodeId(view, tileLayer, viewCoords) {
|
|
|
33
24
|
const idx = (y * 2 * radius + x) * 4;
|
|
34
25
|
const data = buffer.slice(idx, idx + 4 || undefined);
|
|
35
26
|
depthRGBA.fromArray(data).divideScalar(255.0);
|
|
36
|
-
const unpack =
|
|
27
|
+
const unpack = unpack1K(depthRGBA, 256 ** 3);
|
|
37
28
|
const _id = Math.round(unpack);
|
|
38
29
|
if (!ids.includes(_id)) {
|
|
39
30
|
ids.push(_id);
|
|
@@ -84,9 +75,9 @@ function findLayerInParent(obj) {
|
|
|
84
75
|
const raycaster = new THREE.Raycaster();
|
|
85
76
|
const normalized = new THREE.Vector2();
|
|
86
77
|
const pointPos = new THREE.Vector3();
|
|
87
|
-
const pointPosCoord = new
|
|
78
|
+
const pointPosCoord = new Coordinates('EPSG:4978'); // default crs, will be set to view crs when used
|
|
88
79
|
const cameraPos = new THREE.Vector3();
|
|
89
|
-
const cameraPosCoord = new
|
|
80
|
+
const cameraPosCoord = new Coordinates('EPSG:4978'); // default crs, will be set to view crs when used
|
|
90
81
|
|
|
91
82
|
/**
|
|
92
83
|
* @module Picking
|
|
@@ -101,7 +92,7 @@ const cameraPosCoord = new _Coordinates.default('EPSG:4978'); // default crs, wi
|
|
|
101
92
|
* - radius (in pixels) of the picking circle
|
|
102
93
|
* - layer: the geometry layer used for picking
|
|
103
94
|
*/
|
|
104
|
-
|
|
95
|
+
export default {
|
|
105
96
|
pickTilesAt(view, viewCoords, radius, layer) {
|
|
106
97
|
let results = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
107
98
|
const _ids = screenCoordsToNodeId(view, layer, viewCoords, radius);
|
|
@@ -261,5 +252,4 @@ var _default = {
|
|
|
261
252
|
});
|
|
262
253
|
return target;
|
|
263
254
|
}
|
|
264
|
-
};
|
|
265
|
-
exports.default = _default;
|
|
255
|
+
};
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
8
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
10
2
|
class PointCloudNode extends THREE.EventDispatcher {
|
|
11
3
|
constructor() {
|
|
12
4
|
let numPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -47,5 +39,4 @@ class PointCloudNode extends THREE.EventDispatcher {
|
|
|
47
39
|
}
|
|
48
40
|
}
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
exports.default = _default;
|
|
42
|
+
export default PointCloudNode;
|
package/lib/Core/PotreeNode.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import PointCloudNode from "./PointCloudNode.js";
|
|
2
3
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _PointCloudNode = _interopRequireDefault(require("./PointCloudNode"));
|
|
10
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
4
|
// Create an A(xis)A(ligned)B(ounding)B(ox) for the child `childIndex` of one aabb.
|
|
13
5
|
// (PotreeConverter protocol builds implicit octree hierarchy by applying the same
|
|
14
6
|
// subdivision algo recursively)
|
|
15
7
|
const dHalfLength = new THREE.Vector3();
|
|
16
|
-
class PotreeNode extends
|
|
8
|
+
class PotreeNode extends PointCloudNode {
|
|
17
9
|
constructor() {
|
|
18
10
|
let numPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
19
11
|
let childrenBitField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -106,5 +98,4 @@ class PotreeNode extends _PointCloudNode.default {
|
|
|
106
98
|
});
|
|
107
99
|
}
|
|
108
100
|
}
|
|
109
|
-
|
|
110
|
-
exports.default = _default;
|
|
101
|
+
export default PotreeNode;
|