@openglobus/og 0.16.2 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/css/og.css +24 -2
- package/dist/@openglobus/og.css +1 -1
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/og/Clock.js +1 -5
- package/src/og/Events.js +0 -4
- package/src/og/Extent.js +5 -9
- package/src/og/Globe.js +92 -55
- package/src/og/ImageCanvas.js +12 -5
- package/src/og/Lock.js +44 -48
- package/src/og/LonLat.js +0 -4
- package/src/og/Object3d.js +1 -1
- package/src/og/Stack.js +49 -53
- package/src/og/astro/earth.js +112 -116
- package/src/og/astro/jd.js +514 -518
- package/src/og/astro/orbit.js +119 -123
- package/src/og/astro/rotation.js +36 -40
- package/src/og/bv/Box.js +77 -81
- package/src/og/bv/Sphere.js +57 -61
- package/src/og/camera/Camera.js +20 -7
- package/src/og/camera/PlanetCamera.js +8 -15
- package/src/og/control/Atmosphere.js +0 -4
- package/src/og/control/Control.js +9 -8
- package/src/og/control/DebugInfo.js +0 -4
- package/src/og/control/DrawingSwitcher.js +117 -0
- package/src/og/control/EarthCoordinates.js +214 -214
- package/src/og/control/GeoImageDragControl.js +0 -4
- package/src/og/control/KeyboardNavigation.js +0 -4
- package/src/og/control/LayerAnimation.js +0 -4
- package/src/og/control/LayerSwitcher.js +2 -4
- package/src/og/control/Lighting.js +11 -15
- package/src/og/control/MouseNavigation.js +0 -4
- package/src/og/control/MouseWheelZoomControl.js +0 -4
- package/src/og/control/RulerSwitcher.js +0 -4
- package/src/og/control/ScaleControl.js +2 -6
- package/src/og/control/ShowFps.js +40 -44
- package/src/og/control/SimpleNavigation.js +10 -10
- package/src/og/control/SimpleSkyBackground.js +0 -4
- package/src/og/control/Sun.js +0 -4
- package/src/og/control/ToggleWireframe.js +35 -39
- package/src/og/control/ZoomControl.js +0 -4
- package/src/og/control/drawing/DrawingControl.js +51 -0
- package/src/og/control/drawing/LineStringDrawingScene.js +203 -0
- package/src/og/control/drawing/PolygonDrawingScene.js +785 -0
- package/src/og/control/elevationProfile/ElevationProfile.js +275 -0
- package/src/og/control/index.js +5 -1
- package/src/og/control/ruler/Ruler.js +0 -4
- package/src/og/control/ruler/RulerScene.js +3 -2
- package/src/og/control/selection/Selection.js +0 -4
- package/src/og/control/selection/SelectionScene.js +2 -4
- package/src/og/control/timeline/TimelineControl.js +4 -4
- package/src/og/control/timeline/TimelineModel.js +2 -2
- package/src/og/control/timeline/TimelineView.js +1 -0
- package/src/og/control/visibleExtent/Segment.js +5 -5
- package/src/og/control/visibleExtent/drawnode.js +0 -4
- package/src/og/ellipsoid/Ellipsoid.js +205 -275
- package/src/og/ellipsoid/wgs84.js +0 -4
- package/src/og/entity/BaseBillboard.js +375 -379
- package/src/og/entity/Billboard.js +0 -4
- package/src/og/entity/BillboardHandler.js +0 -4
- package/src/og/entity/Entity.js +22 -22
- package/src/og/entity/EntityCollection.js +7 -11
- package/src/og/entity/GeoObject.js +0 -4
- package/src/og/entity/GeoObjectHandler.js +0 -4
- package/src/og/entity/Geometry.js +5 -4
- package/src/og/entity/GeometryHandler.js +3 -4
- package/src/og/entity/Label.js +0 -4
- package/src/og/entity/LabelHandler.js +0 -4
- package/src/og/entity/PointCloud.js +0 -4
- package/src/og/entity/PointCloudHandler.js +122 -126
- package/src/og/entity/Polyline.js +4 -6
- package/src/og/entity/PolylineHandler.js +104 -108
- package/src/og/entity/Ray.js +29 -29
- package/src/og/entity/Strip.js +1 -1
- package/src/og/index.js +3 -1
- package/src/og/input/KeyboardHandler.js +128 -132
- package/src/og/input/MouseHandler.js +94 -98
- package/src/og/input/TouchHandler.js +59 -63
- package/src/og/input/input.js +44 -48
- package/src/og/layer/BaseGeoImage.js +5 -8
- package/src/og/layer/CanvasTiles.js +0 -4
- package/src/og/layer/GeoImage.js +0 -4
- package/src/og/layer/GeoTexture2d.js +0 -4
- package/src/og/layer/GeoVideo.js +0 -4
- package/src/og/layer/KML.js +2 -3
- package/src/og/layer/Layer.js +22 -26
- package/src/og/layer/Material.js +0 -4
- package/src/og/layer/Vector.js +23 -20
- package/src/og/layer/WMS.js +182 -186
- package/src/og/layer/XYZ.js +0 -4
- package/src/og/light/LightSource.js +0 -4
- package/src/og/math/Line2.js +28 -32
- package/src/og/math/Mat3.js +152 -156
- package/src/og/math/Ray.js +0 -4
- package/src/og/math/Vec2.js +0 -4
- package/src/og/math/Vec3.js +0 -4
- package/src/og/math/Vec4.js +0 -4
- package/src/og/math/coder.js +104 -104
- package/src/og/math.js +39 -7
- package/src/og/proj/EPSG3857.js +13 -13
- package/src/og/proj/Proj.js +59 -63
- package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +1 -0
- package/src/og/quadTree/EarthQuadTreeStrategy.js +1 -0
- package/src/og/quadTree/EntityCollectionNode.js +12 -16
- package/src/og/quadTree/MarsQuadTreeStrategy.js +1 -0
- package/src/og/quadTree/QuadTreeStrategy.js +1 -0
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +1 -0
- package/src/og/renderer/Renderer.js +109 -22
- package/src/og/renderer/RendererEvents.js +0 -4
- package/src/og/scene/Axes.js +74 -78
- package/src/og/scene/BaseNode.js +0 -4
- package/src/og/scene/Planet.js +114 -112
- package/src/og/scene/RenderNode.js +11 -3
- package/src/og/scene/SkyBox.js +104 -108
- package/src/og/segment/Segment.js +8 -4
- package/src/og/segment/SegmentLonLat.js +2 -6
- package/src/og/segment/segmentHelper.js +229 -225
- package/src/og/shaders/billboard.js +0 -4
- package/src/og/shaders/drawnode.js +5 -9
- package/src/og/shaders/geoObject.js +0 -4
- package/src/og/shaders/label.js +0 -4
- package/src/og/shaders/pickingMask.js +0 -4
- package/src/og/shaders/pointCloud.js +0 -4
- package/src/og/shaders/polyline.js +0 -4
- package/src/og/shaders/ray.js +0 -4
- package/src/og/shaders/skybox.js +0 -4
- package/src/og/terrain/EmptyTerrain.js +0 -4
- package/src/og/utils/FontAtlas.js +0 -4
- package/src/og/utils/GeoImageCreator.js +1 -2
- package/src/og/utils/NormalMapCreator.js +8 -9
- package/src/og/utils/VectorTileCreator.js +3 -9
- package/src/og/utils/shared.js +20 -1
- package/src/og/webgl/Framebuffer.js +0 -4
- package/src/og/webgl/Handler.js +45 -19
- package/src/og/webgl/Multisample.js +0 -4
- package/src/og/webgl/Program.js +0 -4
- package/src/og/webgl/ProgramController.js +2 -2
- package/types/Clock.d.ts +1 -1
- package/types/Extent.d.ts +5 -5
- package/types/Globe.d.ts +15 -1
- package/types/ImageCanvas.d.ts +5 -0
- package/types/bv/Box.d.ts +1 -1
- package/types/bv/Sphere.d.ts +3 -3
- package/types/camera/Camera.d.ts +3 -2
- package/types/camera/PlanetCamera.d.ts +4 -4
- package/types/control/DrawingSwitcher.d.ts +13 -0
- package/types/control/EarthCoordinates.d.ts +1 -1
- package/types/control/Lighting.d.ts +8 -8
- package/types/control/drawing/DrawingControl.d.ts +14 -0
- package/types/control/drawing/LineStringDrawingScene.d.ts +5 -0
- package/types/control/drawing/PolygonDrawingScene.d.ts +99 -0
- package/types/control/index.d.ts +3 -1
- package/types/control/ruler/RulerScene.d.ts +0 -1
- package/types/control/selection/SelectionScene.d.ts +0 -1
- package/types/ellipsoid/Ellipsoid.d.ts +50 -63
- package/types/entity/Entity.d.ts +3 -2
- package/types/entity/Geometry.d.ts +5 -0
- package/types/entity/Polyline.d.ts +1 -1
- package/types/entity/Ray.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/layer/BaseGeoImage.d.ts +1 -1
- package/types/layer/CanvasTiles.d.ts +1 -1
- package/types/layer/Layer.d.ts +1 -1
- package/types/layer/Vector.d.ts +1 -0
- package/types/math.d.ts +7 -0
- package/types/renderer/Renderer.d.ts +7 -1
- package/types/scene/Axes.d.ts +0 -1
- package/types/scene/Planet.d.ts +26 -24
- package/types/scene/RenderNode.d.ts +2 -0
- package/types/scene/SkyBox.d.ts +0 -1
- package/types/segment/Segment.d.ts +3 -2
- package/types/segment/SegmentLonLat.d.ts +0 -1
- package/types/utils/GeoImageCreator.d.ts +1 -1
- package/types/utils/NormalMapCreator.d.ts +1 -1
- package/types/utils/VectorTileCreator.d.ts +2 -2
- package/types/utils/shared.d.ts +2 -0
- package/types/webgl/Handler.d.ts +6 -4
package/src/og/entity/Entity.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/Entity
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { Extent } from "../Extent.js";
|
|
@@ -90,14 +86,14 @@ class Entity {
|
|
|
90
86
|
* @protected
|
|
91
87
|
* @type {LonLat}
|
|
92
88
|
*/
|
|
93
|
-
this.
|
|
89
|
+
this._lonLat = utils.createLonLat(options.lonlat);
|
|
94
90
|
|
|
95
91
|
/**
|
|
96
92
|
* World Mercator entity coordinates.
|
|
97
93
|
* @protected
|
|
98
94
|
* @type {LonLat}
|
|
99
95
|
*/
|
|
100
|
-
this.
|
|
96
|
+
this._lonLatMerc = null;
|
|
101
97
|
|
|
102
98
|
/**
|
|
103
99
|
* Entity visible terrain altitude.
|
|
@@ -227,6 +223,10 @@ class Entity {
|
|
|
227
223
|
this._counter = n;
|
|
228
224
|
}
|
|
229
225
|
|
|
226
|
+
get layerIndex() {
|
|
227
|
+
return this._layerIndex;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
230
|
get instanceName() {
|
|
231
231
|
return "Entity";
|
|
232
232
|
}
|
|
@@ -343,12 +343,12 @@ class Entity {
|
|
|
343
343
|
let ec = this._entityCollection;
|
|
344
344
|
|
|
345
345
|
if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
|
|
346
|
-
this.
|
|
346
|
+
this._lonLat = ec.renderNode.ellipsoid.cartesianToLonLat(p);
|
|
347
347
|
|
|
348
|
-
if (Math.abs(this.
|
|
349
|
-
this.
|
|
348
|
+
if (Math.abs(this._lonLat.lat) < mercator.MAX_LAT) {
|
|
349
|
+
this._lonLatMerc = this._lonLat.forwardMercator();
|
|
350
350
|
} else {
|
|
351
|
-
this.
|
|
351
|
+
this._lonLatMerc = null;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
|
|
@@ -384,12 +384,12 @@ class Entity {
|
|
|
384
384
|
let ec = this._entityCollection;
|
|
385
385
|
|
|
386
386
|
if (!skipLonLat && ec && ec.renderNode && ec.renderNode.ellipsoid) {
|
|
387
|
-
this.
|
|
387
|
+
this._lonLat = ec.renderNode.ellipsoid.cartesianToLonLat(p);
|
|
388
388
|
|
|
389
|
-
if (Math.abs(this.
|
|
390
|
-
this.
|
|
389
|
+
if (Math.abs(this._lonLat.lat) < mercator.MAX_LAT) {
|
|
390
|
+
this._lonLatMerc = this._lonLat.forwardMercator();
|
|
391
391
|
} else {
|
|
392
|
-
this.
|
|
392
|
+
this._lonLatMerc = null;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
}
|
|
@@ -400,7 +400,7 @@ class Entity {
|
|
|
400
400
|
* @returns {LonLat} -
|
|
401
401
|
*/
|
|
402
402
|
getLonLat() {
|
|
403
|
-
return this.
|
|
403
|
+
return this._lonLat.clone();
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
/**
|
|
@@ -409,7 +409,7 @@ class Entity {
|
|
|
409
409
|
* @param {LonLat} lonlat - WGS84 coordinates.
|
|
410
410
|
*/
|
|
411
411
|
setLonLat(lonlat) {
|
|
412
|
-
let l = this.
|
|
412
|
+
let l = this._lonLat;
|
|
413
413
|
|
|
414
414
|
l.lon = lonlat.lon;
|
|
415
415
|
l.lat = lonlat.lat;
|
|
@@ -418,9 +418,9 @@ class Entity {
|
|
|
418
418
|
let ec = this._entityCollection;
|
|
419
419
|
if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
|
|
420
420
|
if (Math.abs(l.lat) < mercator.MAX_LAT) {
|
|
421
|
-
this.
|
|
421
|
+
this._lonLatMerc = l.forwardMercator();
|
|
422
422
|
} else {
|
|
423
|
-
this.
|
|
423
|
+
this._lonLatMerc = null;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
ec.renderNode.ellipsoid.lonLatToCartesianRes(l, this._cartesian);
|
|
@@ -436,7 +436,7 @@ class Entity {
|
|
|
436
436
|
* @param {number} [height] - Height
|
|
437
437
|
*/
|
|
438
438
|
setLonLat2(lon, lat, height) {
|
|
439
|
-
let l = this.
|
|
439
|
+
let l = this._lonLat;
|
|
440
440
|
|
|
441
441
|
l.lon = lon;
|
|
442
442
|
l.lat = lat;
|
|
@@ -445,9 +445,9 @@ class Entity {
|
|
|
445
445
|
let ec = this._entityCollection;
|
|
446
446
|
if (ec && ec.renderNode && ec.renderNode.ellipsoid) {
|
|
447
447
|
if (Math.abs(l.lat) < mercator.MAX_LAT) {
|
|
448
|
-
this.
|
|
448
|
+
this._lonLatMerc = l.forwardMercator();
|
|
449
449
|
} else {
|
|
450
|
-
this.
|
|
450
|
+
this._lonLatMerc = null;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
ec.renderNode.ellipsoid.lonLatToCartesianRes(l, this._cartesian);
|
|
@@ -683,7 +683,7 @@ class Entity {
|
|
|
683
683
|
*/
|
|
684
684
|
getExtent() {
|
|
685
685
|
let res;
|
|
686
|
-
let c = this.
|
|
686
|
+
let c = this._lonLat;
|
|
687
687
|
if (this.billboard || this.label) {
|
|
688
688
|
res = new Extent(new LonLat(c.lon, c.lat), new LonLat(c.lon, c.lat));
|
|
689
689
|
} else {
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/EntityCollection
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { Events } from "../Events.js";
|
|
@@ -213,10 +209,6 @@ class EntityCollection {
|
|
|
213
209
|
this._counter = n;
|
|
214
210
|
}
|
|
215
211
|
|
|
216
|
-
// setPolygonOffset(factor, units) {
|
|
217
|
-
// this.polygonOffsetUnits = units;
|
|
218
|
-
// }
|
|
219
|
-
|
|
220
212
|
/**
|
|
221
213
|
* Sets collection visibility.
|
|
222
214
|
* @public
|
|
@@ -334,7 +326,7 @@ class EntityCollection {
|
|
|
334
326
|
if (rn) {
|
|
335
327
|
rn.renderer && rn.renderer.assignPickingColor(entity);
|
|
336
328
|
if (rn.ellipsoid && entity._cartesian.isZero()) {
|
|
337
|
-
entity.setCartesian3v(rn.ellipsoid.lonLatToCartesian(entity.
|
|
329
|
+
entity.setCartesian3v(rn.ellipsoid.lonLatToCartesian(entity._lonLat));
|
|
338
330
|
}
|
|
339
331
|
}
|
|
340
332
|
this._addRecursively(entity);
|
|
@@ -472,10 +464,12 @@ class EntityCollection {
|
|
|
472
464
|
addTo(renderNode, isHidden) {
|
|
473
465
|
if (!this.renderNode) {
|
|
474
466
|
this.renderNode = renderNode;
|
|
467
|
+
|
|
475
468
|
if (!isHidden) {
|
|
476
469
|
this._renderNodeIndex = renderNode.entityCollections.length;
|
|
477
470
|
renderNode.entityCollections.push(this);
|
|
478
471
|
}
|
|
472
|
+
|
|
479
473
|
renderNode.ellipsoid && this._updateGeodeticCoordinates(renderNode.ellipsoid);
|
|
480
474
|
|
|
481
475
|
this.bindRenderNode(renderNode);
|
|
@@ -490,10 +484,12 @@ class EntityCollection {
|
|
|
490
484
|
* @param {RenderNode} renderNode
|
|
491
485
|
*/
|
|
492
486
|
bindRenderNode(renderNode) {
|
|
493
|
-
if (renderNode.renderer) {
|
|
487
|
+
if (renderNode.renderer && renderNode.renderer.isInitialized()) {
|
|
488
|
+
|
|
494
489
|
this.billboardHandler.setRenderer(renderNode.renderer);
|
|
495
490
|
this.labelHandler.setRenderer(renderNode.renderer);
|
|
496
491
|
this.rayHandler.setRenderer(renderNode.renderer);
|
|
492
|
+
|
|
497
493
|
this.geoObjectHandler.setRenderNode(renderNode);
|
|
498
494
|
this.polylineHandler.setRenderNode(renderNode);
|
|
499
495
|
this.pointCloudHandler.setRenderNode(renderNode);
|
|
@@ -515,7 +511,7 @@ class EntityCollection {
|
|
|
515
511
|
var i = e.length;
|
|
516
512
|
while (i--) {
|
|
517
513
|
var ei = e[i];
|
|
518
|
-
ei.
|
|
514
|
+
ei._lonLat && ei.setCartesian3v(ellipsoid.lonLatToCartesian(ei._lonLat));
|
|
519
515
|
}
|
|
520
516
|
}
|
|
521
517
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/Geometry
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { Extent } from "../Extent.js";
|
|
@@ -192,6 +188,11 @@ class Geometry {
|
|
|
192
188
|
return res;
|
|
193
189
|
}
|
|
194
190
|
|
|
191
|
+
/**
|
|
192
|
+
* @todo ASAP need test for this method
|
|
193
|
+
* @param geoJson
|
|
194
|
+
* @returns {Geometry}
|
|
195
|
+
*/
|
|
195
196
|
setGeometry(geoJson) {
|
|
196
197
|
var h = this._handler;
|
|
197
198
|
this.remove();
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/GeometryHandler
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { doubleToTwoFloatsV2 } from "../math/coder.js";
|
|
@@ -527,6 +523,9 @@ class GeometryHandler {
|
|
|
527
523
|
assignHandler(handler) {
|
|
528
524
|
this._handler = handler;
|
|
529
525
|
this.refresh();
|
|
526
|
+
if (handler.isInitialized()) {
|
|
527
|
+
this.update();
|
|
528
|
+
}
|
|
530
529
|
}
|
|
531
530
|
|
|
532
531
|
/**
|
package/src/og/entity/Label.js
CHANGED
|
@@ -1,126 +1,122 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export { PointCloudHandler };
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as shaders from "../shaders/pointCloud.js";
|
|
4
|
+
|
|
5
|
+
class PointCloudHandler {
|
|
6
|
+
constructor(entityCollection) {
|
|
7
|
+
/**
|
|
8
|
+
* Picking rendering option.
|
|
9
|
+
* @public
|
|
10
|
+
* @type {boolean}
|
|
11
|
+
*/
|
|
12
|
+
this.pickingEnabled = true;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Parent collection
|
|
16
|
+
* @private
|
|
17
|
+
* @type {EntityCollection}
|
|
18
|
+
*/
|
|
19
|
+
this._entityCollection = entityCollection;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Renderer
|
|
23
|
+
* @private
|
|
24
|
+
* @type {Renderer}
|
|
25
|
+
*/
|
|
26
|
+
this._renderer = null;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Point cloud array
|
|
30
|
+
* @private
|
|
31
|
+
* @type {Array.<PointCloud>}
|
|
32
|
+
*/
|
|
33
|
+
this._pointClouds = [];
|
|
34
|
+
|
|
35
|
+
this.__staticId = PointCloudHandler._staticCounter++;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static get _staticCounter() {
|
|
39
|
+
if (!this._counter && this._counter !== 0) {
|
|
40
|
+
this._counter = 0;
|
|
41
|
+
}
|
|
42
|
+
return this._counter;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static set _staticCounter(n) {
|
|
46
|
+
this._counter = n;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_initProgram() {
|
|
50
|
+
if (this._renderer.handler) {
|
|
51
|
+
if (!this._renderer.handler.programs.pointCloud) {
|
|
52
|
+
this._renderer.handler.addProgram(shaders.pointCloud());
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setRenderNode(renderNode) {
|
|
58
|
+
this._renderer = renderNode.renderer;
|
|
59
|
+
this._initProgram();
|
|
60
|
+
for (var i = 0; i < this._pointClouds.length; i++) {
|
|
61
|
+
this._pointClouds[i].setRenderNode(renderNode);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
add(pointCloud) {
|
|
66
|
+
if (pointCloud._handlerIndex === -1) {
|
|
67
|
+
pointCloud._handler = this;
|
|
68
|
+
pointCloud._handlerIndex = this._pointClouds.length;
|
|
69
|
+
this._pointClouds.push(pointCloud);
|
|
70
|
+
this._entityCollection &&
|
|
71
|
+
this._entityCollection.renderNode &&
|
|
72
|
+
pointCloud.setRenderNode(this._entityCollection.renderNode);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
remove(pointCloud) {
|
|
77
|
+
var index = pointCloud._handlerIndex;
|
|
78
|
+
if (index !== -1) {
|
|
79
|
+
pointCloud._deleteBuffers();
|
|
80
|
+
pointCloud._handlerIndex = -1;
|
|
81
|
+
pointCloud._handler = null;
|
|
82
|
+
this._pointClouds.splice(index, 1);
|
|
83
|
+
this.reindexPointCloudArray(index);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
reindexPointCloudArray(startIndex) {
|
|
88
|
+
var pc = this._pointClouds;
|
|
89
|
+
for (var i = startIndex; i < pc.length; i++) {
|
|
90
|
+
pc[i]._handlerIndex = i;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
draw() {
|
|
95
|
+
var i = this._pointClouds.length;
|
|
96
|
+
while (i--) {
|
|
97
|
+
this._pointClouds[i].draw();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
drawPicking() {
|
|
102
|
+
if (this.pickingEnabled) {
|
|
103
|
+
var i = this._pointClouds.length;
|
|
104
|
+
while (i--) {
|
|
105
|
+
this._pointClouds[i].drawPicking();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
clear() {
|
|
111
|
+
var i = this._pointClouds.length;
|
|
112
|
+
while (i--) {
|
|
113
|
+
this._pointClouds[i]._deleteBuffers();
|
|
114
|
+
this._pointClouds[i]._handler = null;
|
|
115
|
+
this._pointClouds[i]._handlerIndex = -1;
|
|
116
|
+
}
|
|
117
|
+
this._pointClouds.length = 0;
|
|
118
|
+
this._pointClouds = [];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { PointCloudHandler };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/entity/Polyline
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
"use strict";
|
|
6
2
|
|
|
7
3
|
import { Extent } from "../Extent.js";
|
|
@@ -96,7 +92,7 @@ class Polyline {
|
|
|
96
92
|
this._pathLengths = [];
|
|
97
93
|
|
|
98
94
|
/**
|
|
99
|
-
* Polyline geodetic degrees
|
|
95
|
+
* Polyline geodetic degrees coordinates.
|
|
100
96
|
* @private
|
|
101
97
|
* @type {Array.<LonLat>}
|
|
102
98
|
*/
|
|
@@ -1763,7 +1759,9 @@ class Polyline {
|
|
|
1763
1759
|
this._createData3v([].concat(this._path3v));
|
|
1764
1760
|
}
|
|
1765
1761
|
this._refresh();
|
|
1766
|
-
|
|
1762
|
+
if (renderNode.renderer.isInitialized()) {
|
|
1763
|
+
this._update();
|
|
1764
|
+
}
|
|
1767
1765
|
}
|
|
1768
1766
|
}
|
|
1769
1767
|
|