@openglobus/og 0.11.8 → 0.12.4

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 (197) hide show
  1. package/css/og.css +2 -0
  2. package/dist/@openglobus/og.css +1 -0
  3. package/dist/@openglobus/og.esm.js +21 -0
  4. package/dist/@openglobus/og.esm.js.map +1 -0
  5. package/dist/@openglobus/og.umd.js +21 -0
  6. package/dist/@openglobus/og.umd.js.map +1 -0
  7. package/package.json +11 -11
  8. package/src/og/Globe.js +18 -6
  9. package/src/og/camera/Camera.js +70 -79
  10. package/src/og/camera/PlanetCamera.js +25 -30
  11. package/src/og/control/DebugInfo.js +2 -2
  12. package/src/og/control/EarthNavigation.js +26 -17
  13. package/src/og/control/MouseNavigation.js +11 -13
  14. package/src/og/control/MouseWheelZoomControl.js +5 -5
  15. package/src/og/control/Sun.js +3 -3
  16. package/src/og/entity/Entity.js +742 -742
  17. package/src/og/entity/GeoObjectHandler.js +138 -134
  18. package/src/og/entity/LabelHandler.js +2 -1
  19. package/src/og/layer/CanvasTiles.js +8 -11
  20. package/src/og/layer/KML.js +19 -12
  21. package/src/og/layer/Layer.js +9 -2
  22. package/src/og/layer/XYZ.js +27 -28
  23. package/src/og/math/Vec3.js +18 -2
  24. package/src/og/quadTree/Node.js +48 -93
  25. package/src/og/quadTree/quadTree.js +1 -1
  26. package/src/og/renderer/Renderer.js +3 -5
  27. package/src/og/scene/Planet.js +147 -127
  28. package/src/og/segment/Segment.js +63 -136
  29. package/src/og/shaders/drawnode.js +132 -221
  30. package/src/og/shaders/geoObject.js +15 -6
  31. package/src/og/terrain/EmptyTerrain.js +3 -2
  32. package/src/og/terrain/GlobusTerrain.js +2 -0
  33. package/src/og/utils/Loader.js +1 -1
  34. package/src/og/utils/PlainSegmentWorker.js +0 -13
  35. package/src/og/webgl/Handler.js +13 -9
  36. package/types/Clock.d.ts +94 -0
  37. package/types/Deferred.d.ts +6 -0
  38. package/types/Events.d.ts +77 -0
  39. package/types/Extent.d.ts +166 -0
  40. package/types/Globe.d.ts +85 -0
  41. package/types/ImageCanvas.d.ts +123 -0
  42. package/types/Lock.d.ts +12 -0
  43. package/types/LonLat.d.ts +108 -0
  44. package/types/Popup.d.ts +42 -0
  45. package/types/QueueArray.d.ts +19 -0
  46. package/types/Rectangle.d.ts +80 -0
  47. package/types/Stack.d.ts +19 -0
  48. package/types/ajax.d.ts +24 -0
  49. package/types/arial.d.ts +48 -0
  50. package/types/astro/astro.d.ts +38 -0
  51. package/types/astro/earth.d.ts +7 -0
  52. package/types/astro/jd.d.ts +254 -0
  53. package/types/bv/Box.d.ts +30 -0
  54. package/types/bv/Sphere.d.ts +38 -0
  55. package/types/bv/index.d.ts +3 -0
  56. package/types/camera/Camera.d.ts +312 -0
  57. package/types/camera/Frustum.d.ts +133 -0
  58. package/types/camera/PlanetCamera.d.ts +219 -0
  59. package/types/camera/index.d.ts +3 -0
  60. package/types/cons.d.ts +40 -0
  61. package/types/control/CompassButton.d.ts +17 -0
  62. package/types/control/Control.d.ts +104 -0
  63. package/types/control/DebugInfo.d.ts +15 -0
  64. package/types/control/EarthCoordinates.d.ts +47 -0
  65. package/types/control/EarthNavigation.d.ts +43 -0
  66. package/types/control/GeoImageDragControl.d.ts +6 -0
  67. package/types/control/KeyboardNavigation.d.ts +21 -0
  68. package/types/control/LayerSwitcher.d.ts +21 -0
  69. package/types/control/Lighting.d.ts +16 -0
  70. package/types/control/MouseNavigation.d.ts +48 -0
  71. package/types/control/MouseWheelZoomControl.d.ts +45 -0
  72. package/types/control/ScaleControl.d.ts +22 -0
  73. package/types/control/ShowFps.d.ts +11 -0
  74. package/types/control/SimpleNavigation.d.ts +25 -0
  75. package/types/control/Sun.d.ts +50 -0
  76. package/types/control/ToggleWireframe.d.ts +12 -0
  77. package/types/control/TouchNavigation.d.ts +48 -0
  78. package/types/control/ZoomControl.d.ts +27 -0
  79. package/types/control/index.d.ts +18 -0
  80. package/types/ellipsoid/Ellipsoid.d.ts +146 -0
  81. package/types/ellipsoid/index.d.ts +3 -0
  82. package/types/ellipsoid/wgs84.d.ts +6 -0
  83. package/types/entity/BaseBillboard.d.ts +215 -0
  84. package/types/entity/Billboard.d.ts +94 -0
  85. package/types/entity/BillboardHandler.d.ts +79 -0
  86. package/types/entity/Entity.d.ts +348 -0
  87. package/types/entity/EntityCollection.d.ts +317 -0
  88. package/types/entity/GeoObject.d.ts +111 -0
  89. package/types/entity/GeoObjectHandler.d.ts +81 -0
  90. package/types/entity/Geometry.d.ts +74 -0
  91. package/types/entity/GeometryHandler.d.ts +76 -0
  92. package/types/entity/Label.d.ts +189 -0
  93. package/types/entity/LabelHandler.d.ts +31 -0
  94. package/types/entity/LabelWorker.d.ts +11 -0
  95. package/types/entity/PointCloud.d.ts +174 -0
  96. package/types/entity/PointCloudHandler.d.ts +38 -0
  97. package/types/entity/Polyline.d.ts +306 -0
  98. package/types/entity/PolylineHandler.d.ts +18 -0
  99. package/types/entity/Ray.d.ts +124 -0
  100. package/types/entity/RayHandler.d.ts +67 -0
  101. package/types/entity/ShapeHandler.d.ts +22 -0
  102. package/types/entity/Strip.d.ts +119 -0
  103. package/types/entity/StripHandler.d.ts +38 -0
  104. package/types/entity/index.d.ts +8 -0
  105. package/types/index.core.d.ts +65 -0
  106. package/types/index.d.ts +45 -0
  107. package/types/index.webgl.d.ts +7 -0
  108. package/types/input/KeyboardHandler.d.ts +10 -0
  109. package/types/input/MouseHandler.d.ts +5 -0
  110. package/types/input/TouchHandler.d.ts +5 -0
  111. package/types/input/input.d.ts +34 -0
  112. package/types/layer/BaseGeoImage.d.ts +94 -0
  113. package/types/layer/CanvasTiles.d.ts +67 -0
  114. package/types/layer/GeoImage.d.ts +52 -0
  115. package/types/layer/GeoTexture2d.d.ts +8 -0
  116. package/types/layer/GeoVideo.d.ts +55 -0
  117. package/types/layer/KML.d.ts +68 -0
  118. package/types/layer/Layer.d.ts +311 -0
  119. package/types/layer/Material.d.ts +45 -0
  120. package/types/layer/Vector.d.ts +208 -0
  121. package/types/layer/WMS.d.ts +61 -0
  122. package/types/layer/XYZ.d.ts +119 -0
  123. package/types/layer/index.d.ts +10 -0
  124. package/types/light/LightSource.d.ts +178 -0
  125. package/types/math/Line2.d.ts +11 -0
  126. package/types/math/Line3.d.ts +10 -0
  127. package/types/math/Mat3.d.ts +65 -0
  128. package/types/math/Mat4.d.ts +176 -0
  129. package/types/math/Plane.d.ts +18 -0
  130. package/types/math/Quat.d.ts +379 -0
  131. package/types/math/Ray.d.ts +82 -0
  132. package/types/math/Vec2.d.ts +309 -0
  133. package/types/math/Vec3.d.ts +467 -0
  134. package/types/math/Vec4.d.ts +162 -0
  135. package/types/math/coder.d.ts +43 -0
  136. package/types/math/index.d.ts +11 -0
  137. package/types/math.d.ts +261 -0
  138. package/types/mercator.d.ts +92 -0
  139. package/types/proj/EPSG3857.d.ts +6 -0
  140. package/types/proj/EPSG4326.d.ts +6 -0
  141. package/types/proj/Proj.d.ts +42 -0
  142. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  143. package/types/quadTree/Node.d.ts +60 -0
  144. package/types/quadTree/quadTree.d.ts +40 -0
  145. package/types/renderer/Renderer.d.ts +290 -0
  146. package/types/renderer/RendererEvents.d.ts +237 -0
  147. package/types/res/images.d.ts +3 -0
  148. package/types/scene/Axes.d.ts +11 -0
  149. package/types/scene/BaseNode.d.ts +60 -0
  150. package/types/scene/Planet.d.ts +576 -0
  151. package/types/scene/RenderNode.d.ts +142 -0
  152. package/types/scene/SkyBox.d.ts +10 -0
  153. package/types/scene/index.d.ts +4 -0
  154. package/types/segment/Segment.d.ts +275 -0
  155. package/types/segment/SegmentLonLat.d.ts +17 -0
  156. package/types/segment/Slice.d.ts +10 -0
  157. package/types/segment/segmentHelper.d.ts +13 -0
  158. package/types/shaders/billboard.d.ts +3 -0
  159. package/types/shaders/depth.d.ts +2 -0
  160. package/types/shaders/drawnode.d.ts +7 -0
  161. package/types/shaders/geoObject.d.ts +3 -0
  162. package/types/shaders/label.d.ts +4 -0
  163. package/types/shaders/pointCloud.d.ts +2 -0
  164. package/types/shaders/polyline.d.ts +3 -0
  165. package/types/shaders/ray.d.ts +2 -0
  166. package/types/shaders/screenFrame.d.ts +2 -0
  167. package/types/shaders/shape.d.ts +4 -0
  168. package/types/shaders/skybox.d.ts +2 -0
  169. package/types/shaders/toneMapping.d.ts +2 -0
  170. package/types/shapes/BaseShape.d.ts +250 -0
  171. package/types/shapes/Sphere.d.ts +41 -0
  172. package/types/terrain/BilTerrain.d.ts +7 -0
  173. package/types/terrain/EmptyTerrain.d.ts +73 -0
  174. package/types/terrain/Geoid.d.ts +26 -0
  175. package/types/terrain/GlobusTerrain.d.ts +116 -0
  176. package/types/terrain/MapboxTerrain.d.ts +7 -0
  177. package/types/terrain/index.d.ts +5 -0
  178. package/types/utils/FontAtlas.d.ts +15 -0
  179. package/types/utils/GeoImageCreator.d.ts +30 -0
  180. package/types/utils/ImagesCacheManager.d.ts +10 -0
  181. package/types/utils/Loader.d.ts +25 -0
  182. package/types/utils/NormalMapCreator.d.ts +39 -0
  183. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  184. package/types/utils/TerrainWorker.d.ts +9 -0
  185. package/types/utils/TextureAtlas.d.ts +111 -0
  186. package/types/utils/VectorTileCreator.d.ts +16 -0
  187. package/types/utils/colorTable.d.ts +143 -0
  188. package/types/utils/earcut.d.ts +6 -0
  189. package/types/utils/shared.d.ts +231 -0
  190. package/types/webgl/Framebuffer.d.ts +135 -0
  191. package/types/webgl/Handler.d.ts +417 -0
  192. package/types/webgl/Multisample.d.ts +89 -0
  193. package/types/webgl/Program.d.ts +161 -0
  194. package/types/webgl/ProgramController.d.ts +89 -0
  195. package/types/webgl/callbacks.d.ts +1 -0
  196. package/types/webgl/index.d.ts +6 -0
  197. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,174 @@
1
+ /**
2
+ * PointCloud object.
3
+ * @class
4
+ * @param {*} [options] - Point cloud options:
5
+ * @param {Array.<Array.<number>>} [options.points] - Points cartesian coordinates array,
6
+ * where first three is cartesian coordinates, next fourth is a RGBA color, and last is an point properties.
7
+ * @param {number} [options.pointSize] - Point screen size in pixels.
8
+ * @param {number} [options.pickingDistance] - Point border picking size in screen pixels.
9
+ * @param {boolean} [options.visibility] - Point cloud visibility.
10
+ * @example <caption>Creates point cloud with two ten pixel size points</caption>
11
+ * new og.Entity({
12
+ * pointCloud: {
13
+ * pointSize: 10,
14
+ * points: [
15
+ * [0, 0, 0, 255, 255, 255, 255, { 'name': 'White point' }],
16
+ * [100, 100, 0, 255, 0, 0, 255, { 'name': 'Red point' }]
17
+ * ]
18
+ * }
19
+ * });
20
+ */
21
+ export class PointCloud {
22
+ static set _staticCounter(arg: any);
23
+ static get _staticCounter(): any;
24
+ constructor(options: any);
25
+ /**
26
+ * Object unic identifier.
27
+ * @public
28
+ * @readonly
29
+ * @type {number}
30
+ */
31
+ public readonly id: number;
32
+ /**
33
+ * Cloud visibility.
34
+ * @public
35
+ * @type {boolean}
36
+ */
37
+ public visibility: boolean;
38
+ /**
39
+ * Point screen size in pixels.
40
+ * @public
41
+ * @type {number}
42
+ */
43
+ public pointSize: number;
44
+ /**
45
+ * Point picking border size in pixels.
46
+ * @public
47
+ * @type {number}
48
+ */
49
+ public pickingDistance: number;
50
+ /**
51
+ * Parent collection render node.
52
+ * @private
53
+ * @type {RenderNode}
54
+ */
55
+ private _renderNode;
56
+ /**
57
+ * Entity instance that holds this point cloud.
58
+ * @private
59
+ * @type {Entity}
60
+ */
61
+ private _entity;
62
+ /**
63
+ * Points properties.
64
+ * @private
65
+ * @type {Array.<*>}
66
+ */
67
+ private _points;
68
+ /**
69
+ * Coordinates array.
70
+ * @private
71
+ * @type {Array.<number>}
72
+ */
73
+ private _coordinatesData;
74
+ /**
75
+ * Color array.
76
+ * @private
77
+ * @type {Array.<number>}
78
+ */
79
+ private _colorData;
80
+ /**
81
+ * Picking color array.
82
+ * @private
83
+ * @type {Array.<number>}
84
+ */
85
+ private _pickingColorData;
86
+ _coordinatesBuffer: any;
87
+ _colorBuffer: any;
88
+ _pickingColorBuffer: any;
89
+ /**
90
+ * Handler that stores and renders this object.
91
+ * @private
92
+ * @type {PointCloudHandler}
93
+ */
94
+ private _handler;
95
+ _handlerIndex: number;
96
+ _buffersUpdateCallbacks: (() => void)[];
97
+ _changedBuffers: any[];
98
+ /**
99
+ * Clears point cloud data
100
+ * @public
101
+ */
102
+ public clear(): void;
103
+ /**
104
+ * Set point cloud opacity.
105
+ * @public
106
+ * @param {number} opacity - Cloud opacity.
107
+ */
108
+ public setOpacity(opacity: number): void;
109
+ opacity: number;
110
+ /**
111
+ * Sets cloud visibility.
112
+ * @public
113
+ * @param {number} visibility - Visibility flag.
114
+ */
115
+ public setVisibility(visibility: number): void;
116
+ /**
117
+ * @return {boolean} Point cloud visibily.
118
+ */
119
+ getVisibility(): boolean;
120
+ /**
121
+ * Assign rendering scene node.
122
+ * @public
123
+ * @param {RenderNode} renderNode - Assigned render node.
124
+ */
125
+ public setRenderNode(renderNode: RenderNode): void;
126
+ /**
127
+ * Removes from entity.
128
+ * @public
129
+ */
130
+ public remove(): void;
131
+ /**
132
+ * Adds points to render.
133
+ * @public
134
+ * @param {Array.<Array<number>>} points - Point cloud array.
135
+ * @example
136
+ * var points = [[0, 0, 0, 255, 255, 255, 255, { 'name': 'White point' }], [100, 100, 0, 255, 0, 0, 255, { 'name': 'Red point' }]];
137
+ */
138
+ public setPoints(points: Array<Array<number>>): void;
139
+ setPointPosition(index: any, x: any, y: any, z: any): void;
140
+ setPointColor(index: any, r: any, g: any, b: any, a: any): void;
141
+ addPoints(points: any): void;
142
+ addPoint(index: any, point: any): void;
143
+ /**
144
+ * Returns specific point by index.
145
+ * @public
146
+ * @param {number} index - Point index.
147
+ * @return {*} Specific point
148
+ */
149
+ public getPoint(index: number): any;
150
+ removePoint(index: any): void;
151
+ insertPoint(index: any, point: any): void;
152
+ /**
153
+ * Each point iterator.
154
+ * @public
155
+ * @param {callback} callback -
156
+ */
157
+ public each(callback: any): void;
158
+ draw(): void;
159
+ drawPicking(): void;
160
+ /**
161
+ * Update gl buffers.
162
+ * @private
163
+ */
164
+ private _update;
165
+ /**
166
+ * Delete buffers
167
+ * @private
168
+ */
169
+ private _deleteBuffers;
170
+ _createCoordinatesBuffer(): void;
171
+ _createColorBuffer(): void;
172
+ _createPickingColorBuffer(): void;
173
+ _setPickingColors(): void;
174
+ }
@@ -0,0 +1,38 @@
1
+ export class PointCloudHandler {
2
+ static set _staticCounter(arg: any);
3
+ static get _staticCounter(): any;
4
+ constructor(entityCollection: any);
5
+ /**
6
+ * Picking rendering option.
7
+ * @public
8
+ * @type {boolean}
9
+ */
10
+ public pickingEnabled: boolean;
11
+ /**
12
+ * Parent collection
13
+ * @private
14
+ * @type {EntityCollection}
15
+ */
16
+ private _entityCollection;
17
+ /**
18
+ * Renderer
19
+ * @private
20
+ * @type {Renderer}
21
+ */
22
+ private _renderer;
23
+ /**
24
+ * Point cloud array
25
+ * @private
26
+ * @type {Array.<PointCloud>}
27
+ */
28
+ private _pointClouds;
29
+ __staticId: number;
30
+ _initProgram(): void;
31
+ setRenderNode(renderNode: any): void;
32
+ add(pointCloud: any): void;
33
+ remove(pointCloud: any): void;
34
+ reindexPointCloudArray(startIndex: any): void;
35
+ draw(): void;
36
+ drawPicking(): void;
37
+ clear(): void;
38
+ }
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Polyline object.
3
+ * @class
4
+ * @param {Object} [options] - Polyline options:
5
+ * @param {number} [options.thickness] - Thickness in screen pixels 1.5 is default.
6
+ * @param {Number} [options.altitude] - Relative to ground layers altitude value.
7
+ * @param {Vec4} [options.color] - RGBA color.
8
+ * @param {Boolean} [options.opacity] - Line opacity.
9
+ * @param {Boolean} [options.visibility] - Polyline visibility. True default.
10
+ * @param {Boolean} [options.isClosed] - Closed geometry type identificator.
11
+ * @param {Array.<Array.<number>>} [options.pathLonLat] - Polyline geodetic coordinates array. [[0,0,0], [1,1,1],...]
12
+ * @param {Array.<Array.<number>>} [options.path3v] - LinesString cartesian coordinates array. [[0,0,0], [1,1,1],...]
13
+ * @param {Array.<Array.<number>>} [options.pathColors] - Coordinates color. [[1,0,0,1], [0,1,0,1],...] for right and green colors.
14
+ */
15
+ export class Polyline {
16
+ static set _staticCounter(arg: any);
17
+ static get _staticCounter(): any;
18
+ /**
19
+ * Appends to the line array new cartesian coordinates line data.
20
+ * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
21
+ * @param {Boolean} isClosed - Identificator for the closed line data creation.
22
+ * @param {Number[]} outVertices - Out vertices data array.
23
+ * @param {Number[]} outOrders - Out vertices orders data array.
24
+ * @param {Number[]} outIndexes - Out vertices indexes data array.
25
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
26
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
27
+ * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
28
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
29
+ * @param {Extent} [outExtent] - Geodetic line extent.
30
+ * @param {Array} [outColors]
31
+ * @static
32
+ */
33
+ static appendLineData3v(path3v: Array<Array<number>>, pathColors: any, defaultColor: any, isClosed: boolean, outVerticesHigh: any, outVerticesLow: any, outOrders: number[], outIndexes: number[], ellipsoid?: Ellipsoid, outTransformedPathLonLat?: Array<Array<LonLat>>, outPath3v?: Array<Array<LonLat>>, outTransformedPathMerc?: Array<Array<LonLat>>, outExtent?: Extent, outColors?: any[]): void;
34
+ /**
35
+ * Appends to the line new cartesian coordinates point data.
36
+ * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
37
+ * @param {Boolean} isClosed - Identificator for the closed line data creation.
38
+ * @param {Number[]} outVertices - Out vertices data array.
39
+ * @param {Number[]} outOrders - Out vertices orders data array.
40
+ * @param {Number[]} outIndexes - Out vertices indexes data array.
41
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
42
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
43
+ * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
44
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
45
+ * @param {Extent} [outExtent] - Geodetic line extent.
46
+ * @static
47
+ */
48
+ static appendPoint3v(path3v: Array<Array<number>>, point3v: any, pathColors: any, color: any, isClosed: boolean, outVerticesHigh: any, outVerticesLow: any, outColors: any, outOrders: number[], outIndexes: number[], ellipsoid?: Ellipsoid, outTransformedPathLonLat?: Array<Array<LonLat>>, outTransformedPathMerc?: Array<Array<LonLat>>, outExtent?: Extent): void;
49
+ /**
50
+ * Appends to the line array new geodetic coordinates line data.
51
+ * @param {Array.<Array.<number>>} pathLonLat - Line geodetic coordinates path array. [[0,0,0], [1,1,1],...]
52
+ * @param {Boolean} isClosed - Identificator for the closed line data creation.
53
+ * @param {Number[]} outVertices - Out vertices data array.
54
+ * @param {Number[]} outOrders - Out vertices orders data array.
55
+ * @param {Number[]} outIndexes - Out indexes data array.
56
+ * @param {Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
57
+ * @param {Array.<Array.<number>>} outTransformedPathCartesian - Cartesian coordinates out array. [[0,0,0], [1,1,1],...]
58
+ * @param {Array.<Array.<LonLat>>} outPathLonLat - Geographic coordinates out array.
59
+ * @param {Array.<Array.<LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
60
+ * @param {Extent} outExtent - Geodetic line extent.
61
+ * @static
62
+ */
63
+ static appendLineDataLonLat(pathLonLat: Array<Array<number>>, pathColors: any, defaultColor: any, isClosed: boolean, outVerticesHigh: any, outVerticesLow: any, outOrders: number[], outIndexes: number[], ellipsoid: Ellipsoid, outTransformedPathCartesian: Array<Array<number>>, outPathLonLat: Array<Array<LonLat>>, outTransformedPathMerc: Array<Array<LonLat>>, outExtent: Extent, outColors: any): void;
64
+ constructor(options: any);
65
+ /**
66
+ * Object unic identifier.
67
+ * @public
68
+ * @readonly
69
+ * @type {number}
70
+ */
71
+ public readonly id: number;
72
+ altitude: any;
73
+ /**
74
+ * Polyline thickness in screen pixels.
75
+ * @public
76
+ * @type {number}
77
+ */
78
+ public thickness: number;
79
+ /**
80
+ * Polyline RGBA color.
81
+ * @public
82
+ * @type {Array<number>} - (exactly 4 entries)
83
+ */
84
+ public _defaultColor: Array<number>;
85
+ /**
86
+ * Polyline visibility.
87
+ * @public
88
+ * @type {boolean}
89
+ */
90
+ public visibility: boolean;
91
+ /**
92
+ * Polyline geometry ring type identificator.
93
+ * @protected
94
+ * @type {Boolean}
95
+ */
96
+ protected _closedLine: boolean;
97
+ /**
98
+ * Polyline cartesian coordinates.
99
+ * @private
100
+ * @type {Array.<Vec3>}
101
+ */
102
+ private _path3v;
103
+ _pathLengths: any[];
104
+ /**
105
+ * Polyline geodetic degrees coordiantes.
106
+ * @private
107
+ * @type {Array.<LonLat>}
108
+ */
109
+ private _pathLonLat;
110
+ /**
111
+ * Polyline geodetic mercator coordinates.
112
+ * @private
113
+ * @type {Array.<LonLat>}
114
+ */
115
+ private _pathLonLatMerc;
116
+ _pathColors: any;
117
+ /**
118
+ * Polyline geodetic extent.
119
+ * @protected
120
+ * @type {Extent}
121
+ */
122
+ protected _extent: Extent;
123
+ _verticesHigh: any[];
124
+ _verticesLow: any[];
125
+ _orders: any[];
126
+ _indexes: any[];
127
+ _colors: any[];
128
+ _verticesHighBuffer: any;
129
+ _verticesLowBuffer: any;
130
+ _ordersBuffer: any;
131
+ _indexesBuffer: any;
132
+ _colorsBuffer: any;
133
+ _pickingColor: number[];
134
+ _renderNode: any;
135
+ /**
136
+ * Entity instance that holds this Polyline.
137
+ * @private
138
+ * @type {Entity}
139
+ */
140
+ private _entity;
141
+ /**
142
+ * Handler that stores and renders this Polyline object.
143
+ * @private
144
+ * @type {PolylineHandler}
145
+ */
146
+ private _handler;
147
+ _handlerIndex: number;
148
+ _buffersUpdateCallbacks: (() => void)[];
149
+ _changedBuffers: any[];
150
+ /**
151
+ * Sets polyline path with cartesian coordinates.
152
+ * @protected
153
+ * @param {pg.math.Vector3[]} path3v - Cartesian coordinates.
154
+ */
155
+ protected _setEqualPath3v(path3v: pg.math.Vector3[]): void;
156
+ /**
157
+ * Sets polyline with geodetic coordinates.
158
+ * @protected
159
+ * @param {LonLat[]} pathLonLat - Geodetic polyline path coordinates.
160
+ */
161
+ protected _setEqualPathLonLat(pathLonLat: LonLat[]): void;
162
+ setPointLonLat(lonlat: any, index: any, segmentIndex: any): void;
163
+ setPoint3v(coordinates: any, index: any, segmentIndex: any, skipLonLat: any): void;
164
+ _resizePathLengths(index?: number): void;
165
+ removeSegment(index: any): void;
166
+ removePoint(index: any, multiLineIndex?: number): void;
167
+ insertPoint3v(point3v: any, index: number, color: any, multilineIndex?: number): void;
168
+ /**
169
+ * Adds a new cartesian point in the end of the path in a last line segment.
170
+ * @public
171
+ * @param {Vec3} point3v - New coordinate.
172
+ */
173
+ public appendPoint3v(point3v: Vec3, color: any, skipEllipsoid: any): void;
174
+ /**
175
+ * Adds a new cartesian point in the end of the path.
176
+ * @public
177
+ * @param {Vec3} point3v - New coordinate.
178
+ * @param {number} [multiLineIndex=0] - Path part index, first by default.
179
+ */
180
+ public addPoint3v(point3v: Vec3, multiLineIndex?: number): void;
181
+ /**
182
+ * Adds a new geodetic point in the end of the path.
183
+ * @public
184
+ * @param {LonLat} lonLat - New coordinate.
185
+ * @param {number} [multiLineIndex=0] - Path part index, first by default.
186
+ */
187
+ public addPointLonLat(lonLat: LonLat, multiLineIndex?: number): void;
188
+ /**
189
+ * Clear Polyline object data.
190
+ * @public
191
+ */
192
+ public clear(): void;
193
+ setPointColor(color: any, index?: number, segmentIndex?: number): void;
194
+ /**
195
+ * Sets Polyline opacity.
196
+ * @public
197
+ * @param {number} opacity - Opacity.
198
+ */
199
+ public setOpacity(opacity: number): void;
200
+ /**
201
+ * Sets Polyline thickness in screen pixels.
202
+ * @public
203
+ * @param {number} thickness - Thickness.
204
+ */
205
+ public setThickness(thickness: number): void;
206
+ /**
207
+ * Returns thickness.
208
+ * @public
209
+ * @return {number} Thickness in screen pixels.
210
+ */
211
+ public getThickness(): number;
212
+ /**
213
+ * Sets visibility.
214
+ * @public
215
+ * @param {boolean} visibility - Polyline visibility.
216
+ */
217
+ public setVisibility(visibility: boolean): void;
218
+ /**
219
+ * Gets Polyline visibility.
220
+ * @public
221
+ * @return {boolean} Polyline visibility.
222
+ */
223
+ public getVisibility(): boolean;
224
+ /**
225
+ * Assign with render node.
226
+ * @public
227
+ * @param {RenderNode} renderNode -
228
+ */
229
+ public setRenderNode(renderNode: RenderNode): void;
230
+ /**
231
+ * @protected
232
+ */
233
+ protected _clearData(): void;
234
+ _createData3v(path3v: any): void;
235
+ _createDataLonLat(pathLonlat: any): void;
236
+ /**
237
+ * Removes from an entity.
238
+ * @public
239
+ */
240
+ public remove(): void;
241
+ setPickingColor3v(color: any): void;
242
+ /**
243
+ * Returns polyline geodetic extent.
244
+ * @public
245
+ * @returns {Extent} - Geodetic extent
246
+ */
247
+ public getExtent(): Extent;
248
+ /**
249
+ * Returns path cartesian coordinates.
250
+ * @return {Array.<Vec3>} Polyline path.
251
+ */
252
+ getPath3v(): Array<Vec3>;
253
+ /**
254
+ * Returns geodetic path coordinates.
255
+ * @return {Array.<LonLat>} Polyline path.
256
+ */
257
+ getPathLonLat(): Array<LonLat>;
258
+ getPathColors(): any;
259
+ setPathColors(pathColors: any): void;
260
+ setColorHTML(htmlColor: any): void;
261
+ /**
262
+ * Sets geodetic coordinates.
263
+ * @public
264
+ * @param {Array.<Array.<number>>} pathLonLat - Polyline path cartesian coordinates. (exactly 3 entries)
265
+ * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
266
+ */
267
+ public setPathLonLat(pathLonLat: Array<Array<number>>, forceEqual?: boolean): void;
268
+ /**
269
+ * Sets Polyline cartesian coordinates.
270
+ * @public
271
+ * @param {Array.<Array.<number>>} path3v - Polyline path cartesian coordinates. (exactly 3 entries)
272
+ * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
273
+ */
274
+ public setPath3v(path3v: Array<Array<number>>, pathColors: any, forceEqual?: boolean): void;
275
+ draw(): void;
276
+ drawPicking(): void;
277
+ /**
278
+ * Refresh buffers.
279
+ * @protected
280
+ */
281
+ protected _refresh(): void;
282
+ /**
283
+ * Updates render buffers.
284
+ * @protected
285
+ */
286
+ protected _update(): void;
287
+ /**
288
+ * Clear GL buffers.
289
+ * @protected
290
+ */
291
+ protected _deleteBuffers(): void;
292
+ /**
293
+ * Creates gl main data buffer.
294
+ * @protected
295
+ */
296
+ protected _createVerticesBuffer(): void;
297
+ /**
298
+ * Creates gl index and order buffer.
299
+ * @protected
300
+ */
301
+ protected _createIndexBuffer(): void;
302
+ _createColorsBuffer(): void;
303
+ }
304
+ import { Extent } from "../Extent.js";
305
+ import { LonLat } from "../LonLat.js";
306
+ import { Vec3 } from "../math/Vec3.js";
@@ -0,0 +1,18 @@
1
+ export class PolylineHandler {
2
+ static set _staticCounter(arg: any);
3
+ static get _staticCounter(): any;
4
+ constructor(entityCollection: any);
5
+ _entityCollection: any;
6
+ _renderer: any;
7
+ _polylines: any[];
8
+ __staticId: number;
9
+ pickingEnabled: boolean;
10
+ _initProgram(): void;
11
+ setRenderNode(renderNode: any): void;
12
+ add(polyline: any): void;
13
+ remove(polyline: any): void;
14
+ reindexPolylineArray(startIndex: any): void;
15
+ draw(): void;
16
+ drawPicking(): void;
17
+ clear(): void;
18
+ }
@@ -0,0 +1,124 @@
1
+ /**
2
+ * Ray class.
3
+ * @class
4
+ * @param {Object} [options] - Options:
5
+ * @param {Vec3|Array.<number>} [options.startPosition] - Ray start point position.
6
+ * @param {Vec3|Array.<number>} [options.endPosition] - Ray end point position.
7
+ * @param {Vec3|Array.<number>} [options.startColor] - Ray start point color.
8
+ * @param {Vec3|Array.<number>} [options.endColor] - Ray end point color.
9
+ * @param {boolean} [options.visibility] - Visibility.
10
+ */
11
+ export class Ray {
12
+ constructor(options: any);
13
+ /**
14
+ * Object unic identifier.
15
+ * @public
16
+ * @readonly
17
+ * @type {number}
18
+ */
19
+ public readonly id: number;
20
+ _thickness: any;
21
+ _length: any;
22
+ _lengthHighLow: Float32Array;
23
+ _startPosition: any;
24
+ _startPositionHigh: Vec3;
25
+ _startPositionLow: Vec3;
26
+ _endPosition: any;
27
+ _endPositionHigh: Vec3;
28
+ _endPositionLow: Vec3;
29
+ _startColor: any;
30
+ _endColor: any;
31
+ /**
32
+ * Ray visibility.
33
+ * @protected
34
+ * @type {boolean}
35
+ */
36
+ protected _visibility: boolean;
37
+ /**
38
+ * Entity instance that holds this billboard.
39
+ * @protected
40
+ * @type {Entity}
41
+ */
42
+ protected _entity: Entity;
43
+ /**
44
+ * Handler that stores and renders this billboard object.
45
+ * @protected
46
+ * @type {BillboardHandler}
47
+ */
48
+ protected _handler: BillboardHandler;
49
+ /**
50
+ * Billboard handler array index.
51
+ * @protected
52
+ * @type {number}
53
+ */
54
+ protected _handlerIndex: number;
55
+ /**
56
+ * Sets ray start position.
57
+ * @public
58
+ * @param {number} x - X coordinate.
59
+ * @param {number} y - Y coordinate.
60
+ * @param {number} z - Z coordinate.
61
+ */
62
+ public setStartPosition(x: number, y: number, z: number): void;
63
+ /**
64
+ * Sets ray start position.
65
+ * @public
66
+ * @param {Vec3} position - Cartesian coordinates.
67
+ */
68
+ public setStartPosition3v(position: Vec3): void;
69
+ /**
70
+ * Sets ray end position.
71
+ * @public
72
+ * @param {number} x - X coordinate.
73
+ * @param {number} y - Y coordinate.
74
+ * @param {number} z - Z coordinate.
75
+ */
76
+ public setEndPosition(x: number, y: number, z: number): void;
77
+ /**
78
+ * Sets ray end position.
79
+ * @public
80
+ * @param {Vec3} position - Cartesian coordinates.
81
+ */
82
+ public setEndPosition3v(position: Vec3): void;
83
+ setLength(length: any): void;
84
+ setThickness(thickness: any): void;
85
+ setColors4v(startColor: any, endColor: any): void;
86
+ setColorsHTML(startColor: any, endColor: any): void;
87
+ /**
88
+ * Returns ray start position.
89
+ * @public
90
+ * @returns {Vec3}
91
+ */
92
+ public getStartPosition(): Vec3;
93
+ /**
94
+ * Returns ray end position.
95
+ * @public
96
+ * @returns {Vec3}
97
+ */
98
+ public getEndPosition(): Vec3;
99
+ /**
100
+ * Sets billboard visibility.
101
+ * @public
102
+ * @param {boolean} visibility - Visibility flag.
103
+ */
104
+ public setVisibility(visibility: boolean): void;
105
+ /**
106
+ * Returns billboard visibility.
107
+ * @public
108
+ * @returns {boolean}
109
+ */
110
+ public getVisibility(): boolean;
111
+ /**
112
+ * Removes billboard from hander.
113
+ * @public
114
+ */
115
+ public remove(): void;
116
+ /**
117
+ * Sets billboard picking color.
118
+ * @public
119
+ * @param {Vec3} color - Picking color.
120
+ */
121
+ public setPickingColor3v(color: Vec3): void;
122
+ }
123
+ import { Vec3 } from "../math/Vec3.js";
124
+ import { Entity } from "./Entity.js";