@openglobus/og 0.11.1 → 0.11.6

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 (255) hide show
  1. package/package.json +18 -20
  2. package/src/og/Clock.js +11 -11
  3. package/src/og/Deferred.js +1 -1
  4. package/src/og/Events.js +9 -7
  5. package/src/og/Extent.js +117 -72
  6. package/src/og/Globe.js +35 -22
  7. package/src/og/ImageCanvas.js +24 -18
  8. package/src/og/Lock.js +2 -2
  9. package/src/og/LonLat.js +40 -37
  10. package/src/og/Popup.js +21 -15
  11. package/src/og/QueueArray.js +7 -3
  12. package/src/og/Rectangle.js +11 -6
  13. package/src/og/Stack.js +8 -5
  14. package/src/og/ajax.js +21 -33
  15. package/src/og/astro/astro.js +5 -5
  16. package/src/og/astro/earth.js +23 -17
  17. package/src/og/astro/jd.js +44 -39
  18. package/src/og/astro/orbit.js +20 -18
  19. package/src/og/astro/rotation.js +17 -8
  20. package/src/og/bv/Box.js +7 -3
  21. package/src/og/bv/Sphere.js +17 -9
  22. package/src/og/camera/Camera.js +137 -86
  23. package/src/og/camera/Frustum.js +30 -19
  24. package/src/og/camera/PlanetCamera.js +30 -26
  25. package/src/og/control/CompassButton.js +8 -2
  26. package/src/og/control/Control.js +13 -11
  27. package/src/og/control/DebugInfo.js +4 -1
  28. package/src/og/control/EarthCoordinates.js +62 -41
  29. package/src/og/control/EarthNavigation.js +20 -22
  30. package/src/og/control/GeoImageDragControl.js +1 -1
  31. package/src/og/control/KeyboardNavigation.js +12 -12
  32. package/src/og/control/LayerSwitcher.js +24 -23
  33. package/src/og/control/Lighting.js +1 -1
  34. package/src/og/control/MouseNavigation.js +1 -1
  35. package/src/og/control/ScaleControl.js +1 -1
  36. package/src/og/control/SegmentBoundVisualization.js +8 -9
  37. package/src/og/control/ShowFps.js +15 -10
  38. package/src/og/control/SimpleNavigation.js +8 -10
  39. package/src/og/control/Sun.js +25 -15
  40. package/src/og/control/ToggleWireframe.js +5 -5
  41. package/src/og/control/TouchNavigation.js +58 -45
  42. package/src/og/control/ZoomControl.js +41 -25
  43. package/src/og/control/index.js +4 -0
  44. package/src/og/ellipsoid/Ellipsoid.js +181 -85
  45. package/src/og/ellipsoid/wgs84.js +4 -4
  46. package/src/og/entity/BaseBillboard.js +97 -44
  47. package/src/og/entity/Billboard.js +15 -11
  48. package/src/og/entity/BillboardHandler.js +314 -64
  49. package/src/og/entity/Entity.js +106 -74
  50. package/src/og/entity/EntityCollection.js +72 -49
  51. package/src/og/entity/GeoObject.js +228 -0
  52. package/src/og/entity/GeoObjectHandler.js +910 -0
  53. package/src/og/entity/Geometry.js +29 -26
  54. package/src/og/entity/GeometryHandler.js +598 -126
  55. package/src/og/entity/Label.js +74 -40
  56. package/src/og/entity/LabelHandler.js +47 -246
  57. package/src/og/entity/LabelWorker.js +213 -0
  58. package/src/og/entity/Object3d.js +504 -0
  59. package/src/og/entity/PointCloud.js +81 -33
  60. package/src/og/entity/PointCloudHandler.js +9 -9
  61. package/src/og/entity/Polyline.js +39 -39
  62. package/src/og/entity/Ray.js +61 -28
  63. package/src/og/entity/ShapeHandler.js +1 -1
  64. package/src/og/entity/Strip.js +77 -48
  65. package/src/og/entity/StripHandler.js +27 -27
  66. package/src/og/entity/index.js +8 -16
  67. package/src/og/input/KeyboardHandler.js +107 -104
  68. package/src/og/input/MouseHandler.js +81 -78
  69. package/src/og/input/TouchHandler.js +55 -51
  70. package/src/og/layer/BaseGeoImage.js +61 -30
  71. package/src/og/layer/CanvasTiles.js +26 -24
  72. package/src/og/layer/GeoImage.js +10 -10
  73. package/src/og/layer/GeoTexture2d.js +1 -1
  74. package/src/og/layer/GeoVideo.js +3 -3
  75. package/src/og/layer/KML.js +66 -40
  76. package/src/og/layer/Layer.js +27 -17
  77. package/src/og/layer/Material.js +93 -61
  78. package/src/og/layer/Vector.js +118 -72
  79. package/src/og/layer/WMS.js +36 -19
  80. package/src/og/layer/XYZ.js +55 -48
  81. package/src/og/light/LightSource.js +47 -40
  82. package/src/og/math/Line2.js +24 -24
  83. package/src/og/math/Line3.js +103 -102
  84. package/src/og/math/Mat3.js +134 -121
  85. package/src/og/math/Mat4.js +603 -459
  86. package/src/og/math/Plane.js +21 -20
  87. package/src/og/math/Quat.js +980 -927
  88. package/src/og/math/Ray.js +195 -187
  89. package/src/og/math/Vec2.js +127 -117
  90. package/src/og/math/Vec3.js +206 -176
  91. package/src/og/math/Vec4.js +49 -53
  92. package/src/og/math/coder.js +18 -18
  93. package/src/og/math.js +12 -12
  94. package/src/og/mercator.js +11 -11
  95. package/src/og/proj/EPSG3857.js +4 -4
  96. package/src/og/proj/EPSG4326.js +4 -4
  97. package/src/og/proj/Proj.js +31 -31
  98. package/src/og/quadTree/EntityCollectionNode.js +310 -300
  99. package/src/og/quadTree/Node.js +1008 -993
  100. package/src/og/renderer/Renderer.js +768 -747
  101. package/src/og/renderer/RendererEvents.js +9 -6
  102. package/src/og/scene/Axes.js +1 -1
  103. package/src/og/scene/BaseNode.js +8 -9
  104. package/src/og/scene/Planet.js +115 -87
  105. package/src/og/scene/RenderNode.js +29 -22
  106. package/src/og/scene/SkyBox.js +1 -1
  107. package/src/og/segment/Segment.js +1886 -1878
  108. package/src/og/segment/SegmentLonLat.js +298 -268
  109. package/src/og/segment/segmentHelper.js +11 -11
  110. package/src/og/shaders/bloom.js +1 -1
  111. package/src/og/shaders/blur.js +2 -2
  112. package/src/og/shaders/depth.js +1 -1
  113. package/src/og/shaders/geoObject.js +211 -0
  114. package/src/og/shaders/label.js +1 -1
  115. package/src/og/shaders/lumFilter.js +1 -1
  116. package/src/og/shaders/pointCloud.js +42 -42
  117. package/src/og/shaders/screenFrame.js +1 -1
  118. package/src/og/shaders/shape.js +15 -21
  119. package/src/og/shaders/skybox.js +37 -37
  120. package/src/og/shaders/toneMapping.js +1 -1
  121. package/src/og/shapes/BaseShape.js +129 -57
  122. package/src/og/shapes/Icosphere.js +30 -15
  123. package/src/og/shapes/Sphere.js +13 -16
  124. package/src/og/terrain/BilTerrain.js +2 -1
  125. package/src/og/terrain/EmptyTerrain.js +2 -2
  126. package/src/og/terrain/Geoid.js +2 -2
  127. package/src/og/terrain/GlobusTerrain.js +10 -10
  128. package/src/og/terrain/MapboxTerrain.js +1 -1
  129. package/src/og/utils/GeoImageCreator.js +9 -9
  130. package/src/og/utils/Loader.js +6 -6
  131. package/src/og/utils/NormalMapCreator.js +13 -13
  132. package/src/og/utils/TerrainWorker.js +1 -1
  133. package/src/og/utils/TextureAtlas.js +20 -22
  134. package/src/og/utils/VectorTileCreator.js +5 -5
  135. package/src/og/utils/earcut.js +1 -1
  136. package/src/og/utils/shared.js +15 -15
  137. package/src/og/webgl/Framebuffer.js +101 -53
  138. package/src/og/webgl/Handler.js +125 -85
  139. package/src/og/webgl/Multisample.js +55 -27
  140. package/src/og/webgl/Program.js +80 -35
  141. package/src/og/webgl/ProgramController.js +27 -23
  142. package/src/og/webgl/callbacks.js +8 -8
  143. package/types/Clock.d.ts +6 -2
  144. package/types/Deferred.d.ts +1 -1
  145. package/types/Events.d.ts +8 -4
  146. package/types/Extent.d.ts +37 -33
  147. package/types/Globe.d.ts +15 -13
  148. package/types/ImageCanvas.d.ts +5 -3
  149. package/types/LonLat.d.ts +24 -24
  150. package/types/Popup.d.ts +4 -0
  151. package/types/QueueArray.d.ts +6 -2
  152. package/types/Rectangle.d.ts +10 -4
  153. package/types/Stack.d.ts +4 -0
  154. package/types/ajax.d.ts +1 -1
  155. package/types/astro/earth.d.ts +3 -2
  156. package/types/bv/Box.d.ts +10 -5
  157. package/types/bv/Sphere.d.ts +13 -7
  158. package/types/camera/Camera.d.ts +90 -81
  159. package/types/camera/Frustum.d.ts +26 -22
  160. package/types/camera/PlanetCamera.d.ts +49 -53
  161. package/types/control/CompassButton.d.ts +4 -4
  162. package/types/control/Control.d.ts +7 -4
  163. package/types/control/DebugInfo.d.ts +3 -4
  164. package/types/control/EarthCoordinates.d.ts +6 -6
  165. package/types/control/EarthNavigation.d.ts +42 -0
  166. package/types/control/KeyboardNavigation.d.ts +3 -4
  167. package/types/control/LayerSwitcher.d.ts +3 -5
  168. package/types/control/Lighting.d.ts +3 -3
  169. package/types/control/MouseNavigation.d.ts +47 -0
  170. package/types/control/ScaleControl.d.ts +3 -3
  171. package/types/control/ShowFps.d.ts +3 -4
  172. package/types/control/SimpleNavigation.d.ts +3 -6
  173. package/types/control/Sun.d.ts +8 -10
  174. package/types/control/ToggleWireframe.d.ts +3 -3
  175. package/types/control/TouchNavigation.d.ts +48 -0
  176. package/types/control/ZoomControl.d.ts +3 -4
  177. package/types/control/index.d.ts +3 -1
  178. package/types/ellipsoid/Ellipsoid.d.ts +47 -43
  179. package/types/ellipsoid/wgs84.d.ts +3 -2
  180. package/types/entity/BaseBillboard.d.ts +41 -34
  181. package/types/entity/Billboard.d.ts +7 -7
  182. package/types/entity/BillboardHandler.d.ts +4 -0
  183. package/types/entity/Entity.d.ts +101 -83
  184. package/types/entity/EntityCollection.d.ts +57 -43
  185. package/types/entity/GeoObject.d.ts +111 -0
  186. package/types/entity/GeoObjectHandler.d.ts +77 -0
  187. package/types/entity/Geometry.d.ts +9 -7
  188. package/types/entity/GeometryHandler.d.ts +2 -2
  189. package/types/entity/Label.d.ts +24 -29
  190. package/types/entity/LabelHandler.d.ts +9 -2
  191. package/types/entity/LabelWorker.d.ts +9 -0
  192. package/types/entity/PointCloud.d.ts +8 -8
  193. package/types/entity/PointCloudHandler.d.ts +3 -3
  194. package/types/entity/Polyline.d.ts +58 -55
  195. package/types/entity/Ray.d.ts +19 -18
  196. package/types/entity/Strip.d.ts +8 -7
  197. package/types/entity/StripHandler.d.ts +3 -3
  198. package/types/entity/index.d.ts +7 -7
  199. package/types/input/KeyboardHandler.d.ts +10 -0
  200. package/types/input/MouseHandler.d.ts +5 -0
  201. package/types/input/TouchHandler.d.ts +5 -0
  202. package/types/layer/BaseGeoImage.d.ts +23 -35
  203. package/types/layer/CanvasTiles.d.ts +15 -22
  204. package/types/layer/GeoImage.d.ts +5 -18
  205. package/types/layer/GeoVideo.d.ts +5 -30
  206. package/types/layer/KML.d.ts +20 -15
  207. package/types/layer/Layer.d.ts +326 -0
  208. package/types/layer/Material.d.ts +45 -0
  209. package/types/layer/Vector.d.ts +208 -0
  210. package/types/layer/WMS.d.ts +4 -7
  211. package/types/layer/XYZ.d.ts +19 -25
  212. package/types/light/LightSource.d.ts +54 -53
  213. package/types/math/Line2.d.ts +11 -0
  214. package/types/math/Line3.d.ts +10 -0
  215. package/types/math/Mat3.d.ts +30 -18
  216. package/types/math/Mat4.d.ts +71 -52
  217. package/types/math/Plane.d.ts +5 -4
  218. package/types/math/Quat.d.ts +379 -0
  219. package/types/math/Ray.d.ts +82 -0
  220. package/types/math/Vec2.d.ts +102 -101
  221. package/types/math/Vec3.d.ts +143 -142
  222. package/types/math/Vec4.d.ts +40 -39
  223. package/types/math/coder.d.ts +12 -11
  224. package/types/math.d.ts +8 -8
  225. package/types/mercator.d.ts +3 -3
  226. package/types/proj/EPSG3857.d.ts +3 -2
  227. package/types/proj/EPSG4326.d.ts +3 -2
  228. package/types/proj/Proj.d.ts +42 -0
  229. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  230. package/types/quadTree/Node.d.ts +61 -0
  231. package/types/renderer/Renderer.d.ts +300 -0
  232. package/types/renderer/RendererEvents.d.ts +10 -7
  233. package/types/scene/BaseNode.d.ts +9 -9
  234. package/types/scene/Planet.d.ts +131 -126
  235. package/types/scene/RenderNode.d.ts +22 -23
  236. package/types/segment/Segment.d.ts +279 -0
  237. package/types/segment/SegmentLonLat.d.ts +16 -0
  238. package/types/shaders/geoObject.d.ts +3 -0
  239. package/types/shapes/BaseShape.d.ts +43 -40
  240. package/types/shapes/Sphere.d.ts +7 -7
  241. package/types/terrain/BilTerrain.d.ts +0 -1
  242. package/types/terrain/EmptyTerrain.d.ts +4 -4
  243. package/types/terrain/GlobusTerrain.d.ts +17 -54
  244. package/types/terrain/MapboxTerrain.d.ts +0 -1
  245. package/types/utils/GeoImageCreator.d.ts +3 -2
  246. package/types/utils/TextureAtlas.d.ts +8 -8
  247. package/types/utils/shared.d.ts +25 -24
  248. package/types/webgl/Framebuffer.d.ts +5 -5
  249. package/types/webgl/Handler.d.ts +68 -43
  250. package/types/webgl/Multisample.d.ts +5 -5
  251. package/types/webgl/Program.d.ts +8 -2
  252. package/types/webgl/ProgramController.d.ts +18 -13
  253. package/src/og/inherits.js +0 -8
  254. package/src/og/utils/polylabel.js +0 -176
  255. package/types/inherits.d.ts +0 -4
@@ -2,10 +2,10 @@
2
2
  * @module og/entity/PointCloud
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import { Vec3 } from '../math/Vec3.js';
8
- import { Vec4 } from '../math/Vec4.js';
7
+ import { Vec3 } from "../math/Vec3.js";
8
+ import { Vec4 } from "../math/Vec4.js";
9
9
 
10
10
  const COORDINATES_BUFFER = 0;
11
11
  const COLOR_BUFFER = 1;
@@ -15,7 +15,7 @@ const PICKING_COLOR_BUFFER = 2;
15
15
  * PointCloud object.
16
16
  * @class
17
17
  * @param {*} [options] - Point cloud options:
18
- * @param {Array.<Array.<number,number,number,number,number,number,number,*>>} [options.points] - Points cartesian coordinates array,
18
+ * @param {Array.<Array.<number>>} [options.points] - Points cartesian coordinates array,
19
19
  * where first three is cartesian coordinates, next fourth is a RGBA color, and last is an point properties.
20
20
  * @param {number} [options.pointSize] - Point screen size in pixels.
21
21
  * @param {number} [options.pickingDistance] - Point border picking size in screen pixels.
@@ -33,7 +33,6 @@ const PICKING_COLOR_BUFFER = 2;
33
33
  */
34
34
  class PointCloud {
35
35
  constructor(options) {
36
-
37
36
  options = options || {};
38
37
 
39
38
  /**
@@ -49,7 +48,7 @@ class PointCloud {
49
48
  * @public
50
49
  * @type {boolean}
51
50
  */
52
- this.visibility = (options.visibility != undefined ? options.visibility : true);
51
+ this.visibility = options.visibility != undefined ? options.visibility : true;
53
52
 
54
53
  /**
55
54
  * Point screen size in pixels.
@@ -68,14 +67,14 @@ class PointCloud {
68
67
  /**
69
68
  * Parent collection render node.
70
69
  * @private
71
- * @type {og.scene.RenderNode}
70
+ * @type {RenderNode}
72
71
  */
73
72
  this._renderNode = null;
74
73
 
75
74
  /**
76
75
  * Entity instance that holds this point cloud.
77
76
  * @private
78
- * @type {og.Entity}
77
+ * @type {Entity}
79
78
  */
80
79
  this._entity = null;
81
80
 
@@ -114,7 +113,7 @@ class PointCloud {
114
113
  /**
115
114
  * Handler that stores and renders this object.
116
115
  * @private
117
- * @type {og.PointCloudHandler}
116
+ * @type {PointCloudHandler}
118
117
  */
119
118
  this._handler = null;
120
119
  this._handlerIndex = -1;
@@ -145,7 +144,6 @@ class PointCloud {
145
144
  * @public
146
145
  */
147
146
  clear() {
148
-
149
147
  this._points.length = 0;
150
148
  this._points = [];
151
149
 
@@ -189,7 +187,7 @@ class PointCloud {
189
187
  /**
190
188
  * Assign rendering scene node.
191
189
  * @public
192
- * @param {og.scene.RenderNode} renderNode - Assigned render node.
190
+ * @param {RenderNode} renderNode - Assigned render node.
193
191
  */
194
192
  setRenderNode(renderNode) {
195
193
  this._renderNode = renderNode;
@@ -208,7 +206,7 @@ class PointCloud {
208
206
  /**
209
207
  * Adds points to render.
210
208
  * @public
211
- * @param {Array.<Array<number,number,number,number,number,number,number,*>>} points - Point cloud array.
209
+ * @param {Array.<Array<number>>} points - Point cloud array.
212
210
  * @example
213
211
  * var points = [[0, 0, 0, 255, 255, 255, 255, { 'name': 'White point' }], [100, 100, 0, 255, 0, 0, 255, { 'name': 'Red point' }]];
214
212
  */
@@ -217,7 +215,7 @@ class PointCloud {
217
215
  for (var i = 0; i < points.length; i++) {
218
216
  var pi = points[i];
219
217
  var pos = new Vec3(pi[0], pi[1], pi[2]),
220
- col = new Vec4(pi[3], pi[4], pi[5], (pi[6] == undefined ? 255.0 : pi[6]));
218
+ col = new Vec4(pi[3], pi[4], pi[5], pi[6] == undefined ? 255.0 : pi[6]);
221
219
  this._coordinatesData.push(pos.x, pos.y, pos.z);
222
220
  this._colorData.push(col.x / 255.0, col.y / 255.0, col.z / 255.0, col.w / 255.0);
223
221
  var p = {
@@ -233,7 +231,12 @@ class PointCloud {
233
231
 
234
232
  if (this._renderNode) {
235
233
  this._renderNode.renderer.assignPickingColor(p);
236
- this._pickingColorData.push(p._pickingColor.x / 255.0, p._pickingColor.y / 255.0, p._pickingColor.z / 255.0, 1.0);
234
+ this._pickingColorData.push(
235
+ p._pickingColor.x / 255.0,
236
+ p._pickingColor.y / 255.0,
237
+ p._pickingColor.z / 255.0,
238
+ 1.0
239
+ );
237
240
  }
238
241
  }
239
242
 
@@ -243,21 +246,18 @@ class PointCloud {
243
246
  }
244
247
 
245
248
  setPointPosition(index, x, y, z) {
246
-
247
249
  // TODO: ...
248
250
 
249
251
  this._changedBuffers[COORDINATES_BUFFER] = true;
250
252
  }
251
253
 
252
254
  setPointColor(index, r, g, b, a) {
253
-
254
255
  // TODO: ...
255
256
 
256
257
  this._changedBuffers[COLOR_BUFFER] = true;
257
258
  }
258
259
 
259
260
  addPoints(points) {
260
-
261
261
  // TODO: ...
262
262
 
263
263
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -266,7 +266,6 @@ class PointCloud {
266
266
  }
267
267
 
268
268
  addPoint(index, point) {
269
-
270
269
  // TODO: ...
271
270
 
272
271
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -285,7 +284,6 @@ class PointCloud {
285
284
  }
286
285
 
287
286
  removePoint(index) {
288
-
289
287
  // TODO: ...
290
288
 
291
289
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -294,7 +292,6 @@ class PointCloud {
294
292
  }
295
293
 
296
294
  insertPoint(index, point) {
297
-
298
295
  // TODO: ...
299
296
 
300
297
  this._changedBuffers[COORDINATES_BUFFER] = true;
@@ -316,7 +313,6 @@ class PointCloud {
316
313
 
317
314
  draw() {
318
315
  if (this.visibility && this._coordinatesData.length) {
319
-
320
316
  this._update();
321
317
 
322
318
  var rn = this._renderNode;
@@ -327,18 +323,32 @@ class PointCloud {
327
323
  sha = p.attributes,
328
324
  shu = p.uniforms;
329
325
 
330
- gl.polygonOffset(this._handler._entityCollection.polygonOffsetFactor, this._handler._entityCollection.polygonOffsetUnits);
326
+ gl.polygonOffset(
327
+ this._handler._entityCollection.polygonOffsetFactor,
328
+ this._handler._entityCollection.polygonOffsetUnits
329
+ );
331
330
 
332
331
  sh.activate();
333
332
 
334
- gl.uniformMatrix4fv(shu.projectionViewMatrix, false, r.activeCamera._projectionViewMatrix._m);
333
+ gl.uniformMatrix4fv(
334
+ shu.projectionViewMatrix,
335
+ false,
336
+ r.activeCamera._projectionViewMatrix._m
337
+ );
335
338
 
336
339
  gl.uniform1f(shu.opacity, this._handler._entityCollection._fadingOpacity);
337
340
 
338
341
  gl.uniform1f(shu.pointSize, this.pointSize);
339
342
 
340
343
  gl.bindBuffer(gl.ARRAY_BUFFER, this._coordinatesBuffer);
341
- gl.vertexAttribPointer(sha.coordinates, this._coordinatesBuffer.itemSize, gl.FLOAT, false, 0, 0);
344
+ gl.vertexAttribPointer(
345
+ sha.coordinates,
346
+ this._coordinatesBuffer.itemSize,
347
+ gl.FLOAT,
348
+ false,
349
+ 0,
350
+ 0
351
+ );
342
352
 
343
353
  gl.bindBuffer(gl.ARRAY_BUFFER, this._colorBuffer);
344
354
  gl.vertexAttribPointer(sha.colors, this._colorBuffer.itemSize, gl.FLOAT, false, 0, 0);
@@ -359,19 +369,40 @@ class PointCloud {
359
369
 
360
370
  sh.activate();
361
371
 
362
- gl.polygonOffset(this._handler._entityCollection.polygonOffsetFactor, this._handler._entityCollection.polygonOffsetUnits);
372
+ gl.polygonOffset(
373
+ this._handler._entityCollection.polygonOffsetFactor,
374
+ this._handler._entityCollection.polygonOffsetUnits
375
+ );
363
376
 
364
- gl.uniformMatrix4fv(shu.projectionViewMatrix, false, r.activeCamera._projectionViewMatrix._m);
377
+ gl.uniformMatrix4fv(
378
+ shu.projectionViewMatrix,
379
+ false,
380
+ r.activeCamera._projectionViewMatrix._m
381
+ );
365
382
 
366
383
  gl.uniform1f(shu.opacity, this._handler._entityCollection._fadingOpacity);
367
384
 
368
385
  gl.uniform1f(shu.pointSize, this.pointSize + this.pickingDistance);
369
386
 
370
387
  gl.bindBuffer(gl.ARRAY_BUFFER, this._coordinatesBuffer);
371
- gl.vertexAttribPointer(sha.coordinates, this._coordinatesBuffer.itemSize, gl.FLOAT, false, 0, 0);
388
+ gl.vertexAttribPointer(
389
+ sha.coordinates,
390
+ this._coordinatesBuffer.itemSize,
391
+ gl.FLOAT,
392
+ false,
393
+ 0,
394
+ 0
395
+ );
372
396
 
373
397
  gl.bindBuffer(gl.ARRAY_BUFFER, this._pickingColorBuffer);
374
- gl.vertexAttribPointer(sha.colors, this._pickingColorBuffer.itemSize, gl.FLOAT, false, 0, 0);
398
+ gl.vertexAttribPointer(
399
+ sha.colors,
400
+ this._pickingColorBuffer.itemSize,
401
+ gl.FLOAT,
402
+ false,
403
+ 0,
404
+ 0
405
+ );
375
406
 
376
407
  gl.drawArrays(gl.POINTS, 0, this._coordinatesBuffer.numItems);
377
408
  }
@@ -415,19 +446,31 @@ class PointCloud {
415
446
  _createCoordinatesBuffer() {
416
447
  var h = this._renderNode.renderer.handler;
417
448
  h.gl.deleteBuffer(this._coordinatesBuffer);
418
- this._coordinatesBuffer = h.createArrayBuffer(new Float32Array(this._coordinatesData), 3, (this._coordinatesData.length) / 3);
449
+ this._coordinatesBuffer = h.createArrayBuffer(
450
+ new Float32Array(this._coordinatesData),
451
+ 3,
452
+ this._coordinatesData.length / 3
453
+ );
419
454
  }
420
455
 
421
456
  _createColorBuffer() {
422
457
  var h = this._renderNode.renderer.handler;
423
458
  h.gl.deleteBuffer(this._colorBuffer);
424
- this._colorBuffer = h.createArrayBuffer(new Float32Array(this._colorData), 4, (this._colorData.length) / 4);
459
+ this._colorBuffer = h.createArrayBuffer(
460
+ new Float32Array(this._colorData),
461
+ 4,
462
+ this._colorData.length / 4
463
+ );
425
464
  }
426
465
 
427
466
  _createPickingColorBuffer() {
428
467
  var h = this._renderNode.renderer.handler;
429
468
  h.gl.deleteBuffer(this._pickingColorBuffer);
430
- this._pickingColorBuffer = h.createArrayBuffer(new Float32Array(this._pickingColorData), 4, (this._pickingColorData.length) / 4);
469
+ this._pickingColorBuffer = h.createArrayBuffer(
470
+ new Float32Array(this._pickingColorData),
471
+ 4,
472
+ this._pickingColorData.length / 4
473
+ );
431
474
  }
432
475
 
433
476
  _setPickingColors() {
@@ -437,11 +480,16 @@ class PointCloud {
437
480
  p._entity = this._entity;
438
481
  p._entityCollection = this._entity._entityCollection;
439
482
  this._renderNode.renderer.assignPickingColor(p);
440
- this._pickingColorData.push(p._pickingColor.x / 255.0, p._pickingColor.y / 255.0, p._pickingColor.z / 255.0, 1.0);
483
+ this._pickingColorData.push(
484
+ p._pickingColor.x / 255.0,
485
+ p._pickingColor.y / 255.0,
486
+ p._pickingColor.z / 255.0,
487
+ 1.0
488
+ );
441
489
  }
442
490
  this._changedBuffers[PICKING_COLOR_BUFFER] = true;
443
491
  }
444
492
  }
445
493
  }
446
494
 
447
- export { PointCloud };
495
+ export { PointCloud };
@@ -2,13 +2,12 @@
2
2
  * @module og/entity/PointCloudHandler
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import * as shaders from '../shaders/pointCloud.js';
7
+ import * as shaders from "../shaders/pointCloud.js";
8
8
 
9
9
  class PointCloudHandler {
10
10
  constructor(entityCollection) {
11
-
12
11
  /**
13
12
  * Picking rendering option.
14
13
  * @public
@@ -19,21 +18,21 @@ class PointCloudHandler {
19
18
  /**
20
19
  * Parent collection
21
20
  * @private
22
- * @type {og.EntityCollection}
21
+ * @type {EntityCollection}
23
22
  */
24
23
  this._entityCollection = entityCollection;
25
24
 
26
25
  /**
27
26
  * Renderer
28
27
  * @private
29
- * @type {og.Renderer}
28
+ * @type {Renderer}
30
29
  */
31
30
  this._renderer = null;
32
31
 
33
32
  /**
34
33
  * Point cloud array
35
34
  * @private
36
- * @type {Array.<og.PointCloud>}
35
+ * @type {Array.<PointCloud>}
37
36
  */
38
37
  this._pointClouds = [];
39
38
 
@@ -72,7 +71,8 @@ class PointCloudHandler {
72
71
  pointCloud._handler = this;
73
72
  pointCloud._handlerIndex = this._pointClouds.length;
74
73
  this._pointClouds.push(pointCloud);
75
- this._entityCollection && this._entityCollection.renderNode &&
74
+ this._entityCollection &&
75
+ this._entityCollection.renderNode &&
76
76
  pointCloud.setRenderNode(this._entityCollection.renderNode);
77
77
  }
78
78
  }
@@ -121,6 +121,6 @@ class PointCloudHandler {
121
121
  this._pointClouds.length = 0;
122
122
  this._pointClouds = [];
123
123
  }
124
- };
124
+ }
125
125
 
126
- export { PointCloudHandler };
126
+ export { PointCloudHandler };
@@ -32,13 +32,13 @@ const A = 3;
32
32
  * @param {Object} [options] - Polyline options:
33
33
  * @param {number} [options.thickness] - Thickness in screen pixels 1.5 is default.
34
34
  * @param {Number} [options.altitude] - Relative to ground layers altitude value.
35
- * @param {og.Vec4} [options.color] - RGBA color.
35
+ * @param {Vec4} [options.color] - RGBA color.
36
36
  * @param {Boolean} [options.opacity] - Line opacity.
37
37
  * @param {Boolean} [options.visibility] - Polyline visibility. True default.
38
38
  * @param {Boolean} [options.isClosed] - Closed geometry type identificator.
39
- * @param {Array.<Array.<number,number,number>>} [options.pathLonLat] - Polyline geodetic coordinates array.
40
- * @param {Array.<Array.<number,number,number>>} [options.path3v] - LinesString cartesian coordinates array. [[0,0,0], [1,1,1],...]
41
- * @param {Array.<Array.<number,number,number, number>>} [options.pathColors] - Coordinates color. [[1,0,0,1], [0,1,0,1],...] for right and green colors.
39
+ * @param {Array.<Array.<number>>} [options.pathLonLat] - Polyline geodetic coordinates array. [[0,0,0], [1,1,1],...]
40
+ * @param {Array.<Array.<number>>} [options.path3v] - LinesString cartesian coordinates array. [[0,0,0], [1,1,1],...]
41
+ * @param {Array.<Array.<number>>} [options.pathColors] - Coordinates color. [[1,0,0,1], [0,1,0,1],...] for right and green colors.
42
42
  */
43
43
  class Polyline {
44
44
  constructor(options) {
@@ -64,7 +64,7 @@ class Polyline {
64
64
  /**
65
65
  * Polyline RGBA color.
66
66
  * @public
67
- * @type {Array<Number,Number,Number,Number>}
67
+ * @type {Array<number>} - (exactly 4 entries)
68
68
  */
69
69
  this._defaultColor = htmlColorToFloat32Array(
70
70
  options.color || DEFAULT_COLOR,
@@ -88,7 +88,7 @@ class Polyline {
88
88
  /**
89
89
  * Polyline cartesian coordinates.
90
90
  * @private
91
- * @type {Array.<og.Vec3>}
91
+ * @type {Array.<Vec3>}
92
92
  */
93
93
  this._path3v = [];
94
94
 
@@ -97,14 +97,14 @@ class Polyline {
97
97
  /**
98
98
  * Polyline geodetic degrees coordiantes.
99
99
  * @private
100
- * @type {Array.<og.LonLat>}
100
+ * @type {Array.<LonLat>}
101
101
  */
102
102
  this._pathLonLat = [];
103
103
 
104
104
  /**
105
105
  * Polyline geodetic mercator coordinates.
106
106
  * @private
107
- * @type {Array.<og.LonLat>}
107
+ * @type {Array.<LonLat>}
108
108
  */
109
109
  this._pathLonLatMerc = [];
110
110
 
@@ -113,7 +113,7 @@ class Polyline {
113
113
  /**
114
114
  * Polyline geodetic extent.
115
115
  * @protected
116
- * @type {og.Extent}
116
+ * @type {Extent}
117
117
  */
118
118
  this._extent = new Extent();
119
119
 
@@ -136,14 +136,14 @@ class Polyline {
136
136
  /**
137
137
  * Entity instance that holds this Polyline.
138
138
  * @private
139
- * @type {og.Entity}
139
+ * @type {Entity}
140
140
  */
141
141
  this._entity = null;
142
142
 
143
143
  /**
144
144
  * Handler that stores and renders this Polyline object.
145
145
  * @private
146
- * @type {og.PolylineHandler}
146
+ * @type {PolylineHandler}
147
147
  */
148
148
  this._handler = null;
149
149
  this._handlerIndex = -1;
@@ -178,16 +178,16 @@ class Polyline {
178
178
 
179
179
  /**
180
180
  * Appends to the line array new cartesian coordinates line data.
181
- * @param {Array.<Array.<number, number, number>>} path3v - Line coordinates path array.
181
+ * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
182
182
  * @param {Boolean} isClosed - Identificator for the closed line data creation.
183
183
  * @param {Number[]} outVertices - Out vertices data array.
184
184
  * @param {Number[]} outOrders - Out vertices orders data array.
185
185
  * @param {Number[]} outIndexes - Out vertices indexes data array.
186
- * @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
187
- * @param {Array.<Array.<og.LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
188
- * @param {Array.<Array.<og.LonLat>>} [outPath3v] - Cartesian coordinates out array.
189
- * @param {Array.<Array.<og.LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
190
- * @param {og.Extent} [outExtent] - Geodetic line extent.
186
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
187
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
188
+ * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
189
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
190
+ * @param {Extent} [outExtent] - Geodetic line extent.
191
191
  * @param {Array} [outColors]
192
192
  * @static
193
193
  */
@@ -449,16 +449,16 @@ class Polyline {
449
449
 
450
450
  /**
451
451
  * Appends to the line new cartesian coordinates point data.
452
- * @param {Array.<Array.<number, number, number>>} path3v - Line coordinates path array.
452
+ * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
453
453
  * @param {Boolean} isClosed - Identificator for the closed line data creation.
454
454
  * @param {Number[]} outVertices - Out vertices data array.
455
455
  * @param {Number[]} outOrders - Out vertices orders data array.
456
456
  * @param {Number[]} outIndexes - Out vertices indexes data array.
457
- * @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
458
- * @param {Array.<Array.<og.LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
459
- * @param {Array.<Array.<og.LonLat>>} [outPath3v] - Cartesian coordinates out array.
460
- * @param {Array.<Array.<og.LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
461
- * @param {og.Extent} [outExtent] - Geodetic line extent.
457
+ * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
458
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
459
+ * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
460
+ * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
461
+ * @param {Extent} [outExtent] - Geodetic line extent.
462
462
  * @static
463
463
  */
464
464
  static appendPoint3v(
@@ -701,16 +701,16 @@ class Polyline {
701
701
 
702
702
  /**
703
703
  * Appends to the line array new geodetic coordinates line data.
704
- * @param {Array.<Array.<number, number, number>>} pathLonLat - Line geodetic coordinates path array.
704
+ * @param {Array.<Array.<number>>} pathLonLat - Line geodetic coordinates path array. [[0,0,0], [1,1,1],...]
705
705
  * @param {Boolean} isClosed - Identificator for the closed line data creation.
706
706
  * @param {Number[]} outVertices - Out vertices data array.
707
707
  * @param {Number[]} outOrders - Out vertices orders data array.
708
708
  * @param {Number[]} outIndexes - Out indexes data array.
709
- * @param {og.Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
710
- * @param {Array.<Array.<Number, Number, Number>>} outTransformedPathCartesian - Cartesian coordinates out array.
711
- * @param {Array.<Array.<og.LonLat>>} outPathLonLat - Geographic coordinates out array.
712
- * @param {Array.<Array.<og.LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
713
- * @param {og.Extent} outExtent - Geodetic line extent.
709
+ * @param {Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
710
+ * @param {Array.<Array.<number>>} outTransformedPathCartesian - Cartesian coordinates out array. [[0,0,0], [1,1,1],...]
711
+ * @param {Array.<Array.<LonLat>>} outPathLonLat - Geographic coordinates out array.
712
+ * @param {Array.<Array.<LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
713
+ * @param {Extent} outExtent - Geodetic line extent.
714
714
  * @static
715
715
  */
716
716
  static appendLineDataLonLat(
@@ -1157,7 +1157,7 @@ class Polyline {
1157
1157
  /**
1158
1158
  * Sets polyline with geodetic coordinates.
1159
1159
  * @protected
1160
- * @param {og.LonLat[]} pathLonLat - Geodetic polyline path coordinates.
1160
+ * @param {LonLat[]} pathLonLat - Geodetic polyline path coordinates.
1161
1161
  */
1162
1162
  _setEqualPathLonLat(pathLonLat) {
1163
1163
  var extent = this._extent;
@@ -1579,7 +1579,7 @@ class Polyline {
1579
1579
  /**
1580
1580
  * Adds a new cartesian point in the end of the path in a last line segment.
1581
1581
  * @public
1582
- * @param {og.Vec3} point3v - New coordinate.
1582
+ * @param {Vec3} point3v - New coordinate.
1583
1583
  */
1584
1584
  appendPoint3v(point3v, color, skipEllipsoid) {
1585
1585
  if (this._path3v.length === 0) {
@@ -1623,7 +1623,7 @@ class Polyline {
1623
1623
  /**
1624
1624
  * Adds a new cartesian point in the end of the path.
1625
1625
  * @public
1626
- * @param {og.Vec3} point3v - New coordinate.
1626
+ * @param {Vec3} point3v - New coordinate.
1627
1627
  * @param {number} [multiLineIndex=0] - Path part index, first by default.
1628
1628
  */
1629
1629
  addPoint3v(point3v, multiLineIndex = 0) {
@@ -1640,7 +1640,7 @@ class Polyline {
1640
1640
  /**
1641
1641
  * Adds a new geodetic point in the end of the path.
1642
1642
  * @public
1643
- * @param {og.LonLat} lonLat - New coordinate.
1643
+ * @param {LonLat} lonLat - New coordinate.
1644
1644
  * @param {number} [multiLineIndex=0] - Path part index, first by default.
1645
1645
  */
1646
1646
  addPointLonLat(lonLat, multiLineIndex = 0) {
@@ -1752,7 +1752,7 @@ class Polyline {
1752
1752
  /**
1753
1753
  * Assign with render node.
1754
1754
  * @public
1755
- * @param {og.scene.RenderNode} renderNode -
1755
+ * @param {RenderNode} renderNode -
1756
1756
  */
1757
1757
  setRenderNode(renderNode) {
1758
1758
  if (renderNode) {
@@ -1870,7 +1870,7 @@ class Polyline {
1870
1870
  /**
1871
1871
  * Returns polyline geodetic extent.
1872
1872
  * @public
1873
- * @returns {og.Extent} - Geodetic extent
1873
+ * @returns {Extent} - Geodetic extent
1874
1874
  */
1875
1875
  getExtent() {
1876
1876
  return this._extent.clone();
@@ -1878,7 +1878,7 @@ class Polyline {
1878
1878
 
1879
1879
  /**
1880
1880
  * Returns path cartesian coordinates.
1881
- * @return {Array.<og.Vec3>} Polyline path.
1881
+ * @return {Array.<Vec3>} Polyline path.
1882
1882
  */
1883
1883
  getPath3v() {
1884
1884
  return this._path3v;
@@ -1886,7 +1886,7 @@ class Polyline {
1886
1886
 
1887
1887
  /**
1888
1888
  * Returns geodetic path coordinates.
1889
- * @return {Array.<og.LonLat>} Polyline path.
1889
+ * @return {Array.<LonLat>} Polyline path.
1890
1890
  */
1891
1891
  getPathLonLat() {
1892
1892
  return this._pathLonLat;
@@ -1932,7 +1932,7 @@ class Polyline {
1932
1932
  /**
1933
1933
  * Sets geodetic coordinates.
1934
1934
  * @public
1935
- * @param {Array.<Array.<number,number,number>>} pathLonLat - Polyline path cartesian coordinates.
1935
+ * @param {Array.<Array.<number>>} pathLonLat - Polyline path cartesian coordinates. (exactly 3 entries)
1936
1936
  * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
1937
1937
  */
1938
1938
  setPathLonLat(pathLonLat, forceEqual) {
@@ -1955,7 +1955,7 @@ class Polyline {
1955
1955
  /**
1956
1956
  * Sets Polyline cartesian coordinates.
1957
1957
  * @public
1958
- * @param {Array.<Array.<number,number,number>>} path3v - Polyline path cartesian coordinates.
1958
+ * @param {Array.<Array.<number>>} path3v - Polyline path cartesian coordinates. (exactly 3 entries)
1959
1959
  * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
1960
1960
  */
1961
1961
  setPath3v(path3v, pathColors, forceEqual) {