@openglobus/og 0.17.2 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (845) hide show
  1. package/README.md +76 -47
  2. package/lib/@openglobus/og.esm.js +2 -0
  3. package/lib/@openglobus/og.esm.js.map +1 -0
  4. package/lib/@openglobus/og.umd.js +2 -0
  5. package/lib/@openglobus/og.umd.js.map +1 -0
  6. package/lib/@openglobus/res/fonts/Karla-Bold.json +5252 -0
  7. package/lib/@openglobus/res/fonts/Karla-Bold.ttf.cfg +920 -0
  8. package/lib/@openglobus/res/fonts/Karla-Bold.ttf.png +0 -0
  9. package/lib/@openglobus/res/fonts/Karla-Light.json +5252 -0
  10. package/lib/@openglobus/res/fonts/Karla-Light.ttf.cfg +830 -0
  11. package/lib/@openglobus/res/fonts/Karla-Light.ttf.png +0 -0
  12. package/lib/@openglobus/res/fonts/Karla-Medium.json +5252 -0
  13. package/lib/@openglobus/res/fonts/Karla-Medium.ttf.cfg +1196 -0
  14. package/lib/@openglobus/res/fonts/Karla-Medium.ttf.png +0 -0
  15. package/lib/@openglobus/res/fonts/NotoSansArabic-Regular.json +3332 -0
  16. package/lib/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.cfg +1370 -0
  17. package/lib/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.png +0 -0
  18. package/lib/@openglobus/res/fonts/Roboto-Regular.json +37147 -0
  19. package/lib/@openglobus/res/fonts/Roboto-Regular.ttf.cfg +1340 -0
  20. package/lib/@openglobus/res/fonts/Roboto-Regular.ttf.png +0 -0
  21. package/lib/@openglobus/res/fonts/arial.json +4321 -0
  22. package/lib/@openglobus/res/fonts/arial.ttf.cfg +1570 -0
  23. package/lib/@openglobus/res/fonts/arial.ttf.png +0 -0
  24. package/lib/@openglobus/res/night-4326.png +0 -0
  25. package/lib/@openglobus/res/night.png +0 -0
  26. package/lib/@openglobus/res/spec.png +0 -0
  27. package/lib/js/Clock.d.ts +106 -0
  28. package/lib/js/Clock.js +141 -0
  29. package/lib/js/Deferred.d.ts +6 -0
  30. package/lib/js/Deferred.js +13 -0
  31. package/lib/js/Events.d.ts +90 -0
  32. package/lib/js/Events.js +145 -0
  33. package/lib/js/Extent.d.ts +145 -0
  34. package/lib/js/Extent.js +278 -0
  35. package/lib/js/Globe.d.ts +132 -0
  36. package/lib/js/Globe.js +265 -0
  37. package/lib/js/ImageCanvas.d.ts +128 -0
  38. package/lib/js/ImageCanvas.js +203 -0
  39. package/lib/js/Lock.d.ts +15 -0
  40. package/lib/js/Lock.js +27 -0
  41. package/lib/js/LonLat.d.ts +128 -0
  42. package/lib/js/LonLat.js +192 -0
  43. package/lib/js/Object3d.d.ts +49 -0
  44. package/lib/js/Object3d.js +309 -0
  45. package/lib/js/Popup.d.ts +46 -0
  46. package/lib/js/Popup.js +160 -0
  47. package/lib/js/QueueArray.d.ts +16 -0
  48. package/lib/js/QueueArray.js +63 -0
  49. package/lib/js/Rectangle.d.ts +76 -0
  50. package/lib/js/Rectangle.js +77 -0
  51. package/lib/js/Stack.d.ts +20 -0
  52. package/lib/js/Stack.js +42 -0
  53. package/lib/js/astro/astro.d.ts +39 -0
  54. package/lib/js/astro/astro.js +43 -0
  55. package/lib/js/astro/earth.d.ts +8 -0
  56. package/lib/js/astro/earth.js +75 -0
  57. package/lib/js/astro/jd.d.ts +234 -0
  58. package/lib/js/astro/jd.js +416 -0
  59. package/lib/js/astro/orbit.d.ts +5 -0
  60. package/lib/js/astro/orbit.js +104 -0
  61. package/lib/js/astro/rotation.d.ts +2 -0
  62. package/lib/js/astro/rotation.js +25 -0
  63. package/lib/js/bv/Box.d.ts +32 -0
  64. package/lib/js/bv/Box.js +53 -0
  65. package/lib/js/bv/Sphere.d.ts +37 -0
  66. package/lib/js/bv/Sphere.js +31 -0
  67. package/lib/js/bv/index.d.ts +3 -0
  68. package/lib/js/bv/index.js +3 -0
  69. package/lib/js/camera/Camera.d.ts +314 -0
  70. package/lib/js/camera/Camera.js +453 -0
  71. package/lib/js/camera/Frustum.d.ts +139 -0
  72. package/lib/js/camera/Frustum.js +238 -0
  73. package/lib/js/camera/PlanetCamera.d.ts +234 -0
  74. package/lib/js/camera/PlanetCamera.js +465 -0
  75. package/lib/js/camera/index.d.ts +3 -0
  76. package/lib/js/camera/index.js +3 -0
  77. package/lib/js/cons.d.ts +40 -0
  78. package/lib/js/cons.js +92 -0
  79. package/lib/js/control/Atmosphere.d.ts +16 -0
  80. package/lib/js/control/Atmosphere.js +334 -0
  81. package/lib/js/control/CompassButton.d.ts +16 -0
  82. package/lib/js/control/CompassButton.js +118 -0
  83. package/lib/js/control/Control.d.ts +100 -0
  84. package/lib/js/control/Control.js +137 -0
  85. package/lib/js/control/DebugInfo.d.ts +25 -0
  86. package/lib/js/control/DebugInfo.js +281 -0
  87. package/lib/js/control/DrawingSwitcher.d.ts +13 -0
  88. package/lib/js/control/DrawingSwitcher.js +94 -0
  89. package/lib/js/control/EarthCoordinates.d.ts +41 -0
  90. package/lib/js/control/EarthCoordinates.js +161 -0
  91. package/lib/js/control/EarthNavigation.d.ts +50 -0
  92. package/lib/js/control/EarthNavigation.js +202 -0
  93. package/lib/js/control/GeoImageDragControl.d.ts +22 -0
  94. package/lib/js/control/GeoImageDragControl.js +102 -0
  95. package/lib/js/control/KeyboardNavigation.d.ts +28 -0
  96. package/lib/js/control/KeyboardNavigation.js +143 -0
  97. package/lib/js/control/LayerAnimation.d.ts +71 -0
  98. package/lib/js/control/LayerAnimation.js +283 -0
  99. package/lib/js/control/LayerSwitcher.d.ts +21 -0
  100. package/lib/js/control/LayerSwitcher.js +51 -0
  101. package/lib/js/control/Lighting.d.ts +49 -0
  102. package/lib/js/control/Lighting.js +412 -0
  103. package/lib/js/control/MouseNavigation.d.ts +62 -0
  104. package/lib/js/control/MouseNavigation.js +362 -0
  105. package/lib/js/control/MouseWheelZoomControl.d.ts +44 -0
  106. package/lib/js/control/MouseWheelZoomControl.js +181 -0
  107. package/lib/js/control/RulerSwitcher.d.ts +17 -0
  108. package/lib/js/control/RulerSwitcher.js +57 -0
  109. package/lib/js/control/ScaleControl.d.ts +24 -0
  110. package/lib/js/control/ScaleControl.js +91 -0
  111. package/lib/js/control/SegmentBoundVisualization.d.ts +12 -0
  112. package/lib/js/control/SegmentBoundVisualization.js +37 -0
  113. package/lib/js/control/ShowFps.d.ts +9 -0
  114. package/lib/js/control/ShowFps.js +20 -0
  115. package/lib/js/control/SimpleNavigation.d.ts +25 -0
  116. package/lib/js/control/SimpleNavigation.js +96 -0
  117. package/lib/js/control/SimpleSkyBackground.d.ts +15 -0
  118. package/lib/js/control/SimpleSkyBackground.js +177 -0
  119. package/lib/js/control/Sun.d.ts +33 -0
  120. package/lib/js/control/Sun.js +117 -0
  121. package/lib/js/control/ToggleWireframe.d.ts +14 -0
  122. package/lib/js/control/ToggleWireframe.js +28 -0
  123. package/lib/js/control/TouchNavigation.d.ts +52 -0
  124. package/lib/js/control/TouchNavigation.js +263 -0
  125. package/lib/js/control/ZoomControl.d.ts +27 -0
  126. package/lib/js/control/ZoomControl.js +86 -0
  127. package/lib/js/control/drawing/DrawingControl.d.ts +12 -0
  128. package/lib/js/control/drawing/DrawingControl.js +35 -0
  129. package/lib/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
  130. package/lib/js/control/drawing/LineStringDrawingScene.js +139 -0
  131. package/lib/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
  132. package/lib/js/control/drawing/PolygonDrawingScene.js +534 -0
  133. package/lib/js/control/elevationProfile/ElevationProfile.d.ts +61 -0
  134. package/lib/js/control/elevationProfile/ElevationProfile.js +217 -0
  135. package/lib/js/control/heightRuler/HeightRuler.d.ts +7 -0
  136. package/lib/js/control/heightRuler/HeightRuler.js +11 -0
  137. package/lib/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
  138. package/lib/js/control/heightRuler/HeightRulerScene.js +181 -0
  139. package/lib/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
  140. package/lib/js/control/heightRuler/HeightRulerSwitcher.js +13 -0
  141. package/lib/js/control/index.d.ts +28 -0
  142. package/lib/js/control/index.js +28 -0
  143. package/lib/js/control/ruler/Ruler.d.ts +13 -0
  144. package/lib/js/control/ruler/Ruler.js +23 -0
  145. package/lib/js/control/ruler/RulerScene.d.ts +88 -0
  146. package/lib/js/control/ruler/RulerScene.js +324 -0
  147. package/lib/js/control/selection/Selection.d.ts +55 -0
  148. package/lib/js/control/selection/Selection.js +78 -0
  149. package/lib/js/control/selection/SelectionScene.d.ts +44 -0
  150. package/lib/js/control/selection/SelectionScene.js +272 -0
  151. package/lib/js/control/timeline/TimelineControl.d.ts +18 -0
  152. package/lib/js/control/timeline/TimelineControl.js +79 -0
  153. package/lib/js/control/timeline/TimelineModel.d.ts +41 -0
  154. package/lib/js/control/timeline/TimelineModel.js +104 -0
  155. package/lib/js/control/timeline/TimelineView.d.ts +85 -0
  156. package/lib/js/control/timeline/TimelineView.js +363 -0
  157. package/lib/js/control/timeline/timelineUtils.d.ts +12 -0
  158. package/lib/js/control/timeline/timelineUtils.js +112 -0
  159. package/lib/js/control/visibleExtent/Segment.d.ts +277 -0
  160. package/lib/js/control/visibleExtent/Segment.js +1301 -0
  161. package/lib/js/control/visibleExtent/VisibleExtent.d.ts +5 -0
  162. package/lib/js/control/visibleExtent/VisibleExtent.js +56 -0
  163. package/lib/js/control/visibleExtent/drawnode.d.ts +7 -0
  164. package/lib/js/control/visibleExtent/drawnode.js +718 -0
  165. package/lib/js/ellipsoid/Ellipsoid.d.ts +187 -0
  166. package/lib/js/ellipsoid/Ellipsoid.js +434 -0
  167. package/lib/js/ellipsoid/index.d.ts +3 -0
  168. package/lib/js/ellipsoid/index.js +3 -0
  169. package/lib/js/ellipsoid/wgs84.d.ts +6 -0
  170. package/lib/js/ellipsoid/wgs84.js +6 -0
  171. package/lib/js/entity/BaseBillboard.d.ts +222 -0
  172. package/lib/js/entity/BaseBillboard.js +284 -0
  173. package/lib/js/entity/BaseBillboardHandler.d.ts +81 -0
  174. package/lib/js/entity/BaseBillboardHandler.js +546 -0
  175. package/lib/js/entity/Billboard.d.ts +113 -0
  176. package/lib/js/entity/Billboard.js +127 -0
  177. package/lib/js/entity/BillboardHandler.d.ts +15 -0
  178. package/lib/js/entity/BillboardHandler.js +103 -0
  179. package/lib/js/entity/Entity.d.ts +354 -0
  180. package/lib/js/entity/Entity.js +515 -0
  181. package/lib/js/entity/EntityCollection.d.ts +364 -0
  182. package/lib/js/entity/EntityCollection.js +621 -0
  183. package/lib/js/entity/GeoObject.d.ts +138 -0
  184. package/lib/js/entity/GeoObject.js +194 -0
  185. package/lib/js/entity/GeoObjectHandler.d.ts +99 -0
  186. package/lib/js/entity/GeoObjectHandler.js +558 -0
  187. package/lib/js/entity/Geometry.d.ts +111 -0
  188. package/lib/js/entity/Geometry.js +283 -0
  189. package/lib/js/entity/GeometryHandler.d.ts +84 -0
  190. package/lib/js/entity/GeometryHandler.js +687 -0
  191. package/lib/js/entity/Label.d.ts +207 -0
  192. package/lib/js/entity/Label.js +291 -0
  193. package/lib/js/entity/LabelHandler.d.ts +65 -0
  194. package/lib/js/entity/LabelHandler.js +696 -0
  195. package/lib/js/entity/LabelWorker.d.ts +15 -0
  196. package/lib/js/entity/LabelWorker.js +163 -0
  197. package/lib/js/entity/PointCloud.d.ts +179 -0
  198. package/lib/js/entity/PointCloud.js +327 -0
  199. package/lib/js/entity/PointCloudHandler.d.ts +42 -0
  200. package/lib/js/entity/PointCloudHandler.js +82 -0
  201. package/lib/js/entity/Polyline.d.ts +337 -0
  202. package/lib/js/entity/Polyline.js +1546 -0
  203. package/lib/js/entity/PolylineHandler.d.ts +22 -0
  204. package/lib/js/entity/PolylineHandler.js +78 -0
  205. package/lib/js/entity/Ray.d.ts +133 -0
  206. package/lib/js/entity/Ray.js +171 -0
  207. package/lib/js/entity/RayHandler.d.ts +70 -0
  208. package/lib/js/entity/RayHandler.js +496 -0
  209. package/lib/js/entity/Strip.d.ts +127 -0
  210. package/lib/js/entity/Strip.js +401 -0
  211. package/lib/js/entity/StripHandler.d.ts +42 -0
  212. package/lib/js/entity/StripHandler.js +110 -0
  213. package/lib/js/entity/index.d.ts +11 -0
  214. package/lib/js/entity/index.js +11 -0
  215. package/lib/js/index.d.ts +33 -0
  216. package/lib/js/index.js +33 -0
  217. package/lib/js/input/KeyboardHandler.d.ts +33 -0
  218. package/lib/js/input/KeyboardHandler.js +157 -0
  219. package/lib/js/input/MouseHandler.d.ts +16 -0
  220. package/lib/js/input/MouseHandler.js +81 -0
  221. package/lib/js/input/TouchHandler.d.ts +11 -0
  222. package/lib/js/input/TouchHandler.js +42 -0
  223. package/lib/js/input/input.d.ts +3 -0
  224. package/lib/js/input/input.js +42 -0
  225. package/lib/js/layer/BaseGeoImage.d.ts +145 -0
  226. package/lib/js/layer/BaseGeoImage.js +382 -0
  227. package/lib/js/layer/CanvasTiles.d.ts +103 -0
  228. package/lib/js/layer/CanvasTiles.js +302 -0
  229. package/lib/js/layer/GeoImage.d.ts +61 -0
  230. package/lib/js/layer/GeoImage.js +130 -0
  231. package/lib/js/layer/GeoTexture2d.d.ts +17 -0
  232. package/lib/js/layer/GeoTexture2d.js +37 -0
  233. package/lib/js/layer/GeoVideo.d.ts +68 -0
  234. package/lib/js/layer/GeoVideo.js +157 -0
  235. package/lib/js/layer/KML.d.ts +72 -0
  236. package/lib/js/layer/KML.js +303 -0
  237. package/lib/js/layer/Layer.d.ts +401 -0
  238. package/lib/js/layer/Layer.js +732 -0
  239. package/lib/js/layer/Material.d.ts +34 -0
  240. package/lib/js/layer/Material.js +69 -0
  241. package/lib/js/layer/Vector.d.ts +244 -0
  242. package/lib/js/layer/Vector.js +849 -0
  243. package/lib/js/layer/WMS.d.ts +75 -0
  244. package/lib/js/layer/WMS.js +112 -0
  245. package/lib/js/layer/XYZ.d.ts +149 -0
  246. package/lib/js/layer/XYZ.js +299 -0
  247. package/lib/js/layer/index.d.ts +11 -0
  248. package/lib/js/layer/index.js +11 -0
  249. package/lib/js/light/LightSource.d.ts +174 -0
  250. package/lib/js/light/LightSource.js +292 -0
  251. package/lib/js/math/Line2.d.ts +11 -0
  252. package/lib/js/math/Line2.js +21 -0
  253. package/lib/js/math/Line3.d.ts +28 -0
  254. package/lib/js/math/Line3.js +85 -0
  255. package/lib/js/math/Mat3.d.ts +77 -0
  256. package/lib/js/math/Mat3.js +139 -0
  257. package/lib/js/math/Mat4.d.ts +195 -0
  258. package/lib/js/math/Mat4.js +470 -0
  259. package/lib/js/math/Plane.d.ts +20 -0
  260. package/lib/js/math/Plane.js +108 -0
  261. package/lib/js/math/Quat.d.ts +373 -0
  262. package/lib/js/math/Quat.js +783 -0
  263. package/lib/js/math/Ray.d.ts +76 -0
  264. package/lib/js/math/Ray.js +188 -0
  265. package/lib/js/math/Vec2.d.ts +310 -0
  266. package/lib/js/math/Vec2.js +463 -0
  267. package/lib/js/math/Vec3.d.ts +472 -0
  268. package/lib/js/math/Vec3.js +799 -0
  269. package/lib/js/math/Vec4.d.ts +163 -0
  270. package/lib/js/math/Vec4.js +211 -0
  271. package/lib/js/math/coder.d.ts +51 -0
  272. package/lib/js/math/coder.js +101 -0
  273. package/lib/js/math/index.d.ts +11 -0
  274. package/lib/js/math/index.js +11 -0
  275. package/lib/js/math.d.ts +266 -0
  276. package/lib/js/math.js +379 -0
  277. package/lib/js/mercator.d.ts +92 -0
  278. package/lib/js/mercator.js +119 -0
  279. package/lib/js/proj/EPSG3857.d.ts +9 -0
  280. package/lib/js/proj/EPSG3857.js +9 -0
  281. package/lib/js/proj/EPSG4326.d.ts +9 -0
  282. package/lib/js/proj/EPSG4326.js +9 -0
  283. package/lib/js/proj/Proj.d.ts +43 -0
  284. package/lib/js/proj/Proj.js +38 -0
  285. package/lib/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
  286. package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +17 -0
  287. package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +6 -0
  288. package/lib/js/quadTree/EarthQuadTreeStrategy.js +19 -0
  289. package/lib/js/quadTree/EntityCollectionNode.d.ts +54 -0
  290. package/lib/js/quadTree/EntityCollectionNode.js +328 -0
  291. package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +6 -0
  292. package/lib/js/quadTree/MarsQuadTreeStrategy.js +17 -0
  293. package/lib/js/quadTree/Node.d.ts +61 -0
  294. package/lib/js/quadTree/Node.js +660 -0
  295. package/lib/js/quadTree/QuadTreeStrategy.d.ts +25 -0
  296. package/lib/js/quadTree/QuadTreeStrategy.js +69 -0
  297. package/lib/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
  298. package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +15 -0
  299. package/lib/js/quadTree/index.d.ts +12 -0
  300. package/lib/js/quadTree/index.js +12 -0
  301. package/lib/js/quadTree/quadTree.d.ts +40 -0
  302. package/lib/js/quadTree/quadTree.js +66 -0
  303. package/lib/js/renderer/Renderer.d.ts +311 -0
  304. package/lib/js/renderer/Renderer.js +899 -0
  305. package/lib/js/renderer/RendererEvents.d.ts +237 -0
  306. package/lib/js/renderer/RendererEvents.js +848 -0
  307. package/lib/js/scene/Axes.d.ts +12 -0
  308. package/lib/js/scene/Axes.js +59 -0
  309. package/lib/js/scene/BaseNode.d.ts +61 -0
  310. package/lib/js/scene/BaseNode.js +69 -0
  311. package/lib/js/scene/Planet.d.ts +623 -0
  312. package/lib/js/scene/Planet.js +1431 -0
  313. package/lib/js/scene/RenderNode.d.ts +150 -0
  314. package/lib/js/scene/RenderNode.js +301 -0
  315. package/lib/js/scene/SkyBox.d.ts +13 -0
  316. package/lib/js/scene/SkyBox.js +87 -0
  317. package/lib/js/scene/index.d.ts +5 -0
  318. package/lib/js/scene/index.js +5 -0
  319. package/lib/js/segment/Segment.d.ts +278 -0
  320. package/lib/js/segment/Segment.js +1142 -0
  321. package/lib/js/segment/SegmentLonLat.d.ts +48 -0
  322. package/lib/js/segment/SegmentLonLat.js +214 -0
  323. package/lib/js/segment/SegmentLonLatWgs84.d.ts +10 -0
  324. package/lib/js/segment/SegmentLonLatWgs84.js +23 -0
  325. package/lib/js/segment/Slice.d.ts +13 -0
  326. package/lib/js/segment/Slice.js +33 -0
  327. package/lib/js/segment/segmentHelper.d.ts +18 -0
  328. package/lib/js/segment/segmentHelper.js +180 -0
  329. package/lib/js/shaders/atmos.d.ts +4 -0
  330. package/lib/js/shaders/atmos.js +312 -0
  331. package/lib/js/shaders/billboard.d.ts +3 -0
  332. package/lib/js/shaders/billboard.js +214 -0
  333. package/lib/js/shaders/bloom.d.ts +2 -0
  334. package/lib/js/shaders/bloom.js +32 -0
  335. package/lib/js/shaders/blur.d.ts +3 -0
  336. package/lib/js/shaders/blur.js +68 -0
  337. package/lib/js/shaders/depth.d.ts +2 -0
  338. package/lib/js/shaders/depth.js +43 -0
  339. package/lib/js/shaders/drawnode.d.ts +8 -0
  340. package/lib/js/shaders/drawnode.js +986 -0
  341. package/lib/js/shaders/geoObject.d.ts +3 -0
  342. package/lib/js/shaders/geoObject.js +256 -0
  343. package/lib/js/shaders/label.d.ts +4 -0
  344. package/lib/js/shaders/label.js +589 -0
  345. package/lib/js/shaders/lumFilter.d.ts +2 -0
  346. package/lib/js/shaders/lumFilter.js +36 -0
  347. package/lib/js/shaders/pickingMask.d.ts +2 -0
  348. package/lib/js/shaders/pickingMask.js +22 -0
  349. package/lib/js/shaders/pointCloud.d.ts +2 -0
  350. package/lib/js/shaders/pointCloud.js +32 -0
  351. package/lib/js/shaders/polyline.d.ts +3 -0
  352. package/lib/js/shaders/polyline.js +345 -0
  353. package/lib/js/shaders/ray.d.ts +2 -0
  354. package/lib/js/shaders/ray.js +76 -0
  355. package/lib/js/shaders/screenFrame.d.ts +2 -0
  356. package/lib/js/shaders/screenFrame.js +26 -0
  357. package/lib/js/shaders/skybox.d.ts +2 -0
  358. package/lib/js/shaders/skybox.js +28 -0
  359. package/lib/js/shaders/toneMapping.d.ts +2 -0
  360. package/lib/js/shaders/toneMapping.js +85 -0
  361. package/lib/js/shaders/utils.d.ts +1 -0
  362. package/lib/js/shaders/utils.js +86 -0
  363. package/lib/js/terrain/BilTerrain.d.ts +18 -0
  364. package/lib/js/terrain/BilTerrain.js +152 -0
  365. package/lib/js/terrain/EmptyTerrain.d.ts +106 -0
  366. package/lib/js/terrain/EmptyTerrain.js +106 -0
  367. package/lib/js/terrain/Geoid.d.ts +33 -0
  368. package/lib/js/terrain/Geoid.js +191 -0
  369. package/lib/js/terrain/GlobusTerrain.d.ts +134 -0
  370. package/lib/js/terrain/GlobusTerrain.js +332 -0
  371. package/lib/js/terrain/MapboxTerrain.d.ts +21 -0
  372. package/lib/js/terrain/MapboxTerrain.js +298 -0
  373. package/lib/js/terrain/index.d.ts +5 -0
  374. package/lib/js/terrain/index.js +5 -0
  375. package/lib/js/ui/Button.d.ts +32 -0
  376. package/lib/js/ui/Button.js +78 -0
  377. package/lib/js/ui/ButtonGroup.d.ts +16 -0
  378. package/lib/js/ui/ButtonGroup.js +41 -0
  379. package/lib/js/ui/Dialog.d.ts +55 -0
  380. package/lib/js/ui/Dialog.js +173 -0
  381. package/lib/js/ui/Slider.d.ts +38 -0
  382. package/lib/js/ui/Slider.js +129 -0
  383. package/lib/js/ui/ToggleButton.d.ts +20 -0
  384. package/lib/js/ui/ToggleButton.js +42 -0
  385. package/lib/js/ui/View.d.ts +37 -0
  386. package/lib/js/ui/View.js +151 -0
  387. package/lib/js/ui/icons.d.ts +1 -0
  388. package/lib/js/ui/icons.js +3 -0
  389. package/lib/js/utils/BaseWorker.d.ts +14 -0
  390. package/lib/js/utils/BaseWorker.js +47 -0
  391. package/lib/js/utils/FontAtlas.d.ts +82 -0
  392. package/lib/js/utils/FontAtlas.js +220 -0
  393. package/lib/js/utils/GeoImageCreator.d.ts +34 -0
  394. package/lib/js/utils/GeoImageCreator.js +163 -0
  395. package/lib/js/utils/ImagesCacheManager.d.ts +22 -0
  396. package/lib/js/utils/ImagesCacheManager.js +63 -0
  397. package/lib/js/utils/Loader.d.ts +63 -0
  398. package/lib/js/utils/Loader.js +156 -0
  399. package/lib/js/utils/NormalMapCreator.d.ts +52 -0
  400. package/lib/js/utils/NormalMapCreator.js +310 -0
  401. package/lib/js/utils/PlainSegmentWorker.d.ts +24 -0
  402. package/lib/js/utils/PlainSegmentWorker.js +383 -0
  403. package/lib/js/utils/TerrainWorker.d.ts +28 -0
  404. package/lib/js/utils/TerrainWorker.js +551 -0
  405. package/lib/js/utils/TextureAtlas.d.ts +113 -0
  406. package/lib/js/utils/TextureAtlas.js +231 -0
  407. package/lib/js/utils/VectorTileCreator.d.ts +18 -0
  408. package/lib/js/utils/VectorTileCreator.js +320 -0
  409. package/lib/js/utils/colorTable.d.ts +3 -0
  410. package/lib/js/utils/colorTable.js +143 -0
  411. package/lib/js/utils/earcut.d.ts +7 -0
  412. package/lib/js/utils/earcut.js +536 -0
  413. package/lib/js/utils/objParser.d.ts +24 -0
  414. package/lib/js/utils/objParser.js +201 -0
  415. package/lib/js/utils/shared.d.ts +267 -0
  416. package/lib/js/utils/shared.js +893 -0
  417. package/lib/js/utils/units.d.ts +16 -0
  418. package/lib/js/utils/units.js +61 -0
  419. package/lib/js/webgl/BaseFramebuffer.d.ts +53 -0
  420. package/lib/js/webgl/BaseFramebuffer.js +88 -0
  421. package/lib/js/webgl/Framebuffer.d.ts +69 -0
  422. package/lib/js/webgl/Framebuffer.js +149 -0
  423. package/lib/js/webgl/Handler.d.ts +473 -0
  424. package/lib/js/webgl/Handler.js +1003 -0
  425. package/lib/js/webgl/Multisample.d.ts +27 -0
  426. package/lib/js/webgl/Multisample.js +77 -0
  427. package/lib/js/webgl/Program.d.ts +159 -0
  428. package/lib/js/webgl/Program.js +314 -0
  429. package/lib/js/webgl/ProgramController.d.ts +86 -0
  430. package/lib/js/webgl/ProgramController.js +110 -0
  431. package/lib/js/webgl/index.d.ts +6 -0
  432. package/lib/js/webgl/index.js +6 -0
  433. package/lib/js/webgl/types.d.ts +9 -0
  434. package/lib/js/webgl/types.js +26 -0
  435. package/lib/js/webgl/variableHandlers.d.ts +22 -0
  436. package/lib/js/webgl/variableHandlers.js +78 -0
  437. package/package.json +29 -38
  438. package/dist/@openglobus/og.esm.js +0 -21
  439. package/dist/@openglobus/og.esm.js.map +0 -1
  440. package/dist/@openglobus/og.umd.js +0 -21
  441. package/dist/@openglobus/og.umd.js.map +0 -1
  442. package/src/og/Clock.js +0 -214
  443. package/src/og/Deferred.js +0 -11
  444. package/src/og/Events.js +0 -185
  445. package/src/og/Extent.js +0 -352
  446. package/src/og/Globe.js +0 -342
  447. package/src/og/ImageCanvas.js +0 -236
  448. package/src/og/Lock.js +0 -44
  449. package/src/og/LonLat.js +0 -220
  450. package/src/og/Object3d.js +0 -395
  451. package/src/og/Popup.js +0 -187
  452. package/src/og/QueueArray.js +0 -75
  453. package/src/og/Rectangle.js +0 -111
  454. package/src/og/Stack.js +0 -49
  455. package/src/og/astro/astro.js +0 -51
  456. package/src/og/astro/earth.js +0 -112
  457. package/src/og/astro/jd.js +0 -514
  458. package/src/og/astro/orbit.js +0 -119
  459. package/src/og/astro/rotation.js +0 -36
  460. package/src/og/bv/Box.js +0 -77
  461. package/src/og/bv/Sphere.js +0 -57
  462. package/src/og/bv/index.js +0 -4
  463. package/src/og/camera/Camera.js +0 -645
  464. package/src/og/camera/Frustum.js +0 -331
  465. package/src/og/camera/PlanetCamera.js +0 -674
  466. package/src/og/camera/index.js +0 -4
  467. package/src/og/cons.js +0 -108
  468. package/src/og/control/Atmosphere.js +0 -387
  469. package/src/og/control/CompassButton.js +0 -146
  470. package/src/og/control/Control.js +0 -198
  471. package/src/og/control/DebugInfo.js +0 -259
  472. package/src/og/control/DrawingSwitcher.js +0 -117
  473. package/src/og/control/EarthCoordinates.js +0 -214
  474. package/src/og/control/EarthNavigation.js +0 -258
  475. package/src/og/control/GeoImageDragControl.js +0 -117
  476. package/src/og/control/KeyboardNavigation.js +0 -172
  477. package/src/og/control/LayerAnimation.js +0 -379
  478. package/src/og/control/LayerSwitcher.js +0 -424
  479. package/src/og/control/Lighting.js +0 -487
  480. package/src/og/control/MouseNavigation.js +0 -436
  481. package/src/og/control/MouseWheelZoomControl.js +0 -253
  482. package/src/og/control/RulerSwitcher.js +0 -74
  483. package/src/og/control/ScaleControl.js +0 -119
  484. package/src/og/control/SegmentBoundVisualization.js +0 -54
  485. package/src/og/control/ShowFps.js +0 -40
  486. package/src/og/control/SimpleNavigation.js +0 -123
  487. package/src/og/control/SimpleSkyBackground.js +0 -206
  488. package/src/og/control/Sun.js +0 -176
  489. package/src/og/control/ToggleWireframe.js +0 -35
  490. package/src/og/control/TouchNavigation.js +0 -350
  491. package/src/og/control/ZoomControl.js +0 -115
  492. package/src/og/control/drawing/DrawingControl.js +0 -51
  493. package/src/og/control/drawing/LineStringDrawingScene.js +0 -203
  494. package/src/og/control/drawing/PolygonDrawingScene.js +0 -785
  495. package/src/og/control/elevationProfile/ElevationProfile.js +0 -275
  496. package/src/og/control/heightRuler/HeightRuler.js +0 -12
  497. package/src/og/control/heightRuler/HeightRulerScene.js +0 -228
  498. package/src/og/control/heightRuler/HeightRulerSwitcher.js +0 -15
  499. package/src/og/control/index.js +0 -56
  500. package/src/og/control/ruler/Ruler.js +0 -39
  501. package/src/og/control/ruler/RulerScene.js +0 -395
  502. package/src/og/control/selection/Selection.js +0 -95
  503. package/src/og/control/selection/SelectionScene.js +0 -345
  504. package/src/og/control/timeline/TimelineControl.js +0 -100
  505. package/src/og/control/timeline/TimelineModel.js +0 -137
  506. package/src/og/control/timeline/TimelineView.js +0 -462
  507. package/src/og/control/timeline/timelineUtils.js +0 -132
  508. package/src/og/control/visibleExtent/Segment.js +0 -1854
  509. package/src/og/control/visibleExtent/VisibleExtent.js +0 -80
  510. package/src/og/control/visibleExtent/drawnode.js +0 -747
  511. package/src/og/ellipsoid/Ellipsoid.js +0 -565
  512. package/src/og/ellipsoid/index.js +0 -4
  513. package/src/og/ellipsoid/wgs84.js +0 -9
  514. package/src/og/entity/BaseBillboard.js +0 -375
  515. package/src/og/entity/Billboard.js +0 -161
  516. package/src/og/entity/BillboardHandler.js +0 -883
  517. package/src/og/entity/Entity.js +0 -728
  518. package/src/og/entity/EntityCollection.js +0 -830
  519. package/src/og/entity/GeoObject.js +0 -244
  520. package/src/og/entity/GeoObjectHandler.js +0 -744
  521. package/src/og/entity/Geometry.js +0 -320
  522. package/src/og/entity/GeometryHandler.js +0 -1340
  523. package/src/og/entity/Label.js +0 -345
  524. package/src/og/entity/LabelHandler.js +0 -895
  525. package/src/og/entity/LabelWorker.js +0 -194
  526. package/src/og/entity/PointCloud.js +0 -491
  527. package/src/og/entity/PointCloudHandler.js +0 -122
  528. package/src/og/entity/Polyline.js +0 -2203
  529. package/src/og/entity/PolylineHandler.js +0 -105
  530. package/src/og/entity/Ray.js +0 -262
  531. package/src/og/entity/RayHandler.js +0 -841
  532. package/src/og/entity/Strip.js +0 -628
  533. package/src/og/entity/StripHandler.js +0 -158
  534. package/src/og/entity/index.js +0 -9
  535. package/src/og/index.js +0 -112
  536. package/src/og/input/KeyboardHandler.js +0 -195
  537. package/src/og/input/MouseHandler.js +0 -94
  538. package/src/og/input/TouchHandler.js +0 -59
  539. package/src/og/input/input.js +0 -44
  540. package/src/og/layer/BaseGeoImage.js +0 -480
  541. package/src/og/layer/CanvasTiles.js +0 -360
  542. package/src/og/layer/GeoImage.js +0 -150
  543. package/src/og/layer/GeoTexture2d.js +0 -50
  544. package/src/og/layer/GeoVideo.js +0 -187
  545. package/src/og/layer/KML.js +0 -358
  546. package/src/og/layer/Layer.js +0 -907
  547. package/src/og/layer/Material.js +0 -98
  548. package/src/og/layer/Vector.js +0 -1068
  549. package/src/og/layer/WMS.js +0 -182
  550. package/src/og/layer/XYZ.js +0 -374
  551. package/src/og/layer/index.js +0 -11
  552. package/src/og/light/LightSource.js +0 -362
  553. package/src/og/math/Line2.js +0 -28
  554. package/src/og/math/Line3.js +0 -140
  555. package/src/og/math/Mat3.js +0 -152
  556. package/src/og/math/Mat4.js +0 -603
  557. package/src/og/math/Plane.js +0 -117
  558. package/src/og/math/Quat.js +0 -980
  559. package/src/og/math/Ray.js +0 -237
  560. package/src/og/math/Vec2.js +0 -520
  561. package/src/og/math/Vec3.js +0 -931
  562. package/src/og/math/Vec4.js +0 -256
  563. package/src/og/math/coder.js +0 -104
  564. package/src/og/math/index.js +0 -23
  565. package/src/og/math.js +0 -430
  566. package/src/og/mercator.js +0 -149
  567. package/src/og/proj/EPSG3857.js +0 -13
  568. package/src/og/proj/EPSG4326.js +0 -13
  569. package/src/og/proj/Proj.js +0 -59
  570. package/src/og/quadTree/EPSG4326QuadTreeStrategy.js +0 -27
  571. package/src/og/quadTree/EarthQuadTreeStrategy.js +0 -30
  572. package/src/og/quadTree/EntityCollectionNode.js +0 -391
  573. package/src/og/quadTree/MarsQuadTreeStrategy.js +0 -28
  574. package/src/og/quadTree/Node.js +0 -785
  575. package/src/og/quadTree/QuadTreeStrategy.js +0 -94
  576. package/src/og/quadTree/Wgs84QuadTreeStrategy.js +0 -27
  577. package/src/og/quadTree/index.js +0 -14
  578. package/src/og/quadTree/quadTree.js +0 -77
  579. package/src/og/renderer/Renderer.js +0 -1185
  580. package/src/og/renderer/RendererEvents.js +0 -1094
  581. package/src/og/res/images.js +0 -8
  582. package/src/og/scene/Axes.js +0 -74
  583. package/src/og/scene/BaseNode.js +0 -109
  584. package/src/og/scene/Planet.js +0 -1931
  585. package/src/og/scene/RenderNode.js +0 -392
  586. package/src/og/scene/SkyBox.js +0 -104
  587. package/src/og/scene/index.js +0 -5
  588. package/src/og/segment/Segment.js +0 -1687
  589. package/src/og/segment/SegmentLonLat.js +0 -294
  590. package/src/og/segment/SegmentLonLatWgs84.js +0 -40
  591. package/src/og/segment/Slice.js +0 -45
  592. package/src/og/segment/segmentHelper.js +0 -230
  593. package/src/og/shaders/atmos.js +0 -332
  594. package/src/og/shaders/billboard.js +0 -225
  595. package/src/og/shaders/bloom.js +0 -37
  596. package/src/og/shaders/blur.js +0 -79
  597. package/src/og/shaders/depth.js +0 -48
  598. package/src/og/shaders/drawnode.js +0 -1040
  599. package/src/og/shaders/geoObject.js +0 -270
  600. package/src/og/shaders/label.js +0 -604
  601. package/src/og/shaders/lumFilter.js +0 -41
  602. package/src/og/shaders/pickingMask.js +0 -27
  603. package/src/og/shaders/pointCloud.js +0 -38
  604. package/src/og/shaders/polyline.js +0 -557
  605. package/src/og/shaders/ray.js +0 -81
  606. package/src/og/shaders/screenFrame.js +0 -31
  607. package/src/og/shaders/skybox.js +0 -33
  608. package/src/og/shaders/toneMapping.js +0 -90
  609. package/src/og/shaders/utils.js +0 -88
  610. package/src/og/terrain/BilTerrain.js +0 -243
  611. package/src/og/terrain/EmptyTerrain.js +0 -174
  612. package/src/og/terrain/Geoid.js +0 -247
  613. package/src/og/terrain/GlobusTerrain.js +0 -483
  614. package/src/og/terrain/MapboxTerrain.js +0 -470
  615. package/src/og/terrain/index.js +0 -6
  616. package/src/og/ui/Button.js +0 -107
  617. package/src/og/ui/ButtonGroup.js +0 -57
  618. package/src/og/ui/Dialog.js +0 -239
  619. package/src/og/ui/Slider.js +0 -170
  620. package/src/og/ui/ToggleButton.js +0 -51
  621. package/src/og/ui/UIhelpers.js +0 -155
  622. package/src/og/ui/View.js +0 -190
  623. package/src/og/ui/icons.js +0 -3
  624. package/src/og/utils/BaseWorker.js +0 -46
  625. package/src/og/utils/FontAtlas.js +0 -218
  626. package/src/og/utils/GeoImageCreator.js +0 -204
  627. package/src/og/utils/ImagesCacheManager.js +0 -70
  628. package/src/og/utils/Loader.js +0 -188
  629. package/src/og/utils/NormalMapCreator.js +0 -404
  630. package/src/og/utils/PlainSegmentWorker.js +0 -398
  631. package/src/og/utils/TerrainWorker.js +0 -573
  632. package/src/og/utils/TextureAtlas.js +0 -291
  633. package/src/og/utils/VectorTileCreator.js +0 -391
  634. package/src/og/utils/colorTable.js +0 -145
  635. package/src/og/utils/earcut.js +0 -661
  636. package/src/og/utils/functionComposition.js +0 -13
  637. package/src/og/utils/objParser.js +0 -227
  638. package/src/og/utils/shared.js +0 -989
  639. package/src/og/utils/units.js +0 -78
  640. package/src/og/webgl/Framebuffer.js +0 -311
  641. package/src/og/webgl/Handler.js +0 -1170
  642. package/src/og/webgl/Multisample.js +0 -275
  643. package/src/og/webgl/Program.js +0 -407
  644. package/src/og/webgl/ProgramController.js +0 -143
  645. package/src/og/webgl/callbacks.js +0 -98
  646. package/src/og/webgl/index.js +0 -13
  647. package/src/og/webgl/types.js +0 -31
  648. package/src/og.jsdoc +0 -3
  649. package/types/Clock.d.ts +0 -99
  650. package/types/Deferred.d.ts +0 -6
  651. package/types/Events.d.ts +0 -78
  652. package/types/Extent.d.ts +0 -166
  653. package/types/Globe.d.ts +0 -108
  654. package/types/ImageCanvas.d.ts +0 -128
  655. package/types/Lock.d.ts +0 -12
  656. package/types/LonLat.d.ts +0 -127
  657. package/types/Object3d.d.ts +0 -35
  658. package/types/Popup.d.ts +0 -29
  659. package/types/QueueArray.d.ts +0 -19
  660. package/types/Rectangle.d.ts +0 -80
  661. package/types/Stack.d.ts +0 -19
  662. package/types/arial.d.ts +0 -49
  663. package/types/astro/astro.d.ts +0 -38
  664. package/types/astro/earth.d.ts +0 -7
  665. package/types/astro/jd.d.ts +0 -254
  666. package/types/bv/Box.d.ts +0 -30
  667. package/types/bv/Sphere.d.ts +0 -38
  668. package/types/bv/index.d.ts +0 -3
  669. package/types/camera/Camera.d.ts +0 -314
  670. package/types/camera/Frustum.d.ts +0 -133
  671. package/types/camera/PlanetCamera.d.ts +0 -219
  672. package/types/camera/index.d.ts +0 -3
  673. package/types/cons.d.ts +0 -40
  674. package/types/control/Atmosphere.d.ts +0 -15
  675. package/types/control/CompassButton.d.ts +0 -16
  676. package/types/control/Control.d.ts +0 -104
  677. package/types/control/DebugInfo.d.ts +0 -19
  678. package/types/control/DrawingSwitcher.d.ts +0 -13
  679. package/types/control/EarthCoordinates.d.ts +0 -44
  680. package/types/control/EarthNavigation.d.ts +0 -43
  681. package/types/control/GeoImageDragControl.d.ts +0 -14
  682. package/types/control/KeyboardNavigation.d.ts +0 -24
  683. package/types/control/LayerAnimation.d.ts +0 -73
  684. package/types/control/LayerSwitcher.d.ts +0 -64
  685. package/types/control/Lighting.d.ts +0 -41
  686. package/types/control/MouseNavigation.d.ts +0 -49
  687. package/types/control/MouseWheelZoomControl.d.ts +0 -46
  688. package/types/control/ScaleControl.d.ts +0 -23
  689. package/types/control/ShowFps.d.ts +0 -11
  690. package/types/control/SimpleNavigation.d.ts +0 -26
  691. package/types/control/SimpleSkyBackground.d.ts +0 -15
  692. package/types/control/Sun.d.ts +0 -53
  693. package/types/control/ToggleWireframe.d.ts +0 -12
  694. package/types/control/TouchNavigation.d.ts +0 -54
  695. package/types/control/ZoomControl.d.ts +0 -26
  696. package/types/control/drawing/DrawingControl.d.ts +0 -14
  697. package/types/control/drawing/LineStringDrawingScene.d.ts +0 -5
  698. package/types/control/drawing/PolygonDrawingScene.d.ts +0 -99
  699. package/types/control/heightRuler/HeightRuler.d.ts +0 -6
  700. package/types/control/heightRuler/HeightRulerScene.d.ts +0 -23
  701. package/types/control/index.d.ts +0 -27
  702. package/types/control/ruler/Ruler.d.ts +0 -13
  703. package/types/control/ruler/RulerScene.d.ts +0 -51
  704. package/types/control/selection/Selection.d.ts +0 -49
  705. package/types/control/selection/SelectionScene.d.ts +0 -32
  706. package/types/control/timeline/TimelineControl.d.ts +0 -10
  707. package/types/control/timeline/TimelineModel.d.ts +0 -33
  708. package/types/control/timeline/TimelineView.d.ts +0 -57
  709. package/types/control/timeline/timelineUtils.d.ts +0 -9
  710. package/types/ellipsoid/Ellipsoid.d.ts +0 -170
  711. package/types/ellipsoid/index.d.ts +0 -3
  712. package/types/ellipsoid/wgs84.d.ts +0 -6
  713. package/types/entity/BaseBillboard.d.ts +0 -215
  714. package/types/entity/Billboard.d.ts +0 -94
  715. package/types/entity/BillboardHandler.d.ts +0 -75
  716. package/types/entity/Entity.d.ts +0 -340
  717. package/types/entity/EntityCollection.d.ts +0 -303
  718. package/types/entity/GeoObject.d.ts +0 -117
  719. package/types/entity/GeoObjectHandler.d.ts +0 -41
  720. package/types/entity/Geometry.d.ts +0 -79
  721. package/types/entity/GeometryHandler.d.ts +0 -76
  722. package/types/entity/Label.d.ts +0 -190
  723. package/types/entity/LabelHandler.d.ts +0 -31
  724. package/types/entity/LabelWorker.d.ts +0 -9
  725. package/types/entity/PointCloud.d.ts +0 -174
  726. package/types/entity/PointCloudHandler.d.ts +0 -38
  727. package/types/entity/Polyline.d.ts +0 -307
  728. package/types/entity/PolylineHandler.d.ts +0 -18
  729. package/types/entity/Ray.d.ts +0 -122
  730. package/types/entity/RayHandler.d.ts +0 -63
  731. package/types/entity/Strip.d.ts +0 -119
  732. package/types/entity/StripHandler.d.ts +0 -38
  733. package/types/entity/index.d.ts +0 -8
  734. package/types/index.d.ts +0 -53
  735. package/types/input/KeyboardHandler.d.ts +0 -17
  736. package/types/input/MouseHandler.d.ts +0 -5
  737. package/types/input/TouchHandler.d.ts +0 -5
  738. package/types/input/input.d.ts +0 -42
  739. package/types/layer/BaseGeoImage.d.ts +0 -116
  740. package/types/layer/CanvasTiles.d.ts +0 -73
  741. package/types/layer/GeoImage.d.ts +0 -51
  742. package/types/layer/GeoTexture2d.d.ts +0 -7
  743. package/types/layer/GeoVideo.d.ts +0 -47
  744. package/types/layer/KML.d.ts +0 -93
  745. package/types/layer/Layer.d.ts +0 -320
  746. package/types/layer/Material.d.ts +0 -45
  747. package/types/layer/Vector.d.ts +0 -211
  748. package/types/layer/WMS.d.ts +0 -66
  749. package/types/layer/XYZ.d.ts +0 -122
  750. package/types/layer/index.d.ts +0 -10
  751. package/types/light/LightSource.d.ts +0 -178
  752. package/types/math/Line2.d.ts +0 -11
  753. package/types/math/Line3.d.ts +0 -10
  754. package/types/math/Mat3.d.ts +0 -65
  755. package/types/math/Mat4.d.ts +0 -176
  756. package/types/math/Plane.d.ts +0 -18
  757. package/types/math/Quat.d.ts +0 -379
  758. package/types/math/Ray.d.ts +0 -82
  759. package/types/math/Vec2.d.ts +0 -309
  760. package/types/math/Vec3.d.ts +0 -472
  761. package/types/math/Vec4.d.ts +0 -161
  762. package/types/math/coder.d.ts +0 -43
  763. package/types/math/index.d.ts +0 -11
  764. package/types/math.d.ts +0 -268
  765. package/types/mercator.d.ts +0 -92
  766. package/types/proj/EPSG3857.d.ts +0 -6
  767. package/types/proj/EPSG4326.d.ts +0 -6
  768. package/types/proj/Proj.d.ts +0 -42
  769. package/types/quadTree/EPSG4326QuadTreeStrategy.d.ts +0 -3
  770. package/types/quadTree/EarthQuadTreeStrategy.d.ts +0 -3
  771. package/types/quadTree/EntityCollectionNode.d.ts +0 -41
  772. package/types/quadTree/MarsQuadTreeStrategy.d.ts +0 -3
  773. package/types/quadTree/Node.d.ts +0 -58
  774. package/types/quadTree/QuadTreeStrategy.d.ts +0 -21
  775. package/types/quadTree/Wgs84QuadTreeStrategy.d.ts +0 -3
  776. package/types/quadTree/index.d.ts +0 -12
  777. package/types/quadTree/quadTree.d.ts +0 -40
  778. package/types/renderer/Renderer.d.ts +0 -291
  779. package/types/renderer/RendererEvents.d.ts +0 -241
  780. package/types/res/images.d.ts +0 -2
  781. package/types/scene/Axes.d.ts +0 -10
  782. package/types/scene/BaseNode.d.ts +0 -60
  783. package/types/scene/Planet.d.ts +0 -594
  784. package/types/scene/RenderNode.d.ts +0 -152
  785. package/types/scene/SkyBox.d.ts +0 -9
  786. package/types/scene/index.d.ts +0 -4
  787. package/types/segment/Segment.d.ts +0 -273
  788. package/types/segment/SegmentLonLat.d.ts +0 -22
  789. package/types/segment/SegmentLonLatWgs84.d.ts +0 -4
  790. package/types/segment/Slice.d.ts +0 -10
  791. package/types/segment/segmentHelper.d.ts +0 -13
  792. package/types/shaders/atmos.d.ts +0 -4
  793. package/types/shaders/billboard.d.ts +0 -3
  794. package/types/shaders/depth.d.ts +0 -2
  795. package/types/shaders/drawnode.d.ts +0 -8
  796. package/types/shaders/geoObject.d.ts +0 -3
  797. package/types/shaders/label.d.ts +0 -4
  798. package/types/shaders/pickingMask.d.ts +0 -2
  799. package/types/shaders/pointCloud.d.ts +0 -2
  800. package/types/shaders/polyline.d.ts +0 -3
  801. package/types/shaders/ray.d.ts +0 -2
  802. package/types/shaders/screenFrame.d.ts +0 -2
  803. package/types/shaders/skybox.d.ts +0 -2
  804. package/types/shaders/toneMapping.d.ts +0 -2
  805. package/types/shaders/utils.d.ts +0 -1
  806. package/types/terrain/BilTerrain.d.ts +0 -14
  807. package/types/terrain/EmptyTerrain.d.ts +0 -87
  808. package/types/terrain/Geoid.d.ts +0 -17
  809. package/types/terrain/GlobusTerrain.d.ts +0 -122
  810. package/types/terrain/MapboxTerrain.d.ts +0 -14
  811. package/types/terrain/index.d.ts +0 -5
  812. package/types/ui/Button.d.ts +0 -21
  813. package/types/ui/ButtonGroup.d.ts +0 -12
  814. package/types/ui/Dialog.d.ts +0 -41
  815. package/types/ui/Slider.d.ts +0 -33
  816. package/types/ui/ToggleButton.d.ts +0 -10
  817. package/types/ui/UIhelpers.d.ts +0 -13
  818. package/types/ui/View.d.ts +0 -33
  819. package/types/ui/icons.d.ts +0 -1
  820. package/types/utils/BaseWorker.d.ts +0 -14
  821. package/types/utils/FontAtlas.d.ts +0 -16
  822. package/types/utils/GeoImageCreator.d.ts +0 -30
  823. package/types/utils/ImagesCacheManager.d.ts +0 -10
  824. package/types/utils/Loader.d.ts +0 -31
  825. package/types/utils/NormalMapCreator.d.ts +0 -39
  826. package/types/utils/PlainSegmentWorker.d.ts +0 -8
  827. package/types/utils/TerrainWorker.d.ts +0 -7
  828. package/types/utils/TextureAtlas.d.ts +0 -113
  829. package/types/utils/VectorTileCreator.d.ts +0 -14
  830. package/types/utils/colorTable.d.ts +0 -143
  831. package/types/utils/earcut.d.ts +0 -6
  832. package/types/utils/functionComposition.d.ts +0 -5
  833. package/types/utils/objParser.d.ts +0 -8
  834. package/types/utils/shared.d.ts +0 -241
  835. package/types/utils/units.d.ts +0 -20
  836. package/types/webgl/Framebuffer.d.ts +0 -134
  837. package/types/webgl/Handler.d.ts +0 -403
  838. package/types/webgl/Multisample.d.ts +0 -91
  839. package/types/webgl/Program.d.ts +0 -163
  840. package/types/webgl/ProgramController.d.ts +0 -89
  841. package/types/webgl/callbacks.d.ts +0 -1
  842. package/types/webgl/index.d.ts +0 -6
  843. package/types/webgl/types.d.ts +0 -2
  844. /package/{dist → lib}/@openglobus/og.css +0 -0
  845. /package/{src/og → lib/@openglobus/res/fonts}/arial.js +0 -0
@@ -1,2203 +0,0 @@
1
- "use strict";
2
-
3
- import { Extent } from "../Extent.js";
4
- import { LonLat } from "../LonLat.js";
5
- import { Vec3 } from "../math/Vec3.js";
6
- import {
7
- cloneArray, htmlColorToFloat32Array,
8
- htmlColorToRgba, makeArray, makeArrayTyped
9
- } from "../utils/shared.js";
10
-
11
- window.POLYLINE_DEPTH_OFFSET = 0.0;
12
-
13
- const VERTICES_BUFFER = 0;
14
- const INDEX_BUFFER = 1;
15
- const COLORS_BUFFER = 2;
16
-
17
- const DEFAULT_COLOR = "#0000FF";
18
-
19
- const R = 0;
20
- const G = 1;
21
- const B = 2;
22
- const A = 3;
23
-
24
- /**
25
- * Polyline object.
26
- * @class
27
- * @param {Object} [options] - Polyline options:
28
- * @param {number} [options.thickness] - Thickness in screen pixels 1.5 is default.
29
- * @param {Number} [options.altitude] - Relative to ground layers altitude value.
30
- * @param {Vec4} [options.color] - RGBA color.
31
- * @param {Boolean} [options.opacity] - Line opacity.
32
- * @param {Boolean} [options.visibility] - Polyline visibility. True default.
33
- * @param {Boolean} [options.isClosed] - Closed geometry type identificator.
34
- * @param {Array.<Array.<number>>} [options.pathLonLat] - Polyline geodetic coordinates array. [[0,0,0], [1,1,1],...]
35
- * @param {Array.<Array.<number>>} [options.path3v] - LinesString cartesian coordinates array. [[0,0,0], [1,1,1],...]
36
- * @param {Array.<Array.<number>>} [options.pathColors] - Coordinates color. [[1,0,0,1], [0,1,0,1],...] for right and green colors.
37
- */
38
- class Polyline {
39
- constructor(options) {
40
- options = options || {};
41
-
42
- /**
43
- * Object unic identifier.
44
- * @public
45
- * @readonly
46
- * @type {number}
47
- */
48
- this.id = Polyline._staticCounter++;
49
-
50
- this.altitude = options.altitude || 0.0;
51
-
52
- /**
53
- * Polyline thickness in screen pixels.
54
- * @public
55
- * @type {number}
56
- */
57
- this.thickness = options.thickness || 1.5;
58
-
59
- this._opacity = options.opacity != undefined ? options.opacity : 1.0;
60
-
61
- /**
62
- * Polyline RGBA color.
63
- * @public
64
- * @type {Array<number>} - (exactly 4 entries)
65
- */
66
- this._defaultColor = htmlColorToFloat32Array(
67
- options.color || DEFAULT_COLOR,
68
- options.opacity
69
- ); // utils.createColorRGBA(options.color, new Vec4(1.0, 1.0, 1.0, 1.0));
70
-
71
- /**
72
- * Polyline visibility.
73
- * @public
74
- * @type {boolean}
75
- */
76
- this.visibility = options.visibility != undefined ? options.visibility : true;
77
-
78
- /**
79
- * Polyline geometry ring type identificator.
80
- * @protected
81
- * @type {Boolean}
82
- */
83
- this._closedLine = options.isClosed || false;
84
-
85
- /**
86
- * Polyline cartesian coordinates.
87
- * @private
88
- * @type {Array.<Vec3>}
89
- */
90
- this._path3v = [];
91
-
92
- this._pathLengths = [];
93
-
94
- /**
95
- * Polyline geodetic degrees coordinates.
96
- * @private
97
- * @type {Array.<LonLat>}
98
- */
99
- this._pathLonLat = [];
100
-
101
- /**
102
- * Polyline geodetic mercator coordinates.
103
- * @private
104
- * @type {Array.<LonLat>}
105
- */
106
- this._pathLonLatMerc = [];
107
-
108
- this._pathColors = options.pathColors ? cloneArray(options.pathColors) : [];
109
-
110
- /**
111
- * Polyline geodetic extent.
112
- * @protected
113
- * @type {Extent}
114
- */
115
- this._extent = new Extent();
116
-
117
- this._verticesHigh = [];
118
- this._verticesLow = [];
119
- this._orders = [];
120
- this._indexes = [];
121
- this._colors = [];
122
-
123
- this._verticesHighBuffer = null;
124
- this._verticesLowBuffer = null;
125
- this._ordersBuffer = null;
126
- this._indexesBuffer = null;
127
- this._colorsBuffer = null;
128
-
129
- this._pickingColor = [0, 0, 0];
130
-
131
- this._renderNode = null;
132
-
133
- /**
134
- * Entity instance that holds this Polyline.
135
- * @private
136
- * @type {Entity}
137
- */
138
- this._entity = null;
139
-
140
- /**
141
- * Handler that stores and renders this Polyline object.
142
- * @private
143
- * @type {PolylineHandler}
144
- */
145
- this._handler = null;
146
- this._handlerIndex = -1;
147
-
148
- this._buffersUpdateCallbacks = [];
149
- this._buffersUpdateCallbacks[VERTICES_BUFFER] = this._createVerticesBuffer;
150
- this._buffersUpdateCallbacks[INDEX_BUFFER] = this._createIndexBuffer;
151
- this._buffersUpdateCallbacks[COLORS_BUFFER] = this._createColorsBuffer;
152
-
153
- this._changedBuffers = new Array(this._buffersUpdateCallbacks.length);
154
-
155
- // create path
156
- if (options.pathLonLat) {
157
- this.setPathLonLat(options.pathLonLat);
158
- } else if (options.path3v) {
159
- this.setPath3v(options.path3v);
160
- }
161
-
162
- this._refresh();
163
- }
164
-
165
- static get _staticCounter() {
166
- if (!this._counter && this._counter !== 0) {
167
- this._counter = 0;
168
- }
169
- return this._counter;
170
- }
171
-
172
- static set _staticCounter(n) {
173
- this._counter = n;
174
- }
175
-
176
- /**
177
- * Appends to the line array new cartesian coordinates line data.
178
- * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
179
- * @param {Boolean} isClosed - Identificator for the closed line data creation.
180
- * @param {Number[]} outVertices - Out vertices data array.
181
- * @param {Number[]} outOrders - Out vertices orders data array.
182
- * @param {Number[]} outIndexes - Out vertices indexes data array.
183
- * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
184
- * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
185
- * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
186
- * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
187
- * @param {Extent} [outExtent] - Geodetic line extent.
188
- * @param {Array} [outColors]
189
- * @static
190
- */
191
- static appendLineData3v(
192
- path3v,
193
- pathColors,
194
- defaultColor,
195
- isClosed,
196
- outVerticesHigh,
197
- outVerticesLow,
198
- outOrders,
199
- outIndexes,
200
- ellipsoid,
201
- outTransformedPathLonLat,
202
- outPath3v,
203
- outTransformedPathMerc,
204
- outExtent,
205
- outColors
206
- ) {
207
- var index = 0;
208
-
209
- var v_high = new Vec3(),
210
- v_low = new Vec3();
211
-
212
- if (outExtent) {
213
- outExtent.southWest.set(180.0, 90.0);
214
- outExtent.northEast.set(-180.0, -90.0);
215
- }
216
-
217
- if (outIndexes.length > 0) {
218
- index = outIndexes[outIndexes.length - 5] + 9;
219
- outIndexes.push(index, index);
220
- } else {
221
- outIndexes.push(0, 0);
222
- }
223
-
224
- for (let j = 0, len = path3v.length; j < len; j++) {
225
- var path = path3v[j],
226
- pathColors_j = pathColors[j];
227
-
228
- outTransformedPathLonLat[j] = [];
229
- outTransformedPathMerc[j] = [];
230
- outPath3v[j] = [];
231
-
232
- if (path.length === 0) {
233
- continue;
234
- }
235
-
236
- var startIndex = index;
237
-
238
- var last;
239
-
240
- if (isClosed) {
241
- last = path[path.length - 1];
242
- if (last instanceof Array) {
243
- last = new Vec3(last[0], last[1], last[2]);
244
- }
245
- } else {
246
- var p0 = path[0],
247
- p1 = path[1] || p0;
248
- if (p0 instanceof Array) {
249
- p0 = new Vec3(p0[0], p0[1], p0[2]);
250
- }
251
- if (p1 instanceof Array) {
252
- p1 = new Vec3(p1[0], p1[1], p1[2]);
253
- }
254
- last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
255
- }
256
-
257
- let color = defaultColor;
258
-
259
- if (pathColors_j && pathColors_j[0]) {
260
- color = pathColors_j[0];
261
- }
262
-
263
- Vec3.doubleToTwoFloats(last, v_high, v_low);
264
- outVerticesHigh.push(
265
- v_high.x,
266
- v_high.y,
267
- v_high.z,
268
- v_high.x,
269
- v_high.y,
270
- v_high.z,
271
- v_high.x,
272
- v_high.y,
273
- v_high.z,
274
- v_high.x,
275
- v_high.y,
276
- v_high.z
277
- );
278
- outVerticesLow.push(
279
- v_low.x,
280
- v_low.y,
281
- v_low.z,
282
- v_low.x,
283
- v_low.y,
284
- v_low.z,
285
- v_low.x,
286
- v_low.y,
287
- v_low.z,
288
- v_low.x,
289
- v_low.y,
290
- v_low.z
291
- );
292
-
293
- let r = color[R],
294
- g = color[G],
295
- b = color[B],
296
- a = color[A] != undefined ? color[A] : 1.0;
297
-
298
- if (j > 0) {
299
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
300
- }
301
-
302
- outOrders.push(1, -1, 2, -2);
303
-
304
- for (let i = 0, len = path.length; i < len; i++) {
305
- var cur = path[i];
306
-
307
- if (cur instanceof Array) {
308
- cur = new Vec3(cur[0], cur[1], cur[2]);
309
- }
310
-
311
- outPath3v[j].push(cur);
312
-
313
- if (ellipsoid) {
314
- var lonLat = ellipsoid.cartesianToLonLat(cur);
315
- outTransformedPathLonLat[j].push(lonLat);
316
- outTransformedPathMerc[j].push(lonLat.forwardMercator());
317
-
318
- if (lonLat.lon < outExtent.southWest.lon) {
319
- outExtent.southWest.lon = lonLat.lon;
320
- }
321
- if (lonLat.lat < outExtent.southWest.lat) {
322
- outExtent.southWest.lat = lonLat.lat;
323
- }
324
- if (lonLat.lon > outExtent.northEast.lon) {
325
- outExtent.northEast.lon = lonLat.lon;
326
- }
327
- if (lonLat.lat > outExtent.northEast.lat) {
328
- outExtent.northEast.lat = lonLat.lat;
329
- }
330
- }
331
-
332
- if (pathColors_j && pathColors_j[i]) {
333
- color = pathColors_j[i];
334
- }
335
-
336
- r = color[R];
337
- g = color[G];
338
- b = color[B];
339
- a = color[A] != undefined ? color[A] : 1.0;
340
-
341
- Vec3.doubleToTwoFloats(cur, v_high, v_low);
342
- outVerticesHigh.push(
343
- v_high.x,
344
- v_high.y,
345
- v_high.z,
346
- v_high.x,
347
- v_high.y,
348
- v_high.z,
349
- v_high.x,
350
- v_high.y,
351
- v_high.z,
352
- v_high.x,
353
- v_high.y,
354
- v_high.z
355
- );
356
- outVerticesLow.push(
357
- v_low.x,
358
- v_low.y,
359
- v_low.z,
360
- v_low.x,
361
- v_low.y,
362
- v_low.z,
363
- v_low.x,
364
- v_low.y,
365
- v_low.z,
366
- v_low.x,
367
- v_low.y,
368
- v_low.z
369
- );
370
-
371
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
372
-
373
- outOrders.push(1, -1, 2, -2);
374
- outIndexes.push(index++, index++, index++, index++);
375
- }
376
-
377
- var first;
378
- if (isClosed) {
379
- first = path[0];
380
- if (first instanceof Array) {
381
- first = new Vec3(first[0], first[1], first[2]);
382
- }
383
- outIndexes.push(startIndex, startIndex + 1, startIndex + 1, startIndex + 1);
384
- } else {
385
- let p0 = path[path.length - 1],
386
- p1 = path[path.length - 2] || p0;
387
- if (p0 instanceof Array) {
388
- p0 = new Vec3(p0[0], p0[1], p0[2]);
389
- }
390
- if (p1 instanceof Array) {
391
- p1 = new Vec3(p1[0], p1[1], p1[2]);
392
- }
393
- first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
394
- outIndexes.push(index - 1, index - 1, index - 1, index - 1);
395
- }
396
-
397
- if (pathColors_j && pathColors_j[path.length - 1]) {
398
- color = pathColors_j[path.length - 1];
399
- }
400
-
401
- r = color[R];
402
- g = color[G];
403
- b = color[B];
404
- a = color[A] != undefined ? color[A] : 1.0;
405
-
406
- Vec3.doubleToTwoFloats(first, v_high, v_low);
407
- outVerticesHigh.push(
408
- v_high.x,
409
- v_high.y,
410
- v_high.z,
411
- v_high.x,
412
- v_high.y,
413
- v_high.z,
414
- v_high.x,
415
- v_high.y,
416
- v_high.z,
417
- v_high.x,
418
- v_high.y,
419
- v_high.z
420
- );
421
- outVerticesLow.push(
422
- v_low.x,
423
- v_low.y,
424
- v_low.z,
425
- v_low.x,
426
- v_low.y,
427
- v_low.z,
428
- v_low.x,
429
- v_low.y,
430
- v_low.z,
431
- v_low.x,
432
- v_low.y,
433
- v_low.z
434
- );
435
-
436
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
437
-
438
- outOrders.push(1, -1, 2, -2);
439
-
440
- if (j < path3v.length - 1 && path3v[j + 1].length !== 0) {
441
- index += 8;
442
- outIndexes.push(index, index);
443
- }
444
- }
445
- }
446
-
447
- /**
448
- * Appends to the line new cartesian coordinates point data.
449
- * @param {Array.<Array.<number>>} path3v - Line coordinates path array. [[0,0,0], [1,1,1],...]
450
- * @param {Boolean} isClosed - Identificator for the closed line data creation.
451
- * @param {Number[]} outVertices - Out vertices data array.
452
- * @param {Number[]} outOrders - Out vertices orders data array.
453
- * @param {Number[]} outIndexes - Out vertices indexes data array.
454
- * @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
455
- * @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
456
- * @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
457
- * @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
458
- * @param {Extent} [outExtent] - Geodetic line extent.
459
- * @static
460
- */
461
- static appendPoint3v(
462
- path3v,
463
- point3v,
464
- pathColors,
465
- color,
466
- isClosed,
467
- outVerticesHigh,
468
- outVerticesLow,
469
- outColors,
470
- outOrders,
471
- outIndexes,
472
- ellipsoid,
473
- outTransformedPathLonLat,
474
- outTransformedPathMerc,
475
- outExtent
476
- ) {
477
- var v_high = new Vec3(),
478
- v_low = new Vec3();
479
-
480
- var ii = outIndexes.length - 4,
481
- index = outIndexes[ii - 1] + 1;
482
-
483
- if (path3v.length === 0) {
484
- path3v.push([]);
485
- if (!pathColors[0]) {
486
- pathColors[0] = [];
487
- }
488
- } else if (!pathColors[path3v.length - 1]) {
489
- pathColors[path3v.length - 1] = [];
490
- }
491
-
492
- var path = path3v[path3v.length - 1],
493
- len = path.length;
494
-
495
- path.push(point3v);
496
-
497
- let r = color[R],
498
- g = color[G],
499
- b = color[B],
500
- a = color[A] != undefined ? color[A] : 1.0,
501
- pathColors_last = pathColors[path3v.length - 1];
502
-
503
- if (pathColors_last[len]) {
504
- pathColors_last[len][R] = r;
505
- pathColors_last[len][G] = g;
506
- pathColors_last[len][B] = b;
507
- pathColors_last[len][A] = a;
508
- } else {
509
- pathColors_last.push(color);
510
- }
511
-
512
- if (len === 1) {
513
- var last;
514
- if (isClosed) {
515
- last = path[len - 1];
516
- if (last instanceof Array) {
517
- last = new Vec3(last[0], last[1], last[2]);
518
- }
519
- } else {
520
- var p0 = path[0],
521
- p1 = path[1] || p0;
522
- if (p0 instanceof Array) {
523
- p0 = new Vec3(p0[0], p0[1], p0[2]);
524
- }
525
- if (p1 instanceof Array) {
526
- p1 = new Vec3(p1[0], p1[1], p1[2]);
527
- }
528
- last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
529
- }
530
-
531
- Vec3.doubleToTwoFloats(last, v_high, v_low);
532
-
533
- let vi = outVerticesHigh.length - 3 * 12;
534
-
535
- outVerticesHigh[vi] = v_high.x;
536
- outVerticesHigh[vi + 1] = v_high.y;
537
- outVerticesHigh[vi + 2] = v_high.z;
538
- outVerticesHigh[vi + 3] = v_high.x;
539
- outVerticesHigh[vi + 4] = v_high.y;
540
- outVerticesHigh[vi + 5] = v_high.z;
541
- outVerticesHigh[vi + 6] = v_high.x;
542
- outVerticesHigh[vi + 7] = v_high.y;
543
- outVerticesHigh[vi + 8] = v_high.z;
544
- outVerticesHigh[vi + 9] = v_high.x;
545
- outVerticesHigh[vi + 10] = v_high.y;
546
- outVerticesHigh[vi + 11] = v_high.z;
547
-
548
- outVerticesLow[vi] = v_low.x;
549
- outVerticesLow[vi + 1] = v_low.y;
550
- outVerticesLow[vi + 2] = v_low.z;
551
- outVerticesLow[vi + 3] = v_low.x;
552
- outVerticesLow[vi + 4] = v_low.y;
553
- outVerticesLow[vi + 5] = v_low.z;
554
- outVerticesLow[vi + 6] = v_low.x;
555
- outVerticesLow[vi + 7] = v_low.y;
556
- outVerticesLow[vi + 8] = v_low.z;
557
- outVerticesLow[vi + 9] = v_low.x;
558
- outVerticesLow[vi + 10] = v_low.y;
559
- outVerticesLow[vi + 11] = v_low.z;
560
- }
561
-
562
- var startIndex = index;
563
-
564
- if (ellipsoid) {
565
- if (outTransformedPathLonLat.length === 0) {
566
- outTransformedPathLonLat.push([]);
567
- }
568
-
569
- if (outTransformedPathMerc.length === 0) {
570
- outTransformedPathMerc.push([]);
571
- }
572
-
573
- var transformedPathLonLat =
574
- outTransformedPathLonLat[outTransformedPathLonLat.length - 1],
575
- transformedPathMerc = outTransformedPathMerc[outTransformedPathMerc.length - 1];
576
-
577
- let lonLat = ellipsoid.cartesianToLonLat(point3v);
578
- transformedPathLonLat.push(lonLat);
579
- transformedPathMerc.push(lonLat.forwardMercator());
580
-
581
- if (lonLat.lon < outExtent.southWest.lon) {
582
- outExtent.southWest.lon = lonLat.lon;
583
- }
584
- if (lonLat.lat < outExtent.southWest.lat) {
585
- outExtent.southWest.lat = lonLat.lat;
586
- }
587
- if (lonLat.lon > outExtent.northEast.lon) {
588
- outExtent.northEast.lon = lonLat.lon;
589
- }
590
- if (lonLat.lat > outExtent.northEast.lat) {
591
- outExtent.northEast.lat = lonLat.lat;
592
- }
593
- }
594
-
595
- Vec3.doubleToTwoFloats(point3v, v_high, v_low);
596
-
597
- let vi = outVerticesHigh.length - 12;
598
-
599
- outVerticesHigh[vi] = v_high.x;
600
- outVerticesHigh[vi + 1] = v_high.y;
601
- outVerticesHigh[vi + 2] = v_high.z;
602
- outVerticesHigh[vi + 3] = v_high.x;
603
- outVerticesHigh[vi + 4] = v_high.y;
604
- outVerticesHigh[vi + 5] = v_high.z;
605
- outVerticesHigh[vi + 6] = v_high.x;
606
- outVerticesHigh[vi + 7] = v_high.y;
607
- outVerticesHigh[vi + 8] = v_high.z;
608
- outVerticesHigh[vi + 9] = v_high.x;
609
- outVerticesHigh[vi + 10] = v_high.y;
610
- outVerticesHigh[vi + 11] = v_high.z;
611
-
612
- outVerticesLow[vi] = v_low.x;
613
- outVerticesLow[vi + 1] = v_low.y;
614
- outVerticesLow[vi + 2] = v_low.z;
615
- outVerticesLow[vi + 3] = v_low.x;
616
- outVerticesLow[vi + 4] = v_low.y;
617
- outVerticesLow[vi + 5] = v_low.z;
618
- outVerticesLow[vi + 6] = v_low.x;
619
- outVerticesLow[vi + 7] = v_low.y;
620
- outVerticesLow[vi + 8] = v_low.z;
621
- outVerticesLow[vi + 9] = v_low.x;
622
- outVerticesLow[vi + 10] = v_low.y;
623
- outVerticesLow[vi + 11] = v_low.z;
624
-
625
- let ci = outColors.length - 16;
626
-
627
- outColors[ci] = r;
628
- outColors[ci + 1] = g;
629
- outColors[ci + 2] = b;
630
- outColors[ci + 3] = a;
631
- outColors[ci + 4] = r;
632
- outColors[ci + 5] = g;
633
- outColors[ci + 6] = b;
634
- outColors[ci + 7] = a;
635
- outColors[ci + 8] = r;
636
- outColors[ci + 9] = g;
637
- outColors[ci + 10] = b;
638
- outColors[ci + 11] = a;
639
- outColors[ci + 12] = r;
640
- outColors[ci + 13] = g;
641
- outColors[ci + 14] = b;
642
- outColors[ci + 15] = a;
643
-
644
- outIndexes[ii] = index++;
645
- outIndexes[ii + 1] = index++;
646
- outIndexes[ii + 2] = index++;
647
- outIndexes[ii + 3] = index++;
648
-
649
- //
650
- // Close path
651
- //
652
- var first;
653
- if (isClosed) {
654
- first = path[0];
655
- outIndexes.push(startIndex, startIndex + 1, startIndex + 1, startIndex + 1);
656
- } else {
657
- let p0 = path[path.length - 1],
658
- p1 = path[path.length - 2] || p0;
659
-
660
- first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
661
- outIndexes.push(index - 1, index - 1, index - 1, index - 1);
662
- }
663
-
664
- Vec3.doubleToTwoFloats(first, v_high, v_low);
665
- outVerticesHigh.push(
666
- v_high.x,
667
- v_high.y,
668
- v_high.z,
669
- v_high.x,
670
- v_high.y,
671
- v_high.z,
672
- v_high.x,
673
- v_high.y,
674
- v_high.z,
675
- v_high.x,
676
- v_high.y,
677
- v_high.z
678
- );
679
- outVerticesLow.push(
680
- v_low.x,
681
- v_low.y,
682
- v_low.z,
683
- v_low.x,
684
- v_low.y,
685
- v_low.z,
686
- v_low.x,
687
- v_low.y,
688
- v_low.z,
689
- v_low.x,
690
- v_low.y,
691
- v_low.z
692
- );
693
-
694
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
695
-
696
- outOrders.push(1, -1, 2, -2);
697
- }
698
-
699
- /**
700
- * Appends to the line array new geodetic coordinates line data.
701
- * @param {Array.<Array.<number>>} pathLonLat - Line geodetic coordinates path array. [[0,0,0], [1,1,1],...]
702
- * @param {Boolean} isClosed - Identificator for the closed line data creation.
703
- * @param {Number[]} outVertices - Out vertices data array.
704
- * @param {Number[]} outOrders - Out vertices orders data array.
705
- * @param {Number[]} outIndexes - Out indexes data array.
706
- * @param {Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
707
- * @param {Array.<Array.<number>>} outTransformedPathCartesian - Cartesian coordinates out array. [[0,0,0], [1,1,1],...]
708
- * @param {Array.<Array.<LonLat>>} outPathLonLat - Geographic coordinates out array.
709
- * @param {Array.<Array.<LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
710
- * @param {Extent} outExtent - Geodetic line extent.
711
- * @static
712
- */
713
- static appendLineDataLonLat(
714
- pathLonLat,
715
- pathColors,
716
- defaultColor,
717
- isClosed,
718
- outVerticesHigh,
719
- outVerticesLow,
720
- outOrders,
721
- outIndexes,
722
- ellipsoid,
723
- outTransformedPathCartesian,
724
- outPathLonLat,
725
- outTransformedPathMerc,
726
- outExtent,
727
- outColors
728
- ) {
729
- var index = 0;
730
-
731
- var v_high = new Vec3(),
732
- v_low = new Vec3();
733
-
734
- if (outExtent) {
735
- outExtent.southWest.set(180.0, 90.0);
736
- outExtent.northEast.set(-180.0, -90.0);
737
- }
738
-
739
- if (outIndexes.length > 0) {
740
- index = outIndexes[outIndexes.length - 5] + 9;
741
- outIndexes.push(index, index);
742
- } else {
743
- outIndexes.push(0, 0);
744
- }
745
-
746
- for (let j = 0, len = pathLonLat.length; j < len; j++) {
747
- var path = pathLonLat[j],
748
- pathColors_j = pathColors[j];
749
-
750
- outTransformedPathCartesian[j] = [];
751
- outTransformedPathMerc[j] = [];
752
- outPathLonLat[j] = [];
753
-
754
- if (path.length === 0) {
755
- continue;
756
- }
757
-
758
- var startIndex = index;
759
-
760
- var last;
761
-
762
- if (isClosed) {
763
- let pp = path[path.length - 1];
764
- if (pp instanceof Array) {
765
- last = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
766
- } else {
767
- last = ellipsoid.lonLatToCartesian(pp);
768
- }
769
- } else {
770
- let p0, p1;
771
- let pp = path[0];
772
- if (pp instanceof Array) {
773
- p0 = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
774
- } else {
775
- p0 = ellipsoid.lonLatToCartesian(pp);
776
- }
777
-
778
- pp = path[1];
779
-
780
- if (!pp) {
781
- pp = path[0];
782
- }
783
-
784
- if (pp instanceof Array) {
785
- p1 = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
786
- } else {
787
- p1 = ellipsoid.lonLatToCartesian(pp);
788
- }
789
-
790
- last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
791
- }
792
-
793
- let color = defaultColor;
794
-
795
- if (pathColors_j && pathColors_j[0]) {
796
- color = pathColors_j[0];
797
- }
798
-
799
- Vec3.doubleToTwoFloats(last, v_high, v_low);
800
- outVerticesHigh.push(
801
- v_high.x,
802
- v_high.y,
803
- v_high.z,
804
- v_high.x,
805
- v_high.y,
806
- v_high.z,
807
- v_high.x,
808
- v_high.y,
809
- v_high.z,
810
- v_high.x,
811
- v_high.y,
812
- v_high.z
813
- );
814
- outVerticesLow.push(
815
- v_low.x,
816
- v_low.y,
817
- v_low.z,
818
- v_low.x,
819
- v_low.y,
820
- v_low.z,
821
- v_low.x,
822
- v_low.y,
823
- v_low.z,
824
- v_low.x,
825
- v_low.y,
826
- v_low.z
827
- );
828
-
829
- let r = color[R],
830
- g = color[G],
831
- b = color[B],
832
- a = color[A] != undefined ? color[A] : 1.0;
833
-
834
- if (j > 0) {
835
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
836
- }
837
-
838
- outOrders.push(1, -1, 2, -2);
839
-
840
- for (let i = 0, len = path.length; i < len; i++) {
841
- var cur = path[i];
842
-
843
- if (cur instanceof Array) {
844
- cur = new LonLat(cur[0], cur[1], cur[2]);
845
- }
846
-
847
- if (pathColors_j && pathColors_j[i]) {
848
- color = pathColors_j[i];
849
- }
850
-
851
- r = color[R];
852
- g = color[G];
853
- b = color[B];
854
- a = color[A] != undefined ? color[A] : 1.0;
855
-
856
- var cartesian = ellipsoid.lonLatToCartesian(cur);
857
- outTransformedPathCartesian[j].push(cartesian);
858
- outPathLonLat[j].push(cur);
859
- outTransformedPathMerc[j].push(cur.forwardMercator());
860
-
861
- Vec3.doubleToTwoFloats(cartesian, v_high, v_low);
862
- outVerticesHigh.push(
863
- v_high.x,
864
- v_high.y,
865
- v_high.z,
866
- v_high.x,
867
- v_high.y,
868
- v_high.z,
869
- v_high.x,
870
- v_high.y,
871
- v_high.z,
872
- v_high.x,
873
- v_high.y,
874
- v_high.z
875
- );
876
- outVerticesLow.push(
877
- v_low.x,
878
- v_low.y,
879
- v_low.z,
880
- v_low.x,
881
- v_low.y,
882
- v_low.z,
883
- v_low.x,
884
- v_low.y,
885
- v_low.z,
886
- v_low.x,
887
- v_low.y,
888
- v_low.z
889
- );
890
-
891
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
892
-
893
- outOrders.push(1, -1, 2, -2);
894
- outIndexes.push(index++, index++, index++, index++);
895
-
896
- if (cur.lon < outExtent.southWest.lon) {
897
- outExtent.southWest.lon = cur.lon;
898
- }
899
- if (cur.lat < outExtent.southWest.lat) {
900
- outExtent.southWest.lat = cur.lat;
901
- }
902
- if (cur.lon > outExtent.northEast.lon) {
903
- outExtent.northEast.lon = cur.lon;
904
- }
905
- if (cur.lat > outExtent.northEast.lat) {
906
- outExtent.northEast.lat = cur.lat;
907
- }
908
- }
909
-
910
- var first;
911
- if (isClosed) {
912
- let pp = path[0];
913
- if (pp instanceof Array) {
914
- first = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
915
- } else {
916
- first = ellipsoid.lonLatToCartesian(pp);
917
- }
918
- outIndexes.push(startIndex, startIndex + 1, startIndex + 1, startIndex + 1);
919
- } else {
920
- let p0, p1;
921
- let pp = path[path.length - 1];
922
- if (pp instanceof Array) {
923
- p0 = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
924
- } else {
925
- p0 = ellipsoid.lonLatToCartesian(pp);
926
- }
927
-
928
- pp = path[path.length - 2];
929
-
930
- if (!pp) {
931
- pp = path[0];
932
- }
933
-
934
- if (pp instanceof Array) {
935
- p1 = ellipsoid.lonLatToCartesian(new LonLat(pp[0], pp[1], pp[2]));
936
- } else {
937
- p1 = ellipsoid.lonLatToCartesian(pp);
938
- }
939
- first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
940
- outIndexes.push(index - 1, index - 1, index - 1, index - 1);
941
- }
942
-
943
- if (pathColors_j && pathColors_j[path.length - 1]) {
944
- color = pathColors_j[path.length - 1];
945
- }
946
-
947
- r = color[R];
948
- g = color[G];
949
- b = color[B];
950
- a = color[A] != undefined ? color[A] : 1.0;
951
-
952
- Vec3.doubleToTwoFloats(first, v_high, v_low);
953
- outVerticesHigh.push(
954
- v_high.x,
955
- v_high.y,
956
- v_high.z,
957
- v_high.x,
958
- v_high.y,
959
- v_high.z,
960
- v_high.x,
961
- v_high.y,
962
- v_high.z,
963
- v_high.x,
964
- v_high.y,
965
- v_high.z
966
- );
967
- outVerticesLow.push(
968
- v_low.x,
969
- v_low.y,
970
- v_low.z,
971
- v_low.x,
972
- v_low.y,
973
- v_low.z,
974
- v_low.x,
975
- v_low.y,
976
- v_low.z,
977
- v_low.x,
978
- v_low.y,
979
- v_low.z
980
- );
981
-
982
- outColors.push(r, g, b, a, r, g, b, a, r, g, b, a, r, g, b, a);
983
-
984
- outOrders.push(1, -1, 2, -2);
985
-
986
- if (j < pathLonLat.length - 1 && pathLonLat[j + 1].length !== 0) {
987
- index += 8;
988
- outIndexes.push(index, index);
989
- }
990
- }
991
- }
992
-
993
- /**
994
- * Sets polyline path with cartesian coordinates.
995
- * @protected
996
- * @param {pg.math.Vector3[]} path3v - Cartesian coordinates.
997
- */
998
- _setEqualPath3v(path3v) {
999
- var extent = this._extent;
1000
- extent.southWest.set(180, 90);
1001
- extent.northEast.set(-180, -90);
1002
-
1003
- var v_high = new Vec3(),
1004
- v_low = new Vec3();
1005
-
1006
- var vh = this._verticesHigh,
1007
- vl = this._verticesLow,
1008
- l = this._pathLonLat,
1009
- m = this._pathLonLatMerc,
1010
- k = 0;
1011
-
1012
- var ellipsoid = this._renderNode.ellipsoid;
1013
-
1014
- for (let j = 0; j < path3v.length; j++) {
1015
- var path = path3v[j];
1016
-
1017
- var last;
1018
- if (this._closedLine) {
1019
- last = path[path.length - 1];
1020
- } else {
1021
- last = new Vec3(
1022
- path[0].x + path[0].x - path[1].x,
1023
- path[0].y + path[0].y - path[1].y,
1024
- path[0].z + path[0].z - path[1].z
1025
- );
1026
- }
1027
-
1028
- Vec3.doubleToTwoFloats(last, v_high, v_low);
1029
-
1030
- vh[k] = v_high.x;
1031
- vl[k++] = v_low.x;
1032
- vh[k] = v_high.y;
1033
- vl[k++] = v_low.y;
1034
- vh[k] = v_high.z;
1035
- vl[k++] = v_low.z;
1036
- vh[k] = v_high.x;
1037
- vl[k++] = v_low.x;
1038
- vh[k] = v_high.y;
1039
- vl[k++] = v_low.y;
1040
- vh[k] = v_high.z;
1041
- vl[k++] = v_low.z;
1042
- vh[k] = v_high.x;
1043
- vl[k++] = v_low.x;
1044
- vh[k] = v_high.y;
1045
- vl[k++] = v_low.y;
1046
- vh[k] = v_high.z;
1047
- vl[k++] = v_low.z;
1048
- vh[k] = v_high.x;
1049
- vl[k++] = v_low.x;
1050
- vh[k] = v_high.y;
1051
- vl[k++] = v_low.y;
1052
- vh[k] = v_high.z;
1053
- vl[k++] = v_low.z;
1054
-
1055
- for (let i = 0; i < path.length; i++) {
1056
- var cur = path[i],
1057
- pji = this._path3v[j][i];
1058
-
1059
- pji.x = cur.x;
1060
- pji.y = cur.y;
1061
- pji.z = cur.z;
1062
-
1063
- if (ellipsoid) {
1064
- var lonLat = ellipsoid.cartesianToLonLat(cur);
1065
-
1066
- this._pathLonLat[j][i] = lonLat;
1067
-
1068
- l[j][i] = lonLat;
1069
- m[j][i] = lonLat.forwardMercator();
1070
-
1071
- if (lonLat.lon < extent.southWest.lon) {
1072
- extent.southWest.lon = lonLat.lon;
1073
- }
1074
- if (lonLat.lat < extent.southWest.lat) {
1075
- extent.southWest.lat = lonLat.lat;
1076
- }
1077
- if (lonLat.lon > extent.northEast.lon) {
1078
- extent.northEast.lon = lonLat.lon;
1079
- }
1080
- if (lonLat.lat > extent.northEast.lat) {
1081
- extent.northEast.lat = lonLat.lat;
1082
- }
1083
- }
1084
-
1085
- Vec3.doubleToTwoFloats(cur, v_high, v_low);
1086
-
1087
- vh[k] = v_high.x;
1088
- vl[k++] = v_low.x;
1089
- vh[k] = v_high.y;
1090
- vl[k++] = v_low.y;
1091
- vh[k] = v_high.z;
1092
- vl[k++] = v_low.z;
1093
- vh[k] = v_high.x;
1094
- vl[k++] = v_low.x;
1095
- vh[k] = v_high.y;
1096
- vl[k++] = v_low.y;
1097
- vh[k] = v_high.z;
1098
- vl[k++] = v_low.z;
1099
- vh[k] = v_high.x;
1100
- vl[k++] = v_low.x;
1101
- vh[k] = v_high.y;
1102
- vl[k++] = v_low.y;
1103
- vh[k] = v_high.z;
1104
- vl[k++] = v_low.z;
1105
- vh[k] = v_high.x;
1106
- vl[k++] = v_low.x;
1107
- vh[k] = v_high.y;
1108
- vl[k++] = v_low.y;
1109
- vh[k] = v_high.z;
1110
- vl[k++] = v_low.z;
1111
- }
1112
-
1113
- var first;
1114
- if (this._closedLine) {
1115
- first = path[0];
1116
- } else {
1117
- var l1 = path.length - 1;
1118
- first = new Vec3(
1119
- path[l1].x + path[l1].x - path[l1 - 1].x,
1120
- path[l1].y + path[l1].y - path[l1 - 1].y,
1121
- path[l1].z + path[l1].z - path[l1 - 1].z
1122
- );
1123
- }
1124
-
1125
- Vec3.doubleToTwoFloats(first, v_high, v_low);
1126
-
1127
- vh[k] = v_high.x;
1128
- vl[k++] = v_low.x;
1129
- vh[k] = v_high.y;
1130
- vl[k++] = v_low.y;
1131
- vh[k] = v_high.z;
1132
- vl[k++] = v_low.z;
1133
- vh[k] = v_high.x;
1134
- vl[k++] = v_low.x;
1135
- vh[k] = v_high.y;
1136
- vl[k++] = v_low.y;
1137
- vh[k] = v_high.z;
1138
- vl[k++] = v_low.z;
1139
- vh[k] = v_high.x;
1140
- vl[k++] = v_low.x;
1141
- vh[k] = v_high.y;
1142
- vl[k++] = v_low.y;
1143
- vh[k] = v_high.z;
1144
- vl[k++] = v_low.z;
1145
- vh[k] = v_high.x;
1146
- vl[k++] = v_low.x;
1147
- vh[k] = v_high.y;
1148
- vl[k++] = v_low.y;
1149
- vh[k] = v_high.z;
1150
- vl[k++] = v_low.z;
1151
- }
1152
- }
1153
-
1154
- /**
1155
- * Sets polyline with geodetic coordinates.
1156
- * @protected
1157
- * @param {LonLat[]} pathLonLat - Geodetic polyline path coordinates.
1158
- */
1159
- _setEqualPathLonLat(pathLonLat) {
1160
- var extent = this._extent;
1161
- extent.southWest.set(180.0, 90.0);
1162
- extent.northEast.set(-180.0, -90.0);
1163
-
1164
- var v_high = new Vec3(),
1165
- v_low = new Vec3();
1166
-
1167
- var vh = this._verticesHigh,
1168
- vl = this._verticesLow,
1169
- l = this._pathLonLat,
1170
- m = this._pathLonLatMerc,
1171
- c = this._path3v,
1172
- k = 0;
1173
-
1174
- var ellipsoid = this._renderNode.ellipsoid;
1175
-
1176
- for (let j = 0; j < pathLonLat.length; j++) {
1177
- var path = pathLonLat[j];
1178
-
1179
- var last;
1180
- if (this._closedLine) {
1181
- last = ellipsoid.lonLatToCartesian(path[path.length - 1]);
1182
- } else {
1183
- let p0 = ellipsoid.lonLatToCartesian(path[0]),
1184
- p1 = ellipsoid.lonLatToCartesian(path[1]);
1185
- last = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
1186
- }
1187
-
1188
- Vec3.doubleToTwoFloats(last, v_high, v_low);
1189
-
1190
- vh[k] = v_high.x;
1191
- vl[k++] = v_low.x;
1192
- vh[k] = v_high.y;
1193
- vl[k++] = v_low.y;
1194
- vh[k] = v_high.z;
1195
- vl[k++] = v_low.z;
1196
- vh[k] = v_high.x;
1197
- vl[k++] = v_low.x;
1198
- vh[k] = v_high.y;
1199
- vl[k++] = v_low.y;
1200
- vh[k] = v_high.z;
1201
- vl[k++] = v_low.z;
1202
- vh[k] = v_high.x;
1203
- vl[k++] = v_low.x;
1204
- vh[k] = v_high.y;
1205
- vl[k++] = v_low.y;
1206
- vh[k] = v_high.z;
1207
- vl[k++] = v_low.z;
1208
- vh[k] = v_high.x;
1209
- vl[k++] = v_low.x;
1210
- vh[k] = v_high.y;
1211
- vl[k++] = v_low.y;
1212
- vh[k] = v_high.z;
1213
- vl[k++] = v_low.z;
1214
-
1215
- for (let i = 0; i < path.length; i++) {
1216
- var cur = path[i];
1217
- var cartesian = ellipsoid.lonLatToCartesian(cur);
1218
- c[j][i] = cartesian;
1219
- m[j][i] = cur.forwardMercator();
1220
- l[j][i] = cur;
1221
-
1222
- Vec3.doubleToTwoFloats(cartesian, v_high, v_low);
1223
-
1224
- vh[k] = v_high.x;
1225
- vl[k++] = v_low.x;
1226
- vh[k] = v_high.y;
1227
- vl[k++] = v_low.y;
1228
- vh[k] = v_high.z;
1229
- vl[k++] = v_low.z;
1230
- vh[k] = v_high.x;
1231
- vl[k++] = v_low.x;
1232
- vh[k] = v_high.y;
1233
- vl[k++] = v_low.y;
1234
- vh[k] = v_high.z;
1235
- vl[k++] = v_low.z;
1236
- vh[k] = v_high.x;
1237
- vl[k++] = v_low.x;
1238
- vh[k] = v_high.y;
1239
- vl[k++] = v_low.y;
1240
- vh[k] = v_high.z;
1241
- vl[k++] = v_low.z;
1242
- vh[k] = v_high.x;
1243
- vl[k++] = v_low.x;
1244
- vh[k] = v_high.y;
1245
- vl[k++] = v_low.y;
1246
- vh[k] = v_high.z;
1247
- vl[k++] = v_low.z;
1248
-
1249
- if (cur.lon < extent.southWest.lon) {
1250
- extent.southWest.lon = cur.lon;
1251
- }
1252
- if (cur.lat < extent.southWest.lat) {
1253
- extent.southWest.lat = cur.lat;
1254
- }
1255
- if (cur.lon > extent.northEast.lon) {
1256
- extent.northEast.lon = cur.lon;
1257
- }
1258
- if (cur.lat > extent.northEast.lat) {
1259
- extent.northEast.lat = cur.lat;
1260
- }
1261
- }
1262
-
1263
- var first;
1264
- if (this._closedLine) {
1265
- first = ellipsoid.lonLatToCartesian(path[0]);
1266
- } else {
1267
- let p0 = ellipsoid.lonLatToCartesian(path[path.length - 1]),
1268
- p1 = ellipsoid.lonLatToCartesian(path[path.length - 2]);
1269
- first = new Vec3(p0.x + p0.x - p1.x, p0.y + p0.y - p1.y, p0.z + p0.z - p1.z);
1270
- }
1271
-
1272
- Vec3.doubleToTwoFloats(first, v_high, v_low);
1273
-
1274
- vh[k] = v_high.x;
1275
- vl[k++] = v_low.x;
1276
- vh[k] = v_high.y;
1277
- vl[k++] = v_low.y;
1278
- vh[k] = v_high.z;
1279
- vl[k++] = v_low.z;
1280
- vh[k] = v_high.x;
1281
- vl[k++] = v_low.x;
1282
- vh[k] = v_high.y;
1283
- vl[k++] = v_low.y;
1284
- vh[k] = v_high.z;
1285
- vl[k++] = v_low.z;
1286
- vh[k] = v_high.x;
1287
- vl[k++] = v_low.x;
1288
- vh[k] = v_high.y;
1289
- vl[k++] = v_low.y;
1290
- vh[k] = v_high.z;
1291
- vl[k++] = v_low.z;
1292
- vh[k] = v_high.x;
1293
- vl[k++] = v_low.x;
1294
- vh[k] = v_high.y;
1295
- vl[k++] = v_low.y;
1296
- vh[k] = v_high.z;
1297
- vl[k++] = v_low.z;
1298
- }
1299
- }
1300
-
1301
- setPointLonLat(lonlat, index, segmentIndex) {
1302
- if (this._renderNode && this._renderNode.ellipsoid) {
1303
- let l = this._pathLonLat,
1304
- m = this._pathLonLatMerc;
1305
-
1306
- l[segmentIndex][index] = lonlat;
1307
- m[segmentIndex][index] = lonlat.forwardMercator();
1308
-
1309
- //
1310
- // Apply new extent(TODO: think about optimization)
1311
- //
1312
- var extent = this._extent;
1313
- extent.southWest.set(180.0, 90.0);
1314
- extent.northEast.set(-180.0, -90.0);
1315
- for (let i = 0; i < l.length; i++) {
1316
- var pi = l[i];
1317
- for (let j = 0; j < pi.length; j++) {
1318
- var lon = pi[j].lon,
1319
- lat = pi[j].lat;
1320
- if (lon > extent.northEast.lon) {
1321
- extent.northEast.lon = lon;
1322
- }
1323
- if (lat > extent.northEast.lat) {
1324
- extent.northEast.lat = lat;
1325
- }
1326
- if (lon < extent.southWest.lon) {
1327
- extent.southWest.lon = lon;
1328
- }
1329
- if (lat < extent.southWest.lat) {
1330
- extent.southWest.lat = lat;
1331
- }
1332
- }
1333
- }
1334
-
1335
- this.setPoint3v(
1336
- this._renderNode.ellipsoid.lonLatToCartesian(lonlat),
1337
- index,
1338
- segmentIndex,
1339
- true
1340
- );
1341
- } else {
1342
- let path = this._pathLonLat[segmentIndex];
1343
- path[index].lon = lonlat.lon;
1344
- path[index].lat = lonlat.lat;
1345
- path[index].height = lonlat.height;
1346
- }
1347
- }
1348
-
1349
- setPoint3v(coordinates, index = 0, segmentIndex = 0, skipLonLat = false) {
1350
-
1351
- if (this._renderNode) {
1352
- var v_high = new Vec3(),
1353
- v_low = new Vec3();
1354
-
1355
- var vh = this._verticesHigh,
1356
- vl = this._verticesLow,
1357
- l = this._pathLonLat,
1358
- m = this._pathLonLatMerc,
1359
- k = 0,
1360
- kk = 0;
1361
-
1362
- //for (let i = 0; i < segmentIndex; i++) {
1363
- // kk += this._path3v[i].length * 12 + 24;
1364
- //}
1365
- kk = this._pathLengths[segmentIndex] * 12 + 24 * segmentIndex;
1366
-
1367
- let path = this._path3v[segmentIndex];
1368
-
1369
- path[index].x = coordinates.x;
1370
- path[index].y = coordinates.y;
1371
- path[index].z = coordinates.z;
1372
-
1373
- let _closedLine = this._closedLine || path.length === 1;
1374
-
1375
- if (index === 0 || index === 1) {
1376
- var last;
1377
- if (_closedLine) {
1378
- last = path[path.length - 1];
1379
- } else {
1380
- last = new Vec3(
1381
- path[0].x + path[0].x - path[1].x,
1382
- path[0].y + path[0].y - path[1].y,
1383
- path[0].z + path[0].z - path[1].z
1384
- );
1385
- }
1386
-
1387
- k = kk;
1388
-
1389
- Vec3.doubleToTwoFloats(last, v_high, v_low);
1390
-
1391
- vh[k] = v_high.x;
1392
- vh[k + 1] = v_high.y;
1393
- vh[k + 2] = v_high.z;
1394
- vh[k + 3] = v_high.x;
1395
- vh[k + 4] = v_high.y;
1396
- vh[k + 5] = v_high.z;
1397
- vh[k + 6] = v_high.x;
1398
- vh[k + 7] = v_high.y;
1399
- vh[k + 8] = v_high.z;
1400
- vh[k + 9] = v_high.x;
1401
- vh[k + 10] = v_high.y;
1402
- vh[k + 11] = v_high.z;
1403
-
1404
- vl[k] = v_low.x;
1405
- vl[k + 1] = v_low.y;
1406
- vl[k + 2] = v_low.z;
1407
- vl[k + 3] = v_low.x;
1408
- vl[k + 4] = v_low.y;
1409
- vl[k + 5] = v_low.z;
1410
- vl[k + 6] = v_low.x;
1411
- vl[k + 7] = v_low.y;
1412
- vl[k + 8] = v_low.z;
1413
- vl[k + 9] = v_low.x;
1414
- vl[k + 10] = v_low.y;
1415
- vl[k + 11] = v_low.z;
1416
- }
1417
-
1418
- if (!skipLonLat && this._renderNode.ellipsoid) {
1419
- var lonLat = this._renderNode.ellipsoid.cartesianToLonLat(coordinates);
1420
- l[segmentIndex][index] = lonLat;
1421
- m[segmentIndex][index] = lonLat.forwardMercator();
1422
-
1423
- //
1424
- // Apply new extent(TODO: think about optimization)
1425
- //
1426
- var extent = this._extent;
1427
- extent.southWest.set(180.0, 90.0);
1428
- extent.northEast.set(-180.0, -90.0);
1429
- for (let i = 0; i < l.length; i++) {
1430
- var pi = l[i];
1431
- for (let j = 0; j < pi.length; j++) {
1432
- var lon = pi[j].lon,
1433
- lat = pi[j].lat;
1434
- if (lon > extent.northEast.lon) {
1435
- extent.northEast.lon = lon;
1436
- }
1437
- if (lat > extent.northEast.lat) {
1438
- extent.northEast.lat = lat;
1439
- }
1440
- if (lon < extent.southWest.lon) {
1441
- extent.southWest.lon = lon;
1442
- }
1443
- if (lat < extent.southWest.lat) {
1444
- extent.southWest.lat = lat;
1445
- }
1446
- }
1447
- }
1448
- }
1449
-
1450
- k = kk + index * 12 + 12;
1451
-
1452
- Vec3.doubleToTwoFloats(coordinates, v_high, v_low);
1453
-
1454
- vh[k] = v_high.x;
1455
- vh[k + 1] = v_high.y;
1456
- vh[k + 2] = v_high.z;
1457
- vh[k + 3] = v_high.x;
1458
- vh[k + 4] = v_high.y;
1459
- vh[k + 5] = v_high.z;
1460
- vh[k + 6] = v_high.x;
1461
- vh[k + 7] = v_high.y;
1462
- vh[k + 8] = v_high.z;
1463
- vh[k + 9] = v_high.x;
1464
- vh[k + 10] = v_high.y;
1465
- vh[k + 11] = v_high.z;
1466
-
1467
- vl[k] = v_low.x;
1468
- vl[k + 1] = v_low.y;
1469
- vl[k + 2] = v_low.z;
1470
- vl[k + 3] = v_low.x;
1471
- vl[k + 4] = v_low.y;
1472
- vl[k + 5] = v_low.z;
1473
- vl[k + 6] = v_low.x;
1474
- vl[k + 7] = v_low.y;
1475
- vl[k + 8] = v_low.z;
1476
- vl[k + 9] = v_low.x;
1477
- vl[k + 10] = v_low.y;
1478
- vl[k + 11] = v_low.z;
1479
-
1480
- if (index === path.length - 1 || index === path.length - 2) {
1481
- var first;
1482
- if (_closedLine) {
1483
- first = path[0];
1484
- } else {
1485
- var l1 = path.length - 1;
1486
- first = new Vec3(
1487
- path[l1].x + path[l1].x - path[l1 - 1].x,
1488
- path[l1].y + path[l1].y - path[l1 - 1].y,
1489
- path[l1].z + path[l1].z - path[l1 - 1].z
1490
- );
1491
- }
1492
-
1493
- k = kk + path.length * 12 + 12;
1494
-
1495
- Vec3.doubleToTwoFloats(first, v_high, v_low);
1496
-
1497
- vh[k] = v_high.x;
1498
- vh[k + 1] = v_high.y;
1499
- vh[k + 2] = v_high.z;
1500
- vh[k + 3] = v_high.x;
1501
- vh[k + 4] = v_high.y;
1502
- vh[k + 5] = v_high.z;
1503
- vh[k + 6] = v_high.x;
1504
- vh[k + 7] = v_high.y;
1505
- vh[k + 8] = v_high.z;
1506
- vh[k + 9] = v_high.x;
1507
- vh[k + 10] = v_high.y;
1508
- vh[k + 11] = v_high.z;
1509
-
1510
- vl[k] = v_low.x;
1511
- vl[k + 1] = v_low.y;
1512
- vl[k + 2] = v_low.z;
1513
- vl[k + 3] = v_low.x;
1514
- vl[k + 4] = v_low.y;
1515
- vl[k + 5] = v_low.z;
1516
- vl[k + 6] = v_low.x;
1517
- vl[k + 7] = v_low.y;
1518
- vl[k + 8] = v_low.z;
1519
- vl[k + 9] = v_low.x;
1520
- vl[k + 10] = v_low.y;
1521
- vl[k + 11] = v_low.z;
1522
- }
1523
-
1524
- this._changedBuffers[VERTICES_BUFFER] = true;
1525
- } else {
1526
- let path = this._path3v[segmentIndex];
1527
- path[index].x = coordinates.x;
1528
- path[index].y = coordinates.y;
1529
- path[index].z = coordinates.z;
1530
- }
1531
- }
1532
-
1533
- _resizePathLengths(index = 0) {
1534
- this._pathLengths[0] = 0;
1535
- for (let i = index + 1, len = this._path3v.length; i <= len; i++) {
1536
- this._pathLengths[i] = this._pathLengths[i - 1] + this._path3v[i - 1].length;
1537
- }
1538
- }
1539
-
1540
- removeSegment(index) {
1541
- this._path3v.splice(index, 1);
1542
- this.setPath3v([].concat(this._path3v));
1543
- }
1544
-
1545
- removePoint(index, multiLineIndex = 0) {
1546
- this._path3v[multiLineIndex].splice(index, 1);
1547
- if (this._path3v[multiLineIndex].length === 0) {
1548
- this._path3v.splice(multiLineIndex, 1);
1549
- }
1550
- this.setPath3v([].concat(this._path3v));
1551
- }
1552
-
1553
- insertPoint3v(point3v, index = 0, color, multilineIndex = 0) {
1554
- let p = [].concat(this._path3v),
1555
- pp = p[multilineIndex];
1556
- if (pp) {
1557
- let c = [].concat(this._pathColors);
1558
-
1559
- pp.splice(index, 0, point3v);
1560
-
1561
- if (color) {
1562
- let cc = c[multilineIndex];
1563
- if (!cc) {
1564
- cc = new Array(pp.length);
1565
- }
1566
- cc.splice(index, 0, color);
1567
- }
1568
-
1569
- this.setPath3v(p, c);
1570
- } else {
1571
- this.addPoint3v(point3v, multilineIndex);
1572
- }
1573
- }
1574
-
1575
- /**
1576
- * Adds a new cartesian point in the end of the path in a last line segment.
1577
- * @public
1578
- * @param {Vec3} point3v - New coordinate.
1579
- */
1580
- appendPoint3v(point3v, color, skipEllipsoid) {
1581
- if (this._path3v.length === 0) {
1582
- this._pathColors.push([color || this._defaultColor]);
1583
- this.addPoint3v(point3v);
1584
- } else {
1585
- //
1586
- // Making typedArrays suitable for appendPoint function
1587
- //
1588
- this._verticesHigh = makeArray(this._verticesHigh);
1589
- this._verticesLow = makeArray(this._verticesLow);
1590
- this._colors = makeArray(this._colors);
1591
- this._orders = makeArray(this._orders);
1592
- this._indexes = makeArray(this._indexes);
1593
-
1594
- Polyline.appendPoint3v(
1595
- this._path3v,
1596
- point3v,
1597
- this._pathColors,
1598
- color || this._defaultColor,
1599
- this._closedLine,
1600
- this._verticesHigh,
1601
- this._verticesLow,
1602
- this._colors,
1603
- this._orders,
1604
- this._indexes,
1605
- !skipEllipsoid && this._renderNode.ellipsoid,
1606
- this._pathLonLat,
1607
- this._pathLonLatMerc,
1608
- this._extent
1609
- );
1610
-
1611
- this._pathLengths[this._path3v.length] += 1;
1612
-
1613
- this._changedBuffers[VERTICES_BUFFER] = true;
1614
- this._changedBuffers[COLORS_BUFFER] = true;
1615
- this._changedBuffers[INDEX_BUFFER] = true;
1616
- }
1617
- }
1618
-
1619
- /**
1620
- * Adds a new cartesian point in the end of the path.
1621
- * @public
1622
- * @param {Vec3} point3v - New coordinate.
1623
- * @param {number} [multiLineIndex=0] - Path part index, first by default.
1624
- */
1625
- addPoint3v(point3v, multiLineIndex = 0) {
1626
- //
1627
- // TODO: could be optimized
1628
- //
1629
- if (multiLineIndex >= this._path3v.length) {
1630
- this._path3v.push([]);
1631
- }
1632
- this._path3v[multiLineIndex].push(point3v);
1633
- this.setPath3v([].concat(this._path3v));
1634
- }
1635
-
1636
- /**
1637
- * Adds a new geodetic point in the end of the path.
1638
- * @public
1639
- * @param {LonLat} lonLat - New coordinate.
1640
- * @param {number} [multiLineIndex=0] - Path part index, first by default.
1641
- */
1642
- addPointLonLat(lonLat, multiLineIndex = 0) {
1643
- //
1644
- // TODO: could be optimized
1645
- //
1646
- if (multiLineIndex >= this._pathLonLat.length) {
1647
- this._pathLonLat.push([]);
1648
- }
1649
- this._pathLonLat[multiLineIndex].push(lonLat);
1650
- this.setPathLonLat([].concat(this._pathLonLat));
1651
- }
1652
-
1653
- /**
1654
- * Clear Polyline object data.
1655
- * @public
1656
- */
1657
- clear() {
1658
- this._clearData();
1659
- }
1660
-
1661
- setPointColor(color, index = 0, segmentIndex = 0) {
1662
- if (this._renderNode && index < this._path3v[segmentIndex].length) {
1663
- let colors = this._pathColors[segmentIndex];
1664
-
1665
- if (!colors) {
1666
- if (this._path3v[segmentIndex] && index < this._path3v[segmentIndex].length) {
1667
- this._pathColors[segmentIndex] = new Array(this._path3v[segmentIndex].length);
1668
- } else {
1669
- return;
1670
- }
1671
- }
1672
-
1673
- if (!colors[index]) {
1674
- colors[index] = [color[R], color[G], color[B], color[A] || 1.0];
1675
- } else {
1676
- colors[index][R] = color[R];
1677
- colors[index][G] = color[G];
1678
- colors[index][B] = color[B];
1679
- colors[index][A] = color[A] || 1.0;
1680
- }
1681
-
1682
- let c = this._colors;
1683
-
1684
- //optimized with this._pathLengths
1685
- //for (let i = 0; i < segmentIndex; i++) {
1686
- // kk += this._path3v[i].length * 16 + 32;
1687
- //}
1688
-
1689
- let k = index * 16 + this._pathLengths[segmentIndex] * 16 + 32 * segmentIndex;
1690
-
1691
- c[k] = c[k + 4] = c[k + 8] = c[k + 12] = color[R];
1692
- c[k + 1] = c[k + 5] = c[k + 9] = c[k + 13] = color[G];
1693
- c[k + 2] = c[k + 6] = c[k + 10] = c[k + 14] = color[B];
1694
- c[k + 3] = c[k + 7] = c[k + 11] = c[k + 15] = color[A] || 1.0;
1695
-
1696
- this._changedBuffers[COLORS_BUFFER] = true;
1697
- } else {
1698
- let pathColors = this._pathColors[segmentIndex];
1699
- pathColors[index] = color;
1700
- }
1701
- }
1702
-
1703
- /**
1704
- * Sets Polyline opacity.
1705
- * @public
1706
- * @param {number} opacity - Opacity.
1707
- */
1708
- setOpacity(opacity) {
1709
- this._opacity = opacity;
1710
- }
1711
-
1712
- /**
1713
- * Sets Polyline thickness in screen pixels.
1714
- * @public
1715
- * @param {number} thickness - Thickness.
1716
- */
1717
- setThickness(thickness) {
1718
- this.thickness = thickness;
1719
- }
1720
-
1721
- /**
1722
- * Returns thickness.
1723
- * @public
1724
- * @return {number} Thickness in screen pixels.
1725
- */
1726
- getThickness() {
1727
- return this.thickness;
1728
- }
1729
-
1730
- /**
1731
- * Sets visibility.
1732
- * @public
1733
- * @param {boolean} visibility - Polyline visibility.
1734
- */
1735
- setVisibility(visibility) {
1736
- this.visibility = visibility;
1737
- }
1738
-
1739
- /**
1740
- * Gets Polyline visibility.
1741
- * @public
1742
- * @return {boolean} Polyline visibility.
1743
- */
1744
- getVisibility() {
1745
- return this.visibility;
1746
- }
1747
-
1748
- /**
1749
- * Assign with render node.
1750
- * @public
1751
- * @param {RenderNode} renderNode -
1752
- */
1753
- setRenderNode(renderNode) {
1754
- if (renderNode) {
1755
- this._renderNode = renderNode;
1756
- if (this._pathLonLat.length) {
1757
- this._createDataLonLat([].concat(this._pathLonLat));
1758
- } else {
1759
- this._createData3v([].concat(this._path3v));
1760
- }
1761
- this._refresh();
1762
- if (renderNode.renderer.isInitialized()) {
1763
- this._update();
1764
- }
1765
- }
1766
- }
1767
-
1768
- /**
1769
- * @protected
1770
- */
1771
- _clearData() {
1772
- this._verticesHigh = null;
1773
- this._verticesLow = null;
1774
- this._orders = null;
1775
- this._indexes = null;
1776
- this._colors = null;
1777
-
1778
- this._verticesHigh = [];
1779
- this._verticesLow = [];
1780
- this._orders = [];
1781
- this._indexes = [];
1782
- this._colors = [];
1783
-
1784
- this._path3v.length = 0;
1785
- this._pathLonLat.length = 0;
1786
- this._pathLonLatMerc.length = 0;
1787
-
1788
- this._path3v = [];
1789
- this._pathLonLat = [];
1790
- this._pathLonLatMerc = [];
1791
- }
1792
-
1793
- _createData3v(path3v) {
1794
- this._clearData();
1795
- Polyline.appendLineData3v(
1796
- path3v,
1797
- this._pathColors,
1798
- this._defaultColor,
1799
- this._closedLine,
1800
- this._verticesHigh,
1801
- this._verticesLow,
1802
- this._orders,
1803
- this._indexes,
1804
- this._renderNode.ellipsoid,
1805
- this._pathLonLat,
1806
- this._path3v,
1807
- this._pathLonLatMerc,
1808
- this._extent,
1809
- this._colors
1810
- );
1811
- this._resizePathLengths(0);
1812
- }
1813
-
1814
- _createDataLonLat(pathLonlat) {
1815
- this._clearData();
1816
- Polyline.appendLineDataLonLat(
1817
- pathLonlat,
1818
- this._pathColors,
1819
- this._defaultColor,
1820
- this._closedLine,
1821
- this._verticesHigh,
1822
- this._verticesLow,
1823
- this._orders,
1824
- this._indexes,
1825
- this._renderNode.ellipsoid,
1826
- this._path3v,
1827
- this._pathLonLat,
1828
- this._pathLonLatMerc,
1829
- this._extent,
1830
- this._colors
1831
- );
1832
- this._resizePathLengths(0);
1833
- }
1834
-
1835
- /**
1836
- * Removes from an entity.
1837
- * @public
1838
- */
1839
- remove() {
1840
- this._entity = null;
1841
-
1842
- this._pathColors.length = 0;
1843
- this._pathColors = [];
1844
-
1845
- this._verticesHigh = null;
1846
- this._verticesLow = null;
1847
- this._orders = null;
1848
- this._indexes = null;
1849
- this._colors = null;
1850
-
1851
- this._verticesHigh = [];
1852
- this._verticesLow = [];
1853
- this._orders = [];
1854
- this._indexes = [];
1855
- this._colors = [];
1856
-
1857
- this._deleteBuffers();
1858
-
1859
- this._handler && this._handler.remove(this);
1860
- }
1861
-
1862
- setPickingColor3v(color) {
1863
- this._pickingColor[0] = color.x / 255.0;
1864
- this._pickingColor[1] = color.y / 255.0;
1865
- this._pickingColor[2] = color.z / 255.0;
1866
- }
1867
-
1868
- /**
1869
- * Returns polyline geodetic extent.
1870
- * @public
1871
- * @returns {Extent} - Geodetic extent
1872
- */
1873
- getExtent() {
1874
- return this._extent.clone();
1875
- }
1876
-
1877
- /**
1878
- * Returns path cartesian coordinates.
1879
- * @return {Array.<Vec3>} Polyline path.
1880
- */
1881
- getPath3v() {
1882
- return this._path3v;
1883
- }
1884
-
1885
- /**
1886
- * Returns geodetic path coordinates.
1887
- * @return {Array.<LonLat>} Polyline path.
1888
- */
1889
- getPathLonLat() {
1890
- return this._pathLonLat;
1891
- }
1892
-
1893
- getPathColors() {
1894
- return this._pathColors;
1895
- }
1896
-
1897
- setPathColors(pathColors) {
1898
- if (this._renderNode) {
1899
- // ...
1900
- }
1901
- }
1902
-
1903
- setColorHTML(htmlColor) {
1904
- this._defaultColor = htmlColorToFloat32Array(htmlColor);
1905
-
1906
- let color = htmlColorToRgba(htmlColor),
1907
- p = this._pathColors;
1908
-
1909
- for (let i = 0, len = p.length; i < len; i++) {
1910
- let s = p[i];
1911
- for (let j = 0, slen = s.length; j < slen; j++) {
1912
- s[j][0] = color.x;
1913
- s[j][1] = color.y;
1914
- s[j][2] = color.z;
1915
- s[j][3] = color.w;
1916
- }
1917
- }
1918
-
1919
- let c = this._colors;
1920
- for (let i = 0, len = c.length; i < len; i += 4) {
1921
- c[i] = color.x;
1922
- c[i + 1] = color.y;
1923
- c[i + 2] = color.z;
1924
- c[i + 3] = color.w;
1925
- }
1926
-
1927
- this._changedBuffers[COLORS_BUFFER] = true;
1928
- }
1929
-
1930
- /**
1931
- * Sets geodetic coordinates.
1932
- * @public
1933
- * @param {Array.<Array.<number>>} pathLonLat - Polyline path cartesian coordinates. (exactly 3 entries)
1934
- * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
1935
- */
1936
- setPathLonLat(pathLonLat, forceEqual) {
1937
- if (this._renderNode && this._renderNode.ellipsoid) {
1938
- if (forceEqual) {
1939
- this._setEqualPathLonLat(pathLonLat);
1940
- this._changedBuffers[VERTICES_BUFFER] = true;
1941
- this._changedBuffers[COLORS_BUFFER] = true;
1942
- } else {
1943
- this._createDataLonLat(pathLonLat);
1944
- this._changedBuffers[VERTICES_BUFFER] = true;
1945
- this._changedBuffers[INDEX_BUFFER] = true;
1946
- this._changedBuffers[COLORS_BUFFER] = true;
1947
- }
1948
- } else {
1949
- this._pathLonLat = [].concat(pathLonLat);
1950
- }
1951
- }
1952
-
1953
- /**
1954
- * Sets Polyline cartesian coordinates.
1955
- * @public
1956
- * @param {Array.<Array.<number>>} path3v - Polyline path cartesian coordinates. (exactly 3 entries)
1957
- * @param {Boolean} [forceEqual=false] - Makes assigning faster for size equal coordinates array.
1958
- */
1959
- setPath3v(path3v, pathColors, forceEqual) {
1960
- if (pathColors) {
1961
- this._pathColors = [].concat(pathColors);
1962
- }
1963
-
1964
- if (this._renderNode) {
1965
- if (forceEqual) {
1966
- this._setEqualPath3v(path3v);
1967
- this._changedBuffers[VERTICES_BUFFER] = true;
1968
- this._changedBuffers[COLORS_BUFFER] = true;
1969
- } else {
1970
- this._createData3v(path3v);
1971
- this._changedBuffers[VERTICES_BUFFER] = true;
1972
- this._changedBuffers[INDEX_BUFFER] = true;
1973
- this._changedBuffers[COLORS_BUFFER] = true;
1974
- }
1975
- } else {
1976
- this._path3v = [].concat(path3v);
1977
- }
1978
- }
1979
-
1980
- draw() {
1981
- if (this.visibility && this._path3v.length) {
1982
- this._update();
1983
-
1984
- var rn = this._renderNode;
1985
- var r = rn.renderer;
1986
- var sh = r.handler.programs.polyline_screen;
1987
- var p = sh._program;
1988
- var gl = r.handler.gl,
1989
- sha = p.attributes,
1990
- shu = p.uniforms,
1991
- ec = this._handler._entityCollection;
1992
-
1993
- sh.activate();
1994
-
1995
- gl.disable(gl.CULL_FACE);
1996
-
1997
- gl.uniform1f(shu.depthOffset, ec.polygonOffsetUnits + window.POLYLINE_DEPTH_OFFSET);
1998
-
1999
- gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
2000
- gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
2001
-
2002
- // gl.uniform4fv(shu.color, [this.color.x, this.color.y, this.color.z, this.color.w * this._handler._entityCollection._fadingOpacity]);
2003
-
2004
- gl.uniform3fv(shu.eyePositionHigh, r.activeCamera.eyeHigh);
2005
- gl.uniform3fv(shu.eyePositionLow, r.activeCamera.eyeLow);
2006
-
2007
- gl.uniform2fv(shu.uFloatParams, [
2008
- rn._planetRadius2 || 0.0,
2009
- r.activeCamera._tanViewAngle_hradOneByHeight
2010
- ]);
2011
- gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
2012
- gl.uniform1f(shu.thickness, this.thickness * 0.5);
2013
- gl.uniform1f(shu.opacity, this._opacity * ec._fadingOpacity);
2014
-
2015
- gl.bindBuffer(gl.ARRAY_BUFFER, this._colorsBuffer);
2016
- gl.vertexAttribPointer(sha.color, this._colorsBuffer.itemSize, gl.FLOAT, false, 0, 0);
2017
-
2018
- var v = this._verticesHighBuffer;
2019
- gl.bindBuffer(gl.ARRAY_BUFFER, v);
2020
- gl.vertexAttribPointer(sha.prevHigh, v.itemSize, gl.FLOAT, false, 12, 0);
2021
- gl.vertexAttribPointer(sha.currentHigh, v.itemSize, gl.FLOAT, false, 12, 48);
2022
- gl.vertexAttribPointer(sha.nextHigh, v.itemSize, gl.FLOAT, false, 12, 96);
2023
-
2024
- v = this._verticesLowBuffer;
2025
- gl.bindBuffer(gl.ARRAY_BUFFER, v);
2026
- gl.vertexAttribPointer(sha.prevLow, v.itemSize, gl.FLOAT, false, 12, 0);
2027
- gl.vertexAttribPointer(sha.currentLow, v.itemSize, gl.FLOAT, false, 12, 48);
2028
- gl.vertexAttribPointer(sha.nextLow, v.itemSize, gl.FLOAT, false, 12, 96);
2029
-
2030
- gl.bindBuffer(gl.ARRAY_BUFFER, this._ordersBuffer);
2031
- gl.vertexAttribPointer(sha.order, this._ordersBuffer.itemSize, gl.FLOAT, false, 4, 0);
2032
-
2033
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexesBuffer);
2034
- gl.drawElements(gl.TRIANGLE_STRIP, this._indexesBuffer.numItems, gl.UNSIGNED_INT, 0);
2035
-
2036
- gl.enable(gl.CULL_FACE);
2037
- }
2038
- }
2039
-
2040
- drawPicking() {
2041
- if (this.visibility && this._path3v.length) {
2042
- var rn = this._renderNode;
2043
- var r = rn.renderer;
2044
- var sh = r.handler.programs.polyline_picking;
2045
- var p = sh._program;
2046
- var gl = r.handler.gl,
2047
- sha = p.attributes,
2048
- shu = p.uniforms;
2049
-
2050
- sh.activate();
2051
-
2052
- gl.disable(gl.CULL_FACE);
2053
-
2054
- gl.uniform1f(shu.depthOffset, this._handler._entityCollection.polygonOffsetUnits + window.POLYLINE_DEPTH_OFFSET);
2055
-
2056
- gl.uniformMatrix4fv(shu.proj, false, r.activeCamera.getProjectionMatrix());
2057
- gl.uniformMatrix4fv(shu.view, false, r.activeCamera.getViewMatrix());
2058
-
2059
- gl.uniform4fv(shu.color, [
2060
- this._pickingColor[0],
2061
- this._pickingColor[1],
2062
- this._pickingColor[2],
2063
- 1.0
2064
- ]);
2065
-
2066
- gl.uniform3fv(shu.eyePositionHigh, r.activeCamera.eyeHigh);
2067
- gl.uniform3fv(shu.eyePositionLow, r.activeCamera.eyeLow);
2068
-
2069
- gl.uniform2fv(shu.uFloatParams, [
2070
- rn._planetRadius2 || 0.0,
2071
- r.activeCamera._tanViewAngle_hradOneByHeight
2072
- ]);
2073
- gl.uniform2fv(shu.viewport, [r.handler.canvas.width, r.handler.canvas.height]);
2074
- gl.uniform1f(shu.thickness, this.thickness * 0.5);
2075
-
2076
- var v = this._verticesHighBuffer;
2077
- gl.bindBuffer(gl.ARRAY_BUFFER, v);
2078
- gl.vertexAttribPointer(sha.prevHigh, v.itemSize, gl.FLOAT, false, 12, 0);
2079
- gl.vertexAttribPointer(sha.currentHigh, v.itemSize, gl.FLOAT, false, 12, 48);
2080
- gl.vertexAttribPointer(sha.nextHigh, v.itemSize, gl.FLOAT, false, 12, 96);
2081
-
2082
- v = this._verticesLowBuffer;
2083
- gl.bindBuffer(gl.ARRAY_BUFFER, v);
2084
- gl.vertexAttribPointer(sha.prevLow, v.itemSize, gl.FLOAT, false, 12, 0);
2085
- gl.vertexAttribPointer(sha.currentLow, v.itemSize, gl.FLOAT, false, 12, 48);
2086
- gl.vertexAttribPointer(sha.nextLow, v.itemSize, gl.FLOAT, false, 12, 96);
2087
-
2088
- gl.bindBuffer(gl.ARRAY_BUFFER, this._ordersBuffer);
2089
- gl.vertexAttribPointer(sha.order, this._ordersBuffer.itemSize, gl.FLOAT, false, 4, 0);
2090
-
2091
- gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexesBuffer);
2092
- gl.drawElements(gl.TRIANGLE_STRIP, this._indexesBuffer.numItems, gl.UNSIGNED_INT, 0);
2093
-
2094
- gl.enable(gl.CULL_FACE);
2095
- }
2096
- }
2097
-
2098
- /**
2099
- * Refresh buffers.
2100
- * @protected
2101
- */
2102
- _refresh() {
2103
- var i = this._changedBuffers.length;
2104
- while (i--) {
2105
- this._changedBuffers[i] = true;
2106
- }
2107
- }
2108
-
2109
- /**
2110
- * Updates render buffers.
2111
- * @protected
2112
- */
2113
- _update() {
2114
- if (this._renderNode) {
2115
- var i = this._changedBuffers.length;
2116
- while (i--) {
2117
- if (this._changedBuffers[i]) {
2118
- this._buffersUpdateCallbacks[i].call(this);
2119
- this._changedBuffers[i] = false;
2120
- }
2121
- }
2122
- }
2123
- }
2124
-
2125
- /**
2126
- * Clear GL buffers.
2127
- * @protected
2128
- */
2129
- _deleteBuffers() {
2130
- if (this._renderNode) {
2131
- var r = this._renderNode.renderer,
2132
- gl = r.handler.gl;
2133
-
2134
- gl.deleteBuffer(this._verticesHighBuffer);
2135
- gl.deleteBuffer(this._verticesLowBuffer);
2136
- gl.deleteBuffer(this._ordersBuffer);
2137
- gl.deleteBuffer(this._indexesBuffer);
2138
- gl.deleteBuffer(this._colorsBuffer);
2139
-
2140
- this._verticesHighBuffer = null;
2141
- this._verticesLowBuffer = null;
2142
- this._ordersBuffer = null;
2143
- this._indexesBuffer = null;
2144
- this._colorsBuffer = null;
2145
- }
2146
- }
2147
-
2148
- /**
2149
- * Creates gl main data buffer.
2150
- * @protected
2151
- */
2152
- _createVerticesBuffer() {
2153
- var h = this._renderNode.renderer.handler;
2154
-
2155
- let numItems = this._verticesHigh.length / 3;
2156
-
2157
- if (!this._verticesHighBuffer || this._verticesHighBuffer.numItems !== numItems) {
2158
- h.gl.deleteBuffer(this._verticesHighBuffer);
2159
- h.gl.deleteBuffer(this._verticesLowBuffer);
2160
- this._verticesHighBuffer = h.createStreamArrayBuffer(3, numItems);
2161
- this._verticesLowBuffer = h.createStreamArrayBuffer(3, numItems);
2162
- }
2163
-
2164
- this._verticesHigh = makeArrayTyped(this._verticesHigh);
2165
- this._verticesLow = makeArrayTyped(this._verticesLow);
2166
-
2167
- h.setStreamArrayBuffer(this._verticesHighBuffer, this._verticesHigh);
2168
- h.setStreamArrayBuffer(this._verticesLowBuffer, this._verticesLow);
2169
- }
2170
-
2171
- /**
2172
- * Creates gl index and order buffer.
2173
- * @protected
2174
- */
2175
- _createIndexBuffer() {
2176
- var h = this._renderNode.renderer.handler;
2177
- h.gl.deleteBuffer(this._ordersBuffer);
2178
- h.gl.deleteBuffer(this._indexesBuffer);
2179
-
2180
- this._orders = makeArrayTyped(this._orders);
2181
-
2182
- this._ordersBuffer = h.createArrayBuffer(this._orders, 1, this._orders.length / 2);
2183
-
2184
- this._indexes = makeArrayTyped(this._indexes, Uint32Array);
2185
-
2186
- this._indexesBuffer = h.createElementArrayBuffer(this._indexes, 1, this._indexes.length);
2187
- }
2188
-
2189
- _createColorsBuffer() {
2190
- var h = this._renderNode.renderer.handler;
2191
- h.gl.deleteBuffer(this._colorsBuffer);
2192
-
2193
- this._colors = makeArrayTyped(this._colors);
2194
-
2195
- this._colorsBuffer = h.createArrayBuffer(
2196
- new Float32Array(this._colors),
2197
- 4,
2198
- this._colors.length / 4
2199
- );
2200
- }
2201
- }
2202
-
2203
- export { Polyline };