@openglobus/og 0.28.7 → 1.0.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/LICENSE.md +218 -4
  2. package/README.md +31 -18
  3. package/lib/Deferred.d.ts +2 -2
  4. package/lib/Events.d.ts +1 -1
  5. package/lib/Globe.d.ts +8 -5
  6. package/lib/Object3d.d.ts +17 -14
  7. package/lib/Popup.d.ts +2 -2
  8. package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +1 -0
  9. package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +1 -0
  10. package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +1 -0
  11. package/lib/bv/index.d.ts +2 -2
  12. package/lib/camera/Camera.d.ts +280 -27
  13. package/lib/camera/Frustum.d.ts +100 -15
  14. package/lib/camera/PlanetCamera.d.ts +93 -8
  15. package/lib/camera/index.d.ts +2 -2
  16. package/lib/control/CameraFrameComposer.d.ts +2 -2
  17. package/lib/control/CameraFrameHandler.d.ts +1 -1
  18. package/lib/control/CompassButton.d.ts +2 -2
  19. package/lib/control/EarthCoordinates.d.ts +5 -2
  20. package/lib/control/FramebufferPreview.d.ts +3 -3
  21. package/lib/control/GeoImageDragControl.d.ts +1 -1
  22. package/lib/control/LayerAnimation.d.ts +2 -2
  23. package/lib/control/LayerSwitcher.d.ts +3 -0
  24. package/lib/control/Lighting.d.ts +4 -2
  25. package/lib/control/Navigation.d.ts +15 -11
  26. package/lib/control/OrthoSwitcher.d.ts +18 -0
  27. package/lib/control/SimpleTouchNavigation.d.ts +44 -0
  28. package/lib/control/Sun.d.ts +4 -2
  29. package/lib/control/TouchNavigation.d.ts +4 -8
  30. package/lib/control/atmosphere/Atmosphere.d.ts +2 -0
  31. package/lib/control/atmosphere/AtmosphereConfig.d.ts +2 -6
  32. package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +17 -3
  33. package/lib/control/cameraDepthHandler/camera_depth.d.ts +2 -2
  34. package/lib/control/drawing/LineStringDrawingScene.d.ts +1 -0
  35. package/lib/control/drawing/PolygonDrawingScene.d.ts +14 -14
  36. package/lib/control/elevationProfile/ElevationProfile.d.ts +1 -1
  37. package/lib/control/elevationProfile/ElevationProfileLegend.d.ts +1 -1
  38. package/lib/control/elevationProfile/ElevationProfileScene.d.ts +9 -12
  39. package/lib/control/elevationProfile/ElevationProfileView.d.ts +16 -5
  40. package/lib/control/entityEditor/EntityEditor.d.ts +19 -0
  41. package/lib/control/{geoObjectEditor/GeoObjectEditorDialog.d.ts → entityEditor/EntityEditorDialog.d.ts} +9 -8
  42. package/lib/control/{geoObjectEditor/GeoObjectEditorScene.d.ts → entityEditor/EntityEditorScene.d.ts} +12 -12
  43. package/lib/control/{geoObjectEditor → entityEditor}/colors.d.ts +2 -2
  44. package/lib/control/entityTree/EntityTree.d.ts +46 -0
  45. package/lib/control/entityTree/EntityTreeView.d.ts +24 -0
  46. package/lib/control/heightRuler/HeightRulerScene.d.ts +3 -2
  47. package/lib/control/index.d.ts +5 -3
  48. package/lib/control/ruler/RulerScene.d.ts +8 -8
  49. package/lib/control/selection/SelectionScene.d.ts +6 -6
  50. package/lib/control/timeline/TimelineControl.d.ts +2 -2
  51. package/lib/control/timeline/TimelineModel.d.ts +1 -1
  52. package/lib/control/timeline/TimelineView.d.ts +52 -13
  53. package/lib/control/visibleExtent/segment.d.ts +7 -0
  54. package/lib/ellipsoid/index.d.ts +4 -4
  55. package/lib/entity/Entity.d.ts +114 -100
  56. package/lib/entity/EntityCollection.d.ts +95 -70
  57. package/lib/entity/{BaseBillboard.d.ts → billboard/BaseBillboard.d.ts} +16 -17
  58. package/lib/entity/{BaseBillboardHandler.d.ts → billboard/BaseBillboardHandler.d.ts} +24 -9
  59. package/lib/entity/{Billboard.d.ts → billboard/Billboard.d.ts} +11 -7
  60. package/lib/entity/{BillboardHandler.d.ts → billboard/BillboardHandler.d.ts} +1 -1
  61. package/lib/entity/{GeoObject.d.ts → geoObject/GeoObject.d.ts} +7 -6
  62. package/lib/entity/{GeoObjectHandler.d.ts → geoObject/GeoObjectHandler.d.ts} +29 -11
  63. package/lib/entity/{InstanceData.d.ts → geoObject/InstanceData.d.ts} +18 -13
  64. package/lib/entity/{Geometry.d.ts → geometry/Geometry.d.ts} +10 -10
  65. package/lib/entity/{GeometryHandler.d.ts → geometry/GeometryHandler.d.ts} +7 -7
  66. package/lib/entity/index.d.ts +8 -8
  67. package/lib/entity/{Label.d.ts → label/Label.d.ts} +12 -13
  68. package/lib/entity/{LabelHandler.d.ts → label/LabelHandler.d.ts} +31 -7
  69. package/lib/entity/{LabelWorker.d.ts → label/LabelWorker.d.ts} +3 -3
  70. package/lib/entity/{PointCloud.d.ts → pointCloud/PointCloud.d.ts} +18 -12
  71. package/lib/entity/{PointCloudHandler.d.ts → pointCloud/PointCloudHandler.d.ts} +4 -4
  72. package/lib/entity/polyline/Polyline.d.ts +242 -0
  73. package/lib/entity/polyline/PolylineBatchRenderer.d.ts +443 -0
  74. package/lib/entity/{PolylineHandler.d.ts → polyline/PolylineHandler.d.ts} +19 -7
  75. package/lib/entity/{Ray.d.ts → ray/Ray.d.ts} +27 -9
  76. package/lib/entity/{RayHandler.d.ts → ray/RayHandler.d.ts} +18 -8
  77. package/lib/entity/{Strip.d.ts → strip/Strip.d.ts} +21 -17
  78. package/lib/entity/{StripHandler.d.ts → strip/StripHandler.d.ts} +11 -6
  79. package/lib/index.d.ts +47 -42
  80. package/lib/layer/BaseGeoImage.d.ts +20 -17
  81. package/lib/layer/CanvasTiles.d.ts +14 -12
  82. package/lib/layer/GeoImage.d.ts +1 -1
  83. package/lib/layer/GeoTexture2d.d.ts +2 -2
  84. package/lib/layer/KML.d.ts +19 -18
  85. package/lib/layer/Layer.d.ts +72 -53
  86. package/lib/layer/Vector.d.ts +47 -30
  87. package/lib/layer/WMS.d.ts +1 -1
  88. package/lib/layer/XYZ.d.ts +11 -12
  89. package/lib/layer/index.d.ts +12 -12
  90. package/lib/math/Line2.d.ts +1 -1
  91. package/lib/math/Line3.d.ts +1 -1
  92. package/lib/math/Mat3.d.ts +3 -13
  93. package/lib/math/Mat4.d.ts +16 -10
  94. package/lib/math/Plane.d.ts +1 -1
  95. package/lib/math/Quat.d.ts +14 -12
  96. package/lib/math/Ray.d.ts +4 -3
  97. package/lib/math/Vec2.d.ts +25 -17
  98. package/lib/math/Vec3.d.ts +33 -31
  99. package/lib/math/Vec4.d.ts +1 -1
  100. package/lib/math/coder.d.ts +1 -1
  101. package/lib/math/index.d.ts +13 -14
  102. package/lib/mercator.d.ts +4 -4
  103. package/lib/og.css +1 -1
  104. package/lib/og.es.js +1 -1
  105. package/lib/og.es.js.map +1 -1
  106. package/lib/quadTree/EntityCollectionNode.d.ts +10 -10
  107. package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +5 -5
  108. package/lib/quadTree/QuadTreeStrategy.d.ts +3 -4
  109. package/lib/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +4 -4
  110. package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +4 -4
  111. package/lib/renderer/AtmosphereDeferredShading.d.ts +12 -0
  112. package/lib/renderer/IDeferredShadingPass.d.ts +8 -0
  113. package/lib/renderer/ITransparencyPass.d.ts +8 -0
  114. package/lib/renderer/PhongDeferredShading.d.ts +16 -0
  115. package/lib/renderer/Renderer.d.ts +166 -99
  116. package/lib/renderer/RendererEvents.d.ts +15 -5
  117. package/lib/renderer/WOITPass.d.ts +14 -0
  118. package/lib/res/fonts/Ephesis-Regular.json +1 -0
  119. package/lib/res/fonts/Ephesis-Regular.png +0 -0
  120. package/lib/res/fonts/Karla-Bold.json +1 -0
  121. package/lib/res/fonts/Karla-Bold.png +0 -0
  122. package/lib/res/fonts/Karla-Italic.json +1 -0
  123. package/lib/res/fonts/Karla-Italic.png +0 -0
  124. package/lib/res/fonts/Karla-Light.json +1 -0
  125. package/lib/res/fonts/Karla-Light.png +0 -0
  126. package/lib/res/fonts/Karla-Medium.json +1 -0
  127. package/lib/res/fonts/Karla-Medium.png +0 -0
  128. package/lib/res/fonts/Roboto-Regular.json +1 -37147
  129. package/lib/res/fonts/Roboto-Regular.png +0 -0
  130. package/lib/res/fonts/arial.json +1 -4321
  131. package/lib/res/fonts/arial.png +0 -0
  132. package/lib/res/night-4326.png +0 -0
  133. package/lib/res/night.png +0 -0
  134. package/lib/scene/AltitudeNearPlaneStrategy.d.ts +17 -0
  135. package/lib/scene/Axes.d.ts +4 -3
  136. package/lib/scene/Planet.d.ts +244 -69
  137. package/lib/scene/{RenderNode.d.ts → Scene.d.ts} +49 -46
  138. package/lib/scene/SkyBox.d.ts +5 -3
  139. package/lib/scene/index.d.ts +2 -2
  140. package/lib/segment/Segment.d.ts +29 -15
  141. package/lib/segment/SegmentLonLat.d.ts +0 -1
  142. package/lib/shadeModeConstants.d.ts +7 -0
  143. package/lib/shaders/applyDeferredDepth.d.ts +2 -0
  144. package/lib/shaders/atmos/atmos.d.ts +3 -3
  145. package/lib/shaders/billboard/billboard.d.ts +4 -3
  146. package/lib/shaders/deferredShading/deferredShading.d.ts +2 -0
  147. package/lib/shaders/deferredShading/deferredShadingAtmos.d.ts +3 -0
  148. package/lib/shaders/depth.d.ts +2 -2
  149. package/lib/shaders/geo_object/geo_object.d.ts +8 -4
  150. package/lib/shaders/label/label.d.ts +4 -4
  151. package/lib/shaders/pointCloud.d.ts +2 -2
  152. package/lib/shaders/polyline/polyline.d.ts +7 -3
  153. package/lib/shaders/ray/ray.d.ts +3 -2
  154. package/lib/shaders/screenFrame.d.ts +2 -2
  155. package/lib/shaders/segment/segment.d.ts +7 -0
  156. package/lib/shaders/skybox.d.ts +2 -2
  157. package/lib/shaders/strip/strip.d.ts +3 -0
  158. package/lib/shaders/tone_mapping/toneMapping.d.ts +2 -2
  159. package/lib/shaders/weightedOITResolve.d.ts +2 -0
  160. package/lib/terrain/BilTerrain.d.ts +1 -1
  161. package/lib/terrain/EmptyTerrain.d.ts +5 -6
  162. package/lib/terrain/GlobusTerrain.d.ts +18 -23
  163. package/lib/terrain/RgbTerrain.d.ts +8 -8
  164. package/lib/terrain/index.d.ts +5 -5
  165. package/lib/tsconfig.tsbuildinfo +1 -1
  166. package/lib/ui/Button.d.ts +7 -5
  167. package/lib/ui/ButtonGroup.d.ts +1 -1
  168. package/lib/ui/Checkbox.d.ts +2 -2
  169. package/lib/ui/Color.d.ts +2 -2
  170. package/lib/ui/Dialog.d.ts +30 -3
  171. package/lib/ui/Input.d.ts +7 -2
  172. package/lib/ui/Slider.d.ts +5 -2
  173. package/lib/ui/ToggleButton.d.ts +2 -2
  174. package/lib/ui/View.d.ts +1 -1
  175. package/lib/ui/icons.d.ts +1 -1
  176. package/lib/ui/index.d.ts +9 -9
  177. package/lib/utils/FontAtlas.d.ts +57 -8
  178. package/lib/utils/GeoImageCreator.d.ts +2 -2
  179. package/lib/utils/ImagesCacheManager.d.ts +3 -3
  180. package/lib/utils/Loader.d.ts +2 -2
  181. package/lib/utils/PlainSegmentWorker.d.ts +2 -2
  182. package/lib/utils/TerrainWorker.d.ts +2 -2
  183. package/lib/utils/TextureAtlas.d.ts +7 -2
  184. package/lib/utils/TextureResourceManager.d.ts +162 -0
  185. package/lib/utils/VectorTileCreator.d.ts +1 -1
  186. package/lib/utils/colorSpace.d.ts +9 -0
  187. package/lib/utils/gltf/gltfParser.d.ts +9 -2
  188. package/lib/utils/gltf/types.d.ts +20 -2
  189. package/lib/utils/shared.d.ts +11 -5
  190. package/lib/utils/textureResourceMeta.d.ts +9 -0
  191. package/lib/webgl/BaseFramebuffer.d.ts +7 -0
  192. package/lib/webgl/Framebuffer.d.ts +9 -6
  193. package/lib/webgl/Handler.d.ts +81 -99
  194. package/lib/webgl/ShaderProgram.d.ts +190 -0
  195. package/lib/webgl/index.d.ts +2 -2
  196. package/lib/webgl/variableHandlers.d.ts +2 -1
  197. package/package.json +77 -76
  198. package/lib/assets/LabelWorker.worker-BT1uJgYn.js.map +0 -1
  199. package/lib/assets/PlainSegmentWorker.worker-CT1cj8jj.js.map +0 -1
  200. package/lib/assets/TerrainWorker.worker-DmikdfB2.js.map +0 -1
  201. package/lib/control/OldMouseNavigation.d.ts +0 -65
  202. package/lib/control/ZoomControl.d.ts +0 -28
  203. package/lib/control/geoObjectEditor/GeoObjectEditor.d.ts +0 -13
  204. package/lib/control/visibleExtent/drawnode.d.ts +0 -7
  205. package/lib/entity/Polyline.d.ts +0 -417
  206. package/lib/light/LightSource.d.ts +0 -36
  207. package/lib/res/fonts/Roboto-Regular.ttf.cfg +0 -1340
  208. package/lib/res/fonts/Roboto-Regular.ttf.png +0 -0
  209. package/lib/res/fonts/arial.ttf.cfg +0 -1570
  210. package/lib/res/fonts/arial.ttf.png +0 -0
  211. package/lib/scene/BaseNode.d.ts +0 -61
  212. package/lib/shaders/drawnode/drawnode.d.ts +0 -8
  213. package/lib/webgl/Program.d.ts +0 -161
  214. package/lib/webgl/ProgramController.d.ts +0 -87
  215. /package/lib/control/{geoObjectEditor → entityEditor}/ArrowEntity.d.ts +0 -0
  216. /package/lib/control/{geoObjectEditor → entityEditor}/AxisTrackEntity.d.ts +0 -0
  217. /package/lib/control/{geoObjectEditor → entityEditor}/MoveAxisEntity.d.ts +0 -0
  218. /package/lib/control/{geoObjectEditor → entityEditor}/MovePlaneEntity.d.ts +0 -0
  219. /package/lib/control/{geoObjectEditor → entityEditor}/RotateEntity.d.ts +0 -0
  220. /package/lib/entity/{LabelWorker.worker.d.ts → label/LabelWorker.worker.d.ts} +0 -0
@@ -1,9 +1,9 @@
1
1
  import type { EventsHandler } from "../../Events";
2
2
  import { ButtonGroup } from "../../ui/ButtonGroup";
3
- import { View } from '../../ui/View';
4
- import type { IViewParams, ViewEventsList } from '../../ui/View';
3
+ import { View } from "../../ui/View";
4
+ import type { IViewParams, ViewEventsList } from "../../ui/View";
5
5
  import { ToggleButton } from "../../ui/ToggleButton";
6
- import { TimelineModel } from './TimelineModel';
6
+ import { TimelineModel } from "./TimelineModel";
7
7
  import type { MouseEventExt } from "../../input/MouseHandler";
8
8
  interface ITimelineViewParams extends IViewParams {
9
9
  currentDate?: Date;
@@ -13,18 +13,28 @@ interface ITimelineViewParams extends IViewParams {
13
13
  maxDate?: Date;
14
14
  fillStyle?: string;
15
15
  }
16
+ declare const TOUCH_MODE_NONE = 0;
17
+ declare const TOUCH_MODE_CURRENT = 1;
18
+ declare const TOUCH_MODE_PINCH = 2;
19
+ declare const TOUCH_MODE_SCALE = 3;
16
20
  type TimelineViewEventsList = [
17
- 'startdrag',
18
- 'stopdrag',
19
- 'startdragcurrent',
20
- 'stopdragcurrent',
21
- 'setcurrent',
22
- 'reset',
23
- 'play',
24
- 'playback',
25
- 'pause',
26
- 'visibility'
21
+ "startdrag",
22
+ "stopdrag",
23
+ "startdragcurrent",
24
+ "stopdragcurrent",
25
+ "setcurrent",
26
+ "reset",
27
+ "play",
28
+ "playback",
29
+ "pause",
30
+ "visibility"
27
31
  ];
32
+ type TimelineTouchMode = typeof TOUCH_MODE_NONE | typeof TOUCH_MODE_CURRENT | typeof TOUCH_MODE_PINCH | typeof TOUCH_MODE_SCALE;
33
+ interface ITimelineTouchPointer {
34
+ pointerId: number;
35
+ clientX: number;
36
+ clientY: number;
37
+ }
28
38
  declare class TimelineView extends View<TimelineModel> {
29
39
  events: EventsHandler<TimelineViewEventsList> & EventsHandler<ViewEventsList>;
30
40
  fillStyle: string;
@@ -46,6 +56,12 @@ declare class TimelineView extends View<TimelineModel> {
46
56
  protected _clickCurrentDate: Date;
47
57
  protected _clickTime: number;
48
58
  protected _clickDelay: number;
59
+ protected _clickMoveTolerance: number;
60
+ protected _touchMode: TimelineTouchMode;
61
+ protected _touchPinchDistance: number;
62
+ protected _touchPointers: Map<number, ITimelineTouchPointer>;
63
+ protected _touchScalePointerId: number | null;
64
+ protected _touchCurrentPointerId: number | null;
49
65
  protected _onResizeObserver_: () => void;
50
66
  protected _resizeObserver: ResizeObserver;
51
67
  protected _pauseBtn: ToggleButton;
@@ -67,17 +83,40 @@ declare class TimelineView extends View<TimelineModel> {
67
83
  protected _onMouseWheel: (e: MouseEventExt) => void;
68
84
  protected _onMouseWheelFF: (e: MouseEventExt) => void;
69
85
  protected _zoom(pointerTime: number, pointerCenterOffsetX: number, dir: number): void;
86
+ protected _zoomByScale(pointerTime: number, pointerCenterOffsetX: number, scale: number): void;
87
+ protected _startScaleDrag(clientX: number, sourceEvent: Event, allowClick?: boolean, pointerId?: number | null): void;
88
+ protected _moveScaleDrag(clientX: number): void;
89
+ protected _stopScaleDrag(clientX: number | null, allowClick?: boolean): void;
90
+ protected _startCurrentDrag(clientX: number, sourceEvent: Event, pointerId?: number | null): void;
91
+ protected _moveCurrentDrag(clientX: number): void;
92
+ protected _stopCurrentDrag(): void;
93
+ protected _isClickGesture(clientX: number): boolean;
94
+ protected _setCurrentByClientX(clientX: number): Date;
95
+ protected _captureTouchPointer(e: PointerEvent): void;
96
+ protected _updateTouchPointer(e: PointerEvent): void;
97
+ protected _releaseTouchPointerCapture(pointerId: number): void;
98
+ protected _getFirstTouchPointer(): ITimelineTouchPointer | null;
99
+ protected _getTwoTouchPointers(): [ITimelineTouchPointer, ITimelineTouchPointer] | null;
100
+ protected _getTouchPointer(pointerId: number | null): ITimelineTouchPointer | null;
101
+ protected _getTouchDistance(t0: ITimelineTouchPointer, t1: ITimelineTouchPointer): number;
102
+ protected _startPinchGesture(t0: ITimelineTouchPointer, t1: ITimelineTouchPointer, sourceEvent: Event): void;
103
+ protected _movePinchGesture(t0: ITimelineTouchPointer, t1: ITimelineTouchPointer): void;
70
104
  protected _onMouseDown: (e: MouseEvent) => void;
71
105
  protected _onMouseUp: (e: MouseEvent) => void;
72
106
  protected _onMouseEnter: () => void;
73
107
  protected _onMouseOut: () => void;
74
108
  protected _onCurrentMouseEnter: () => void;
75
109
  protected _onCurrentMouseOut: () => void;
110
+ protected _onScalePointerDown: (e: PointerEvent) => void;
111
+ protected _onCurrentPointerDown: (e: PointerEvent) => void;
112
+ protected _onPointerMove: (e: PointerEvent) => void;
113
+ protected _onPointerUp: (e: PointerEvent) => void;
76
114
  protected _onMouseMove: (e: MouseEvent) => void;
77
115
  get clientWidth(): number;
78
116
  get clientHeight(): number;
79
117
  protected _resize(): void;
80
118
  getOffsetByTime(milliseconds: number): number;
119
+ protected _clearEvents(): void;
81
120
  remove(): void;
82
121
  protected _clearCanvas(): void;
83
122
  protected _drawCurrent(): void;
@@ -0,0 +1,7 @@
1
+ import { ShaderProgram } from "../../webgl/ShaderProgram";
2
+ export declare function segment_screen_nl(): ShaderProgram;
3
+ export declare function segment_screen_wl(): ShaderProgram;
4
+ export declare function segment_screen_wl_webgl2(): ShaderProgram;
5
+ export declare function segment_colorPicking(): ShaderProgram;
6
+ export declare function segment_heightPicking(): ShaderProgram;
7
+ export declare function segment_depth(): ShaderProgram;
@@ -1,4 +1,4 @@
1
- export * from './Ellipsoid';
2
- export * from './wgs84';
3
- export * from './mars';
4
- export * from './moon';
1
+ export * from "./Ellipsoid";
2
+ export * from "./wgs84";
3
+ export * from "./mars";
4
+ export * from "./moon";
@@ -1,33 +1,31 @@
1
- import { Billboard } from "./Billboard";
2
- import { EntityCollection } from "./EntityCollection";
3
- import type { IBillboardParams } from "./Billboard";
1
+ import { Billboard } from "./billboard/Billboard";
2
+ import type { EntityCollection } from "./EntityCollection";
3
+ import type { IBillboardParams } from "./billboard/Billboard";
4
4
  import type { EntityCollectionEvents } from "./EntityCollection";
5
5
  import { Extent } from "../Extent";
6
- import { Geometry } from "./Geometry";
7
- import { GeoObject } from "./GeoObject";
8
- import type { IGeometryParams } from "./Geometry";
9
- import type { IGeoObjectParams } from "./GeoObject";
6
+ import { Geometry } from "./geometry/Geometry";
7
+ import { GeoObject } from "./geoObject/GeoObject";
8
+ import type { IGeometryParams } from "./geometry/Geometry";
9
+ import type { IGeoObjectParams } from "./geoObject/GeoObject";
10
10
  import { LonLat } from "../LonLat";
11
- import { Label } from "./Label";
12
- import type { ILabelParams } from "./Label";
11
+ import { Label } from "./label/Label";
12
+ import type { ILabelParams } from "./label/Label";
13
13
  import { Vec3 } from "../math/Vec3";
14
14
  import type { NumberArray3 } from "../math/Vec3";
15
15
  import type { NumberArray2 } from "../math/Vec2";
16
- import { PointCloud } from "./PointCloud";
17
- import { Polyline } from "./Polyline";
18
- import type { IPointCloudParams } from "./PointCloud";
19
- import type { IPolylineParams } from "./Polyline";
20
- import { Ray } from "./Ray";
21
- import type { IRayParams } from "./Ray";
22
- import { Strip } from "./Strip";
23
- import type { IStripParams } from "./Strip";
24
- import { Vector } from "../layer/Vector";
25
- import type { VectorEventsType } from "../layer/Vector";
26
- import { EntityCollectionNode } from "../quadTree/EntityCollectionNode";
16
+ import { PointCloud } from "./pointCloud/PointCloud";
17
+ import { Polyline } from "./polyline/Polyline";
18
+ import type { IPointCloudParams } from "./pointCloud/PointCloud";
19
+ import type { IPolylineParams } from "./polyline/Polyline";
20
+ import { Ray } from "./ray/Ray";
21
+ import type { IRayParams } from "./ray/Ray";
22
+ import { Strip } from "./strip/Strip";
23
+ import type { IStripParams } from "./strip/Strip";
24
+ import type { Vector, VectorEventsType } from "../layer/Vector";
25
+ import type { EntityCollectionNode } from "../quadTree/EntityCollectionNode";
27
26
  import { Quat } from "../math/Quat";
28
27
  /**
29
- * Interface for Entity parameters.
30
- * @typedef {Object} IEntityParams
28
+ * Options for creating an {@link Entity}.
31
29
  * @property {string} [name] - Name of the entity.
32
30
  * @property {any} [properties] - Additional properties of the entity.
33
31
  * @property {Vec3 | NumberArray3} [cartesian] - Cartesian position.
@@ -43,13 +41,15 @@ import { Quat } from "../math/Quat";
43
41
  * @property {GeoObject | IGeoObjectParams} [geoObject] - Geo object or parameters.
44
42
  * @property {Strip | IStripParams} [strip] - Strip object or parameters.
45
43
  * @property {boolean} [independentPicking] - Independent picking flag.
46
- * @property {boolean} [relativePosition] - Parent relative position flag, otherwise position is absolute.
44
+ * @property {boolean} [relativePosition] - When `true`, the entity position is relative to its parent.
47
45
  * @property {number} [pitch] - Rotation around local X-axis.
48
46
  * @property {number} [yaw] - Rotation around local Y-axis.
49
47
  * @property {number} [roll] - Rotation around local Z-axis.
50
48
  * @property {number | Vec3 | NumberArray3} [scale] - Scaling factor.
51
- * @property {boolean} [forceGlobalPosition] - Forces global position for entity make the same position as its parent.
52
- * @property {boolean} [forceGlobalRotation] - Forces global rotation for the entity make the same rotation as its parent.
49
+ * @property {boolean} [forceGlobalPosition] - Forces the entity to use the same world position as its parent.
50
+ * @property {boolean} [forceGlobalRotation] - Forces the entity to use the same world rotation as its parent.
51
+ * @property {boolean} [forceGlobalScale] - Forces the entity to use the same world scale as its parent.
52
+ * @property {Vec3 | NumberArray3} [localPosition] - Local position offset.
53
53
  */
54
54
  export interface IEntityParams {
55
55
  name?: string;
@@ -78,11 +78,11 @@ export interface IEntityParams {
78
78
  localPosition?: Vec3 | NumberArray3;
79
79
  }
80
80
  /**
81
- * Entity instances aggregate multiple forms of visualization into a single high-level object.
82
- * They can be created manually and added to entity collection.
81
+ * Entity combines multiple visual features into one object.
82
+ * You can create it manually and add it to an entity collection.
83
83
  *
84
84
  * @class
85
- * @param {IEntityParams} [options] - Entity options:
85
+ * @param {IEntityParams} [options] - Entity options.
86
86
  * @param {string} [options.name] - Name of the entity.
87
87
  * @param {any} [options.properties] - Additional properties of the entity.
88
88
  * @param {Vec3 | NumberArray3} [options.cartesian] - Cartesian position.
@@ -98,26 +98,27 @@ export interface IEntityParams {
98
98
  * @param {GeoObject | IGeoObjectParams} [options.geoObject] - Geo object or parameters.
99
99
  * @param {Strip | IStripParams} [options.strip] - Strip object or parameters.
100
100
  * @param {boolean} [options.independentPicking] - Independent picking flag.
101
- * @param {boolean} [options.relativePosition] - Parent relative position flag, otherwise position is absolute.
101
+ * @param {boolean} [options.relativePosition] - When `true`, the entity position is relative to its parent.
102
102
  * @param {number} [options.pitch] - Rotation around local X-axis in radians.
103
103
  * @param {number} [options.yaw] - Rotation around local Y-axis in radians.
104
104
  * @param {number} [options.roll] - Rotation around local Z-axis in radians.
105
105
  * @param {number | Vec3 | NumberArray3} [options.scale] - Scaling factor.
106
- * @param {boolean} [options.forceGlobalPosition] - Forces global position for the entity make the same position as its parent.
107
- * @param {boolean} [options.forceGlobalRotation] - Forces global rotation for the entity make the same rotation as its parent.
108
- * @param {boolean} [options.forceGlobalScale] - Forces global scale for the entity make the same scale as its parent.
106
+ * @param {boolean} [options.forceGlobalPosition] - Forces the entity to use the same world position as its parent.
107
+ * @param {boolean} [options.forceGlobalRotation] - Forces the entity to use the same world rotation as its parent.
108
+ * @param {boolean} [options.forceGlobalScale] - Forces the entity to use the same world scale as its parent.
109
+ * @param {Vec3 | NumberArray3} [options.localPosition] - Local position offset.
109
110
  */
110
111
  declare class Entity {
111
112
  static __counter__: number;
112
113
  protected _name: string;
113
114
  /**
114
- * Uniq identifier.
115
+ * Unique identifier.
115
116
  * @public
116
117
  * @readonly
117
118
  */
118
119
  protected __id: number;
119
120
  /**
120
- * Entity user defined properties.
121
+ * User-defined entity properties.
121
122
  * @public
122
123
  * @type {Object}
123
124
  */
@@ -144,7 +145,7 @@ declare class Entity {
144
145
  */
145
146
  _cartesian: Vec3;
146
147
  /**
147
- * Entity cartesian is equal root entity absolute cartesian.
148
+ * Absolute cartesian position of the root entity.
148
149
  * @protected
149
150
  * @type {Vec3}
150
151
  */
@@ -164,7 +165,7 @@ declare class Entity {
164
165
  */
165
166
  _lonLatMerc: LonLat;
166
167
  /**
167
- * Entity visible terrain altitude.
168
+ * Entity altitude.
168
169
  * @public
169
170
  * @type {number}
170
171
  */
@@ -182,19 +183,19 @@ declare class Entity {
182
183
  */
183
184
  _entityCollection: EntityCollection | null;
184
185
  /**
185
- * Entity collection array store index.
186
+ * Index of this entity in the collection array.
186
187
  * @public
187
188
  * @type {number}
188
189
  */
189
190
  _entityCollectionIndex: number;
190
191
  /**
191
- * Assigned vector layer pointer.
192
+ * Assigned vector layer.
192
193
  * @public
193
194
  * @type {Vector}
194
195
  */
195
196
  _layer: Vector | null;
196
197
  /**
197
- * Assigned vector layer entity array index.
198
+ * Index of this entity in the layer array.
198
199
  * @public
199
200
  * @type {number}
200
201
  */
@@ -232,21 +233,21 @@ declare class Entity {
232
233
  */
233
234
  ray: Ray | null;
234
235
  /**
235
- * PointCloud entity.
236
+ * Point cloud entity.
236
237
  * @public
237
238
  * @type {PointCloud | null}
238
239
  */
239
240
  pointCloud: PointCloud | null;
240
241
  /**
241
- * Geometry entity(available for vector layer only).
242
+ * Geometry entity (available only in vector layers).
242
243
  * @public
243
244
  * @type {Geometry | null}
244
245
  */
245
246
  geometry: Geometry | null;
246
247
  /**
247
- * Geo object entity
248
+ * Geo object entity.
248
249
  * @public
249
- * @type {Geometry | null}
250
+ * @type {GeoObject | null}
250
251
  */
251
252
  geoObject: GeoObject | null;
252
253
  /**
@@ -266,25 +267,26 @@ declare class Entity {
266
267
  protected _qRot: Quat;
267
268
  _absoluteQRot: Quat;
268
269
  protected _useDirectQuaternion: boolean;
270
+ protected _opacity: number | null;
269
271
  constructor(options?: IEntityParams);
270
272
  get name(): string;
271
273
  set name(name: string);
272
274
  get isEmpty(): boolean;
273
275
  /**
274
- * Returns root entity object.
276
+ * Returns the root entity.
275
277
  * @public
276
- * @return {Entity}
278
+ * @returns {Entity} Root entity.
277
279
  */
278
280
  get rootEntity(): Entity;
279
281
  /**
280
- * Sets relative position property
281
- * @param isRelative
282
+ * Sets whether the entity position is relative to its parent.
283
+ * @param {boolean} isRelative - Relative-position flag.
282
284
  */
283
285
  set relativePosition(isRelative: boolean);
284
286
  /**
285
- * Gets relative position property
287
+ * Returns whether the entity position is relative to its parent.
286
288
  * @public
287
- * @returns{boolean}
289
+ * @returns {boolean}
288
290
  */
289
291
  get relativePosition(): boolean;
290
292
  /**
@@ -294,7 +296,7 @@ declare class Entity {
294
296
  */
295
297
  get entityCollection(): EntityCollection | null;
296
298
  /**
297
- * Gets entity uniq id
299
+ * Returns the entity id.
298
300
  * @public
299
301
  * @returns {number}
300
302
  */
@@ -311,8 +313,8 @@ declare class Entity {
311
313
  */
312
314
  get layerIndex(): number;
313
315
  /**
314
- * Gets the instance class name of the entity.
315
- * @returns {string} The instance name "Entity".
316
+ * Returns the instance class name.
317
+ * @returns {string} Always `"Entity"`.
316
318
  */
317
319
  get instanceName(): string;
318
320
  protected _createOptionFeature<T, K>(featureName: string, options?: T | K): T | null;
@@ -322,14 +324,14 @@ declare class Entity {
322
324
  */
323
325
  getCollectionIndex(): number;
324
326
  /**
325
- * Adds current entity into the specified entity collection.
327
+ * Adds the entity to a collection or vector layer.
326
328
  * @public
327
- * @param {EntityCollection | Vector} collection - Specified entity collection or vector layer.
328
- * @returns {Entity} - This object.
329
+ * @param {EntityCollection | Vector} collection - Target collection or vector layer.
330
+ * @returns {Entity} This object.
329
331
  */
330
332
  addTo(collection: EntityCollection | Vector): Entity;
331
333
  /**
332
- * Removes current entity from its collection or layer.
334
+ * Removes the entity from its collection or layer.
333
335
  * @public
334
336
  */
335
337
  remove(): this;
@@ -339,34 +341,46 @@ declare class Entity {
339
341
  * @param {boolean} visibility - Entity visibility.
340
342
  */
341
343
  setVisibility(visibility: boolean): void;
344
+ /**
345
+ * Sets entity opacity for all available features.
346
+ * @public
347
+ * @param {number} opacity - Entity opacity.
348
+ */
349
+ setOpacity(opacity: number): void;
350
+ /**
351
+ * Returns entity opacity.
352
+ * @public
353
+ * @returns {number} Entity opacity.
354
+ */
355
+ getOpacity(): number;
342
356
  /**
343
357
  * Returns entity visibility.
344
358
  * @public
345
- * @returns {boolean} -
359
+ * @returns {boolean} Entity visibility flag.
346
360
  */
347
361
  getVisibility(): boolean;
348
362
  /**
349
363
  * Sets entity cartesian position.
350
364
  * @public
351
- * @param {Vec3} cartesian - Cartesian position in 3d space.
365
+ * @param {Vec3} cartesian - Cartesian position in 3D space.
352
366
  */
353
367
  setCartesian3v(cartesian: Vec3): void;
354
368
  /**
355
- * Gets scale factor
369
+ * Returns the local scale.
356
370
  * @public
357
371
  * @returns {Vec3}
358
372
  */
359
373
  getScale(): Vec3;
360
374
  /**
361
- * Sets XYZ axis scale for the inner object such as GeoObject
375
+ * Sets per-axis local scale.
362
376
  * @public
363
- * @param {Vec3} scale - Scale factor
377
+ * @param {Vec3} scale - Scale vector.
364
378
  */
365
379
  setScale3v(scale: Vec3): void;
366
380
  /**
367
- * Sets scale for the inner object such as GeoObject
381
+ * Sets uniform local scale.
368
382
  * @public
369
- * @param {number} val - Scale factor
383
+ * @param {number} val - Scale value.
370
384
  */
371
385
  setScale(val: number): void;
372
386
  /**
@@ -406,9 +420,9 @@ declare class Entity {
406
420
  setRotation(rot: Quat): void;
407
421
  /**
408
422
  * Sets rotation directly from glTF quaternion with common coordinate system conversion.
409
- * This method avoids current pitch/yaw/roll airplane like conversion.
423
+ * This method avoids the current pitch/yaw/roll conversion.
410
424
  * @public
411
- * @param {Quat} rot - Quaternion from glTF
425
+ * @param {Quat} rot - Quaternion from glTF.
412
426
  */
413
427
  setDirectQuaternionRotation(rot: Quat): void;
414
428
  /**
@@ -491,53 +505,53 @@ declare class Entity {
491
505
  */
492
506
  setAbsoluteCartesian(x: number, y: number, z: number): void;
493
507
  /**
494
- * Sets the absolute cartesian position of the entity using a Vec3.
508
+ * Sets absolute cartesian position using a vector.
495
509
  * @public
496
- * @param {Vec3} absolutCartesian - The absolute cartesian position.
510
+ * @param {Vec3} absolutCartesian - Absolute cartesian position.
497
511
  */
498
512
  setAbsoluteCartesian3v(absolutCartesian: Vec3): void;
499
513
  /**
500
514
  * Returns absolute cartesian position.
501
515
  * @public
502
- * @returns {Vec3} -
516
+ * @returns {Vec3} Absolute cartesian position.
503
517
  */
504
518
  getAbsoluteCartesian(): Vec3;
505
519
  /**
506
- * Sets entity cartesian position.
520
+ * Sets local cartesian position.
507
521
  * @public
508
- * @param {number} x - 3d space X - position.
509
- * @param {number} y - 3d space Y - position.
510
- * @param {number} z - 3d space Z - position.
522
+ * @param {number} x - X coordinate in 3D space.
523
+ * @param {number} y - Y coordinate in 3D space.
524
+ * @param {number} z - Z coordinate in 3D space.
511
525
  */
512
526
  setCartesian(x: number, y: number, z: number): void;
513
527
  protected _updatePitchYawRoll(): void;
514
528
  _updateAbsolutePosition(): void;
515
529
  /**
516
- * Sets entity cartesian position without event dispatching.
530
+ * Sets local cartesian position without dispatching events.
517
531
  * @public
518
- * @param {Vec3} cartesian - Cartesian position in 3d space.
519
- * @param {boolean} skipLonLat - skip geodetic calculation.
532
+ * @param {Vec3} cartesian - Cartesian position in 3D space.
533
+ * @param {boolean} skipLonLat - Skip geodetic conversion.
520
534
  */
521
535
  _setCartesian3vSilent(cartesian: Vec3, skipLonLat?: boolean): void;
522
536
  protected _updateLonLat(): void;
523
537
  /**
524
- * Gets entity geodetic coordinates.
538
+ * Returns geodetic coordinates.
525
539
  * @public
526
- * @returns {LonLat} -
540
+ * @returns {LonLat} Entity geodetic coordinates.
527
541
  */
528
542
  getLonLat(): LonLat;
529
543
  /**
530
- * Sets geodetic coordinates of the entity point object.
544
+ * Sets geodetic coordinates.
531
545
  * @public
532
- * @param {LonLat} lonlat - coordinates.
546
+ * @param {LonLat} lonlat - Geodetic coordinates.
533
547
  */
534
548
  setLonLat(lonlat: LonLat): void;
535
549
  /**
536
- * Sets geodetic coordinates of the entity point object.
550
+ * Sets geodetic coordinates.
537
551
  * @public
538
552
  * @param {number} lon - Longitude.
539
- * @param {number} lat - Latitude
540
- * @param {number} [height] - Height
553
+ * @param {number} lat - Latitude.
554
+ * @param {number} [height] - Height.
541
555
  */
542
556
  setLonLat2(lon: number, lat: number, height?: number): void;
543
557
  /**
@@ -547,102 +561,102 @@ declare class Entity {
547
561
  */
548
562
  setAltitude(altitude: number): void;
549
563
  /**
550
- * Sets entity altitude over the planet.
564
+ * Returns entity altitude over the planet.
551
565
  * @public
552
- * @return {number} Altitude.
566
+ * @returns {number} Altitude.
553
567
  */
554
568
  getAltitude(): number;
555
569
  /**
556
570
  * Returns cartesian position.
557
571
  * @public
558
- * @returns {Vec3} -
572
+ * @returns {Vec3} Cartesian position.
559
573
  */
560
574
  getCartesian(): Vec3;
561
575
  /**
562
576
  * Sets entity billboard.
563
577
  * @public
564
578
  * @param {Billboard} billboard - Billboard object.
565
- * @returns {Billboard} -
579
+ * @returns {Billboard} Assigned billboard object.
566
580
  */
567
581
  setBillboard(billboard: Billboard): Billboard;
568
582
  /**
569
583
  * Sets entity label.
570
584
  * @public
571
585
  * @param {Label} label - Text label.
572
- * @returns {Label} -
586
+ * @returns {Label} Assigned label object.
573
587
  */
574
588
  setLabel(label: Label): Label;
575
589
  /**
576
590
  * Sets entity ray.
577
591
  * @public
578
592
  * @param {Ray} ray - Ray object.
579
- * @returns {Ray} -
593
+ * @returns {Ray} Assigned ray object.
580
594
  */
581
595
  setRay(ray: Ray): Ray;
582
596
  /**
583
597
  * Sets entity polyline.
584
598
  * @public
585
599
  * @param {Polyline} polyline - Polyline object.
586
- * @returns {Polyline} -
600
+ * @returns {Polyline} Assigned polyline object.
587
601
  */
588
602
  setPolyline(polyline: Polyline): Polyline;
589
603
  /**
590
604
  * Sets entity pointCloud.
591
605
  * @public
592
606
  * @param {PointCloud} pointCloud - PointCloud object.
593
- * @returns {PointCloud} -
607
+ * @returns {PointCloud} Assigned point cloud object.
594
608
  */
595
609
  setPointCloud(pointCloud: PointCloud): PointCloud;
596
610
  /**
597
611
  * Sets entity geometry.
598
612
  * @public
599
613
  * @param {Geometry} geometry - Geometry object.
600
- * @returns {Geometry} -
614
+ * @returns {Geometry} Assigned geometry object.
601
615
  */
602
616
  setGeometry(geometry: Geometry): Geometry;
603
617
  /**
604
618
  * Sets entity geoObject.
605
619
  * @public
606
620
  * @param {GeoObject} geoObject - GeoObject.
607
- * @returns {GeoObject} -
621
+ * @returns {GeoObject} Assigned geo object.
608
622
  */
609
623
  setGeoObject(geoObject: GeoObject): GeoObject;
610
624
  /**
611
625
  * Sets entity strip.
612
626
  * @public
613
627
  * @param {Strip} strip - Strip object.
614
- * @returns {Strip} -
628
+ * @returns {Strip} Assigned strip object.
615
629
  */
616
630
  setStrip(strip: Strip): Strip;
617
631
  /**
618
- * Gets layer container
632
+ * Returns the assigned vector layer.
619
633
  * @public
620
634
  * @returns {Vector | null}
621
635
  */
622
636
  get layer(): Vector | null;
623
637
  get rendererEvents(): VectorEventsType | EntityCollectionEvents | null;
624
638
  /**
625
- * Append child entity.
639
+ * Appends child entities.
626
640
  * @public
627
641
  * @param {Entity[]} entities - Child entities.
628
- * @param {boolean} [forceRelativePosition] - Force relative position property.
642
+ * @param {boolean} [forceRelativePosition] - If defined, sets `relativePosition` for each child.
629
643
  */
630
644
  appendChildren(entities: Entity[], forceRelativePosition?: boolean): void;
631
645
  /**
632
- * Append child entity.
646
+ * Appends a child entity.
633
647
  * @public
634
648
  * @param {Entity} entity - Child entity.
635
649
  */
636
650
  appendChild(entity: Entity): void;
637
651
  /**
638
- * Appends entity items(billboard, label etc.) picking color.
652
+ * Applies entity picking color to all supported features.
639
653
  * @public
640
654
  */
641
655
  setPickingColor(): void;
642
656
  /**
643
- * Return geodetic extent.
657
+ * Returns geodetic extent.
644
658
  * @public
645
- * @returns {Extent} -
659
+ * @returns {Extent} Geodetic extent.
646
660
  */
647
661
  getExtent(): Extent;
648
662
  }