@openglobus/og 0.18.0 → 0.18.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/README.md +8 -8
- package/lib/@openglobus/og.esm.js +2 -0
- package/lib/@openglobus/og.esm.js.map +1 -0
- package/lib/@openglobus/og.umd.js +2 -0
- package/lib/@openglobus/og.umd.js.map +1 -0
- package/lib/js/Clock.d.ts +106 -0
- package/{src/Clock.ts → lib/js/Clock.js} +31 -126
- package/lib/js/Deferred.d.ts +6 -0
- package/lib/js/Deferred.js +13 -0
- package/lib/js/Events.d.ts +90 -0
- package/{src/Events.ts → lib/js/Events.js} +29 -84
- package/lib/js/Extent.d.ts +145 -0
- package/{src/Extent.ts → lib/js/Extent.js} +74 -120
- package/lib/js/Globe.d.ts +132 -0
- package/{src/Globe.ts → lib/js/Globe.js} +61 -159
- package/lib/js/ImageCanvas.d.ts +128 -0
- package/{src/ImageCanvas.ts → lib/js/ImageCanvas.js} +24 -65
- package/lib/js/Lock.d.ts +15 -0
- package/{src/Lock.ts → lib/js/Lock.js} +7 -21
- package/lib/js/LonLat.d.ts +128 -0
- package/{src/LonLat.ts → lib/js/LonLat.js} +44 -75
- package/lib/js/Object3d.d.ts +49 -0
- package/{src/Object3d.ts → lib/js/Object3d.js} +64 -184
- package/lib/js/Popup.d.ts +46 -0
- package/{src/Popup.ts → lib/js/Popup.js} +42 -110
- package/lib/js/QueueArray.d.ts +16 -0
- package/{src/QueueArray.ts → lib/js/QueueArray.js} +12 -25
- package/lib/js/Rectangle.d.ts +76 -0
- package/{src/Rectangle.ts → lib/js/Rectangle.js} +12 -50
- package/lib/js/Stack.d.ts +20 -0
- package/{src/Stack.ts → lib/js/Stack.js} +13 -29
- package/lib/js/astro/astro.d.ts +39 -0
- package/{src/astro/astro.ts → lib/js/astro/astro.js} +2 -8
- package/lib/js/astro/earth.d.ts +8 -0
- package/{src/astro/earth.ts → lib/js/astro/earth.js} +3 -39
- package/lib/js/astro/jd.d.ts +234 -0
- package/{src/astro/jd.ts → lib/js/astro/jd.js} +55 -134
- package/lib/js/astro/orbit.d.ts +5 -0
- package/{src/astro/orbit.ts → lib/js/astro/orbit.js} +26 -39
- package/lib/js/astro/rotation.d.ts +2 -0
- package/{src/astro/rotation.ts → lib/js/astro/rotation.js} +2 -11
- package/lib/js/bv/Box.d.ts +32 -0
- package/{src/bv/Box.ts → lib/js/bv/Box.js} +7 -35
- package/lib/js/bv/Sphere.d.ts +37 -0
- package/{src/bv/Sphere.ts → lib/js/bv/Sphere.js} +6 -34
- package/{src/bv/index.ts → lib/js/bv/index.d.ts} +0 -1
- package/lib/js/bv/index.js +3 -0
- package/lib/js/camera/Camera.d.ts +314 -0
- package/{src/camera/Camera.ts → lib/js/camera/Camera.js} +77 -326
- package/lib/js/camera/Frustum.d.ts +139 -0
- package/{src/camera/Frustum.ts → lib/js/camera/Frustum.js} +66 -185
- package/lib/js/camera/PlanetCamera.d.ts +234 -0
- package/{src/camera/PlanetCamera.ts → lib/js/camera/PlanetCamera.js} +65 -338
- package/{src/camera/index.ts → lib/js/camera/index.d.ts} +0 -1
- package/lib/js/camera/index.js +3 -0
- package/lib/js/cons.d.ts +40 -0
- package/{src/cons.ts → lib/js/cons.js} +10 -22
- package/lib/js/control/Atmosphere.d.ts +16 -0
- package/{src/control/Atmosphere.ts → lib/js/control/Atmosphere.js} +33 -86
- package/lib/js/control/CompassButton.d.ts +16 -0
- package/{src/control/CompassButton.ts → lib/js/control/CompassButton.js} +18 -43
- package/lib/js/control/Control.d.ts +100 -0
- package/{src/control/Control.ts → lib/js/control/Control.js} +22 -89
- package/lib/js/control/DebugInfo.d.ts +25 -0
- package/{src/control/DebugInfo.ts → lib/js/control/DebugInfo.js} +38 -84
- package/lib/js/control/DrawingSwitcher.d.ts +13 -0
- package/{src/control/DrawingSwitcher.ts → lib/js/control/DrawingSwitcher.js} +13 -30
- package/lib/js/control/EarthCoordinates.d.ts +41 -0
- package/{src/control/EarthCoordinates.ts → lib/js/control/EarthCoordinates.js} +58 -119
- package/lib/js/control/EarthNavigation.d.ts +50 -0
- package/{src/control/EarthNavigation.ts → lib/js/control/EarthNavigation.js} +70 -161
- package/lib/js/control/GeoImageDragControl.d.ts +22 -0
- package/{src/control/GeoImageDragControl.ts → lib/js/control/GeoImageDragControl.js} +26 -49
- package/lib/js/control/KeyboardNavigation.d.ts +28 -0
- package/{src/control/KeyboardNavigation.ts → lib/js/control/KeyboardNavigation.js} +67 -92
- package/lib/js/control/LayerAnimation.d.ts +71 -0
- package/{src/control/LayerAnimation.ts → lib/js/control/LayerAnimation.js} +82 -162
- package/lib/js/control/LayerSwitcher.d.ts +21 -0
- package/{src/control/LayerSwitcher.ts → lib/js/control/LayerSwitcher.js} +16 -41
- package/lib/js/control/Lighting.d.ts +49 -0
- package/{src/control/Lighting.ts → lib/js/control/Lighting.js} +106 -219
- package/lib/js/control/MouseNavigation.d.ts +62 -0
- package/{src/control/MouseNavigation.ts → lib/js/control/MouseNavigation.js} +105 -211
- package/lib/js/control/MouseWheelZoomControl.d.ts +44 -0
- package/lib/js/control/MouseWheelZoomControl.js +181 -0
- package/lib/js/control/RulerSwitcher.d.ts +17 -0
- package/{src/control/RulerSwitcher.ts → lib/js/control/RulerSwitcher.js} +13 -28
- package/lib/js/control/ScaleControl.d.ts +24 -0
- package/lib/js/control/ScaleControl.js +91 -0
- package/lib/js/control/SegmentBoundVisualization.d.ts +12 -0
- package/lib/js/control/SegmentBoundVisualization.js +37 -0
- package/lib/js/control/ShowFps.d.ts +9 -0
- package/lib/js/control/ShowFps.js +20 -0
- package/lib/js/control/SimpleNavigation.d.ts +25 -0
- package/{src/control/SimpleNavigation.ts → lib/js/control/SimpleNavigation.js} +29 -51
- package/lib/js/control/SimpleSkyBackground.d.ts +15 -0
- package/{src/control/SimpleSkyBackground.ts → lib/js/control/SimpleSkyBackground.js} +21 -48
- package/lib/js/control/Sun.d.ts +33 -0
- package/{src/control/Sun.ts → lib/js/control/Sun.js} +34 -85
- package/lib/js/control/ToggleWireframe.d.ts +14 -0
- package/lib/js/control/ToggleWireframe.js +28 -0
- package/lib/js/control/TouchNavigation.d.ts +52 -0
- package/{src/control/TouchNavigation.ts → lib/js/control/TouchNavigation.js} +88 -193
- package/lib/js/control/ZoomControl.d.ts +27 -0
- package/{src/control/ZoomControl.ts → lib/js/control/ZoomControl.js} +25 -50
- package/lib/js/control/drawing/DrawingControl.d.ts +12 -0
- package/{src/control/drawing/DrawingControl.ts → lib/js/control/drawing/DrawingControl.js} +10 -20
- package/lib/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
- package/{src/control/drawing/LineStringDrawingScene.ts → lib/js/control/drawing/LineStringDrawingScene.js} +28 -85
- package/lib/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
- package/{src/control/drawing/PolygonDrawingScene.ts → lib/js/control/drawing/PolygonDrawingScene.js} +190 -388
- package/lib/js/control/elevationProfile/ElevationProfile.d.ts +61 -0
- package/{src/control/elevationProfile/ElevationProfile.ts → lib/js/control/elevationProfile/ElevationProfile.js} +56 -148
- package/lib/js/control/heightRuler/HeightRuler.d.ts +7 -0
- package/{src/control/heightRuler/HeightRuler.ts → lib/js/control/heightRuler/HeightRuler.js} +4 -9
- package/lib/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
- package/{src/control/heightRuler/HeightRulerScene.ts → lib/js/control/heightRuler/HeightRulerScene.js} +47 -99
- package/lib/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
- package/{src/control/heightRuler/HeightRulerSwitcher.ts → lib/js/control/heightRuler/HeightRulerSwitcher.js} +2 -4
- package/{src/control/index.ts → lib/js/control/index.d.ts} +1 -18
- package/lib/js/control/index.js +28 -0
- package/lib/js/control/ruler/Ruler.d.ts +13 -0
- package/lib/js/control/ruler/Ruler.js +23 -0
- package/lib/js/control/ruler/RulerScene.d.ts +88 -0
- package/lib/js/control/ruler/RulerScene.js +324 -0
- package/lib/js/control/selection/Selection.d.ts +55 -0
- package/{src/control/selection/Selection.ts → lib/js/control/selection/Selection.js} +15 -34
- package/lib/js/control/selection/SelectionScene.d.ts +44 -0
- package/{src/control/selection/SelectionScene.ts → lib/js/control/selection/SelectionScene.js} +26 -113
- package/lib/js/control/timeline/TimelineControl.d.ts +18 -0
- package/{src/control/timeline/TimelineControl.ts → lib/js/control/timeline/TimelineControl.js} +13 -43
- package/lib/js/control/timeline/TimelineModel.d.ts +41 -0
- package/{src/control/timeline/TimelineModel.ts → lib/js/control/timeline/TimelineModel.js} +26 -74
- package/lib/js/control/timeline/TimelineView.d.ts +85 -0
- package/{src/control/timeline/TimelineView.ts → lib/js/control/timeline/TimelineView.js} +133 -281
- package/lib/js/control/timeline/timelineUtils.d.ts +12 -0
- package/lib/js/control/timeline/timelineUtils.js +112 -0
- package/lib/js/control/visibleExtent/Segment.d.ts +277 -0
- package/{src → lib/js}/control/visibleExtent/Segment.js +145 -698
- package/lib/js/control/visibleExtent/VisibleExtent.d.ts +5 -0
- package/{src → lib/js}/control/visibleExtent/VisibleExtent.js +1 -18
- package/lib/js/control/visibleExtent/drawnode.d.ts +7 -0
- package/{src/control/visibleExtent/drawnode.ts → lib/js/control/visibleExtent/drawnode.js} +1 -28
- package/lib/js/ellipsoid/Ellipsoid.d.ts +187 -0
- package/{src/ellipsoid/Ellipsoid.ts → lib/js/ellipsoid/Ellipsoid.js} +82 -267
- package/lib/js/ellipsoid/index.d.ts +3 -0
- package/lib/js/ellipsoid/index.js +3 -0
- package/lib/js/ellipsoid/wgs84.d.ts +6 -0
- package/{src/ellipsoid/wgs84.ts → lib/js/ellipsoid/wgs84.js} +1 -2
- package/lib/js/entity/BaseBillboard.d.ts +222 -0
- package/{src/entity/BaseBillboard.ts → lib/js/entity/BaseBillboard.js} +48 -165
- package/lib/js/entity/BaseBillboardHandler.d.ts +81 -0
- package/{src/entity/BaseBillboardHandler.ts → lib/js/entity/BaseBillboardHandler.js} +139 -365
- package/lib/js/entity/Billboard.d.ts +113 -0
- package/{src/entity/Billboard.ts → lib/js/entity/Billboard.js} +19 -83
- package/lib/js/entity/BillboardHandler.d.ts +15 -0
- package/{src/entity/BillboardHandler.ts → lib/js/entity/BillboardHandler.js} +27 -59
- package/lib/js/entity/Entity.d.ts +354 -0
- package/{src/entity/Entity.ts → lib/js/entity/Entity.js} +101 -373
- package/lib/js/entity/EntityCollection.d.ts +364 -0
- package/{src/entity/EntityCollection.ts → lib/js/entity/EntityCollection.js} +51 -353
- package/lib/js/entity/GeoObject.d.ts +138 -0
- package/{src/entity/GeoObject.ts → lib/js/entity/GeoObject.js} +41 -146
- package/lib/js/entity/GeoObjectHandler.d.ts +99 -0
- package/{src/entity/GeoObjectHandler.ts → lib/js/entity/GeoObjectHandler.js} +162 -423
- package/lib/js/entity/Geometry.d.ts +111 -0
- package/lib/js/entity/Geometry.js +283 -0
- package/lib/js/entity/GeometryHandler.d.ts +84 -0
- package/{src/entity/GeometryHandler.ts → lib/js/entity/GeometryHandler.js} +162 -657
- package/lib/js/entity/Label.d.ts +207 -0
- package/{src/entity/Label.ts → lib/js/entity/Label.js} +62 -164
- package/lib/js/entity/LabelHandler.d.ts +65 -0
- package/{src/entity/LabelHandler.ts → lib/js/entity/LabelHandler.js} +175 -408
- package/lib/js/entity/LabelWorker.d.ts +15 -0
- package/{src/entity/LabelWorker.ts → lib/js/entity/LabelWorker.js} +24 -45
- package/lib/js/entity/PointCloud.d.ts +179 -0
- package/{src/entity/PointCloud.ts → lib/js/entity/PointCloud.js} +65 -265
- package/lib/js/entity/PointCloudHandler.d.ts +42 -0
- package/{src/entity/PointCloudHandler.ts → lib/js/entity/PointCloudHandler.js} +19 -62
- package/lib/js/entity/Polyline.d.ts +337 -0
- package/{src/entity/Polyline.ts → lib/js/entity/Polyline.js} +289 -924
- package/lib/js/entity/PolylineHandler.d.ts +22 -0
- package/{src/entity/PolylineHandler.ts → lib/js/entity/PolylineHandler.js} +12 -37
- package/lib/js/entity/Ray.d.ts +133 -0
- package/{src/entity/Ray.ts → lib/js/entity/Ray.js} +26 -146
- package/lib/js/entity/RayHandler.d.ts +70 -0
- package/{src/entity/RayHandler.ts → lib/js/entity/RayHandler.js} +102 -342
- package/lib/js/entity/Strip.d.ts +127 -0
- package/{src/entity/Strip.ts → lib/js/entity/Strip.js} +102 -372
- package/lib/js/entity/StripHandler.d.ts +42 -0
- package/{src/entity/StripHandler.ts → lib/js/entity/StripHandler.js} +22 -74
- package/{src/entity/index.ts → lib/js/entity/index.d.ts} +1 -2
- package/lib/js/entity/index.js +11 -0
- package/lib/js/index.d.ts +33 -0
- package/lib/js/index.js +33 -0
- package/lib/js/input/KeyboardHandler.d.ts +33 -0
- package/{src/input/KeyboardHandler.ts → lib/js/input/KeyboardHandler.js} +45 -84
- package/lib/js/input/MouseHandler.d.ts +16 -0
- package/{src/input/MouseHandler.ts → lib/js/input/MouseHandler.js} +12 -36
- package/lib/js/input/TouchHandler.d.ts +11 -0
- package/{src/input/TouchHandler.ts → lib/js/input/TouchHandler.js} +11 -23
- package/lib/js/input/input.d.ts +3 -0
- package/{src/input/input.ts → lib/js/input/input.js} +1 -1
- package/lib/js/layer/BaseGeoImage.d.ts +145 -0
- package/{src/layer/BaseGeoImage.ts → lib/js/layer/BaseGeoImage.js} +70 -235
- package/lib/js/layer/CanvasTiles.d.ts +103 -0
- package/{src/layer/CanvasTiles.ts → lib/js/layer/CanvasTiles.js} +54 -146
- package/lib/js/layer/GeoImage.d.ts +61 -0
- package/{src/layer/GeoImage.ts → lib/js/layer/GeoImage.js} +24 -54
- package/lib/js/layer/GeoTexture2d.d.ts +17 -0
- package/lib/js/layer/GeoTexture2d.js +37 -0
- package/lib/js/layer/GeoVideo.d.ts +68 -0
- package/{src/layer/GeoVideo.ts → lib/js/layer/GeoVideo.js} +31 -61
- package/lib/js/layer/KML.d.ts +72 -0
- package/{src/layer/KML.ts → lib/js/layer/KML.js} +94 -138
- package/lib/js/layer/Layer.d.ts +401 -0
- package/{src/layer/Layer.ts → lib/js/layer/Layer.js} +92 -443
- package/lib/js/layer/Material.d.ts +34 -0
- package/{src/layer/Material.ts → lib/js/layer/Material.js} +9 -43
- package/lib/js/layer/Vector.d.ts +244 -0
- package/{src/layer/Vector.ts → lib/js/layer/Vector.js} +147 -418
- package/lib/js/layer/WMS.d.ts +75 -0
- package/{src/layer/WMS.ts → lib/js/layer/WMS.js} +18 -100
- package/lib/js/layer/XYZ.d.ts +149 -0
- package/{src/layer/XYZ.ts → lib/js/layer/XYZ.js} +71 -171
- package/lib/js/layer/index.d.ts +11 -0
- package/lib/js/layer/index.js +11 -0
- package/lib/js/light/LightSource.d.ts +174 -0
- package/{src/light/LightSource.ts → lib/js/light/LightSource.js} +22 -131
- package/lib/js/math/Line2.d.ts +11 -0
- package/{src/math/Line2.ts → lib/js/math/Line2.js} +5 -15
- package/lib/js/math/Line3.d.ts +28 -0
- package/lib/js/math/Line3.js +85 -0
- package/lib/js/math/Mat3.d.ts +77 -0
- package/{src/math/Mat3.ts → lib/js/math/Mat3.js} +22 -51
- package/lib/js/math/Mat4.d.ts +195 -0
- package/{src/math/Mat4.ts → lib/js/math/Mat4.js} +53 -219
- package/lib/js/math/Plane.d.ts +20 -0
- package/{src/math/Plane.ts → lib/js/math/Plane.js} +26 -40
- package/lib/js/math/Quat.d.ts +373 -0
- package/{src/math/Quat.ts → lib/js/math/Quat.js} +106 -319
- package/lib/js/math/Ray.d.ts +76 -0
- package/{src/math/Ray.ts → lib/js/math/Ray.js} +21 -66
- package/lib/js/math/Vec2.d.ts +310 -0
- package/{src/math/Vec2.ts → lib/js/math/Vec2.js} +55 -121
- package/lib/js/math/Vec3.d.ts +472 -0
- package/{src/math/Vec3.ts → lib/js/math/Vec3.js} +103 -236
- package/lib/js/math/Vec4.d.ts +163 -0
- package/{src/math/Vec4.ts → lib/js/math/Vec4.js} +23 -79
- package/lib/js/math/coder.d.ts +51 -0
- package/{src/math/coder.ts → lib/js/math/coder.js} +14 -20
- package/lib/js/math/index.d.ts +11 -0
- package/lib/js/math/index.js +11 -0
- package/lib/js/math.d.ts +266 -0
- package/{src/math.ts → lib/js/math.js} +37 -85
- package/lib/js/mercator.d.ts +92 -0
- package/{src/mercator.ts → lib/js/mercator.js} +13 -37
- package/lib/js/proj/EPSG3857.d.ts +9 -0
- package/{src/proj/EPSG3857.ts → lib/js/proj/EPSG3857.js} +0 -2
- package/lib/js/proj/EPSG4326.d.ts +9 -0
- package/{src/proj/EPSG4326.ts → lib/js/proj/EPSG4326.js} +0 -2
- package/lib/js/proj/Proj.d.ts +43 -0
- package/{src/proj/Proj.ts → lib/js/proj/Proj.js} +4 -29
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.js +19 -0
- package/lib/js/quadTree/EntityCollectionNode.d.ts +54 -0
- package/{src/quadTree/EntityCollectionNode.ts → lib/js/quadTree/EntityCollectionNode.js} +83 -150
- package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/MarsQuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/Node.d.ts +61 -0
- package/{src/quadTree/Node.ts → lib/js/quadTree/Node.js} +140 -357
- package/lib/js/quadTree/QuadTreeStrategy.d.ts +25 -0
- package/{src/quadTree/QuadTreeStrategy.ts → lib/js/quadTree/QuadTreeStrategy.js} +13 -44
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +15 -0
- package/lib/js/quadTree/index.d.ts +12 -0
- package/lib/js/quadTree/index.js +12 -0
- package/lib/js/quadTree/quadTree.d.ts +40 -0
- package/{src/quadTree/quadTree.ts → lib/js/quadTree/quadTree.js} +0 -9
- package/lib/js/renderer/Renderer.d.ts +311 -0
- package/{src/renderer/Renderer.ts → lib/js/renderer/Renderer.js} +169 -611
- package/lib/js/renderer/RendererEvents.d.ts +237 -0
- package/{src/renderer/RendererEvents.ts → lib/js/renderer/RendererEvents.js} +134 -471
- package/lib/js/scene/Axes.d.ts +12 -0
- package/lib/js/scene/Axes.js +59 -0
- package/lib/js/scene/BaseNode.d.ts +61 -0
- package/{src/scene/BaseNode.ts → lib/js/scene/BaseNode.js} +11 -57
- package/lib/js/scene/Planet.d.ts +623 -0
- package/{src/scene/Planet.ts → lib/js/scene/Planet.js} +251 -935
- package/lib/js/scene/RenderNode.d.ts +150 -0
- package/{src/scene/RenderNode.ts → lib/js/scene/RenderNode.js} +33 -138
- package/lib/js/scene/SkyBox.d.ts +13 -0
- package/{src/scene/SkyBox.ts → lib/js/scene/SkyBox.js} +16 -37
- package/{src/scene/index.ts → lib/js/scene/index.d.ts} +0 -1
- package/lib/js/scene/index.js +5 -0
- package/lib/js/segment/Segment.d.ts +278 -0
- package/{src/segment/Segment.ts → lib/js/segment/Segment.js} +242 -913
- package/lib/js/segment/SegmentLonLat.d.ts +48 -0
- package/{src/segment/SegmentLonLat.ts → lib/js/segment/SegmentLonLat.js} +58 -132
- package/lib/js/segment/SegmentLonLatWgs84.d.ts +10 -0
- package/lib/js/segment/SegmentLonLatWgs84.js +23 -0
- package/lib/js/segment/Slice.d.ts +13 -0
- package/{src/segment/Slice.ts → lib/js/segment/Slice.js} +4 -22
- package/lib/js/segment/segmentHelper.d.ts +18 -0
- package/{src/segment/segmentHelper.ts → lib/js/segment/segmentHelper.js} +30 -88
- package/lib/js/shaders/atmos.d.ts +4 -0
- package/{src/shaders/atmos.ts → lib/js/shaders/atmos.js} +8 -26
- package/lib/js/shaders/billboard.d.ts +3 -0
- package/{src/shaders/billboard.ts → lib/js/shaders/billboard.js} +9 -18
- package/lib/js/shaders/bloom.d.ts +2 -0
- package/{src/shaders/bloom.ts → lib/js/shaders/bloom.js} +5 -8
- package/lib/js/shaders/blur.d.ts +3 -0
- package/{src/shaders/blur.ts → lib/js/shaders/blur.js} +11 -19
- package/lib/js/shaders/depth.d.ts +2 -0
- package/{src/shaders/depth.ts → lib/js/shaders/depth.js} +3 -6
- package/lib/js/shaders/drawnode.d.ts +8 -0
- package/{src/shaders/drawnode.ts → lib/js/shaders/drawnode.js} +23 -75
- package/lib/js/shaders/geoObject.d.ts +3 -0
- package/{src/shaders/geoObject.ts → lib/js/shaders/geoObject.js} +51 -63
- package/lib/js/shaders/label.d.ts +4 -0
- package/{src/shaders/label.ts → lib/js/shaders/label.js} +12 -25
- package/lib/js/shaders/lumFilter.d.ts +2 -0
- package/{src/shaders/lumFilter.ts → lib/js/shaders/lumFilter.js} +4 -7
- package/lib/js/shaders/pickingMask.d.ts +2 -0
- package/{src/shaders/pickingMask.ts → lib/js/shaders/pickingMask.js} +5 -8
- package/lib/js/shaders/pointCloud.d.ts +2 -0
- package/{src/shaders/pointCloud.ts → lib/js/shaders/pointCloud.js} +4 -7
- package/lib/js/shaders/polyline.d.ts +3 -0
- package/{src/shaders/polyline.ts → lib/js/shaders/polyline.js} +7 -22
- package/lib/js/shaders/ray.d.ts +2 -0
- package/{src/shaders/ray.ts → lib/js/shaders/ray.js} +4 -7
- package/lib/js/shaders/screenFrame.d.ts +2 -0
- package/{src/shaders/screenFrame.ts → lib/js/shaders/screenFrame.js} +5 -8
- package/lib/js/shaders/skybox.d.ts +2 -0
- package/{src/shaders/skybox.ts → lib/js/shaders/skybox.js} +10 -13
- package/lib/js/shaders/toneMapping.d.ts +2 -0
- package/{src/shaders/toneMapping.ts → lib/js/shaders/toneMapping.js} +5 -8
- package/lib/js/shaders/utils.d.ts +1 -0
- package/{src/shaders/utils.ts → lib/js/shaders/utils.js} +1 -1
- package/lib/js/terrain/BilTerrain.d.ts +18 -0
- package/{src/terrain/BilTerrain.ts → lib/js/terrain/BilTerrain.js} +21 -118
- package/lib/js/terrain/EmptyTerrain.d.ts +106 -0
- package/{src/terrain/EmptyTerrain.ts → lib/js/terrain/EmptyTerrain.js} +20 -144
- package/lib/js/terrain/Geoid.d.ts +33 -0
- package/lib/js/terrain/Geoid.js +191 -0
- package/lib/js/terrain/GlobusTerrain.d.ts +134 -0
- package/{src/terrain/GlobusTerrain.ts → lib/js/terrain/GlobusTerrain.js} +82 -239
- package/lib/js/terrain/MapboxTerrain.d.ts +21 -0
- package/{src/terrain/MapboxTerrain.ts → lib/js/terrain/MapboxTerrain.js} +46 -215
- package/{src/terrain/index.ts → lib/js/terrain/index.d.ts} +0 -1
- package/lib/js/terrain/index.js +5 -0
- package/lib/js/ui/Button.d.ts +32 -0
- package/lib/js/ui/Button.js +78 -0
- package/lib/js/ui/ButtonGroup.d.ts +16 -0
- package/lib/js/ui/ButtonGroup.js +41 -0
- package/lib/js/ui/Dialog.d.ts +55 -0
- package/lib/js/ui/Dialog.js +173 -0
- package/lib/js/ui/Slider.d.ts +38 -0
- package/lib/js/ui/Slider.js +129 -0
- package/lib/js/ui/ToggleButton.d.ts +20 -0
- package/lib/js/ui/ToggleButton.js +42 -0
- package/lib/js/ui/View.d.ts +37 -0
- package/{src/ui/View.ts → lib/js/ui/View.js} +31 -77
- package/lib/js/ui/icons.d.ts +1 -0
- package/{src/ui/icons.ts → lib/js/ui/icons.js} +1 -1
- package/lib/js/utils/BaseWorker.d.ts +14 -0
- package/{src/utils/BaseWorker.ts → lib/js/utils/BaseWorker.js} +15 -28
- package/lib/js/utils/FontAtlas.d.ts +82 -0
- package/{src/utils/FontAtlas.ts → lib/js/utils/FontAtlas.js} +45 -181
- package/lib/js/utils/GeoImageCreator.d.ts +34 -0
- package/{src/utils/GeoImageCreator.ts → lib/js/utils/GeoImageCreator.js} +34 -91
- package/lib/js/utils/ImagesCacheManager.d.ts +22 -0
- package/{src/utils/ImagesCacheManager.ts → lib/js/utils/ImagesCacheManager.js} +16 -38
- package/lib/js/utils/Loader.d.ts +63 -0
- package/lib/js/utils/Loader.js +156 -0
- package/lib/js/utils/NormalMapCreator.d.ts +52 -0
- package/{src/utils/NormalMapCreator.ts → lib/js/utils/NormalMapCreator.js} +64 -195
- package/lib/js/utils/PlainSegmentWorker.d.ts +24 -0
- package/{src/utils/PlainSegmentWorker.ts → lib/js/utils/PlainSegmentWorker.js} +24 -56
- package/lib/js/utils/TerrainWorker.d.ts +28 -0
- package/{src/utils/TerrainWorker.ts → lib/js/utils/TerrainWorker.js} +19 -56
- package/lib/js/utils/TextureAtlas.d.ts +113 -0
- package/{src/utils/TextureAtlas.ts → lib/js/utils/TextureAtlas.js} +40 -131
- package/lib/js/utils/VectorTileCreator.d.ts +18 -0
- package/{src/utils/VectorTileCreator.ts → lib/js/utils/VectorTileCreator.js} +61 -147
- package/lib/js/utils/colorTable.d.ts +3 -0
- package/{src/utils/colorTable.ts → lib/js/utils/colorTable.js} +2 -2
- package/lib/js/utils/earcut.d.ts +7 -0
- package/{src/utils/earcut.ts → lib/js/utils/earcut.js} +95 -223
- package/lib/js/utils/objParser.d.ts +24 -0
- package/{src/utils/objParser.ts → lib/js/utils/objParser.js} +38 -93
- package/lib/js/utils/shared.d.ts +267 -0
- package/{src/utils/shared.ts → lib/js/utils/shared.js} +184 -341
- package/lib/js/utils/units.d.ts +16 -0
- package/lib/js/utils/units.js +61 -0
- package/lib/js/webgl/BaseFramebuffer.d.ts +53 -0
- package/{src/webgl/BaseFramebuffer.ts → lib/js/webgl/BaseFramebuffer.js} +22 -59
- package/lib/js/webgl/Framebuffer.d.ts +69 -0
- package/{src/webgl/Framebuffer.ts → lib/js/webgl/Framebuffer.js} +30 -87
- package/lib/js/webgl/Handler.d.ts +473 -0
- package/{src/webgl/Handler.ts → lib/js/webgl/Handler.js} +175 -586
- package/lib/js/webgl/Multisample.d.ts +27 -0
- package/lib/js/webgl/Multisample.js +77 -0
- package/lib/js/webgl/Program.d.ts +159 -0
- package/{src/webgl/Program.ts → lib/js/webgl/Program.js} +73 -210
- package/lib/js/webgl/ProgramController.d.ts +86 -0
- package/{src/webgl/ProgramController.ts → lib/js/webgl/ProgramController.js} +11 -45
- package/{src/webgl/index.ts → lib/js/webgl/index.d.ts} +1 -8
- package/lib/js/webgl/index.js +6 -0
- package/lib/js/webgl/types.d.ts +9 -0
- package/{src/webgl/types.ts → lib/js/webgl/types.js} +5 -8
- package/lib/js/webgl/variableHandlers.d.ts +22 -0
- package/lib/js/webgl/variableHandlers.js +78 -0
- package/package.json +23 -34
- package/dist/@openglobus/og.esm.js +0 -2
- package/dist/@openglobus/og.esm.js.map +0 -1
- package/dist/@openglobus/og.umd.js +0 -2
- package/dist/@openglobus/og.umd.js.map +0 -1
- package/src/Deferred.ts +0 -17
- package/src/control/MouseWheelZoomControl.ts +0 -269
- package/src/control/ScaleControl.ts +0 -131
- package/src/control/SegmentBoundVisualization.ts +0 -50
- package/src/control/ShowFps.ts +0 -28
- package/src/control/ToggleWireframe.ts +0 -35
- package/src/control/ruler/Ruler.ts +0 -35
- package/src/control/ruler/RulerScene.ts +0 -437
- package/src/control/timeline/timelineUtils.ts +0 -133
- package/src/ellipsoid/index.ts +0 -4
- package/src/entity/Geometry.ts +0 -486
- package/src/index.ts +0 -173
- package/src/layer/GeoTexture2d.ts +0 -56
- package/src/layer/index.ts +0 -12
- package/src/math/Line3.ts +0 -162
- package/src/math/index.ts +0 -26
- package/src/quadTree/EPSG4326QuadTreeStrategy.ts +0 -24
- package/src/quadTree/EarthQuadTreeStrategy.ts +0 -28
- package/src/quadTree/MarsQuadTreeStrategy.ts +0 -25
- package/src/quadTree/Wgs84QuadTreeStrategy.ts +0 -22
- package/src/quadTree/index.ts +0 -14
- package/src/scene/Axes.ts +0 -78
- package/src/segment/SegmentLonLatWgs84.ts +0 -33
- package/src/terrain/Geoid.ts +0 -273
- package/src/ui/Button.ts +0 -121
- package/src/ui/ButtonGroup.ts +0 -63
- package/src/ui/Dialog.ts +0 -244
- package/src/ui/Slider.ts +0 -188
- package/src/ui/ToggleButton.ts +0 -68
- package/src/utils/Loader.ts +0 -247
- package/src/utils/units.ts +0 -78
- package/src/webgl/Multisample.ts +0 -153
- package/src/webgl/variableHandlers.ts +0 -114
- /package/{dist → lib}/@openglobus/og.css +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.js +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.json +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.cfg +0 -0
- /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.png +0 -0
- /package/{dist → lib}/@openglobus/res/night-4326.png +0 -0
- /package/{dist → lib}/@openglobus/res/night.png +0 -0
- /package/{dist → lib}/@openglobus/res/spec.png +0 -0
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
import * as mercator from "../mercator";
|
|
2
2
|
import * as quadTree from "../quadTree/quadTree";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {NumberArray2, Vec2} from "../math/Vec2";
|
|
8
|
-
import {Node} from "../quadTree/Node";
|
|
9
|
-
import {Vec3} from "../math/Vec3";
|
|
10
|
-
import {Vec4} from "../math/Vec4";
|
|
11
|
-
import {
|
|
12
|
-
CoordinatesType,
|
|
13
|
-
GeometryType,
|
|
14
|
-
Geometry,
|
|
15
|
-
IMultiLineStringCoordinates,
|
|
16
|
-
ILineStringCoordinates,
|
|
17
|
-
IMultiPolygonCoordinates,
|
|
18
|
-
IPolygonCoordinates
|
|
19
|
-
} from "./Geometry";
|
|
20
|
-
|
|
21
|
-
import {earcut, flatten} from "../utils/earcut";
|
|
22
|
-
import {WebGLBufferExt} from "../webgl/Handler";
|
|
23
|
-
|
|
3
|
+
import { doubleToTwoFloatsV2 } from "../math/coder";
|
|
4
|
+
import { Vec2 } from "../math/Vec2";
|
|
5
|
+
import { GeometryType } from "./Geometry";
|
|
6
|
+
import { earcut, flatten } from "../utils/earcut";
|
|
24
7
|
const POLYVERTICES_BUFFER = 0;
|
|
25
8
|
const POLYINDEXES_BUFFER = 1;
|
|
26
9
|
const POLYCOLORS_BUFFER = 2;
|
|
@@ -33,115 +16,46 @@ const LINESTROKES_BUFFER = 8;
|
|
|
33
16
|
const LINESTROKECOLORS_BUFFER = 9;
|
|
34
17
|
const POLYPICKINGCOLORS_BUFFER = 10;
|
|
35
18
|
const LINEPICKINGCOLORS_BUFFER = 11;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let x = v[0],
|
|
39
|
-
y = v[1];
|
|
40
|
-
|
|
19
|
+
function doubleToTwoFloats(v, high, low) {
|
|
20
|
+
let x = v[0], y = v[1];
|
|
41
21
|
if (x >= 0.0) {
|
|
42
22
|
let doubleHigh = Math.floor(x / 65536.0) * 65536.0;
|
|
43
23
|
high.x = Math.fround(doubleHigh);
|
|
44
24
|
low.x = Math.fround(x - doubleHigh);
|
|
45
|
-
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
46
27
|
let doubleHigh = Math.floor(-x / 65536.0) * 65536.0;
|
|
47
28
|
high.x = Math.fround(-doubleHigh);
|
|
48
29
|
low.x = Math.fround(x + doubleHigh);
|
|
49
30
|
}
|
|
50
|
-
|
|
51
31
|
if (y >= 0.0) {
|
|
52
32
|
let doubleHigh = Math.floor(y / 65536.0) * 65536.0;
|
|
53
33
|
high.y = Math.fround(doubleHigh);
|
|
54
34
|
low.y = Math.fround(y - doubleHigh);
|
|
55
|
-
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
56
37
|
let doubleHigh = Math.floor(-y / 65536.0) * 65536.0;
|
|
57
38
|
high.y = Math.fround(-doubleHigh);
|
|
58
39
|
low.y = Math.fround(y + doubleHigh);
|
|
59
40
|
}
|
|
60
41
|
}
|
|
61
|
-
|
|
62
|
-
let tempHigh = new Vec2(),
|
|
63
|
-
tempLow = new Vec2(),
|
|
64
|
-
tempHighLow = new Vec2();
|
|
65
|
-
|
|
42
|
+
let tempHigh = new Vec2(), tempLow = new Vec2(), tempHighLow = new Vec2();
|
|
66
43
|
class GeometryHandler {
|
|
67
|
-
|
|
68
|
-
static __counter__: number = 0;
|
|
69
|
-
|
|
70
|
-
protected __id: number;
|
|
71
|
-
|
|
72
|
-
protected _layer: Vector;
|
|
73
|
-
|
|
74
|
-
protected _handler: Handler | null;
|
|
75
|
-
|
|
76
|
-
protected _geometries: Geometry[];
|
|
77
|
-
|
|
78
|
-
protected _updatedGeometryArr: Geometry[];
|
|
79
|
-
protected _updatedGeometry: Record<number, boolean>;
|
|
80
|
-
|
|
81
|
-
protected _removeGeometryExtentArr: Extent[];
|
|
82
|
-
protected _removeGeometryExtents: Record<number, boolean>;
|
|
83
|
-
|
|
84
|
-
// Polygon arrays
|
|
85
|
-
protected _polyVerticesHighMerc: number[];
|
|
86
|
-
protected _polyVerticesLowMerc: number[];
|
|
87
|
-
protected _polyColors: number[];
|
|
88
|
-
protected _polyPickingColors: number[];
|
|
89
|
-
protected _polyIndexes: number[];
|
|
90
|
-
|
|
91
|
-
// Line arrays
|
|
92
|
-
protected _lineVerticesHighMerc: number[];
|
|
93
|
-
protected _lineVerticesLowMerc: number[];
|
|
94
|
-
protected _lineOrders: number[];
|
|
95
|
-
protected _lineIndexes: number[];
|
|
96
|
-
protected _lineColors: number[];
|
|
97
|
-
protected _linePickingColors: number[];
|
|
98
|
-
protected _lineThickness: number[];
|
|
99
|
-
protected _lineStrokes: number[];
|
|
100
|
-
protected _lineStrokeColors: number[];
|
|
101
|
-
|
|
102
|
-
// Buffers
|
|
103
|
-
public _polyVerticesHighBufferMerc: WebGLBufferExt | null;
|
|
104
|
-
public _polyVerticesLowBufferMerc: WebGLBufferExt | null;
|
|
105
|
-
public _polyColorsBuffer: WebGLBufferExt | null;
|
|
106
|
-
public _polyPickingColorsBuffer: WebGLBufferExt | null;
|
|
107
|
-
public _polyIndexesBuffer: WebGLBufferExt | null;
|
|
108
|
-
|
|
109
|
-
public _lineVerticesHighBufferMerc: WebGLBufferExt | null;
|
|
110
|
-
public _lineVerticesLowBufferMerc: WebGLBufferExt | null;
|
|
111
|
-
public _lineColorsBuffer: WebGLBufferExt | null;
|
|
112
|
-
public _linePickingColorsBuffer: WebGLBufferExt | null;
|
|
113
|
-
public _lineThicknessBuffer: WebGLBufferExt | null;
|
|
114
|
-
public _lineStrokesBuffer: WebGLBufferExt | null;
|
|
115
|
-
public _lineStrokeColorsBuffer: WebGLBufferExt | null;
|
|
116
|
-
public _lineOrdersBuffer: WebGLBufferExt | null;
|
|
117
|
-
public _lineIndexesBuffer: WebGLBufferExt | null;
|
|
118
|
-
|
|
119
|
-
protected _buffersUpdateCallbacks: Function[];
|
|
120
|
-
|
|
121
|
-
protected _changedBuffers: boolean[];
|
|
122
|
-
|
|
123
|
-
constructor(layer: Vector) {
|
|
44
|
+
constructor(layer) {
|
|
124
45
|
this.__id = GeometryHandler.__counter__++;
|
|
125
|
-
|
|
126
46
|
this._layer = layer;
|
|
127
|
-
|
|
128
47
|
this._handler = null;
|
|
129
|
-
|
|
130
48
|
this._geometries = [];
|
|
131
|
-
|
|
132
49
|
this._updatedGeometryArr = [];
|
|
133
50
|
this._updatedGeometry = {};
|
|
134
|
-
|
|
135
51
|
this._removeGeometryExtentArr = [];
|
|
136
52
|
this._removeGeometryExtents = {};
|
|
137
|
-
|
|
138
53
|
// Polygon arrays
|
|
139
54
|
this._polyVerticesHighMerc = [];
|
|
140
55
|
this._polyVerticesLowMerc = [];
|
|
141
56
|
this._polyColors = [];
|
|
142
57
|
this._polyPickingColors = [];
|
|
143
58
|
this._polyIndexes = [];
|
|
144
|
-
|
|
145
59
|
// Line arrays
|
|
146
60
|
this._lineVerticesHighMerc = [];
|
|
147
61
|
this._lineVerticesLowMerc = [];
|
|
@@ -152,14 +66,12 @@ class GeometryHandler {
|
|
|
152
66
|
this._lineThickness = [];
|
|
153
67
|
this._lineStrokes = [];
|
|
154
68
|
this._lineStrokeColors = [];
|
|
155
|
-
|
|
156
69
|
// Buffers
|
|
157
70
|
this._polyVerticesHighBufferMerc = null;
|
|
158
71
|
this._polyVerticesLowBufferMerc = null;
|
|
159
72
|
this._polyColorsBuffer = null;
|
|
160
73
|
this._polyPickingColorsBuffer = null;
|
|
161
74
|
this._polyIndexesBuffer = null;
|
|
162
|
-
|
|
163
75
|
this._lineVerticesHighBufferMerc = null;
|
|
164
76
|
this._lineVerticesLowBufferMerc = null;
|
|
165
77
|
this._lineColorsBuffer = null;
|
|
@@ -169,7 +81,6 @@ class GeometryHandler {
|
|
|
169
81
|
this._lineStrokeColorsBuffer = null;
|
|
170
82
|
this._lineOrdersBuffer = null;
|
|
171
83
|
this._lineIndexesBuffer = null;
|
|
172
|
-
|
|
173
84
|
this._buffersUpdateCallbacks = [];
|
|
174
85
|
this._buffersUpdateCallbacks[POLYVERTICES_BUFFER] = this.createPolyVerticesBuffer;
|
|
175
86
|
this._buffersUpdateCallbacks[POLYINDEXES_BUFFER] = this.createPolyIndexesBuffer;
|
|
@@ -183,370 +94,173 @@ class GeometryHandler {
|
|
|
183
94
|
this._buffersUpdateCallbacks[LINESTROKECOLORS_BUFFER] = this.createLineStrokeColorsBuffer;
|
|
184
95
|
this._buffersUpdateCallbacks[POLYPICKINGCOLORS_BUFFER] = this.createPolyPickingColorsBuffer;
|
|
185
96
|
this._buffersUpdateCallbacks[LINEPICKINGCOLORS_BUFFER] = this.createLinePickingColorsBuffer;
|
|
186
|
-
|
|
187
97
|
this._changedBuffers = new Array(this._buffersUpdateCallbacks.length);
|
|
188
98
|
}
|
|
189
|
-
|
|
190
|
-
static appendLineData(
|
|
191
|
-
pathArr: CoordinatesType[][],
|
|
192
|
-
isClosed: boolean,
|
|
193
|
-
color: Vec4,
|
|
194
|
-
pickingColor: Vec3,
|
|
195
|
-
thickness: number,
|
|
196
|
-
strokeColor: Vec4,
|
|
197
|
-
strokeSize: number,
|
|
198
|
-
outVerticesHigh: number[],
|
|
199
|
-
outVerticesLow: number[],
|
|
200
|
-
outOrders: number[],
|
|
201
|
-
outIndexes: number[],
|
|
202
|
-
outColors: number[],
|
|
203
|
-
outPickingColors: number[],
|
|
204
|
-
outThickness: number[],
|
|
205
|
-
outStrokeColors: number[],
|
|
206
|
-
outStrokes: number[],
|
|
207
|
-
outVerticesHigh2: number[],
|
|
208
|
-
outVerticesLow2: number[]
|
|
209
|
-
) {
|
|
99
|
+
static appendLineData(pathArr, isClosed, color, pickingColor, thickness, strokeColor, strokeSize, outVerticesHigh, outVerticesLow, outOrders, outIndexes, outColors, outPickingColors, outThickness, outStrokeColors, outStrokes, outVerticesHigh2, outVerticesLow2) {
|
|
210
100
|
var index = 0;
|
|
211
|
-
|
|
212
101
|
if (outIndexes.length > 0) {
|
|
213
102
|
index = outIndexes[outIndexes.length - 5] + 9;
|
|
214
103
|
outIndexes.push(index, index);
|
|
215
|
-
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
216
106
|
outIndexes.push(0, 0);
|
|
217
107
|
}
|
|
218
|
-
|
|
219
|
-
var t = thickness,
|
|
220
|
-
c = [color.x, color.y, color.z, color.w],
|
|
221
|
-
s = strokeSize,
|
|
222
|
-
sc = [strokeColor.x, strokeColor.y, strokeColor.z, strokeColor.w],
|
|
223
|
-
p = [pickingColor.x, pickingColor.y, pickingColor.z, 1.0];
|
|
224
|
-
|
|
108
|
+
var t = thickness, c = [color.x, color.y, color.z, color.w], s = strokeSize, sc = [strokeColor.x, strokeColor.y, strokeColor.z, strokeColor.w], p = [pickingColor.x, pickingColor.y, pickingColor.z, 1.0];
|
|
225
109
|
for (let j = 0; j < pathArr.length; j++) {
|
|
226
110
|
var path = pathArr[j];
|
|
227
|
-
|
|
228
111
|
if (path.length === 0) {
|
|
229
112
|
continue;
|
|
230
113
|
}
|
|
231
|
-
|
|
232
114
|
let startIndex = index;
|
|
233
|
-
let last
|
|
115
|
+
let last;
|
|
234
116
|
if (isClosed) {
|
|
235
117
|
last = path[path.length - 1];
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
let p0 = path[0], p1 = path[1];
|
|
240
121
|
if (!p1) {
|
|
241
122
|
p1 = p0;
|
|
242
123
|
}
|
|
243
|
-
|
|
244
124
|
last = [p0[0] + p0[0] - p1[0], p0[1] + p0[1] - p1[1]];
|
|
245
125
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
tempHigh.x, tempHigh.y,
|
|
252
|
-
tempHigh.x, tempHigh.y,
|
|
253
|
-
tempHigh.x, tempHigh.y
|
|
254
|
-
);
|
|
255
|
-
outVerticesLow.push(
|
|
256
|
-
tempLow.x, tempLow.y,
|
|
257
|
-
tempLow.x, tempLow.y,
|
|
258
|
-
tempLow.x, tempLow.y,
|
|
259
|
-
tempLow.x, tempLow.y
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
outVerticesHigh2.push(
|
|
263
|
-
tempHigh.x, tempHigh.y,
|
|
264
|
-
tempHigh.x, tempHigh.y,
|
|
265
|
-
tempHigh.x, tempHigh.y,
|
|
266
|
-
tempHigh.x, tempHigh.y
|
|
267
|
-
);
|
|
268
|
-
outVerticesLow2.push(
|
|
269
|
-
tempLow.x, tempLow.y,
|
|
270
|
-
tempLow.x, tempLow.y,
|
|
271
|
-
tempLow.x, tempLow.y,
|
|
272
|
-
tempLow.x, tempLow.y
|
|
273
|
-
);
|
|
274
|
-
|
|
126
|
+
doubleToTwoFloats(last, tempHigh, tempLow);
|
|
127
|
+
outVerticesHigh.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
128
|
+
outVerticesLow.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
129
|
+
outVerticesHigh2.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
130
|
+
outVerticesLow2.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
275
131
|
outOrders.push(1, -1, 2, -2);
|
|
276
|
-
|
|
277
132
|
outThickness.push(t, t, t, t);
|
|
278
133
|
outStrokes.push(s, s, s, s);
|
|
279
|
-
outColors.push(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
c[0], c[1], c[2], c[3],
|
|
283
|
-
c[0], c[1], c[2], c[3]
|
|
284
|
-
);
|
|
285
|
-
outStrokeColors.push(
|
|
286
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
287
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
288
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
289
|
-
sc[0], sc[1], sc[2], sc[3]
|
|
290
|
-
);
|
|
291
|
-
outPickingColors.push(
|
|
292
|
-
p[0], p[1], p[2], p[3],
|
|
293
|
-
p[0], p[1], p[2], p[3],
|
|
294
|
-
p[0], p[1], p[2], p[3],
|
|
295
|
-
p[0], p[1], p[2], p[3]
|
|
296
|
-
);
|
|
297
|
-
|
|
134
|
+
outColors.push(c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3]);
|
|
135
|
+
outStrokeColors.push(sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3]);
|
|
136
|
+
outPickingColors.push(p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3]);
|
|
298
137
|
for (let i = 0; i < path.length; i++) {
|
|
299
138
|
let cur = path[i];
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
tempHigh.x, tempHigh.y,
|
|
306
|
-
tempHigh.x, tempHigh.y,
|
|
307
|
-
tempHigh.x, tempHigh.y
|
|
308
|
-
);
|
|
309
|
-
outVerticesLow.push(
|
|
310
|
-
tempLow.x, tempLow.y,
|
|
311
|
-
tempLow.x, tempLow.y,
|
|
312
|
-
tempLow.x, tempLow.y,
|
|
313
|
-
tempLow.x, tempLow.y
|
|
314
|
-
);
|
|
315
|
-
|
|
316
|
-
outVerticesHigh2.push(
|
|
317
|
-
tempHigh.x, tempHigh.y,
|
|
318
|
-
tempHigh.x, tempHigh.y,
|
|
319
|
-
tempHigh.x, tempHigh.y,
|
|
320
|
-
tempHigh.x, tempHigh.y
|
|
321
|
-
);
|
|
322
|
-
outVerticesLow2.push(
|
|
323
|
-
tempLow.x, tempLow.y,
|
|
324
|
-
tempLow.x, tempLow.y,
|
|
325
|
-
tempLow.x, tempLow.y,
|
|
326
|
-
tempLow.x, tempLow.y
|
|
327
|
-
);
|
|
328
|
-
|
|
139
|
+
doubleToTwoFloats(cur, tempHigh, tempLow);
|
|
140
|
+
outVerticesHigh.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
141
|
+
outVerticesLow.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
142
|
+
outVerticesHigh2.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
143
|
+
outVerticesLow2.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
329
144
|
outOrders.push(1, -1, 2, -2);
|
|
330
145
|
outThickness.push(t, t, t, t);
|
|
331
146
|
outStrokes.push(s, s, s, s);
|
|
332
|
-
outColors.push(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
c[0], c[1], c[2], c[3],
|
|
336
|
-
c[0], c[1], c[2], c[3]
|
|
337
|
-
);
|
|
338
|
-
outStrokeColors.push(
|
|
339
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
340
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
341
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
342
|
-
sc[0], sc[1], sc[2], sc[3]
|
|
343
|
-
);
|
|
344
|
-
outPickingColors.push(
|
|
345
|
-
p[0], p[1], p[2], p[3],
|
|
346
|
-
p[0], p[1], p[2], p[3],
|
|
347
|
-
p[0], p[1], p[2], p[3],
|
|
348
|
-
p[0], p[1], p[2], p[3]
|
|
349
|
-
);
|
|
147
|
+
outColors.push(c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3]);
|
|
148
|
+
outStrokeColors.push(sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3]);
|
|
149
|
+
outPickingColors.push(p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3]);
|
|
350
150
|
outIndexes.push(index++, index++, index++, index++);
|
|
351
151
|
}
|
|
352
|
-
|
|
353
|
-
let first: CoordinatesType;
|
|
152
|
+
let first;
|
|
354
153
|
if (isClosed) {
|
|
355
154
|
first = path[0];
|
|
356
155
|
outIndexes.push(startIndex, startIndex + 1, startIndex + 1, startIndex + 1);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
let p0 = path[path.length - 1], p1 = path[path.length - 2];
|
|
361
159
|
if (!p1) {
|
|
362
160
|
p1 = p0;
|
|
363
161
|
}
|
|
364
|
-
|
|
365
162
|
first = [p0[0] + p0[0] - p1[0], p0[1] + p0[1] - p1[1]];
|
|
366
163
|
outIndexes.push(index - 1, index - 1, index - 1, index - 1);
|
|
367
164
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
tempHigh.x, tempHigh.y,
|
|
374
|
-
tempHigh.x, tempHigh.y,
|
|
375
|
-
tempHigh.x, tempHigh.y
|
|
376
|
-
);
|
|
377
|
-
outVerticesLow.push(
|
|
378
|
-
tempLow.x, tempLow.y,
|
|
379
|
-
tempLow.x, tempLow.y,
|
|
380
|
-
tempLow.x, tempLow.y,
|
|
381
|
-
tempLow.x, tempLow.y
|
|
382
|
-
);
|
|
383
|
-
|
|
384
|
-
outVerticesHigh2.push(
|
|
385
|
-
tempHigh.x, tempHigh.y,
|
|
386
|
-
tempHigh.x, tempHigh.y,
|
|
387
|
-
tempHigh.x, tempHigh.y,
|
|
388
|
-
tempHigh.x, tempHigh.y
|
|
389
|
-
);
|
|
390
|
-
outVerticesLow2.push(
|
|
391
|
-
tempLow.x, tempLow.y,
|
|
392
|
-
tempLow.x, tempLow.y,
|
|
393
|
-
tempLow.x, tempLow.y,
|
|
394
|
-
tempLow.x, tempLow.y
|
|
395
|
-
);
|
|
396
|
-
|
|
165
|
+
doubleToTwoFloats(first, tempHigh, tempLow);
|
|
166
|
+
outVerticesHigh.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
167
|
+
outVerticesLow.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
168
|
+
outVerticesHigh2.push(tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y, tempHigh.x, tempHigh.y);
|
|
169
|
+
outVerticesLow2.push(tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y, tempLow.x, tempLow.y);
|
|
397
170
|
outOrders.push(1, -1, 2, -2);
|
|
398
171
|
outThickness.push(t, t, t, t);
|
|
399
172
|
outStrokes.push(s, s, s, s);
|
|
400
|
-
outColors.push(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
c[0], c[1], c[2], c[3],
|
|
404
|
-
c[0], c[1], c[2], c[3]
|
|
405
|
-
);
|
|
406
|
-
outStrokeColors.push(
|
|
407
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
408
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
409
|
-
sc[0], sc[1], sc[2], sc[3],
|
|
410
|
-
sc[0], sc[1], sc[2], sc[3]
|
|
411
|
-
);
|
|
412
|
-
outPickingColors.push(
|
|
413
|
-
p[0], p[1], p[2], p[3],
|
|
414
|
-
p[0], p[1], p[2], p[3],
|
|
415
|
-
p[0], p[1], p[2], p[3],
|
|
416
|
-
p[0], p[1], p[2], p[3]
|
|
417
|
-
);
|
|
418
|
-
|
|
173
|
+
outColors.push(c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3], c[0], c[1], c[2], c[3]);
|
|
174
|
+
outStrokeColors.push(sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3], sc[0], sc[1], sc[2], sc[3]);
|
|
175
|
+
outPickingColors.push(p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3], p[0], p[1], p[2], p[3]);
|
|
419
176
|
if (j < pathArr.length - 1) {
|
|
420
177
|
index += 8;
|
|
421
178
|
outIndexes.push(index, index);
|
|
422
179
|
}
|
|
423
180
|
}
|
|
424
181
|
}
|
|
425
|
-
|
|
426
|
-
public assignHandler(handler: Handler) {
|
|
182
|
+
assignHandler(handler) {
|
|
427
183
|
this._handler = handler;
|
|
428
184
|
this.refresh();
|
|
429
185
|
if (handler.isInitialized()) {
|
|
430
186
|
this.update();
|
|
431
187
|
}
|
|
432
188
|
}
|
|
433
|
-
|
|
434
189
|
/**
|
|
435
190
|
* @public
|
|
436
191
|
* @param {Geometry} geometry - Geometry object.
|
|
437
192
|
*/
|
|
438
|
-
|
|
193
|
+
add(geometry) {
|
|
439
194
|
//
|
|
440
195
|
// Triangulates polygon and sets geometry data.
|
|
441
196
|
if (geometry._handlerIndex === -1) {
|
|
442
197
|
geometry._handler = this;
|
|
443
198
|
geometry._handlerIndex = this._geometries.length;
|
|
444
|
-
|
|
445
199
|
this._geometries.push(geometry);
|
|
446
|
-
|
|
447
|
-
let pickingColor = geometry._entity!._pickingColor.scaleTo(1 / 255);
|
|
448
|
-
|
|
200
|
+
let pickingColor = geometry._entity._pickingColor.scaleTo(1 / 255);
|
|
449
201
|
geometry._polyVerticesHighMerc = [];
|
|
450
202
|
geometry._polyVerticesLowMerc = [];
|
|
451
203
|
geometry._lineVerticesHighMerc = [];
|
|
452
204
|
geometry._lineVerticesLowMerc = [];
|
|
453
|
-
|
|
454
|
-
if ((geometry._coordinates as IPolygonCoordinates)[0].length) {
|
|
205
|
+
if (geometry._coordinates[0].length) {
|
|
455
206
|
if (geometry.type === GeometryType.POLYGON) {
|
|
456
|
-
let coordinates = geometry._coordinates
|
|
457
|
-
let ci
|
|
207
|
+
let coordinates = geometry._coordinates;
|
|
208
|
+
let ci = [];
|
|
458
209
|
for (let j = 0; j < coordinates.length; j++) {
|
|
459
210
|
ci[j] = [];
|
|
460
211
|
for (let k = 0; k < coordinates[j].length; k++) {
|
|
461
212
|
ci[j][k] = [mercator.forward_lon(coordinates[j][k][0]), mercator.forward_lat(coordinates[j][k][1])];
|
|
462
213
|
}
|
|
463
214
|
}
|
|
464
|
-
|
|
465
215
|
let data = flatten(ci);
|
|
466
|
-
let indexes
|
|
467
|
-
|
|
216
|
+
let indexes = earcut(data.vertices, data.holes, 2);
|
|
468
217
|
geometry._polyVerticesHandlerIndex = this._polyVerticesHighMerc.length;
|
|
469
218
|
geometry._polyIndexesHandlerIndex = this._polyIndexes.length;
|
|
470
|
-
|
|
471
219
|
for (let i = 0; i < indexes.length; i++) {
|
|
472
220
|
this._polyIndexes.push(indexes[i] + geometry._polyVerticesHandlerIndex * 0.5);
|
|
473
221
|
}
|
|
474
|
-
|
|
475
222
|
let color = geometry._style.fillColor;
|
|
476
|
-
|
|
477
|
-
let verticesHigh = [],
|
|
478
|
-
verticesLow = [];
|
|
479
|
-
|
|
223
|
+
let verticesHigh = [], verticesLow = [];
|
|
480
224
|
for (let i = 0; i < data.vertices.length * 0.5; i++) {
|
|
481
225
|
this._polyColors.push(color.x, color.y, color.z, color.w);
|
|
482
226
|
this._polyPickingColors.push(pickingColor.x, pickingColor.y, pickingColor.z, 1.0);
|
|
483
227
|
}
|
|
484
|
-
|
|
485
228
|
for (let i = 0; i < data.vertices.length; i++) {
|
|
486
229
|
doubleToTwoFloatsV2(data.vertices[i], tempHighLow);
|
|
487
230
|
verticesHigh[i] = tempHighLow.x;
|
|
488
231
|
verticesLow[i] = tempHighLow.y;
|
|
489
232
|
}
|
|
490
|
-
|
|
491
233
|
geometry._polyVerticesHighMerc = verticesHigh;
|
|
492
234
|
geometry._polyVerticesLowMerc = verticesLow;
|
|
493
|
-
|
|
494
235
|
this._polyVerticesHighMerc.push.apply(this._polyVerticesHighMerc, verticesHigh);
|
|
495
236
|
this._polyVerticesLowMerc.push.apply(this._polyVerticesLowMerc, verticesLow);
|
|
496
|
-
|
|
497
237
|
geometry._polyVerticesLength = data.vertices.length;
|
|
498
238
|
geometry._polyIndexesLength = indexes.length;
|
|
499
|
-
|
|
500
239
|
// Creates polygon stroke data
|
|
501
240
|
geometry._lineVerticesHandlerIndex = this._lineVerticesHighMerc.length;
|
|
502
241
|
geometry._lineOrdersHandlerIndex = this._lineOrders.length;
|
|
503
242
|
geometry._lineIndexesHandlerIndex = this._lineIndexes.length;
|
|
504
243
|
geometry._lineColorsHandlerIndex = this._lineColors.length;
|
|
505
244
|
geometry._lineThicknessHandlerIndex = this._lineThickness.length;
|
|
506
|
-
|
|
507
|
-
GeometryHandler.appendLineData(
|
|
508
|
-
ci,
|
|
509
|
-
true,
|
|
510
|
-
geometry._style.lineColor,
|
|
511
|
-
pickingColor,
|
|
512
|
-
geometry._style.lineWidth,
|
|
513
|
-
geometry._style.strokeColor,
|
|
514
|
-
geometry._style.strokeWidth,
|
|
515
|
-
this._lineVerticesHighMerc,
|
|
516
|
-
this._lineVerticesLowMerc,
|
|
517
|
-
this._lineOrders,
|
|
518
|
-
this._lineIndexes,
|
|
519
|
-
this._lineColors,
|
|
520
|
-
this._linePickingColors,
|
|
521
|
-
this._lineThickness,
|
|
522
|
-
this._lineStrokeColors,
|
|
523
|
-
this._lineStrokes,
|
|
524
|
-
geometry._lineVerticesHighMerc,
|
|
525
|
-
geometry._lineVerticesLowMerc
|
|
526
|
-
);
|
|
527
|
-
|
|
245
|
+
GeometryHandler.appendLineData(ci, true, geometry._style.lineColor, pickingColor, geometry._style.lineWidth, geometry._style.strokeColor, geometry._style.strokeWidth, this._lineVerticesHighMerc, this._lineVerticesLowMerc, this._lineOrders, this._lineIndexes, this._lineColors, this._linePickingColors, this._lineThickness, this._lineStrokeColors, this._lineStrokes, geometry._lineVerticesHighMerc, geometry._lineVerticesLowMerc);
|
|
528
246
|
geometry._lineVerticesLength = this._lineVerticesHighMerc.length - geometry._lineVerticesHandlerIndex;
|
|
529
247
|
geometry._lineOrdersLength = this._lineOrders.length - geometry._lineOrdersHandlerIndex;
|
|
530
248
|
geometry._lineIndexesLength = this._lineIndexes.length - geometry._lineIndexesHandlerIndex;
|
|
531
249
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
532
250
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
let
|
|
537
|
-
let vertices: number[] = [],
|
|
538
|
-
indexes: number[] = [];
|
|
539
|
-
|
|
251
|
+
}
|
|
252
|
+
else if (geometry.type === GeometryType.MULTIPOLYGON) {
|
|
253
|
+
let coordinates = geometry._coordinates;
|
|
254
|
+
let vertices = [], indexes = [];
|
|
540
255
|
// Creates polygon stroke data
|
|
541
256
|
geometry._lineVerticesHandlerIndex = this._lineVerticesHighMerc.length;
|
|
542
257
|
geometry._lineOrdersHandlerIndex = this._lineOrders.length;
|
|
543
258
|
geometry._lineIndexesHandlerIndex = this._lineIndexes.length;
|
|
544
259
|
geometry._lineColorsHandlerIndex = this._lineColors.length;
|
|
545
260
|
geometry._lineThicknessHandlerIndex = this._lineThickness.length;
|
|
546
|
-
|
|
547
261
|
for (let i = 0; i < coordinates.length; i++) {
|
|
548
|
-
let cci
|
|
549
|
-
let ci
|
|
262
|
+
let cci = coordinates[i];
|
|
263
|
+
let ci = [];
|
|
550
264
|
for (let j = 0; j < cci.length; j++) {
|
|
551
265
|
ci[j] = [];
|
|
552
266
|
for (let k = 0; k < coordinates[i][j].length; k++) {
|
|
@@ -554,160 +268,76 @@ class GeometryHandler {
|
|
|
554
268
|
}
|
|
555
269
|
}
|
|
556
270
|
let data = flatten(ci);
|
|
557
|
-
let dataIndexes
|
|
558
|
-
|
|
271
|
+
let dataIndexes = earcut(data.vertices, data.holes, 2);
|
|
559
272
|
for (let j = 0; j < dataIndexes.length; j++) {
|
|
560
273
|
indexes.push(dataIndexes[j] + vertices.length * 0.5);
|
|
561
274
|
}
|
|
562
|
-
|
|
563
275
|
vertices.push.apply(vertices, data.vertices);
|
|
564
|
-
|
|
565
|
-
GeometryHandler.appendLineData(
|
|
566
|
-
ci,
|
|
567
|
-
true,
|
|
568
|
-
geometry._style.lineColor,
|
|
569
|
-
pickingColor,
|
|
570
|
-
geometry._style.lineWidth,
|
|
571
|
-
geometry._style.strokeColor,
|
|
572
|
-
geometry._style.strokeWidth,
|
|
573
|
-
this._lineVerticesHighMerc,
|
|
574
|
-
this._lineVerticesLowMerc,
|
|
575
|
-
this._lineOrders,
|
|
576
|
-
this._lineIndexes,
|
|
577
|
-
this._lineColors,
|
|
578
|
-
this._linePickingColors,
|
|
579
|
-
this._lineThickness,
|
|
580
|
-
this._lineStrokeColors,
|
|
581
|
-
this._lineStrokes,
|
|
582
|
-
geometry._lineVerticesHighMerc,
|
|
583
|
-
geometry._lineVerticesLowMerc
|
|
584
|
-
);
|
|
276
|
+
GeometryHandler.appendLineData(ci, true, geometry._style.lineColor, pickingColor, geometry._style.lineWidth, geometry._style.strokeColor, geometry._style.strokeWidth, this._lineVerticesHighMerc, this._lineVerticesLowMerc, this._lineOrders, this._lineIndexes, this._lineColors, this._linePickingColors, this._lineThickness, this._lineStrokeColors, this._lineStrokes, geometry._lineVerticesHighMerc, geometry._lineVerticesLowMerc);
|
|
585
277
|
}
|
|
586
|
-
|
|
587
278
|
geometry._polyVerticesHandlerIndex = this._polyVerticesHighMerc.length;
|
|
588
279
|
geometry._polyIndexesHandlerIndex = this._polyIndexes.length;
|
|
589
|
-
|
|
590
280
|
for (let i = 0; i < indexes.length; i++) {
|
|
591
281
|
this._polyIndexes.push(indexes[i] + geometry._polyVerticesHandlerIndex * 0.5);
|
|
592
282
|
}
|
|
593
|
-
|
|
594
283
|
let color = geometry._style.fillColor;
|
|
595
|
-
|
|
596
|
-
let verticesHigh = [],
|
|
597
|
-
verticesLow = [];
|
|
598
|
-
|
|
284
|
+
let verticesHigh = [], verticesLow = [];
|
|
599
285
|
for (let i = 0; i < vertices.length * 0.5; i++) {
|
|
600
286
|
this._polyColors.push(color.x, color.y, color.z, color.w);
|
|
601
|
-
this._polyPickingColors.push(
|
|
602
|
-
pickingColor.x,
|
|
603
|
-
pickingColor.y,
|
|
604
|
-
pickingColor.z,
|
|
605
|
-
1.0
|
|
606
|
-
);
|
|
287
|
+
this._polyPickingColors.push(pickingColor.x, pickingColor.y, pickingColor.z, 1.0);
|
|
607
288
|
}
|
|
608
|
-
|
|
609
289
|
for (let i = 0; i < vertices.length; i++) {
|
|
610
290
|
doubleToTwoFloatsV2(vertices[i], tempHighLow);
|
|
611
291
|
verticesHigh[i] = tempHighLow.x;
|
|
612
292
|
verticesLow[i] = tempHighLow.y;
|
|
613
293
|
}
|
|
614
|
-
|
|
615
294
|
geometry._polyVerticesHighMerc = verticesHigh;
|
|
616
295
|
geometry._polyVerticesLowMerc = verticesLow;
|
|
617
|
-
|
|
618
296
|
this._polyVerticesHighMerc.push.apply(this._polyVerticesHighMerc, verticesHigh);
|
|
619
297
|
this._polyVerticesLowMerc.push.apply(this._polyVerticesLowMerc, verticesLow);
|
|
620
|
-
|
|
621
298
|
geometry._polyVerticesLength = vertices.length;
|
|
622
299
|
geometry._polyIndexesLength = indexes.length;
|
|
623
|
-
|
|
624
300
|
geometry._lineVerticesLength = this._lineVerticesHighMerc.length - geometry._lineVerticesHandlerIndex;
|
|
625
301
|
geometry._lineOrdersLength = this._lineOrders.length - geometry._lineOrdersHandlerIndex;
|
|
626
302
|
geometry._lineIndexesLength = this._lineIndexes.length - geometry._lineIndexesHandlerIndex;
|
|
627
303
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
628
304
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
let coordinates: ILineStringCoordinates = geometry._coordinates as ILineStringCoordinates;
|
|
305
|
+
}
|
|
306
|
+
else if (geometry.type === GeometryType.LINESTRING) {
|
|
307
|
+
let coordinates = geometry._coordinates;
|
|
633
308
|
let ci = new Array(coordinates.length);
|
|
634
309
|
for (let j = 0; j < coordinates.length; j++) {
|
|
635
310
|
ci[j] = [mercator.forward_lon(coordinates[j][0]), mercator.forward_lat(coordinates[j][1])];
|
|
636
311
|
}
|
|
637
|
-
|
|
638
312
|
// Creates polygon stroke data
|
|
639
313
|
geometry._lineVerticesHandlerIndex = this._lineVerticesHighMerc.length;
|
|
640
314
|
geometry._lineOrdersHandlerIndex = this._lineOrders.length;
|
|
641
315
|
geometry._lineIndexesHandlerIndex = this._lineIndexes.length;
|
|
642
316
|
geometry._lineColorsHandlerIndex = this._lineColors.length;
|
|
643
317
|
geometry._lineThicknessHandlerIndex = this._lineThickness.length;
|
|
644
|
-
|
|
645
|
-
GeometryHandler.appendLineData(
|
|
646
|
-
[ci],
|
|
647
|
-
false,
|
|
648
|
-
geometry._style.lineColor,
|
|
649
|
-
pickingColor,
|
|
650
|
-
geometry._style.lineWidth,
|
|
651
|
-
geometry._style.strokeColor,
|
|
652
|
-
geometry._style.strokeWidth,
|
|
653
|
-
this._lineVerticesHighMerc,
|
|
654
|
-
this._lineVerticesLowMerc,
|
|
655
|
-
this._lineOrders,
|
|
656
|
-
this._lineIndexes,
|
|
657
|
-
this._lineColors,
|
|
658
|
-
this._linePickingColors,
|
|
659
|
-
this._lineThickness,
|
|
660
|
-
this._lineStrokeColors,
|
|
661
|
-
this._lineStrokes,
|
|
662
|
-
geometry._lineVerticesHighMerc,
|
|
663
|
-
geometry._lineVerticesLowMerc
|
|
664
|
-
);
|
|
665
|
-
|
|
318
|
+
GeometryHandler.appendLineData([ci], false, geometry._style.lineColor, pickingColor, geometry._style.lineWidth, geometry._style.strokeColor, geometry._style.strokeWidth, this._lineVerticesHighMerc, this._lineVerticesLowMerc, this._lineOrders, this._lineIndexes, this._lineColors, this._linePickingColors, this._lineThickness, this._lineStrokeColors, this._lineStrokes, geometry._lineVerticesHighMerc, geometry._lineVerticesLowMerc);
|
|
666
319
|
geometry._lineVerticesLength = this._lineVerticesHighMerc.length - geometry._lineVerticesHandlerIndex;
|
|
667
320
|
geometry._lineOrdersLength = this._lineOrders.length - geometry._lineOrdersHandlerIndex;
|
|
668
321
|
geometry._lineIndexesLength = this._lineIndexes.length - geometry._lineIndexesHandlerIndex;
|
|
669
322
|
geometry._lineColorsLength = this._lineColors.length - geometry._lineColorsHandlerIndex;
|
|
670
323
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
let
|
|
675
|
-
let ci: IMultiLineStringCoordinates = [];
|
|
324
|
+
}
|
|
325
|
+
else if (geometry.type === GeometryType.MULTILINESTRING) {
|
|
326
|
+
let coordinates = geometry._coordinates;
|
|
327
|
+
let ci = [];
|
|
676
328
|
for (let j = 0; j < coordinates.length; j++) {
|
|
677
329
|
ci[j] = [];
|
|
678
330
|
for (let k = 0; k < coordinates[j].length; k++) {
|
|
679
331
|
ci[j][k] = [mercator.forward_lon(coordinates[j][k][0]), mercator.forward_lat(coordinates[j][k][1])];
|
|
680
332
|
}
|
|
681
333
|
}
|
|
682
|
-
|
|
683
334
|
// Creates polygon stroke data
|
|
684
335
|
geometry._lineVerticesHandlerIndex = this._lineVerticesHighMerc.length;
|
|
685
336
|
geometry._lineOrdersHandlerIndex = this._lineOrders.length;
|
|
686
337
|
geometry._lineIndexesHandlerIndex = this._lineIndexes.length;
|
|
687
338
|
geometry._lineColorsHandlerIndex = this._lineColors.length;
|
|
688
339
|
geometry._lineThicknessHandlerIndex = this._lineThickness.length;
|
|
689
|
-
|
|
690
|
-
GeometryHandler.appendLineData(
|
|
691
|
-
ci,
|
|
692
|
-
false,
|
|
693
|
-
geometry._style.lineColor,
|
|
694
|
-
pickingColor,
|
|
695
|
-
geometry._style.lineWidth,
|
|
696
|
-
geometry._style.strokeColor,
|
|
697
|
-
geometry._style.strokeWidth,
|
|
698
|
-
this._lineVerticesHighMerc,
|
|
699
|
-
this._lineVerticesLowMerc,
|
|
700
|
-
this._lineOrders,
|
|
701
|
-
this._lineIndexes,
|
|
702
|
-
this._lineColors,
|
|
703
|
-
this._linePickingColors,
|
|
704
|
-
this._lineThickness,
|
|
705
|
-
this._lineStrokeColors,
|
|
706
|
-
this._lineStrokes,
|
|
707
|
-
geometry._lineVerticesHighMerc,
|
|
708
|
-
geometry._lineVerticesLowMerc
|
|
709
|
-
);
|
|
710
|
-
|
|
340
|
+
GeometryHandler.appendLineData(ci, false, geometry._style.lineColor, pickingColor, geometry._style.lineWidth, geometry._style.strokeColor, geometry._style.strokeWidth, this._lineVerticesHighMerc, this._lineVerticesLowMerc, this._lineOrders, this._lineIndexes, this._lineColors, this._linePickingColors, this._lineThickness, this._lineStrokeColors, this._lineStrokes, geometry._lineVerticesHighMerc, geometry._lineVerticesLowMerc);
|
|
711
341
|
geometry._lineVerticesLength = this._lineVerticesHighMerc.length - geometry._lineVerticesHandlerIndex;
|
|
712
342
|
geometry._lineOrdersLength = this._lineOrders.length - geometry._lineOrdersHandlerIndex;
|
|
713
343
|
geometry._lineIndexesLength = this._lineIndexes.length - geometry._lineIndexesHandlerIndex;
|
|
@@ -715,43 +345,32 @@ class GeometryHandler {
|
|
|
715
345
|
geometry._lineThicknessLength = this._lineThickness.length - geometry._lineThicknessHandlerIndex;
|
|
716
346
|
}
|
|
717
347
|
}
|
|
718
|
-
|
|
719
348
|
// Refresh visibility
|
|
720
349
|
this.setGeometryVisibility(geometry);
|
|
721
|
-
|
|
722
350
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
723
351
|
this._updatedGeometry[geometry.__id] = true;
|
|
724
352
|
this.refresh();
|
|
725
353
|
}
|
|
726
354
|
}
|
|
727
|
-
|
|
728
|
-
public remove(geometry: Geometry) {
|
|
729
|
-
|
|
355
|
+
remove(geometry) {
|
|
730
356
|
const index = geometry._handlerIndex;
|
|
731
357
|
if (index !== -1) {
|
|
732
358
|
this._geometries.splice(index, 1);
|
|
733
|
-
|
|
734
359
|
// polygon
|
|
735
360
|
// this._polyVerticesLonLat.splice(geometry._polyVerticesHandlerIndex, geometry._polyVerticesLength);
|
|
736
|
-
|
|
737
361
|
this._polyVerticesHighMerc.splice(geometry._polyVerticesHandlerIndex, geometry._polyVerticesLength);
|
|
738
362
|
this._polyVerticesLowMerc.splice(geometry._polyVerticesHandlerIndex, geometry._polyVerticesLength);
|
|
739
|
-
|
|
740
363
|
this._polyColors.splice(geometry._polyVerticesHandlerIndex * 2, geometry._polyVerticesLength * 2);
|
|
741
364
|
this._polyPickingColors.splice(geometry._polyVerticesHandlerIndex * 2, geometry._polyVerticesLength * 2);
|
|
742
365
|
this._polyIndexes.splice(geometry._polyIndexesHandlerIndex, geometry._polyIndexesLength);
|
|
743
|
-
|
|
744
366
|
let di = geometry._polyVerticesLength * 0.5;
|
|
745
367
|
for (let i = geometry._polyIndexesHandlerIndex; i < this._polyIndexes.length; i++) {
|
|
746
368
|
this._polyIndexes[i] -= di;
|
|
747
369
|
}
|
|
748
|
-
|
|
749
370
|
// line
|
|
750
371
|
// this._lineVerticesLonLat.splice(geometry._lineVerticesHandlerIndex, geometry._lineVerticesLength);
|
|
751
|
-
|
|
752
372
|
this._lineVerticesHighMerc.splice(geometry._lineVerticesHandlerIndex, geometry._lineVerticesLength);
|
|
753
373
|
this._lineVerticesLowMerc.splice(geometry._lineVerticesHandlerIndex, geometry._lineVerticesLength);
|
|
754
|
-
|
|
755
374
|
this._lineOrders.splice(geometry._lineOrdersHandlerIndex, geometry._lineOrdersLength);
|
|
756
375
|
this._lineColors.splice(geometry._lineColorsHandlerIndex, geometry._lineColorsLength);
|
|
757
376
|
this._linePickingColors.splice(geometry._lineColorsHandlerIndex, geometry._lineColorsLength);
|
|
@@ -759,41 +378,32 @@ class GeometryHandler {
|
|
|
759
378
|
this._lineThickness.splice(geometry._lineThicknessHandlerIndex, geometry._lineThicknessLength);
|
|
760
379
|
this._lineStrokes.splice(geometry._lineThicknessHandlerIndex, geometry._lineThicknessLength);
|
|
761
380
|
this._lineIndexes.splice(geometry._lineIndexesHandlerIndex, geometry._lineIndexesLength);
|
|
762
|
-
|
|
763
381
|
di = geometry._lineVerticesLength * 0.5;
|
|
764
382
|
for (let i = geometry._lineIndexesHandlerIndex; i < this._lineIndexes.length; i++) {
|
|
765
383
|
this._lineIndexes[i] -= di;
|
|
766
384
|
}
|
|
767
|
-
|
|
768
385
|
// reindex
|
|
769
386
|
let g = this._geometries;
|
|
770
387
|
for (let i = index; i < g.length; i++) {
|
|
771
388
|
let gi = g[i];
|
|
772
|
-
|
|
773
389
|
gi._handlerIndex = i;
|
|
774
390
|
gi._polyVerticesHandlerIndex -= geometry._polyVerticesLength;
|
|
775
391
|
gi._polyIndexesHandlerIndex -= geometry._polyIndexesLength;
|
|
776
|
-
|
|
777
392
|
gi._lineVerticesHandlerIndex -= geometry._lineVerticesLength;
|
|
778
393
|
gi._lineOrdersHandlerIndex -= geometry._lineOrdersLength;
|
|
779
394
|
gi._lineColorsHandlerIndex -= geometry._lineColorsLength;
|
|
780
395
|
gi._lineThicknessHandlerIndex -= geometry._lineThicknessLength;
|
|
781
396
|
gi._lineIndexesHandlerIndex -= geometry._lineIndexesLength;
|
|
782
397
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
398
|
geometry._pickingReady = false;
|
|
786
|
-
|
|
787
399
|
geometry._handler = null;
|
|
788
400
|
geometry._handlerIndex = -1;
|
|
789
|
-
|
|
790
401
|
geometry._polyVerticesHighMerc = [];
|
|
791
402
|
geometry._polyVerticesLowMerc = [];
|
|
792
403
|
geometry._polyVerticesLength = -1;
|
|
793
404
|
geometry._polyIndexesLength = -1;
|
|
794
405
|
geometry._polyVerticesHandlerIndex = -1;
|
|
795
406
|
geometry._polyIndexesHandlerIndex = -1;
|
|
796
|
-
|
|
797
407
|
geometry._lineVerticesHighMerc = [];
|
|
798
408
|
geometry._lineVerticesLowMerc = [];
|
|
799
409
|
geometry._lineVerticesLength = -1;
|
|
@@ -806,15 +416,12 @@ class GeometryHandler {
|
|
|
806
416
|
geometry._lineIndexesHandlerIndex = -1;
|
|
807
417
|
geometry._lineThicknessHandlerIndex = -1;
|
|
808
418
|
geometry._lineColorsHandlerIndex = -1;
|
|
809
|
-
|
|
810
419
|
!this._removeGeometryExtents[geometry.__id] && this._removeGeometryExtentArr.push(geometry.getExtent());
|
|
811
420
|
this._removeGeometryExtents[geometry.__id] = true;
|
|
812
|
-
|
|
813
421
|
this.refresh();
|
|
814
422
|
}
|
|
815
423
|
}
|
|
816
|
-
|
|
817
|
-
protected _refreshRecursevely(geometry: Geometry, treeNode: Node) {
|
|
424
|
+
_refreshRecursevely(geometry, treeNode) {
|
|
818
425
|
if (treeNode.ready) {
|
|
819
426
|
let lid = this._layer._id;
|
|
820
427
|
for (let i = 0; i < treeNode.nodes.length; i++) {
|
|
@@ -825,21 +432,20 @@ class GeometryHandler {
|
|
|
825
432
|
if (m && m.isReady) {
|
|
826
433
|
if (m.segment.node.getState() !== quadTree.RENDERING) {
|
|
827
434
|
m.layer.clearMaterial(m);
|
|
828
|
-
}
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
829
437
|
m.pickingReady = m.pickingReady && geometry._pickingReady;
|
|
830
438
|
m.isReady = false;
|
|
831
439
|
m._updateTexture = m.texture;
|
|
832
440
|
m._updatePickingMask = m.pickingMask;
|
|
833
441
|
}
|
|
834
|
-
|
|
835
442
|
geometry._pickingReady = true;
|
|
836
443
|
}
|
|
837
444
|
}
|
|
838
445
|
}
|
|
839
446
|
}
|
|
840
447
|
}
|
|
841
|
-
|
|
842
|
-
protected _refreshRecursevelyExt(extent: Extent, treeNode: Node) {
|
|
448
|
+
_refreshRecursevelyExt(extent, treeNode) {
|
|
843
449
|
if (treeNode.ready) {
|
|
844
450
|
let lid = this._layer.__id;
|
|
845
451
|
for (let i = 0; i < treeNode.nodes.length; i++) {
|
|
@@ -858,22 +464,18 @@ class GeometryHandler {
|
|
|
858
464
|
}
|
|
859
465
|
}
|
|
860
466
|
}
|
|
861
|
-
|
|
862
|
-
protected _refreshPlanetNode(treeNode: Node) {
|
|
467
|
+
_refreshPlanetNode(treeNode) {
|
|
863
468
|
let i;
|
|
864
|
-
|
|
865
469
|
let e = this._removeGeometryExtentArr;
|
|
866
470
|
for (i = 0; i < e.length; i++) {
|
|
867
471
|
this._refreshRecursevelyExt(e[i], treeNode);
|
|
868
472
|
}
|
|
869
|
-
|
|
870
473
|
let g = this._updatedGeometryArr;
|
|
871
474
|
for (i = 0; i < g.length; i++) {
|
|
872
475
|
this._refreshRecursevely(g[i], treeNode);
|
|
873
476
|
}
|
|
874
477
|
}
|
|
875
|
-
|
|
876
|
-
protected _updatePlanet() {
|
|
478
|
+
_updatePlanet() {
|
|
877
479
|
let p = this._layer._planet;
|
|
878
480
|
if (p) {
|
|
879
481
|
let ql = p.quadTreeStrategy.quadTreeList;
|
|
@@ -887,20 +489,17 @@ class GeometryHandler {
|
|
|
887
489
|
this._updatedGeometryArr.length = 0;
|
|
888
490
|
this._updatedGeometryArr = [];
|
|
889
491
|
this._updatedGeometry = {};
|
|
890
|
-
|
|
891
492
|
this._removeGeometryExtentArr.length = 0;
|
|
892
493
|
this._removeGeometryExtentArr = [];
|
|
893
494
|
this._removeGeometryExtents = {};
|
|
894
495
|
}
|
|
895
|
-
|
|
896
|
-
protected refresh() {
|
|
496
|
+
refresh() {
|
|
897
497
|
let i = this._changedBuffers.length;
|
|
898
498
|
while (i--) {
|
|
899
499
|
this._changedBuffers[i] = true;
|
|
900
500
|
}
|
|
901
501
|
}
|
|
902
|
-
|
|
903
|
-
public update() {
|
|
502
|
+
update() {
|
|
904
503
|
if (this._handler) {
|
|
905
504
|
let needUpdate = false;
|
|
906
505
|
let i = this._changedBuffers.length;
|
|
@@ -914,40 +513,31 @@ class GeometryHandler {
|
|
|
914
513
|
needUpdate && this._updatePlanet();
|
|
915
514
|
}
|
|
916
515
|
}
|
|
917
|
-
|
|
918
|
-
public setGeometryVisibility(geometry: Geometry) {
|
|
516
|
+
setGeometryVisibility(geometry) {
|
|
919
517
|
let v = geometry.getVisibility() ? 1.0 : 0.0;
|
|
920
|
-
|
|
921
|
-
let a = this._polyVerticesHighMerc,
|
|
922
|
-
b = this._polyVerticesLowMerc;
|
|
923
|
-
|
|
518
|
+
let a = this._polyVerticesHighMerc, b = this._polyVerticesLowMerc;
|
|
924
519
|
let l = geometry._polyVerticesLength;
|
|
925
520
|
let ind = geometry._polyVerticesHandlerIndex;
|
|
926
521
|
for (let i = 0; i < l; i++) {
|
|
927
522
|
a[ind + i] = geometry._polyVerticesHighMerc[i] * v;
|
|
928
523
|
b[ind + i] = geometry._polyVerticesLowMerc[i] * v;
|
|
929
524
|
}
|
|
930
|
-
|
|
931
525
|
a = this._lineVerticesHighMerc;
|
|
932
526
|
b = this._lineVerticesLowMerc;
|
|
933
|
-
|
|
934
527
|
l = geometry._lineVerticesLength;
|
|
935
528
|
ind = geometry._lineVerticesHandlerIndex;
|
|
936
529
|
for (let i = 0; i < l; i++) {
|
|
937
530
|
a[ind + i] = geometry._lineVerticesHighMerc[i] * v;
|
|
938
531
|
b[ind + i] = geometry._lineVerticesLowMerc[i] * v;
|
|
939
532
|
}
|
|
940
|
-
|
|
941
533
|
this._changedBuffers[POLYVERTICES_BUFFER] = true;
|
|
942
534
|
this._changedBuffers[LINEVERTICES_BUFFER] = true;
|
|
943
|
-
|
|
944
535
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
945
536
|
this._updatedGeometry[geometry.__id] = true;
|
|
946
537
|
}
|
|
947
|
-
|
|
948
|
-
public setPolyColorArr(geometry: Geometry, color: Vec4) {
|
|
538
|
+
setPolyColorArr(geometry, color) {
|
|
949
539
|
let index = geometry._polyVerticesHandlerIndex * 2, // ... / 2 * 4
|
|
950
|
-
|
|
540
|
+
size = index + geometry._polyVerticesLength * 2; // ... / 2 * 4
|
|
951
541
|
let a = this._polyColors;
|
|
952
542
|
for (let i = index; i < size; i += 4) {
|
|
953
543
|
a[i] = color.x;
|
|
@@ -959,10 +549,8 @@ class GeometryHandler {
|
|
|
959
549
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
960
550
|
this._updatedGeometry[geometry.__id] = true;
|
|
961
551
|
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
let index = geometry._lineColorsHandlerIndex,
|
|
965
|
-
size = index + geometry._lineColorsLength;
|
|
552
|
+
setLineStrokeColorArr(geometry, color) {
|
|
553
|
+
let index = geometry._lineColorsHandlerIndex, size = index + geometry._lineColorsLength;
|
|
966
554
|
let a = this._lineStrokeColors;
|
|
967
555
|
for (let i = index; i < size; i += 4) {
|
|
968
556
|
a[i] = color.x;
|
|
@@ -974,10 +562,8 @@ class GeometryHandler {
|
|
|
974
562
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
975
563
|
this._updatedGeometry[geometry.__id] = true;
|
|
976
564
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
let index = geometry._lineColorsHandlerIndex,
|
|
980
|
-
size = index + geometry._lineColorsLength;
|
|
565
|
+
setLineColorArr(geometry, color) {
|
|
566
|
+
let index = geometry._lineColorsHandlerIndex, size = index + geometry._lineColorsLength;
|
|
981
567
|
let a = this._lineColors;
|
|
982
568
|
for (let i = index; i < size; i += 4) {
|
|
983
569
|
a[i] = color.x;
|
|
@@ -989,8 +575,7 @@ class GeometryHandler {
|
|
|
989
575
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
990
576
|
this._updatedGeometry[geometry.__id] = true;
|
|
991
577
|
}
|
|
992
|
-
|
|
993
|
-
public setLineStrokeArr(geometry: Geometry, width: number) {
|
|
578
|
+
setLineStrokeArr(geometry, width) {
|
|
994
579
|
// let index = geometry._lineStrokesHandlerIndex,
|
|
995
580
|
// size = index + geometry._lineStrokesLength;
|
|
996
581
|
// let a = this._lineStrokes;
|
|
@@ -1001,10 +586,8 @@ class GeometryHandler {
|
|
|
1001
586
|
// !this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
1002
587
|
// this._updatedGeometry[geometry.__id] = true;
|
|
1003
588
|
}
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
let index = geometry._lineThicknessHandlerIndex,
|
|
1007
|
-
size = index + geometry._lineThicknessLength;
|
|
589
|
+
setLineThicknessArr(geometry, width) {
|
|
590
|
+
let index = geometry._lineThicknessHandlerIndex, size = index + geometry._lineThicknessLength;
|
|
1008
591
|
let a = this._lineThickness;
|
|
1009
592
|
for (let i = index; i < size; i++) {
|
|
1010
593
|
a[i] = width;
|
|
@@ -1013,13 +596,10 @@ class GeometryHandler {
|
|
|
1013
596
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
1014
597
|
this._updatedGeometry[geometry.__id] = true;
|
|
1015
598
|
}
|
|
1016
|
-
|
|
1017
|
-
public bringToFront(geometry: Geometry) {
|
|
599
|
+
bringToFront(geometry) {
|
|
1018
600
|
let polyIndexes = this._polyIndexes.splice(geometry._polyIndexesHandlerIndex, geometry._polyIndexesLength);
|
|
1019
601
|
let lineIndexes = this._lineIndexes.splice(geometry._lineIndexesHandlerIndex, geometry._lineIndexesLength);
|
|
1020
|
-
|
|
1021
602
|
this._geometries.splice(geometry._handlerIndex, 1);
|
|
1022
|
-
|
|
1023
603
|
let g = this._geometries;
|
|
1024
604
|
for (let i = geometry._handlerIndex; i < g.length; i++) {
|
|
1025
605
|
let gi = g[i];
|
|
@@ -1027,156 +607,81 @@ class GeometryHandler {
|
|
|
1027
607
|
gi._polyIndexesHandlerIndex -= geometry._polyIndexesLength;
|
|
1028
608
|
gi._lineIndexesHandlerIndex -= geometry._lineIndexesLength;
|
|
1029
609
|
}
|
|
1030
|
-
|
|
1031
610
|
geometry._polyIndexesHandlerIndex = this._polyIndexes.length;
|
|
1032
611
|
geometry._lineIndexesHandlerIndex = this._lineIndexes.length;
|
|
1033
|
-
|
|
1034
612
|
geometry._handlerIndex = this._geometries.length;
|
|
1035
613
|
this._geometries.push(geometry);
|
|
1036
|
-
|
|
1037
614
|
this._polyIndexes.push.apply(this._polyIndexes, polyIndexes);
|
|
1038
615
|
this._lineIndexes.push.apply(this._lineIndexes, lineIndexes);
|
|
1039
|
-
|
|
1040
616
|
this._changedBuffers[POLYINDEXES_BUFFER] = true;
|
|
1041
617
|
this._changedBuffers[LINEINDEXES_BUFFER] = true;
|
|
1042
|
-
|
|
1043
618
|
!this._updatedGeometry[geometry.__id] && this._updatedGeometryArr.push(geometry);
|
|
1044
619
|
this._updatedGeometry[geometry.__id] = true;
|
|
1045
620
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
h.
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
h.
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
);
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
h.
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
);
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
h
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
h
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
h
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
h.
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
);
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
public createLineIndexesBuffer() {
|
|
1112
|
-
let h = this._handler!;
|
|
1113
|
-
h.gl!.deleteBuffer(this._lineIndexesBuffer!);
|
|
1114
|
-
this._lineIndexesBuffer = h.createElementArrayBuffer(
|
|
1115
|
-
new Uint32Array(this._lineIndexes),
|
|
1116
|
-
1,
|
|
1117
|
-
this._lineIndexes.length
|
|
1118
|
-
);
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
public createLineOrdersBuffer() {
|
|
1122
|
-
let h = this._handler!;
|
|
1123
|
-
h.gl!.deleteBuffer(this._lineOrdersBuffer!);
|
|
1124
|
-
this._lineOrdersBuffer = h.createArrayBuffer(
|
|
1125
|
-
new Float32Array(this._lineOrders),
|
|
1126
|
-
1,
|
|
1127
|
-
this._lineOrders.length / 2
|
|
1128
|
-
);
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
public createLineColorsBuffer() {
|
|
1132
|
-
let h = this._handler!;
|
|
1133
|
-
h.gl!.deleteBuffer(this._lineColorsBuffer!);
|
|
1134
|
-
this._lineColorsBuffer = h.createArrayBuffer(
|
|
1135
|
-
new Float32Array(this._lineColors),
|
|
1136
|
-
4,
|
|
1137
|
-
this._lineColors.length / 4
|
|
1138
|
-
);
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
public createLinePickingColorsBuffer() {
|
|
1142
|
-
let h = this._handler!;
|
|
1143
|
-
h.gl!.deleteBuffer(this._linePickingColorsBuffer!);
|
|
1144
|
-
this._linePickingColorsBuffer = h.createArrayBuffer(
|
|
1145
|
-
new Float32Array(this._linePickingColors),
|
|
1146
|
-
4,
|
|
1147
|
-
this._linePickingColors.length / 4
|
|
1148
|
-
);
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
public createLineThicknessBuffer() {
|
|
1152
|
-
let h = this._handler!;
|
|
1153
|
-
h.gl!.deleteBuffer(this._lineThicknessBuffer!);
|
|
1154
|
-
this._lineThicknessBuffer = h.createArrayBuffer(
|
|
1155
|
-
new Float32Array(this._lineThickness),
|
|
1156
|
-
1,
|
|
1157
|
-
this._lineThickness.length
|
|
1158
|
-
);
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
public createLineStrokesBuffer() {
|
|
1162
|
-
let h = this._handler!;
|
|
1163
|
-
h.gl!.deleteBuffer(this._lineStrokesBuffer!);
|
|
1164
|
-
this._lineStrokesBuffer = h.createArrayBuffer(
|
|
1165
|
-
new Float32Array(this._lineStrokes),
|
|
1166
|
-
1,
|
|
1167
|
-
this._lineStrokes.length
|
|
1168
|
-
);
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
public createLineStrokeColorsBuffer() {
|
|
1172
|
-
let h = this._handler!;
|
|
1173
|
-
h.gl!.deleteBuffer(this._lineStrokeColorsBuffer!);
|
|
1174
|
-
this._lineStrokeColorsBuffer = h.createArrayBuffer(
|
|
1175
|
-
new Float32Array(this._lineStrokeColors),
|
|
1176
|
-
4,
|
|
1177
|
-
this._lineStrokeColors.length / 4
|
|
1178
|
-
);
|
|
621
|
+
createPolyVerticesBuffer() {
|
|
622
|
+
let h = this._handler;
|
|
623
|
+
h.gl.deleteBuffer(this._polyVerticesHighBufferMerc);
|
|
624
|
+
this._polyVerticesHighBufferMerc = h.createArrayBuffer(new Float32Array(this._polyVerticesHighMerc), 2, this._polyVerticesHighMerc.length / 2);
|
|
625
|
+
h.gl.deleteBuffer(this._polyVerticesLowBufferMerc);
|
|
626
|
+
this._polyVerticesLowBufferMerc = h.createArrayBuffer(new Float32Array(this._polyVerticesLowMerc), 2, this._polyVerticesLowMerc.length / 2);
|
|
627
|
+
}
|
|
628
|
+
createPolyIndexesBuffer() {
|
|
629
|
+
let h = this._handler;
|
|
630
|
+
h.gl.deleteBuffer(this._polyIndexesBuffer);
|
|
631
|
+
this._polyIndexesBuffer = h.createElementArrayBuffer(new Uint32Array(this._polyIndexes), 1, this._polyIndexes.length);
|
|
632
|
+
}
|
|
633
|
+
createPolyColorsBuffer() {
|
|
634
|
+
let h = this._handler;
|
|
635
|
+
h.gl.deleteBuffer(this._polyColorsBuffer);
|
|
636
|
+
this._polyColorsBuffer = h.createArrayBuffer(new Float32Array(this._polyColors), 4, this._polyColors.length / 4);
|
|
637
|
+
}
|
|
638
|
+
createPolyPickingColorsBuffer() {
|
|
639
|
+
let h = this._handler;
|
|
640
|
+
h.gl.deleteBuffer(this._polyPickingColorsBuffer);
|
|
641
|
+
this._polyPickingColorsBuffer = h.createArrayBuffer(new Float32Array(this._polyPickingColors), 4, this._polyPickingColors.length / 4);
|
|
642
|
+
}
|
|
643
|
+
createLineVerticesBuffer() {
|
|
644
|
+
let h = this._handler;
|
|
645
|
+
h.gl.deleteBuffer(this._lineVerticesHighBufferMerc);
|
|
646
|
+
this._lineVerticesHighBufferMerc = h.createArrayBuffer(new Float32Array(this._lineVerticesHighMerc), 2, this._lineVerticesHighMerc.length / 2);
|
|
647
|
+
h.gl.deleteBuffer(this._lineVerticesLowBufferMerc);
|
|
648
|
+
this._lineVerticesLowBufferMerc = h.createArrayBuffer(new Float32Array(this._lineVerticesLowMerc), 2, this._lineVerticesLowMerc.length / 2);
|
|
649
|
+
}
|
|
650
|
+
createLineIndexesBuffer() {
|
|
651
|
+
let h = this._handler;
|
|
652
|
+
h.gl.deleteBuffer(this._lineIndexesBuffer);
|
|
653
|
+
this._lineIndexesBuffer = h.createElementArrayBuffer(new Uint32Array(this._lineIndexes), 1, this._lineIndexes.length);
|
|
654
|
+
}
|
|
655
|
+
createLineOrdersBuffer() {
|
|
656
|
+
let h = this._handler;
|
|
657
|
+
h.gl.deleteBuffer(this._lineOrdersBuffer);
|
|
658
|
+
this._lineOrdersBuffer = h.createArrayBuffer(new Float32Array(this._lineOrders), 1, this._lineOrders.length / 2);
|
|
659
|
+
}
|
|
660
|
+
createLineColorsBuffer() {
|
|
661
|
+
let h = this._handler;
|
|
662
|
+
h.gl.deleteBuffer(this._lineColorsBuffer);
|
|
663
|
+
this._lineColorsBuffer = h.createArrayBuffer(new Float32Array(this._lineColors), 4, this._lineColors.length / 4);
|
|
664
|
+
}
|
|
665
|
+
createLinePickingColorsBuffer() {
|
|
666
|
+
let h = this._handler;
|
|
667
|
+
h.gl.deleteBuffer(this._linePickingColorsBuffer);
|
|
668
|
+
this._linePickingColorsBuffer = h.createArrayBuffer(new Float32Array(this._linePickingColors), 4, this._linePickingColors.length / 4);
|
|
669
|
+
}
|
|
670
|
+
createLineThicknessBuffer() {
|
|
671
|
+
let h = this._handler;
|
|
672
|
+
h.gl.deleteBuffer(this._lineThicknessBuffer);
|
|
673
|
+
this._lineThicknessBuffer = h.createArrayBuffer(new Float32Array(this._lineThickness), 1, this._lineThickness.length);
|
|
674
|
+
}
|
|
675
|
+
createLineStrokesBuffer() {
|
|
676
|
+
let h = this._handler;
|
|
677
|
+
h.gl.deleteBuffer(this._lineStrokesBuffer);
|
|
678
|
+
this._lineStrokesBuffer = h.createArrayBuffer(new Float32Array(this._lineStrokes), 1, this._lineStrokes.length);
|
|
679
|
+
}
|
|
680
|
+
createLineStrokeColorsBuffer() {
|
|
681
|
+
let h = this._handler;
|
|
682
|
+
h.gl.deleteBuffer(this._lineStrokeColorsBuffer);
|
|
683
|
+
this._lineStrokeColorsBuffer = h.createArrayBuffer(new Float32Array(this._lineStrokeColors), 4, this._lineStrokeColors.length / 4);
|
|
1179
684
|
}
|
|
1180
685
|
}
|
|
1181
|
-
|
|
1182
|
-
export {GeometryHandler};
|
|
686
|
+
GeometryHandler.__counter__ = 0;
|
|
687
|
+
export { GeometryHandler };
|