@openglobus/og 0.19.4 → 0.20.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 +3 -3
- package/css/og.css +18 -4
- package/lib/@openglobus/js/Clock.d.ts +106 -0
- package/lib/@openglobus/js/Deferred.d.ts +6 -0
- package/lib/@openglobus/js/Events.d.ts +90 -0
- package/lib/@openglobus/js/Extent.d.ts +145 -0
- package/lib/@openglobus/js/Globe.d.ts +134 -0
- package/lib/@openglobus/js/ImageCanvas.d.ts +128 -0
- package/lib/@openglobus/js/Lock.d.ts +15 -0
- package/lib/@openglobus/js/LonLat.d.ts +128 -0
- package/lib/@openglobus/js/Object3d.d.ts +64 -0
- package/lib/@openglobus/js/Popup.d.ts +46 -0
- package/lib/@openglobus/js/QueueArray.d.ts +16 -0
- package/lib/@openglobus/js/Rectangle.d.ts +76 -0
- package/lib/@openglobus/js/Stack.d.ts +20 -0
- package/lib/@openglobus/js/astro/astro.d.ts +39 -0
- package/lib/@openglobus/js/astro/earth.d.ts +8 -0
- package/lib/@openglobus/js/astro/jd.d.ts +234 -0
- package/lib/@openglobus/js/astro/orbit.d.ts +5 -0
- package/lib/@openglobus/js/astro/rotation.d.ts +2 -0
- package/lib/@openglobus/js/bv/Box.d.ts +32 -0
- package/lib/@openglobus/js/bv/Sphere.d.ts +37 -0
- package/lib/@openglobus/js/bv/index.d.ts +3 -0
- package/lib/@openglobus/js/camera/Camera.d.ts +314 -0
- package/lib/@openglobus/js/camera/Frustum.d.ts +139 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +234 -0
- package/lib/@openglobus/js/camera/index.d.ts +3 -0
- package/lib/@openglobus/js/cons.d.ts +40 -0
- package/lib/@openglobus/js/control/Atmosphere.d.ts +16 -0
- package/lib/@openglobus/js/control/CompassButton.d.ts +16 -0
- package/lib/@openglobus/js/control/Control.d.ts +100 -0
- package/lib/@openglobus/js/control/DebugInfo.d.ts +25 -0
- package/lib/@openglobus/js/control/DrawingSwitcher.d.ts +13 -0
- package/lib/@openglobus/js/control/EarthCoordinates.d.ts +41 -0
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +50 -0
- package/lib/@openglobus/js/control/GeoImageDragControl.d.ts +22 -0
- package/lib/@openglobus/js/control/KeyboardNavigation.d.ts +28 -0
- package/lib/@openglobus/js/control/LayerAnimation.d.ts +71 -0
- package/lib/@openglobus/js/control/LayerSwitcher.d.ts +36 -0
- package/lib/@openglobus/js/control/Lighting.d.ts +53 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +44 -0
- package/lib/@openglobus/js/control/RulerSwitcher.d.ts +17 -0
- package/lib/@openglobus/js/control/ScaleControl.d.ts +24 -0
- package/lib/@openglobus/js/control/SegmentBoundVisualization.d.ts +12 -0
- package/lib/@openglobus/js/control/ShowFps.d.ts +9 -0
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +25 -0
- package/lib/@openglobus/js/control/SimpleSkyBackground.d.ts +17 -0
- package/lib/@openglobus/js/control/Sun.d.ts +33 -0
- package/lib/@openglobus/js/control/ToggleWireframe.d.ts +14 -0
- package/lib/@openglobus/js/control/TouchNavigation.d.ts +52 -0
- package/lib/@openglobus/js/control/ZoomControl.d.ts +27 -0
- package/lib/@openglobus/js/control/drawing/DrawingControl.d.ts +12 -0
- package/lib/@openglobus/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
- package/lib/@openglobus/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfile.d.ts +77 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileButtonsView.d.ts +14 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileControl.d.ts +33 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileLegend.d.ts +20 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileScene.d.ts +80 -0
- package/lib/@openglobus/js/control/elevationProfile/ElevationProfileView.d.ts +63 -0
- package/lib/@openglobus/js/control/elevationProfile/PointListDialog.d.ts +12 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRuler.d.ts +7 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
- package/lib/@openglobus/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
- package/lib/@openglobus/js/control/index.d.ts +29 -0
- package/lib/@openglobus/js/control/ruler/Ruler.d.ts +13 -0
- package/lib/@openglobus/js/control/ruler/RulerScene.d.ts +88 -0
- package/lib/@openglobus/js/control/selection/Selection.d.ts +55 -0
- package/lib/@openglobus/js/control/selection/SelectionScene.d.ts +44 -0
- package/lib/@openglobus/js/control/timeline/TimelineControl.d.ts +18 -0
- package/lib/@openglobus/js/control/timeline/TimelineModel.d.ts +41 -0
- package/lib/@openglobus/js/control/timeline/TimelineView.d.ts +85 -0
- package/lib/@openglobus/js/control/timeline/timelineUtils.d.ts +12 -0
- package/lib/@openglobus/js/control/visibleExtent/drawnode.d.ts +7 -0
- package/lib/@openglobus/js/ellipsoid/Ellipsoid.d.ts +193 -0
- package/lib/@openglobus/js/ellipsoid/index.d.ts +3 -0
- package/lib/@openglobus/js/ellipsoid/wgs84.d.ts +6 -0
- package/lib/@openglobus/js/entity/BaseBillboard.d.ts +222 -0
- package/lib/@openglobus/js/entity/BaseBillboardHandler.d.ts +81 -0
- package/lib/@openglobus/js/entity/Billboard.d.ts +113 -0
- package/lib/@openglobus/js/entity/BillboardHandler.d.ts +15 -0
- package/lib/@openglobus/js/entity/Entity.d.ts +354 -0
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +363 -0
- package/lib/@openglobus/js/entity/GeoObject.d.ts +152 -0
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +104 -0
- package/lib/@openglobus/js/entity/Geometry.d.ts +124 -0
- package/lib/@openglobus/js/entity/GeometryHandler.d.ts +84 -0
- package/lib/@openglobus/js/entity/Label.d.ts +214 -0
- package/lib/@openglobus/js/entity/LabelHandler.d.ts +65 -0
- package/lib/@openglobus/js/entity/LabelWorker.d.ts +15 -0
- package/lib/@openglobus/js/entity/PointCloud.d.ts +179 -0
- package/lib/@openglobus/js/entity/PointCloudHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +345 -0
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +22 -0
- package/lib/@openglobus/js/entity/Ray.d.ts +133 -0
- package/lib/@openglobus/js/entity/RayHandler.d.ts +70 -0
- package/lib/@openglobus/js/entity/Strip.d.ts +139 -0
- package/lib/@openglobus/js/entity/StripHandler.d.ts +42 -0
- package/lib/@openglobus/js/entity/index.d.ts +10 -0
- package/lib/@openglobus/js/index.d.ts +33 -0
- package/lib/@openglobus/js/input/KeyboardHandler.d.ts +33 -0
- package/lib/@openglobus/js/input/MouseHandler.d.ts +16 -0
- package/lib/@openglobus/js/input/TouchHandler.d.ts +11 -0
- package/lib/@openglobus/js/input/input.d.ts +3 -0
- package/lib/@openglobus/js/layer/BaseGeoImage.d.ts +145 -0
- package/lib/@openglobus/js/layer/Bing.d.ts +4 -0
- package/lib/@openglobus/js/layer/CanvasTiles.d.ts +103 -0
- package/lib/@openglobus/js/layer/GeoImage.d.ts +61 -0
- package/lib/@openglobus/js/layer/GeoTexture2d.d.ts +17 -0
- package/lib/@openglobus/js/layer/GeoVideo.d.ts +68 -0
- package/lib/@openglobus/js/layer/KML.d.ts +72 -0
- package/lib/@openglobus/js/layer/Layer.d.ts +415 -0
- package/lib/@openglobus/js/layer/Material.d.ts +34 -0
- package/lib/@openglobus/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +246 -0
- package/lib/@openglobus/js/layer/WMS.d.ts +75 -0
- package/lib/@openglobus/js/layer/XYZ.d.ts +148 -0
- package/lib/@openglobus/js/layer/index.d.ts +12 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +174 -0
- package/lib/@openglobus/js/math/Line2.d.ts +11 -0
- package/lib/@openglobus/js/math/Line3.d.ts +28 -0
- package/lib/@openglobus/js/math/Mat3.d.ts +77 -0
- package/lib/@openglobus/js/math/Mat4.d.ts +195 -0
- package/lib/@openglobus/js/math/Plane.d.ts +20 -0
- package/lib/@openglobus/js/math/Quat.d.ts +373 -0
- package/lib/@openglobus/js/math/Ray.d.ts +76 -0
- package/lib/@openglobus/js/math/Vec2.d.ts +310 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +472 -0
- package/lib/@openglobus/js/math/Vec4.d.ts +163 -0
- package/lib/@openglobus/js/math/coder.d.ts +51 -0
- package/lib/@openglobus/js/math/index.d.ts +11 -0
- package/lib/@openglobus/js/math.d.ts +266 -0
- package/lib/@openglobus/js/mercator.d.ts +92 -0
- package/lib/@openglobus/js/proj/EPSG3857.d.ts +9 -0
- package/lib/@openglobus/js/proj/EPSG4326.d.ts +9 -0
- package/lib/@openglobus/js/proj/Proj.d.ts +43 -0
- package/lib/@openglobus/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/EarthQuadTreeStrategy.d.ts +9 -0
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +54 -0
- package/lib/@openglobus/js/quadTree/MarsQuadTreeStrategy.d.ts +11 -0
- package/lib/@openglobus/js/quadTree/Node.d.ts +80 -0
- package/lib/@openglobus/js/quadTree/QuadTreeStrategy.d.ts +28 -0
- package/lib/@openglobus/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
- package/lib/@openglobus/js/quadTree/index.d.ts +12 -0
- package/lib/@openglobus/js/quadTree/quadTree.d.ts +40 -0
- package/lib/@openglobus/js/renderer/Renderer.d.ts +319 -0
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +240 -0
- package/lib/@openglobus/js/scene/Axes.d.ts +12 -0
- package/lib/@openglobus/js/scene/BaseNode.d.ts +61 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +652 -0
- package/lib/@openglobus/js/scene/RenderNode.d.ts +150 -0
- package/lib/@openglobus/js/scene/SkyBox.d.ts +13 -0
- package/lib/@openglobus/js/scene/index.d.ts +5 -0
- package/lib/@openglobus/js/segment/Segment.d.ts +288 -0
- package/lib/@openglobus/js/segment/SegmentLonLat.d.ts +44 -0
- package/lib/@openglobus/js/segment/SegmentLonLatWgs84.d.ts +10 -0
- package/lib/@openglobus/js/segment/Slice.d.ts +13 -0
- package/lib/@openglobus/js/segment/segmentHelper.d.ts +18 -0
- package/lib/@openglobus/js/shaders/atmos.d.ts +4 -0
- package/lib/@openglobus/js/shaders/billboard.d.ts +3 -0
- package/lib/@openglobus/js/shaders/bloom.d.ts +2 -0
- package/lib/@openglobus/js/shaders/blur.d.ts +3 -0
- package/lib/@openglobus/js/shaders/depth.d.ts +2 -0
- package/lib/@openglobus/js/shaders/drawnode.d.ts +8 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +3 -0
- package/lib/@openglobus/js/shaders/label.d.ts +4 -0
- package/lib/@openglobus/js/shaders/lumFilter.d.ts +2 -0
- package/lib/@openglobus/js/shaders/pointCloud.d.ts +2 -0
- package/lib/@openglobus/js/shaders/polyline.d.ts +3 -0
- package/lib/@openglobus/js/shaders/ray.d.ts +2 -0
- package/lib/@openglobus/js/shaders/screenFrame.d.ts +2 -0
- package/lib/@openglobus/js/shaders/skybox.d.ts +2 -0
- package/lib/@openglobus/js/shaders/toneMapping.d.ts +2 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -0
- package/lib/@openglobus/js/terrain/BilTerrain.d.ts +18 -0
- package/lib/@openglobus/js/terrain/EmptyTerrain.d.ts +113 -0
- package/lib/@openglobus/js/terrain/Geoid.d.ts +33 -0
- package/lib/@openglobus/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +137 -0
- package/lib/{js/terrain/MapboxTerrain.d.ts → @openglobus/js/terrain/RgbTerrain.d.ts} +5 -5
- package/lib/@openglobus/js/terrain/index.d.ts +6 -0
- package/lib/@openglobus/js/ui/Button.d.ts +32 -0
- package/lib/@openglobus/js/ui/ButtonGroup.d.ts +16 -0
- package/lib/@openglobus/js/ui/Color.d.ts +22 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +55 -0
- package/lib/@openglobus/js/ui/Slider.d.ts +38 -0
- package/lib/@openglobus/js/ui/ToggleButton.d.ts +20 -0
- package/lib/@openglobus/js/ui/View.d.ts +37 -0
- package/lib/@openglobus/js/ui/icons.d.ts +1 -0
- package/lib/@openglobus/js/utils/BaseWorker.d.ts +14 -0
- package/lib/@openglobus/js/utils/FontAtlas.d.ts +82 -0
- package/lib/@openglobus/js/utils/GeoImageCreator.d.ts +34 -0
- package/lib/@openglobus/js/utils/ImagesCacheManager.d.ts +22 -0
- package/lib/@openglobus/js/utils/Loader.d.ts +63 -0
- package/lib/@openglobus/js/utils/NormalMapCreator.d.ts +52 -0
- package/lib/@openglobus/js/utils/PlainSegmentWorker.d.ts +24 -0
- package/lib/@openglobus/js/utils/TerrainWorker.d.ts +28 -0
- package/lib/@openglobus/js/utils/TextureAtlas.d.ts +113 -0
- package/lib/@openglobus/js/utils/VectorTileCreator.d.ts +18 -0
- package/lib/@openglobus/js/utils/colorTable.d.ts +3 -0
- package/lib/@openglobus/js/utils/earcut.d.ts +7 -0
- package/lib/@openglobus/js/utils/objParser.d.ts +24 -0
- package/lib/@openglobus/js/utils/shared.d.ts +263 -0
- package/lib/@openglobus/js/utils/units.d.ts +16 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +53 -0
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +69 -0
- package/lib/@openglobus/js/webgl/Handler.d.ts +473 -0
- package/lib/@openglobus/js/webgl/Multisample.d.ts +27 -0
- package/lib/@openglobus/js/webgl/Program.d.ts +159 -0
- package/lib/@openglobus/js/webgl/ProgramController.d.ts +86 -0
- package/lib/@openglobus/js/webgl/index.d.ts +6 -0
- package/lib/@openglobus/js/webgl/types.d.ts +9 -0
- package/lib/@openglobus/js/webgl/variableHandlers.d.ts +22 -0
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Extent.js +2 -2
- package/lib/js/Globe.d.ts +1 -1
- package/lib/js/Object3d.d.ts +8 -1
- package/lib/js/Object3d.js +12 -2
- package/lib/js/camera/Frustum.d.ts +1 -1
- package/lib/js/camera/Frustum.js +3 -2
- package/lib/js/control/DebugInfo.js +19 -18
- package/lib/js/control/Lighting.d.ts +4 -0
- package/lib/js/control/Lighting.js +51 -12
- package/lib/js/control/SimpleSkyBackground.d.ts +2 -0
- package/lib/js/control/SimpleSkyBackground.js +13 -3
- package/lib/js/control/drawing/PolygonDrawingScene.js +2 -2
- package/lib/js/control/visibleExtent/drawnode.js +1 -1
- package/lib/js/entity/GeoObject.d.ts +12 -3
- package/lib/js/entity/GeoObject.js +34 -2
- package/lib/js/entity/GeoObjectHandler.d.ts +5 -0
- package/lib/js/entity/GeoObjectHandler.js +47 -0
- package/lib/js/entity/Geometry.d.ts +24 -11
- package/lib/js/entity/Geometry.js +17 -9
- package/lib/js/entity/GeometryHandler.js +5 -5
- package/lib/js/entity/Label.d.ts +7 -0
- package/lib/js/entity/Label.js +11 -0
- package/lib/js/entity/Polyline.d.ts +15 -7
- package/lib/js/entity/Polyline.js +54 -6
- package/lib/js/entity/Strip.d.ts +12 -0
- package/lib/js/entity/Strip.js +16 -0
- package/lib/js/entity/StripHandler.js +1 -1
- package/lib/js/entity/index.d.ts +10 -11
- package/lib/js/entity/index.js +10 -11
- package/lib/js/index.d.ts +5 -5
- package/lib/js/index.js +5 -5
- package/lib/js/layer/Bing.d.ts +4 -0
- package/lib/js/layer/Bing.js +40 -0
- package/lib/js/layer/GeoImage.d.ts +1 -1
- package/lib/js/layer/GeoVideo.d.ts +1 -1
- package/lib/js/layer/Layer.d.ts +1 -1
- package/lib/js/layer/Layer.js +2 -2
- package/lib/js/layer/OpenStreetMap.d.ts +4 -0
- package/lib/js/layer/OpenStreetMap.js +19 -0
- package/lib/js/layer/Vector.d.ts +3 -0
- package/lib/js/layer/Vector.js +3 -3
- package/lib/js/layer/index.d.ts +12 -11
- package/lib/js/layer/index.js +12 -11
- package/lib/js/math/Mat4.js +18 -17
- package/lib/js/mercator.js +2 -1
- package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +4 -5
- package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/EarthQuadTreeStrategy.js +40 -5
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +13 -14
- package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +5 -0
- package/lib/js/quadTree/MarsQuadTreeStrategy.js +31 -5
- package/lib/js/quadTree/Node.d.ts +2 -1
- package/lib/js/quadTree/Node.js +38 -28
- package/lib/js/quadTree/QuadTreeStrategy.d.ts +3 -0
- package/lib/js/quadTree/QuadTreeStrategy.js +17 -0
- package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +3 -3
- package/lib/js/renderer/Renderer.js +1 -0
- package/lib/js/scene/Planet.js +6 -4
- package/lib/js/segment/Segment.d.ts +12 -9
- package/lib/js/segment/Segment.js +47 -24
- package/lib/js/segment/SegmentLonLat.d.ts +1 -5
- package/lib/js/segment/SegmentLonLat.js +8 -100
- package/lib/js/segment/SegmentLonLatWgs84.js +5 -3
- package/lib/js/shaders/billboard.js +4 -4
- package/lib/js/shaders/drawnode.js +16 -19
- package/lib/js/shaders/geoObject.js +4 -5
- package/lib/js/shaders/ray.js +7 -3
- package/lib/js/terrain/BilTerrain.d.ts +1 -1
- package/lib/js/terrain/BilTerrain.js +7 -6
- package/lib/js/terrain/EmptyTerrain.d.ts +7 -0
- package/lib/js/terrain/EmptyTerrain.js +7 -0
- package/lib/js/terrain/GlobusRgbTerrain.d.ts +6 -0
- package/lib/js/terrain/GlobusRgbTerrain.js +25 -0
- package/lib/js/terrain/GlobusTerrain.d.ts +5 -5
- package/lib/js/terrain/GlobusTerrain.js +35 -30
- package/lib/js/terrain/RgbTerrain.d.ts +22 -0
- package/lib/js/terrain/RgbTerrain.js +415 -0
- package/lib/js/terrain/index.d.ts +3 -2
- package/lib/js/terrain/index.js +3 -2
- package/lib/js/ui/Color.d.ts +22 -0
- package/lib/js/ui/Color.js +58 -0
- package/lib/js/utils/GeoImageCreator.js +1 -1
- package/lib/js/utils/NormalMapCreator.js +1 -1
- package/lib/js/utils/VectorTileCreator.js +3 -3
- package/lib/js/utils/shared.d.ts +1 -8
- package/lib/js/utils/shared.js +17 -8
- package/package.json +2 -1
- package/lib/js/terrain/MapboxTerrain.js +0 -305
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Entity } from "./Entity";
|
|
2
|
+
import { Quat, Vec3, Vec4 } from "../math/index";
|
|
3
|
+
import { GeoObjectHandler, InstanceData } from "./GeoObjectHandler";
|
|
4
|
+
import { NumberArray3 } from "../math/Vec3";
|
|
5
|
+
import { NumberArray4 } from "../math/Vec4";
|
|
6
|
+
import { Object3d } from "../Object3d";
|
|
7
|
+
export interface IGeoObjectParams {
|
|
8
|
+
object3d?: Object3d;
|
|
9
|
+
objSrc?: string;
|
|
10
|
+
textureSrc?: string;
|
|
11
|
+
tag?: string;
|
|
12
|
+
position?: Vec3 | NumberArray3;
|
|
13
|
+
pitch?: number;
|
|
14
|
+
yaw?: number;
|
|
15
|
+
roll?: number;
|
|
16
|
+
scale?: number | Vec3;
|
|
17
|
+
color?: Vec4 | NumberArray4 | string;
|
|
18
|
+
visibility?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @class
|
|
22
|
+
* @param {Object} options - Geo object parameters:
|
|
23
|
+
* @param {Vec3} [options.position] - Geo object position.
|
|
24
|
+
*
|
|
25
|
+
* @todo: GeoObject and GeoObjectHandler provides instanced objects only.
|
|
26
|
+
* It would be nice if it could provide not instanced rendering loop too.
|
|
27
|
+
*/
|
|
28
|
+
declare class GeoObject {
|
|
29
|
+
protected _tag: string;
|
|
30
|
+
instanced: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Entity instance that holds this geo object.
|
|
33
|
+
* @public
|
|
34
|
+
* @type {Entity}
|
|
35
|
+
*/
|
|
36
|
+
_entity: Entity | null;
|
|
37
|
+
/**
|
|
38
|
+
* Geo object center cartesian position.
|
|
39
|
+
* @protected
|
|
40
|
+
* @type {Vec3}
|
|
41
|
+
*/
|
|
42
|
+
protected _position: Vec3;
|
|
43
|
+
_positionHigh: Vec3;
|
|
44
|
+
_positionLow: Vec3;
|
|
45
|
+
protected _pitch: number;
|
|
46
|
+
protected _yaw: number;
|
|
47
|
+
protected _roll: number;
|
|
48
|
+
protected _scale: Vec3;
|
|
49
|
+
/**
|
|
50
|
+
* RGBA color.
|
|
51
|
+
* @public
|
|
52
|
+
* @type {Vec4}
|
|
53
|
+
*/
|
|
54
|
+
_color: Vec4;
|
|
55
|
+
_direction: Vec3;
|
|
56
|
+
_handler: GeoObjectHandler | null;
|
|
57
|
+
_handlerIndex: number;
|
|
58
|
+
_tagData: InstanceData | null;
|
|
59
|
+
_tagDataIndex: number;
|
|
60
|
+
protected _object3d: Object3d;
|
|
61
|
+
protected _visibility: boolean;
|
|
62
|
+
protected _qNorthFrame: Quat;
|
|
63
|
+
private _textureSrc?;
|
|
64
|
+
_objectSrc?: string;
|
|
65
|
+
constructor(options: IGeoObjectParams);
|
|
66
|
+
get tag(): string;
|
|
67
|
+
getPosition(): Vec3;
|
|
68
|
+
getPitch(): number;
|
|
69
|
+
getYaw(): number;
|
|
70
|
+
getRoll(): number;
|
|
71
|
+
getDirection(): Vec3;
|
|
72
|
+
get object3d(): Object3d;
|
|
73
|
+
get vertices(): number[];
|
|
74
|
+
get normals(): number[];
|
|
75
|
+
get texCoords(): number[];
|
|
76
|
+
get indices(): number[];
|
|
77
|
+
/**
|
|
78
|
+
* Sets geo object opacity.
|
|
79
|
+
* @public
|
|
80
|
+
* @param {number} a - Billboard opacity.
|
|
81
|
+
*/
|
|
82
|
+
setOpacity(a: number): void;
|
|
83
|
+
/**
|
|
84
|
+
* Sets color.
|
|
85
|
+
* @public
|
|
86
|
+
* @param {number} r - Red.
|
|
87
|
+
* @param {number} g - Green.
|
|
88
|
+
* @param {number} b - Blue.
|
|
89
|
+
* @param {number} [a] - Alpha.
|
|
90
|
+
*/
|
|
91
|
+
setColor(r: number, g: number, b: number, a?: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* Sets color.
|
|
94
|
+
* @public
|
|
95
|
+
* @param {Vec3 | Vec4} color - RGBA vector.
|
|
96
|
+
*/
|
|
97
|
+
setColor4v(color: Vec3 | Vec4): void;
|
|
98
|
+
/**
|
|
99
|
+
* Sets geo object visibility.
|
|
100
|
+
* @public
|
|
101
|
+
* @param {boolean} visibility - Visibility flag.
|
|
102
|
+
*/
|
|
103
|
+
setVisibility(visibility: boolean): void;
|
|
104
|
+
/**
|
|
105
|
+
* Returns geo object visibility.
|
|
106
|
+
* @public
|
|
107
|
+
* @returns {boolean}
|
|
108
|
+
*/
|
|
109
|
+
getVisibility(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Sets geo object position.
|
|
112
|
+
* @public
|
|
113
|
+
* @param {number} x - X coordinate.
|
|
114
|
+
* @param {number} y - Y coordinate.
|
|
115
|
+
* @param {number} z - Z coordinate.
|
|
116
|
+
*/
|
|
117
|
+
setPosition(x: number, y: number, z: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* Sets geo object position.
|
|
120
|
+
* @public
|
|
121
|
+
* @param {Vec3} position - Cartesian coordinates.
|
|
122
|
+
*/
|
|
123
|
+
setPosition3v(position: Vec3): void;
|
|
124
|
+
setYaw(yaw: number): void;
|
|
125
|
+
setObject(object: Object3d): void;
|
|
126
|
+
setObjectSrc(src: string): void;
|
|
127
|
+
setTextureSrc(src: string): void;
|
|
128
|
+
setColorHTML(color: string): void;
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @param {number} pitch - Pitch in radians
|
|
132
|
+
*/
|
|
133
|
+
setPitch(pitch: number): void;
|
|
134
|
+
setRoll(roll: number): void;
|
|
135
|
+
setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
|
|
136
|
+
setScale(scale: number): void;
|
|
137
|
+
setScale3v(scale: Vec3): void;
|
|
138
|
+
getScale(): Vec3;
|
|
139
|
+
/**
|
|
140
|
+
* Removes geo object from handler.
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
remove(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Sets billboard picking color.
|
|
146
|
+
* @public
|
|
147
|
+
* @param {Vec3} color - Picking color.
|
|
148
|
+
*/
|
|
149
|
+
setPickingColor3v(color: Vec3): void;
|
|
150
|
+
updateDirection(): void;
|
|
151
|
+
}
|
|
152
|
+
export { GeoObject };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { TypedArray } from "../utils/shared";
|
|
2
|
+
import { EntityCollection } from "./EntityCollection";
|
|
3
|
+
import { GeoObject } from "./GeoObject";
|
|
4
|
+
import { Planet } from "../scene/Planet";
|
|
5
|
+
import { Vec3 } from "../math/Vec3";
|
|
6
|
+
import { Vec4 } from "../math/Vec4";
|
|
7
|
+
import { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
8
|
+
import { Object3d } from "../Object3d";
|
|
9
|
+
declare class InstanceData {
|
|
10
|
+
isFree: boolean;
|
|
11
|
+
_geoObjectHandler: GeoObjectHandler;
|
|
12
|
+
geoObjects: GeoObject[];
|
|
13
|
+
numInstances: number;
|
|
14
|
+
_texture: WebGLTextureExt | null;
|
|
15
|
+
_textureSrc: string | null;
|
|
16
|
+
_objectSrc?: string;
|
|
17
|
+
_pitchRollArr: number[] | TypedArray;
|
|
18
|
+
_sizeArr: number[] | TypedArray;
|
|
19
|
+
_vertexArr: number[] | TypedArray;
|
|
20
|
+
_positionHighArr: number[] | TypedArray;
|
|
21
|
+
_positionLowArr: number[] | TypedArray;
|
|
22
|
+
_directionArr: number[] | TypedArray;
|
|
23
|
+
_rgbaArr: number[] | TypedArray;
|
|
24
|
+
_normalsArr: number[] | TypedArray;
|
|
25
|
+
_indicesArr: number[] | TypedArray;
|
|
26
|
+
_pickingColorArr: number[] | TypedArray;
|
|
27
|
+
_visibleArr: number[] | TypedArray;
|
|
28
|
+
_texCoordArr: number[] | TypedArray;
|
|
29
|
+
_pitchRollBuffer: WebGLBufferExt | null;
|
|
30
|
+
_sizeBuffer: WebGLBufferExt | null;
|
|
31
|
+
_vertexBuffer: WebGLBufferExt | null;
|
|
32
|
+
_positionHighBuffer: WebGLBufferExt | null;
|
|
33
|
+
_positionLowBuffer: WebGLBufferExt | null;
|
|
34
|
+
_directionBuffer: WebGLBufferExt | null;
|
|
35
|
+
_rgbaBuffer: WebGLBufferExt | null;
|
|
36
|
+
_normalsBuffer: WebGLBufferExt | null;
|
|
37
|
+
_indicesBuffer: WebGLBufferExt | null;
|
|
38
|
+
_pickingColorBuffer: WebGLBufferExt | null;
|
|
39
|
+
_visibleBuffer: WebGLBufferExt | null;
|
|
40
|
+
_texCoordBuffer: WebGLBufferExt | null;
|
|
41
|
+
_buffersUpdateCallbacks: Function[];
|
|
42
|
+
_changedBuffers: boolean[];
|
|
43
|
+
constructor(geoObjectHandler: GeoObjectHandler);
|
|
44
|
+
createTexture(image: HTMLCanvasElement | ImageBitmap | ImageData | HTMLImageElement): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
_deleteBuffers(): void;
|
|
47
|
+
createVertexBuffer(): void;
|
|
48
|
+
createPitchRollBuffer(): void;
|
|
49
|
+
createVisibleBuffer(): void;
|
|
50
|
+
createSizeBuffer(): void;
|
|
51
|
+
createTexCoordBuffer(): void;
|
|
52
|
+
createPositionBuffer(): void;
|
|
53
|
+
createRgbaBuffer(): void;
|
|
54
|
+
createDirectionBuffer(): void;
|
|
55
|
+
createNormalsBuffer(): void;
|
|
56
|
+
createIndicesBuffer(): void;
|
|
57
|
+
createPickingColorBuffer(): void;
|
|
58
|
+
refresh(): void;
|
|
59
|
+
update(): void;
|
|
60
|
+
}
|
|
61
|
+
declare class GeoObjectHandler {
|
|
62
|
+
static __counter__: number;
|
|
63
|
+
protected __id: number;
|
|
64
|
+
/**
|
|
65
|
+
* Picking rendering option.
|
|
66
|
+
* @public
|
|
67
|
+
* @type {boolean}
|
|
68
|
+
*/
|
|
69
|
+
pickingEnabled: boolean;
|
|
70
|
+
protected _entityCollection: EntityCollection;
|
|
71
|
+
_planet: Planet | null;
|
|
72
|
+
protected _geoObjects: GeoObject[];
|
|
73
|
+
protected _instanceDataMap: Map<string, InstanceData>;
|
|
74
|
+
protected _instanceDataMapValues: InstanceData[];
|
|
75
|
+
protected _dataTagUpdateQueue: InstanceData[];
|
|
76
|
+
constructor(entityCollection: EntityCollection);
|
|
77
|
+
initProgram(): void;
|
|
78
|
+
setRenderNode(renderNode: Planet): void;
|
|
79
|
+
setTextureTag(src: string, tag: string): void;
|
|
80
|
+
setObjectSrc(src: string, tag: string): void;
|
|
81
|
+
_updateInstanceData(object: Object3d, tag: string): void;
|
|
82
|
+
protected _addGeoObjectToArray(geoObject: GeoObject): void;
|
|
83
|
+
_displayPASS(): void;
|
|
84
|
+
drawPicking(): void;
|
|
85
|
+
protected _pickingPASS(): void;
|
|
86
|
+
_loadDataTagTexture(tagData: InstanceData): Promise<void>;
|
|
87
|
+
setDirectionArr(tagData: InstanceData, tagDataIndex: number, direction: Vec3): void;
|
|
88
|
+
setVisibility(tagData: InstanceData, tagDataIndex: number, visibility: boolean): void;
|
|
89
|
+
setPositionArr(tagData: InstanceData, tagDataIndex: number, positionHigh: Vec3, positionLow: Vec3): void;
|
|
90
|
+
setRgbaArr(tagData: InstanceData, tagDataIndex: number, rgba: Vec4): void;
|
|
91
|
+
setPickingColorArr(tagData: InstanceData, tagDataIndex: number, color: Vec3): void;
|
|
92
|
+
setPitchRollArr(tagData: InstanceData, tagDataIndex: number, pitch: number, roll: number): void;
|
|
93
|
+
setScaleArr(tagData: InstanceData, tagDataIndex: number, scale: Vec3): void;
|
|
94
|
+
protected _updateTag(dataTag: InstanceData): void;
|
|
95
|
+
update(): void;
|
|
96
|
+
_removeAll(): void;
|
|
97
|
+
clear(): void;
|
|
98
|
+
draw(): void;
|
|
99
|
+
add(geoObject: GeoObject): void;
|
|
100
|
+
remove(geoObject: GeoObject): void;
|
|
101
|
+
_clearDataTagQueue(): void;
|
|
102
|
+
_removeGeoObject(geoObject: GeoObject): void;
|
|
103
|
+
}
|
|
104
|
+
export { GeoObjectHandler, InstanceData };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Entity } from "./Entity";
|
|
2
|
+
import { Extent } from "../Extent";
|
|
3
|
+
import { GeometryHandler } from "./GeometryHandler";
|
|
4
|
+
import { NumberArray4, Vec4 } from "../math/Vec4";
|
|
5
|
+
import { NumberArray2 } from "../math/Vec2";
|
|
6
|
+
import { NumberArray3 } from "../math/Vec3";
|
|
7
|
+
export declare enum GeometryTypeEnum {
|
|
8
|
+
POINT = 1,
|
|
9
|
+
LINESTRING = 2,
|
|
10
|
+
POLYGON = 3,
|
|
11
|
+
MULTIPOLYGON = 4,
|
|
12
|
+
MULTILINESTRING = 5
|
|
13
|
+
}
|
|
14
|
+
export type CoordinatesType = NumberArray2 | NumberArray3;
|
|
15
|
+
export type IPointCoordinates = CoordinatesType;
|
|
16
|
+
export type ILineStringCoordinates = CoordinatesType[];
|
|
17
|
+
export type IPolygonCoordinates = CoordinatesType[][];
|
|
18
|
+
export type IMultiLineStringCoordinates = ILineStringCoordinates[];
|
|
19
|
+
export type IMultiPolygonCoordinates = IPolygonCoordinates[];
|
|
20
|
+
export type IGeometryCoordinates = IPointCoordinates | IPolygonCoordinates | IMultiPolygonCoordinates | ILineStringCoordinates | IMultiLineStringCoordinates;
|
|
21
|
+
export type GeometryTypeToCoordinates = {
|
|
22
|
+
POINT: IPointCoordinates;
|
|
23
|
+
LINESTRING: ILineStringCoordinates;
|
|
24
|
+
POLYGON: IPolygonCoordinates;
|
|
25
|
+
MULTIPOLYGON: IMultiPolygonCoordinates;
|
|
26
|
+
MULTILINESTRING: IMultiLineStringCoordinates;
|
|
27
|
+
};
|
|
28
|
+
interface IGeometry<T extends keyof typeof GeometryTypeEnum = keyof typeof GeometryTypeEnum> {
|
|
29
|
+
type: T;
|
|
30
|
+
coordinates: GeometryTypeToCoordinates[T];
|
|
31
|
+
}
|
|
32
|
+
export interface IGeometryStyle {
|
|
33
|
+
fillColor?: string | NumberArray4 | Vec4;
|
|
34
|
+
lineColor?: string | NumberArray4 | Vec4;
|
|
35
|
+
strokeColor?: string | NumberArray4 | Vec4;
|
|
36
|
+
lineWidth?: number;
|
|
37
|
+
strokeWidth?: number;
|
|
38
|
+
}
|
|
39
|
+
interface IGeometryStyleInternal {
|
|
40
|
+
fillColor: Vec4;
|
|
41
|
+
lineColor: Vec4;
|
|
42
|
+
strokeColor: Vec4;
|
|
43
|
+
lineWidth: number;
|
|
44
|
+
strokeWidth: number;
|
|
45
|
+
}
|
|
46
|
+
export interface IGeometryParams<T extends keyof typeof GeometryTypeEnum = keyof typeof GeometryTypeEnum> {
|
|
47
|
+
type?: T;
|
|
48
|
+
coordinates?: GeometryTypeToCoordinates[T];
|
|
49
|
+
style?: IGeometryStyle;
|
|
50
|
+
visibility?: boolean;
|
|
51
|
+
}
|
|
52
|
+
declare class Geometry {
|
|
53
|
+
static __counter__: number;
|
|
54
|
+
__id: number;
|
|
55
|
+
/**
|
|
56
|
+
* Entity instance that holds this geometry.
|
|
57
|
+
* @public
|
|
58
|
+
* @type {Entity}
|
|
59
|
+
*/
|
|
60
|
+
_entity: Entity | null;
|
|
61
|
+
_handler: GeometryHandler | null;
|
|
62
|
+
_handlerIndex: number;
|
|
63
|
+
_polyVerticesHighMerc: number[];
|
|
64
|
+
_polyVerticesLowMerc: number[];
|
|
65
|
+
_polyVerticesLength: number;
|
|
66
|
+
_polyIndexesLength: number;
|
|
67
|
+
_polyVerticesHandlerIndex: number;
|
|
68
|
+
_polyIndexesHandlerIndex: number;
|
|
69
|
+
_lineVerticesHighMerc: number[];
|
|
70
|
+
_lineVerticesLowMerc: number[];
|
|
71
|
+
_lineVerticesLength: number;
|
|
72
|
+
_lineOrdersLength: number;
|
|
73
|
+
_lineIndexesLength: number;
|
|
74
|
+
_lineColorsLength: number;
|
|
75
|
+
_lineThicknessLength: number;
|
|
76
|
+
_lineVerticesHandlerIndex: number;
|
|
77
|
+
_lineOrdersHandlerIndex: number;
|
|
78
|
+
_lineIndexesHandlerIndex: number;
|
|
79
|
+
_lineThicknessHandlerIndex: number;
|
|
80
|
+
_lineColorsHandlerIndex: number;
|
|
81
|
+
protected _type: GeometryTypeEnum;
|
|
82
|
+
_coordinates: IGeometryCoordinates;
|
|
83
|
+
protected _extent: Extent;
|
|
84
|
+
_style: IGeometryStyleInternal;
|
|
85
|
+
protected _visibility: boolean;
|
|
86
|
+
_pickingReady: boolean;
|
|
87
|
+
constructor(options?: IGeometryParams);
|
|
88
|
+
get id(): number;
|
|
89
|
+
get type(): number;
|
|
90
|
+
static getType(typeStr: keyof typeof GeometryTypeEnum): GeometryTypeEnum;
|
|
91
|
+
/**
|
|
92
|
+
* Returns geometry extent.
|
|
93
|
+
@static
|
|
94
|
+
@param {IGeometry} geometryObj - GeoJSON style geometry feature.
|
|
95
|
+
@param {IGeometryCoordinates} outCoordinates - Geometry feature coordinates clone.
|
|
96
|
+
@returns {Extent} -
|
|
97
|
+
*/
|
|
98
|
+
static getExtent(geometryObj: IGeometry, outCoordinates: IGeometryCoordinates): Extent;
|
|
99
|
+
/**
|
|
100
|
+
* @todo ASAP need test for this method
|
|
101
|
+
* @param geoJson
|
|
102
|
+
* @returns {Geometry}
|
|
103
|
+
*/
|
|
104
|
+
setGeometry(geoJson: IGeometry): Geometry;
|
|
105
|
+
setFillColor(r: number, g: number, b: number, a?: number): Geometry;
|
|
106
|
+
overlaps(extent: Extent): boolean;
|
|
107
|
+
setFillColor4v(rgba: Vec4): Geometry;
|
|
108
|
+
setStrokeColor(r: number, g: number, b: number, a?: number): Geometry;
|
|
109
|
+
setLineColor(r: number, g: number, b: number, a?: number): Geometry;
|
|
110
|
+
setStrokeColor4v(rgba: Vec4): Geometry;
|
|
111
|
+
setLineColor4v(rgba: Vec4): Geometry;
|
|
112
|
+
setStrokeOpacity(opacity: number): Geometry;
|
|
113
|
+
setLineOpacity(opacity: number): Geometry;
|
|
114
|
+
setStrokeWidth(width: number): Geometry;
|
|
115
|
+
bringToFront(): Geometry;
|
|
116
|
+
setLineWidth(width: number): Geometry;
|
|
117
|
+
setFillOpacity(opacity: number): Geometry;
|
|
118
|
+
setVisibility(visibility: boolean): Geometry;
|
|
119
|
+
getVisibility(): boolean;
|
|
120
|
+
remove(): void;
|
|
121
|
+
getExtent(): Extent;
|
|
122
|
+
getType(): number;
|
|
123
|
+
}
|
|
124
|
+
export { Geometry };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Extent } from "../Extent";
|
|
2
|
+
import { Handler } from "../webgl/Handler";
|
|
3
|
+
import { Vector } from "../layer/Vector";
|
|
4
|
+
import { Node } from "../quadTree/Node";
|
|
5
|
+
import { Vec3 } from "../math/Vec3";
|
|
6
|
+
import { Vec4 } from "../math/Vec4";
|
|
7
|
+
import { CoordinatesType, Geometry } from "./Geometry";
|
|
8
|
+
import { WebGLBufferExt } from "../webgl/Handler";
|
|
9
|
+
declare class GeometryHandler {
|
|
10
|
+
static __counter__: number;
|
|
11
|
+
protected __id: number;
|
|
12
|
+
protected _layer: Vector;
|
|
13
|
+
protected _handler: Handler | null;
|
|
14
|
+
protected _geometries: Geometry[];
|
|
15
|
+
protected _updatedGeometryArr: Geometry[];
|
|
16
|
+
protected _updatedGeometry: Record<number, boolean>;
|
|
17
|
+
protected _removeGeometryExtentArr: Extent[];
|
|
18
|
+
protected _removeGeometryExtents: Record<number, boolean>;
|
|
19
|
+
protected _polyVerticesHighMerc: number[];
|
|
20
|
+
protected _polyVerticesLowMerc: number[];
|
|
21
|
+
protected _polyColors: number[];
|
|
22
|
+
protected _polyPickingColors: number[];
|
|
23
|
+
protected _polyIndexes: number[];
|
|
24
|
+
protected _lineVerticesHighMerc: number[];
|
|
25
|
+
protected _lineVerticesLowMerc: number[];
|
|
26
|
+
protected _lineOrders: number[];
|
|
27
|
+
protected _lineIndexes: number[];
|
|
28
|
+
protected _lineColors: number[];
|
|
29
|
+
protected _linePickingColors: number[];
|
|
30
|
+
protected _lineThickness: number[];
|
|
31
|
+
protected _lineStrokes: number[];
|
|
32
|
+
protected _lineStrokeColors: number[];
|
|
33
|
+
_polyVerticesHighBufferMerc: WebGLBufferExt | null;
|
|
34
|
+
_polyVerticesLowBufferMerc: WebGLBufferExt | null;
|
|
35
|
+
_polyColorsBuffer: WebGLBufferExt | null;
|
|
36
|
+
_polyPickingColorsBuffer: WebGLBufferExt | null;
|
|
37
|
+
_polyIndexesBuffer: WebGLBufferExt | null;
|
|
38
|
+
_lineVerticesHighBufferMerc: WebGLBufferExt | null;
|
|
39
|
+
_lineVerticesLowBufferMerc: WebGLBufferExt | null;
|
|
40
|
+
_lineColorsBuffer: WebGLBufferExt | null;
|
|
41
|
+
_linePickingColorsBuffer: WebGLBufferExt | null;
|
|
42
|
+
_lineThicknessBuffer: WebGLBufferExt | null;
|
|
43
|
+
_lineStrokesBuffer: WebGLBufferExt | null;
|
|
44
|
+
_lineStrokeColorsBuffer: WebGLBufferExt | null;
|
|
45
|
+
_lineOrdersBuffer: WebGLBufferExt | null;
|
|
46
|
+
_lineIndexesBuffer: WebGLBufferExt | null;
|
|
47
|
+
protected _buffersUpdateCallbacks: Function[];
|
|
48
|
+
protected _changedBuffers: boolean[];
|
|
49
|
+
constructor(layer: Vector);
|
|
50
|
+
static appendLineData(pathArr: CoordinatesType[][], isClosed: boolean, color: Vec4, pickingColor: Vec3, thickness: number, strokeColor: Vec4, strokeSize: number, outVerticesHigh: number[], outVerticesLow: number[], outOrders: number[], outIndexes: number[], outColors: number[], outPickingColors: number[], outThickness: number[], outStrokeColors: number[], outStrokes: number[], outVerticesHigh2: number[], outVerticesLow2: number[]): void;
|
|
51
|
+
assignHandler(handler: Handler): void;
|
|
52
|
+
/**
|
|
53
|
+
* @public
|
|
54
|
+
* @param {Geometry} geometry - Geometry object.
|
|
55
|
+
*/
|
|
56
|
+
add(geometry: Geometry): void;
|
|
57
|
+
remove(geometry: Geometry): void;
|
|
58
|
+
protected _refreshRecursevely(geometry: Geometry, treeNode: Node): void;
|
|
59
|
+
protected _refreshRecursevelyExt(extent: Extent, treeNode: Node): void;
|
|
60
|
+
protected _refreshPlanetNode(treeNode: Node): void;
|
|
61
|
+
protected _updatePlanet(): void;
|
|
62
|
+
protected refresh(): void;
|
|
63
|
+
update(): void;
|
|
64
|
+
setGeometryVisibility(geometry: Geometry): void;
|
|
65
|
+
setPolyColorArr(geometry: Geometry, color: Vec4): void;
|
|
66
|
+
setLineStrokeColorArr(geometry: Geometry, color: Vec4): void;
|
|
67
|
+
setLineColorArr(geometry: Geometry, color: Vec4): void;
|
|
68
|
+
setLineStrokeArr(geometry: Geometry, width: number): void;
|
|
69
|
+
setLineThicknessArr(geometry: Geometry, width: number): void;
|
|
70
|
+
bringToFront(geometry: Geometry): void;
|
|
71
|
+
createPolyVerticesBuffer(): void;
|
|
72
|
+
createPolyIndexesBuffer(): void;
|
|
73
|
+
createPolyColorsBuffer(): void;
|
|
74
|
+
createPolyPickingColorsBuffer(): void;
|
|
75
|
+
createLineVerticesBuffer(): void;
|
|
76
|
+
createLineIndexesBuffer(): void;
|
|
77
|
+
createLineOrdersBuffer(): void;
|
|
78
|
+
createLineColorsBuffer(): void;
|
|
79
|
+
createLinePickingColorsBuffer(): void;
|
|
80
|
+
createLineThicknessBuffer(): void;
|
|
81
|
+
createLineStrokesBuffer(): void;
|
|
82
|
+
createLineStrokeColorsBuffer(): void;
|
|
83
|
+
}
|
|
84
|
+
export { GeometryHandler };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { BaseBillboard, IBaseBillboardParams } from "./BaseBillboard";
|
|
2
|
+
import { NumberArray4, Vec4 } from "../math/Vec4";
|
|
3
|
+
import { FontAtlas } from "../utils/FontAtlas";
|
|
4
|
+
import { LabelHandler } from "./LabelHandler";
|
|
5
|
+
export interface ILabelParams extends IBaseBillboardParams {
|
|
6
|
+
text?: string;
|
|
7
|
+
face?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
opacity?: number;
|
|
10
|
+
outline?: number;
|
|
11
|
+
outlineColor?: string | NumberArray4 | Vec4;
|
|
12
|
+
align?: string;
|
|
13
|
+
isRTL?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const ALIGN: Record<string, number>;
|
|
16
|
+
/**
|
|
17
|
+
* Billboard text label.
|
|
18
|
+
* @class
|
|
19
|
+
* @extends {BaseBillboard}
|
|
20
|
+
* @param {Object} [options] - Label options:
|
|
21
|
+
* @param {Vec3|Array.<number>} [options.position] - Billboard spatial position.
|
|
22
|
+
* @param {number} [options.rotation] - Screen angle rotation.
|
|
23
|
+
* @param {Vec4|string|Array.<number>} [options.color] - Billboard color.
|
|
24
|
+
* @param {Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
|
|
25
|
+
* @param {Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
|
|
26
|
+
* @param {boolean} [options.visibility] - Visibility.
|
|
27
|
+
* @param {string} [options.text] - Text string.
|
|
28
|
+
* @param {string} [options.face] - HTML5 font face.
|
|
29
|
+
* @param {number} [options.size] - Font size in pixels.
|
|
30
|
+
* @param {string} [options.style] - HTML5 font style. Example 'normal', 'italic'.
|
|
31
|
+
* @param {string} [options.weight] - HTML5 font weight. Example 'normal', 'bold'.
|
|
32
|
+
* @param {number} [options.outline] - Text outline size. 0 - no outline, 1 - maximum outline. Default 0.58.
|
|
33
|
+
* @param {Vec4|string|Array.<number>} [options.outlineColor] - Outline color.
|
|
34
|
+
* @param {string} [options.align] - Text horizontal align: "left", "right" and "center".
|
|
35
|
+
*/
|
|
36
|
+
declare class Label extends BaseBillboard {
|
|
37
|
+
_handler: LabelHandler | null;
|
|
38
|
+
/**
|
|
39
|
+
* Label text string.
|
|
40
|
+
* @protected
|
|
41
|
+
* @type {string}
|
|
42
|
+
*/
|
|
43
|
+
protected _text: string;
|
|
44
|
+
/**
|
|
45
|
+
* HTML5 font face.
|
|
46
|
+
* @private
|
|
47
|
+
* @type {string}
|
|
48
|
+
*/
|
|
49
|
+
protected _face: string;
|
|
50
|
+
/**
|
|
51
|
+
* Font size in pixels.
|
|
52
|
+
* @protected
|
|
53
|
+
* @type {number}
|
|
54
|
+
*/
|
|
55
|
+
protected _size: number;
|
|
56
|
+
/**
|
|
57
|
+
* Label outline.
|
|
58
|
+
* @protected
|
|
59
|
+
* @type {number}
|
|
60
|
+
*/
|
|
61
|
+
protected _outline: number;
|
|
62
|
+
/**
|
|
63
|
+
* Label outline color.
|
|
64
|
+
* @protected
|
|
65
|
+
* @type {Vec4}
|
|
66
|
+
*/
|
|
67
|
+
protected _outlineColor: Vec4;
|
|
68
|
+
/**
|
|
69
|
+
* Text horizontal align: "left", "right" and "center".
|
|
70
|
+
* @private
|
|
71
|
+
* @type {Label.ALIGN}
|
|
72
|
+
*/
|
|
73
|
+
protected _align: number;
|
|
74
|
+
/**
|
|
75
|
+
* Label font atlas index.
|
|
76
|
+
* @protected
|
|
77
|
+
* @type {number}
|
|
78
|
+
*/
|
|
79
|
+
protected _fontIndex: number;
|
|
80
|
+
/**
|
|
81
|
+
* Font atlas pointer.
|
|
82
|
+
* @private
|
|
83
|
+
* @type {FontAtlas}
|
|
84
|
+
*/
|
|
85
|
+
protected _fontAtlas: FontAtlas | null;
|
|
86
|
+
protected _isRTL: boolean;
|
|
87
|
+
constructor(options?: ILabelParams);
|
|
88
|
+
/**
|
|
89
|
+
* Set label text.
|
|
90
|
+
* @public
|
|
91
|
+
* @param {string} text - Text string.
|
|
92
|
+
* It can't be bigger than maximum labelHandler _maxLetters value.
|
|
93
|
+
*/
|
|
94
|
+
setText(text: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Change text direction.
|
|
97
|
+
* @public
|
|
98
|
+
* @param {boolean} isRTL - Text string.
|
|
99
|
+
*/
|
|
100
|
+
setRtl(isRTL: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* Gets current text string.
|
|
103
|
+
* @public
|
|
104
|
+
* @returns {string}
|
|
105
|
+
*/
|
|
106
|
+
getText(): string;
|
|
107
|
+
/**
|
|
108
|
+
* Sets label text align. Could be center, left or right. Left is default.
|
|
109
|
+
* @public
|
|
110
|
+
* @param {string} align - Text align.
|
|
111
|
+
*/
|
|
112
|
+
setAlign(align: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Gets label text current alignment.
|
|
115
|
+
* @public
|
|
116
|
+
* @returns {string}
|
|
117
|
+
*/
|
|
118
|
+
getAlign(): number;
|
|
119
|
+
/**
|
|
120
|
+
* Sets font face family.
|
|
121
|
+
* @public
|
|
122
|
+
* @param {string} face - Font face family.
|
|
123
|
+
*/
|
|
124
|
+
setFace(face: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Gets current font face.
|
|
127
|
+
* @public
|
|
128
|
+
* @returns {string}
|
|
129
|
+
*/
|
|
130
|
+
getFace(): string;
|
|
131
|
+
/**
|
|
132
|
+
* Sets label font size in pixels.
|
|
133
|
+
* @public
|
|
134
|
+
* @param {number} size - Label size in pixels.
|
|
135
|
+
*/
|
|
136
|
+
setSize(size: number): void;
|
|
137
|
+
/**
|
|
138
|
+
* Gets label size in pixels.
|
|
139
|
+
* @public
|
|
140
|
+
* @returns {number}
|
|
141
|
+
*/
|
|
142
|
+
getSize(): number;
|
|
143
|
+
/**
|
|
144
|
+
* Sets text outline border size. Where 0 - is no outline, and 1 - is the maximum outline size.
|
|
145
|
+
* @public
|
|
146
|
+
* @param {number} outline - Text outline size.
|
|
147
|
+
*/
|
|
148
|
+
setOutline(outline: number): void;
|
|
149
|
+
/**
|
|
150
|
+
* Gets text current outline size.
|
|
151
|
+
* @public
|
|
152
|
+
* @returns {number}
|
|
153
|
+
*/
|
|
154
|
+
getOutline(): number;
|
|
155
|
+
/**
|
|
156
|
+
* Sets label opacity.
|
|
157
|
+
* @public
|
|
158
|
+
* @param {number} a - Label opacity.
|
|
159
|
+
*/
|
|
160
|
+
setOpacity(a: number): void;
|
|
161
|
+
/**
|
|
162
|
+
* Sets text outline color.
|
|
163
|
+
* @public
|
|
164
|
+
* @param {number} r - Red.
|
|
165
|
+
* @param {number} g - Green.
|
|
166
|
+
* @param {number} b - Blue.
|
|
167
|
+
* @param {number} a - Alpha.
|
|
168
|
+
*/
|
|
169
|
+
setOutlineColor(r: number, g: number, b: number, a: number): void;
|
|
170
|
+
/**
|
|
171
|
+
* Sets text outline color.
|
|
172
|
+
* @public
|
|
173
|
+
* @param {Vec4} rgba - Color vector.
|
|
174
|
+
*/
|
|
175
|
+
setOutlineColor4v(rgba: Vec4): void;
|
|
176
|
+
/**
|
|
177
|
+
* Sets text outline color HTML string.
|
|
178
|
+
* @public
|
|
179
|
+
* @param {string} color - HTML string color.
|
|
180
|
+
*/
|
|
181
|
+
setOutlineColorHTML(color: string): void;
|
|
182
|
+
/**
|
|
183
|
+
* Gets outline color vector.
|
|
184
|
+
* @public
|
|
185
|
+
* @returns {Vec4}
|
|
186
|
+
*/
|
|
187
|
+
getOutlineColor(): Vec4;
|
|
188
|
+
/**
|
|
189
|
+
* Sets outline opacity. Actually outline color alpha value.
|
|
190
|
+
* @public
|
|
191
|
+
* @param {number} opacity - Outline opacity.
|
|
192
|
+
*/
|
|
193
|
+
setOutlineOpacity(opacity: number): void;
|
|
194
|
+
/**
|
|
195
|
+
* Gets outline opacity value.
|
|
196
|
+
* @public
|
|
197
|
+
* @returns {number}
|
|
198
|
+
*/
|
|
199
|
+
getOutlineOpacity(): number;
|
|
200
|
+
/**
|
|
201
|
+
* Updates label parameters.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
update(): Promise<void>;
|
|
205
|
+
protected _applyFontIndex(fontIndex: number): void;
|
|
206
|
+
/**
|
|
207
|
+
* Assigns font atlas and update.
|
|
208
|
+
* @public
|
|
209
|
+
* @param {FontAtlas} fontAtlas - Font atlas.
|
|
210
|
+
*/
|
|
211
|
+
assignFontAtlas(fontAtlas: FontAtlas): void;
|
|
212
|
+
serializeWorkerData(workerId: number): Float32Array | null;
|
|
213
|
+
}
|
|
214
|
+
export { Label, ALIGN };
|