@pirireis/webglobeplugins 0.15.34 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Math/angle-calculation.js +14 -13
- package/Math/arc-cdf-points.ts +329 -0
- package/Math/arc-generate-points-exponantial.ts +299 -0
- package/Math/arc.ts +299 -0
- package/Math/bounds/line-bbox.js +225 -186
- package/Math/circle-cdf-points.ts +143 -0
- package/Math/circle.ts +49 -0
- package/Math/constants.ts +12 -0
- package/Math/index.js +0 -1
- package/Math/juction/arc-plane.ts +129 -0
- package/Math/juction/line-sphere.ts +30 -0
- package/Math/juction/plane-plane.ts +64 -0
- package/Math/line.ts +84 -0
- package/Math/matrix4.ts +0 -0
- package/Math/mesh/mapbox-delaunay.js +607 -0
- package/Math/methods.ts +157 -0
- package/Math/plane.ts +92 -0
- package/Math/quaternion.ts +128 -0
- package/Math/roadmap.md +10 -0
- package/Math/templete-shapes/grid-visually-equal.ts +119 -0
- package/Math/types.ts +66 -0
- package/Math/utils.js +3 -2
- package/Math/vec3.ts +180 -0
- package/algorithms/search-binary.js +14 -16
- package/altitude-locator/adaptors.js +0 -1
- package/altitude-locator/keymethod.js +0 -1
- package/altitude-locator/plugin.js +446 -345
- package/altitude-locator/types.js +26 -21
- package/arrowfield/adaptor.js +11 -11
- package/arrowfield/index.js +3 -3
- package/arrowfield/plugin.js +128 -83
- package/bearing-line/index.js +2 -2
- package/bearing-line/plugin.js +520 -444
- package/circle-line-chain/chain-list-map.js +221 -201
- package/circle-line-chain/init.js +0 -1
- package/circle-line-chain/plugin.js +464 -411
- package/circle-line-chain/readme.md +57 -0
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +274 -230
- package/compass-rose/compass-text-writer.js +173 -149
- package/compass-rose/index.js +3 -3
- package/compassrose/compassrose.js +341 -293
- package/compassrose/index.js +2 -2
- package/depth-locator/readme.md +26 -0
- package/dist/Math/angle-calculation.js +13 -0
- package/dist/Math/bounds/line-bbox.js +186 -0
- package/dist/Math/mesh/mapbox-delaunay.js +544 -0
- package/dist/Math/utils.js +2 -0
- package/dist/algorithms/search-binary.js +16 -0
- package/dist/altitude-locator/adaptors.js +1 -0
- package/dist/altitude-locator/keymethod.js +1 -0
- package/dist/altitude-locator/plugin.js +345 -0
- package/dist/altitude-locator/types.js +21 -0
- package/dist/arrowfield/adaptor.js +11 -0
- package/dist/arrowfield/index.js +3 -0
- package/dist/arrowfield/plugin.js +83 -0
- package/dist/bearing-line/index.js +2 -0
- package/dist/bearing-line/plugin.js +444 -0
- package/dist/circle-line-chain/chain-list-map.js +201 -0
- package/dist/circle-line-chain/init.js +1 -0
- package/dist/circle-line-chain/plugin.js +411 -0
- package/dist/circle-line-chain/util.js +1 -0
- package/dist/compass-rose/compass-rose-padding-flat.js +230 -0
- package/dist/compass-rose/compass-text-writer.js +149 -0
- package/dist/compass-rose/index.js +3 -0
- package/dist/compassrose/compassrose.js +293 -0
- package/dist/compassrose/index.js +2 -0
- package/dist/heatwave/index.js +3 -0
- package/dist/heatwave/isobar/objectarraylabels.js +200 -0
- package/dist/heatwave/isobar/plugin.js +302 -0
- package/dist/heatwave/isobar/quadtreecontours.js +298 -0
- package/dist/heatwave/plugins/heatwaveglobeshell.js +204 -0
- package/dist/index.js +12 -0
- package/dist/jest.config.js +7 -0
- package/dist/partialrings/buffer-manager.js +75 -0
- package/dist/partialrings/index.js +2 -0
- package/dist/partialrings/plugin.js +128 -0
- package/dist/partialrings/program.js +279 -0
- package/dist/pin/pin-object-array.js +300 -0
- package/dist/pin/pin-point-totem.js +60 -0
- package/dist/point-heat-map/adaptors/timetracksplugin-format-to-this.js +63 -0
- package/dist/point-heat-map/index.js +1 -0
- package/dist/point-heat-map/plugin-webworker.js +121 -0
- package/dist/point-heat-map/point-to-heat-map-flow.js +124 -0
- package/dist/point-tracks/key-methods.js +2 -0
- package/dist/point-tracks/plugin.js +393 -0
- package/dist/programs/arrowfield/index.js +2 -0
- package/dist/programs/arrowfield/logic.js +254 -0
- package/dist/programs/arrowfield/object.js +60 -0
- package/dist/programs/data2legend/density-to-legend.js +98 -0
- package/dist/programs/data2legend/point-to-density-texture.js +97 -0
- package/dist/programs/float2legendwithratio/index.js +2 -0
- package/dist/programs/float2legendwithratio/logic.js +167 -0
- package/dist/programs/float2legendwithratio/object.js +104 -0
- package/dist/programs/globe-util/is-globe-moved.js +19 -0
- package/dist/programs/globeshell/index.js +2 -0
- package/dist/programs/globeshell/wiggle/index.js +2 -0
- package/dist/programs/globeshell/wiggle/logic.js +342 -0
- package/dist/programs/globeshell/wiggle/object.js +66 -0
- package/dist/programs/helpers/blender/index.js +1 -0
- package/dist/programs/helpers/blender/program.js +76 -0
- package/dist/programs/helpers/fadeaway/index.js +2 -0
- package/dist/programs/helpers/fadeaway/logic.js +69 -0
- package/dist/programs/helpers/fadeaway/object.js +14 -0
- package/dist/programs/helpers/index.js +2 -0
- package/dist/programs/index.js +9 -0
- package/dist/programs/line-on-globe/circle-accurate-3d.js +138 -0
- package/dist/programs/line-on-globe/circle-accurate-flat.js +210 -0
- package/dist/programs/line-on-globe/degree-padding-around-circle-3d.js +156 -0
- package/dist/programs/line-on-globe/index.js +1 -0
- package/dist/programs/line-on-globe/lines-color-instanced-flat.js +131 -0
- package/dist/programs/line-on-globe/util.js +5 -0
- package/dist/programs/picking/pickable-polygon-renderer.js +184 -0
- package/dist/programs/picking/pickable-renderer.js +184 -0
- package/dist/programs/point-on-globe/element-globe-surface-glow.js +138 -0
- package/dist/programs/point-on-globe/element-point-glow.js +150 -0
- package/dist/programs/point-on-globe/square-pixel-point.js +171 -0
- package/dist/programs/polygon-on-globe/texture-dem-triangle-test-plugin.js +97 -0
- package/dist/programs/polygon-on-globe/texture-dem-triangles.js +167 -0
- package/dist/programs/rings/distancering/circleflatprogram.js +116 -0
- package/dist/programs/rings/distancering/circlepaddingfreeangleprogram.js +326 -0
- package/dist/programs/rings/distancering/circlepaddysharedbuffer.js +368 -0
- package/dist/programs/rings/distancering/index.js +6 -0
- package/dist/programs/rings/distancering/paddyflatprogram.js +127 -0
- package/dist/programs/rings/distancering/paddyflatprogram2d.js +129 -0
- package/dist/programs/rings/distancering/paddyflatprogram3d.js +128 -0
- package/dist/programs/rings/index.js +1 -0
- package/dist/programs/totems/gpu-selection-uniform-block.js +104 -0
- package/dist/programs/two-d/pixel-circle.js +1 -0
- package/dist/programs/two-d/pixel-padding-for-compass.js +159 -0
- package/dist/programs/util.js +14 -0
- package/dist/programs/vectorfields/index.js +3 -0
- package/dist/programs/vectorfields/logics/drawrectangleparticles.js +113 -0
- package/dist/programs/vectorfields/logics/index.js +2 -0
- package/dist/programs/vectorfields/logics/pixelbased.js +140 -0
- package/dist/programs/vectorfields/logics/ubo.js +60 -0
- package/dist/programs/vectorfields/pingpongbuffermanager.js +73 -0
- package/dist/rangerings/index.js +5 -0
- package/dist/rangerings/plugin.js +543 -0
- package/dist/rangerings/rangeringangletext.js +326 -0
- package/dist/rangerings/ring-account.js +112 -0
- package/dist/semiplugins/shape-on-terrain/terrain-cover/texture-dem-cover.js +1 -0
- package/dist/shaders/fragment-toy/firework.js +55 -0
- package/dist/shaders/fragment-toy/singularity.js +56 -0
- package/dist/timetracks/adaptors-line-strip.js +65 -0
- package/dist/timetracks/index.js +1 -0
- package/dist/timetracks/plugin-line-strip.js +240 -0
- package/dist/timetracks/program-line-strip.js +608 -0
- package/dist/timetracks/programpoint-line-strip.js +151 -0
- package/dist/util/account/bufferoffsetmanager.js +176 -0
- package/dist/util/account/index.js +3 -0
- package/dist/util/account/util.js +18 -0
- package/dist/util/algorithms/index.js +1 -0
- package/dist/util/algorithms/search-binary.js +25 -0
- package/dist/util/check/index.js +1 -0
- package/dist/util/gl-util/uniform-block/shader.js +1 -0
- package/dist/util/heatwavedatamanager/datamanager.js +149 -0
- package/dist/util/heatwavedatamanager/index.js +2 -0
- package/dist/util/index.js +13 -0
- package/dist/util/interpolation/index.js +1 -0
- package/dist/util/interpolation/timetrack/index.js +2 -0
- package/dist/util/interpolation/timetrack/timetrack-interpolator.js +79 -0
- package/dist/util/interpolation/timetrack/web-worker.js +46 -0
- package/dist/util/jshelpers/data-filler.js +17 -0
- package/dist/util/jshelpers/equality.js +18 -0
- package/dist/util/jshelpers/index.js +2 -0
- package/dist/util/jshelpers/timefilters.js +30 -0
- package/dist/util/picking/fence.js +43 -0
- package/dist/util/picking/picker-displayer.js +136 -0
- package/dist/util/programs/draw-texture-on-canvas.js +86 -0
- package/dist/util/programs/index.js +1 -0
- package/dist/util/programs/shapesonglobe.js +210 -0
- package/dist/util/programs/supersampletotextures.js +109 -0
- package/dist/util/programs/texturetoglobe.js +179 -0
- package/dist/util/shaderfunctions/index.js +2 -0
- package/dist/util/shaderfunctions/nodata.js +8 -0
- package/dist/util/shaderfunctions/noisefunctions.js +41 -0
- package/dist/util/surface-line-data/arcs-to-cuts.js +50 -0
- package/dist/util/surface-line-data/cut-arc.js +1 -0
- package/dist/util/surface-line-data/rbush-manager.js +1 -0
- package/dist/util/surface-line-data/types.js +1 -0
- package/dist/util/surface-line-data/web-worker.js +1 -0
- package/dist/util/webglobe/gldefaultstates.js +4 -0
- package/dist/util/webglobe/index.js +2 -0
- package/dist/util/webglobe/rasteroverlay.js +75 -0
- package/dist/waveparticles/adaptor.js +15 -0
- package/dist/waveparticles/index.js +3 -0
- package/dist/waveparticles/plugin.js +290 -0
- package/dist/wind/imagetovectorfieldandmagnitude.js +56 -0
- package/dist/wind/index.js +5 -0
- package/dist/wind/plugin.js +921 -0
- package/dist/wind/vectorfieldimage.js +23 -0
- package/dist/write-text/attached-text-writer.js +87 -0
- package/dist/write-text/context-text-bulk.js +185 -0
- package/dist/write-text/context-text.js +94 -0
- package/dist/write-text/context-text3old.js +152 -0
- package/dist/write-text/index.js +1 -0
- package/dist/write-text/writer-plugin.js +8 -0
- package/heatwave/index.js +4 -3
- package/heatwave/isobar/objectarraylabels.js +247 -200
- package/heatwave/isobar/plugin.js +339 -302
- package/heatwave/isobar/quadtreecontours.js +336 -298
- package/heatwave/plugins/heatwaveglobeshell.js +259 -204
- package/index.js +15 -12
- package/jest.config.js +6 -7
- package/package.json +6 -2
- package/partialrings/buffer-manager.js +89 -75
- package/partialrings/goals.md +17 -0
- package/partialrings/index.js +3 -2
- package/partialrings/plugin.js +160 -128
- package/partialrings/program.js +233 -188
- package/pin/pin-object-array.js +381 -300
- package/pin/pin-point-totem.js +77 -60
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +78 -63
- package/point-heat-map/index.js +0 -1
- package/point-heat-map/plugin-webworker.js +148 -121
- package/point-heat-map/point-to-heat-map-flow.js +150 -124
- package/point-heat-map/readme.md +15 -0
- package/point-tracks/key-methods.js +3 -2
- package/point-tracks/plugin.js +480 -393
- package/programs/arrowfield/index.js +2 -2
- package/programs/arrowfield/logic.js +173 -141
- package/programs/arrowfield/object.js +89 -60
- package/programs/data2legend/density-to-legend.js +90 -73
- package/programs/data2legend/point-to-density-texture.js +87 -70
- package/programs/float2legendwithratio/index.js +3 -2
- package/programs/float2legendwithratio/logic.js +144 -118
- package/programs/float2legendwithratio/object.js +141 -104
- package/programs/globe-util/is-globe-moved.js +27 -19
- package/programs/globeshell/index.js +2 -2
- package/programs/globeshell/wiggle/index.js +3 -2
- package/programs/globeshell/wiggle/logic.js +272 -243
- package/programs/globeshell/wiggle/object.js +93 -66
- package/programs/helpers/blender/index.js +0 -1
- package/programs/helpers/blender/program.js +73 -58
- package/programs/helpers/fadeaway/index.js +3 -2
- package/programs/helpers/fadeaway/logic.js +53 -46
- package/programs/helpers/fadeaway/object.js +20 -14
- package/programs/helpers/index.js +2 -2
- package/programs/index.js +21 -9
- package/programs/line-on-globe/circle-accurate-3d.js +115 -87
- package/programs/line-on-globe/circle-accurate-flat.js +201 -149
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +136 -104
- package/programs/line-on-globe/index.js +0 -1
- package/programs/line-on-globe/lines-color-instanced-flat.js +102 -83
- package/programs/line-on-globe/linestrip/data.ts +29 -0
- package/programs/line-on-globe/linestrip/linestrip.ts +201 -0
- package/programs/line-on-globe/naive-accurate-flexible.ts +258 -0
- package/programs/line-on-globe/util.js +8 -5
- package/programs/picking/pickable-polygon-renderer.js +215 -0
- package/programs/picking/pickable-renderer.js +129 -98
- package/programs/point-on-globe/element-globe-surface-glow.js +122 -93
- package/programs/point-on-globe/element-point-glow.js +114 -80
- package/programs/point-on-globe/square-pixel-point.js +138 -120
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin.ts +120 -0
- package/programs/polygon-on-globe/texture-dem-triangles.ts +207 -0
- package/programs/programcache.ts +131 -0
- package/programs/rings/distancering/circleflatprogram.js +138 -116
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +323 -275
- package/programs/rings/distancering/circlepaddysharedbuffer.js +423 -368
- package/programs/rings/distancering/index.js +5 -6
- package/programs/rings/distancering/paddyflatprogram.js +148 -127
- package/programs/rings/distancering/paddyflatprogram2d.js +153 -129
- package/programs/rings/distancering/paddyflatprogram3d.js +149 -128
- package/programs/rings/index.js +1 -1
- package/programs/rings/partial-ring/piece-of-pie.ts +323 -0
- package/programs/totems/camerauniformblock.ts +310 -0
- package/programs/totems/canvas-webglobe-info.ts +156 -0
- package/programs/totems/globe-changes.ts +79 -0
- package/programs/totems/gpu-selection-uniform-block.js +127 -99
- package/programs/totems/index.ts +2 -0
- package/programs/two-d/pixel-circle.js +0 -1
- package/programs/two-d/pixel-padding-for-compass.js +112 -97
- package/programs/util.js +19 -14
- package/programs/vectorfields/index.js +3 -3
- package/programs/vectorfields/logics/constants.ts +5 -0
- package/programs/vectorfields/logics/drawrectangleparticles.js +78 -58
- package/programs/vectorfields/logics/index.js +4 -2
- package/programs/vectorfields/logics/pixelbased.js +92 -73
- package/programs/vectorfields/logics/ubo-new.ts +37 -0
- package/programs/vectorfields/logics/ubo.js +57 -51
- package/programs/vectorfields/pingpongbuffermanager.js +80 -73
- package/publish.bat +62 -0
- package/range-tools-on-terrain/bearing-line/adapters.ts +154 -0
- package/range-tools-on-terrain/bearing-line/plugin.ts +569 -0
- package/range-tools-on-terrain/bearing-line/types.ts +65 -0
- package/range-tools-on-terrain/circle-line-chain/adapters.ts +109 -0
- package/range-tools-on-terrain/circle-line-chain/chain-list-map.ts +446 -0
- package/range-tools-on-terrain/circle-line-chain/plugin.ts +607 -0
- package/range-tools-on-terrain/circle-line-chain/types.ts +43 -0
- package/range-tools-on-terrain/range-ring/adapters.ts +114 -0
- package/range-tools-on-terrain/range-ring/enum.ts +2 -0
- package/range-tools-on-terrain/range-ring/plugin.ts +447 -0
- package/range-tools-on-terrain/range-ring/rangeringangletext.ts +396 -0
- package/range-tools-on-terrain/range-ring/types.ts +30 -0
- package/rangerings/enum.ts +2 -0
- package/rangerings/index.js +5 -5
- package/rangerings/plugin.js +644 -543
- package/rangerings/rangeringangletext.js +369 -326
- package/rangerings/ring-account.js +129 -112
- package/semiplugins/interface.ts +14 -0
- package/semiplugins/lightweight/line-plugin.ts +343 -0
- package/semiplugins/lightweight/piece-of-pie-plugin.ts +275 -0
- package/semiplugins/shape-on-terrain/arc-plugin.ts +602 -0
- package/semiplugins/shape-on-terrain/circle-plugin.ts +588 -0
- package/semiplugins/shape-on-terrain/goal.md +12 -0
- package/semiplugins/shape-on-terrain/padding-1-degree.ts +714 -0
- package/semiplugins/shape-on-terrain/terrain-cover/notes.md +90 -0
- package/semiplugins/shape-on-terrain/terrain-cover/texture-dem-cover.ts +0 -0
- package/semiplugins/type.ts +8 -0
- package/shaders/fragment-toy/firework.js +1 -1
- package/shaders/fragment-toy/singularity.js +5 -2
- package/tests/Math/arc-sampling-test.js +367 -0
- package/tests/Math/arc-sampling-test.ts +429 -0
- package/tests/Math/arc.test.ts +102 -0
- package/tests/Math/junction/arc-plane.test.ts +163 -0
- package/tests/Math/junction/plane-plane.test.ts +91 -0
- package/tests/Math/plane-test.ts +17 -0
- package/tests/Math/plane.test.ts +43 -0
- package/tests/Math/vec3.test.ts +14 -0
- package/timetracks/adaptors-line-strip.js +80 -65
- package/timetracks/index.js +0 -1
- package/timetracks/plugin-line-strip.js +295 -240
- package/timetracks/program-line-strip.js +491 -411
- package/timetracks/programpoint-line-strip.js +122 -98
- package/timetracks/readme.md +1 -0
- package/tsconfig.json +22 -0
- package/types.ts +265 -0
- package/util/account/bufferoffsetmanager.js +209 -176
- package/util/account/create-buffermap-orchastration.ts +85 -0
- package/util/account/index.js +6 -3
- package/util/account/single-attribute-buffer-management/buffer-manager.ts +149 -0
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +332 -0
- package/util/account/single-attribute-buffer-management/buffer-orchestrator1.ts +184 -0
- package/util/account/single-attribute-buffer-management/index.ts +11 -0
- package/util/account/single-attribute-buffer-management/object-store.ts +76 -0
- package/util/account/single-attribute-buffer-management/types.ts +43 -0
- package/util/account/util.js +22 -18
- package/util/algorithms/index.js +0 -1
- package/util/algorithms/search-binary.js +26 -25
- package/util/build-strategy/general-strategy.ts +99 -0
- package/util/build-strategy/static-dynamic.ts +50 -0
- package/util/check/index.js +0 -1
- package/util/check/typecheck.ts +74 -0
- package/util/frame-counter-trigger.ts +99 -0
- package/util/geometry/index.ts +64 -0
- package/util/gl-util/buffer/attribute-loader.ts +84 -0
- package/util/gl-util/buffer/index.ts +6 -0
- package/util/gl-util/draw-options/methods.ts +47 -0
- package/util/gl-util/uniform-block/manager.ts +210 -0
- package/util/gl-util/uniform-block/roadmap.md +70 -0
- package/util/gl-util/uniform-block/shader.js +0 -1
- package/util/gl-util/uniform-block/types.ts +20 -0
- package/util/heatwavedatamanager/datamanager.js +168 -149
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordsmeta.ts +28 -0
- package/util/heatwavedatamanager/texture-point-sampler.ts +198 -0
- package/util/index.js +13 -13
- package/util/interpolation/index.js +0 -1
- package/util/interpolation/timetrack/index.js +9 -2
- package/util/interpolation/timetrack/timetrack-interpolator.js +94 -79
- package/util/interpolation/timetrack/web-worker.js +51 -46
- package/util/jshelpers/data-filler.js +19 -17
- package/util/jshelpers/equality.js +17 -18
- package/util/jshelpers/index.js +1 -2
- package/util/jshelpers/timefilters.js +32 -30
- package/util/picking/fence.js +46 -43
- package/util/picking/picker-displayer.js +177 -136
- package/util/programs/draw-texture-on-canvas.js +82 -66
- package/util/programs/index.js +1 -1
- package/util/programs/shapesonglobe.js +203 -167
- package/util/programs/supersampletotextures.js +132 -99
- package/util/programs/texturetoglobe.js +152 -128
- package/util/shaderfunctions/geometrytransformations.ts +388 -0
- package/util/shaderfunctions/index.js +2 -2
- package/util/shaderfunctions/nodata.js +4 -2
- package/util/shaderfunctions/noisefunctions.js +10 -7
- package/util/surface-line-data/arc-bboxes.ts +42 -0
- package/util/surface-line-data/arcs-to-cuts.js +74 -50
- package/util/surface-line-data/cut-arc.js +0 -1
- package/util/surface-line-data/flow.ts +52 -0
- package/util/surface-line-data/rbush-manager.js +0 -1
- package/util/surface-line-data/types.ts +27 -0
- package/util/surface-line-data/web-worker.js +0 -1
- package/util/webglobe/gldefaultstates.js +5 -4
- package/util/webglobe/index.js +2 -2
- package/util/webglobe/rasteroverlay.js +96 -75
- package/util/webglobjectbuilders.ts +446 -0
- package/waveparticles/adaptor.js +16 -15
- package/waveparticles/index.js +3 -3
- package/waveparticles/plugin.js +342 -290
- package/wind/imagetovectorfieldandmagnitude.js +71 -56
- package/wind/index.js +5 -5
- package/wind/plugin.js +845 -670
- package/wind/vectorfieldimage.js +27 -23
- package/write-text/attached-text-writer.js +105 -87
- package/write-text/context-text-bulk.ts +268 -0
- package/write-text/context-text.js +125 -94
- package/write-text/context-text3.ts +253 -0
- package/write-text/context-text3old.js +179 -152
- package/write-text/context-text4.ts +243 -0
- package/write-text/index.js +1 -1
- package/write-text/writer-plugin.js +7 -8
- package/Math/frustum/camera.js +0 -24
- package/Math/frustum/from-globeinfo.js +0 -48
- package/util/account/single-attribute-buffer-management/types.js +0 -1
- /package/{Math → dist/Math}/arc-cdf-points.js +0 -0
- /package/{Math → dist/Math}/arc-generate-points-exponantial.js +0 -0
- /package/{Math → dist/Math}/arc.js +0 -0
- /package/{Math → dist/Math}/circle-cdf-points.js +0 -0
- /package/{Math → dist/Math}/circle.js +0 -0
- /package/{Math → dist/Math}/constants.js +0 -0
- /package/{Math/matrix4.js → dist/Math/index.js} +0 -0
- /package/{Math → dist/Math}/juction/arc-plane.js +0 -0
- /package/{Math → dist/Math}/juction/line-sphere.js +0 -0
- /package/{Math → dist/Math}/juction/plane-plane.js +0 -0
- /package/{Math → dist/Math}/line.js +0 -0
- /package/{util/surface-line-data/types.js → dist/Math/matrix4.js} +0 -0
- /package/{Math → dist/Math}/methods.js +0 -0
- /package/{Math → dist/Math}/plane.js +0 -0
- /package/{Math → dist/Math}/quaternion.js +0 -0
- /package/{Math → dist/Math}/templete-shapes/grid-visually-equal.js +0 -0
- /package/{Math/frustum → dist/Math}/types.js +0 -0
- /package/{Math → dist/Math}/vec3.js +0 -0
- /package/{programs → dist/programs}/line-on-globe/linestrip/data.js +0 -0
- /package/{programs → dist/programs}/line-on-globe/linestrip/linestrip.js +0 -0
- /package/{programs → dist/programs}/line-on-globe/naive-accurate-flexible.js +0 -0
- /package/{programs → dist/programs}/programcache.js +0 -0
- /package/{programs → dist/programs}/rings/partial-ring/piece-of-pie.js +0 -0
- /package/{programs → dist/programs}/totems/camerauniformblock.js +0 -0
- /package/{programs → dist/programs}/totems/canvas-webglobe-info.js +0 -0
- /package/{programs → dist/programs}/totems/globe-changes.js +0 -0
- /package/{programs → dist/programs}/totems/index.js +0 -0
- /package/{programs → dist/programs}/vectorfields/logics/constants.js +0 -0
- /package/{programs → dist/programs}/vectorfields/logics/ubo-new.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/bearing-line/adapters.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/bearing-line/plugin.js +0 -0
- /package/{Math → dist/range-tools-on-terrain/bearing-line}/types.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/circle-line-chain/adapters.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/circle-line-chain/chain-list-map.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/circle-line-chain/plugin.js +0 -0
- /package/{range-tools-on-terrain/bearing-line → dist/range-tools-on-terrain/circle-line-chain}/types.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/range-ring/adapters.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/range-ring/enum.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/range-ring/plugin.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/range-ring/rangeringangletext.js +0 -0
- /package/{range-tools-on-terrain → dist/range-tools-on-terrain}/range-ring/types.js +0 -0
- /package/{rangerings → dist/rangerings}/enum.js +0 -0
- /package/{semiplugins → dist/semiplugins}/interface.js +0 -0
- /package/{semiplugins → dist/semiplugins}/lightweight/line-plugin.js +0 -0
- /package/{semiplugins → dist/semiplugins}/lightweight/piece-of-pie-plugin.js +0 -0
- /package/{semiplugins → dist/semiplugins}/shape-on-terrain/arc-plugin.js +0 -0
- /package/{semiplugins → dist/semiplugins}/shape-on-terrain/circle-plugin.js +0 -0
- /package/{semiplugins → dist/semiplugins}/shape-on-terrain/padding-1-degree.js +0 -0
- /package/{semiplugins → dist/semiplugins}/type.js +0 -0
- /package/{types.js → dist/types.js} +0 -0
- /package/{util → dist/util}/account/create-buffermap-orchastration.js +0 -0
- /package/{util → dist/util}/account/single-attribute-buffer-management/buffer-manager.js +0 -0
- /package/{util → dist/util}/account/single-attribute-buffer-management/buffer-orchestrator.js +0 -0
- /package/{util → dist/util}/account/single-attribute-buffer-management/buffer-orchestrator1.js +0 -0
- /package/{util → dist/util}/account/single-attribute-buffer-management/index.js +0 -0
- /package/{util → dist/util}/account/single-attribute-buffer-management/object-store.js +0 -0
- /package/{range-tools-on-terrain/circle-line-chain → dist/util/account/single-attribute-buffer-management}/types.js +0 -0
- /package/{util → dist/util}/build-strategy/general-strategy.js +0 -0
- /package/{util → dist/util}/build-strategy/static-dynamic.js +0 -0
- /package/{util → dist/util}/check/typecheck.js +0 -0
- /package/{util → dist/util}/frame-counter-trigger.js +0 -0
- /package/{util → dist/util}/geometry/index.js +0 -0
- /package/{util → dist/util}/gl-util/buffer/attribute-loader.js +0 -0
- /package/{util → dist/util}/gl-util/buffer/index.js +0 -0
- /package/{util → dist/util}/gl-util/draw-options/methods.js +0 -0
- /package/{util → dist/util}/gl-util/uniform-block/manager.js +0 -0
- /package/{util → dist/util}/gl-util/uniform-block/types.js +0 -0
- /package/{util → dist/util}/heatwavedatamanager/pointcoordsmeta.js +0 -0
- /package/{util → dist/util}/heatwavedatamanager/texture-point-sampler.js +0 -0
- /package/{util → dist/util}/shaderfunctions/geometrytransformations.js +0 -0
- /package/{util → dist/util}/surface-line-data/arc-bboxes.js +0 -0
- /package/{util → dist/util}/surface-line-data/flow.js +0 -0
- /package/{util → dist/util}/webglobjectbuilders.js +0 -0
- /package/{write-text → dist/write-text}/context-text3.js +0 -0
- /package/{write-text → dist/write-text}/context-text4.js +0 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef RangeRingData
|
|
3
|
+
* @property {number} centerX
|
|
4
|
+
* @property {number} centerY
|
|
5
|
+
* @property {Array<Ring>} rings
|
|
6
|
+
*
|
|
7
|
+
* @typedef Ring
|
|
8
|
+
* @property {number} radius
|
|
9
|
+
* @property {number} padding
|
|
10
|
+
* @property {[number, number, number]} color
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
* @method insertBulk
|
|
14
|
+
* @typedef {Array<{ringID, radius, padding}>} rings
|
|
15
|
+
* @param {Array<centerID:string, x:number, y:number, stepAngle:number, rgba:[4 numbers], rings:rings} items
|
|
16
|
+
|
|
17
|
+
* @method updateCentersCoordinate @param {Array<{centerID, long,lat}>} items
|
|
18
|
+
* @method updateCentersColor @param {Array<{centerID, rgba:[4 numbers]}>} centerColors
|
|
19
|
+
*
|
|
20
|
+
* @method updateCentersHide @param {Array<{centerID, hide, textHide}>} centerHides
|
|
21
|
+
* @method removeCenters @param {Array<{centerID}>} centerIds
|
|
22
|
+
* @method setOpacity @param {number} opacity
|
|
23
|
+
*
|
|
24
|
+
* @method setOneDegreePaddingOn // performance consuming, might be removed
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
import { centerCoords2dflatDataCreatorWithRadius, CircleCache as CircleCache2D } from "../programs/line-on-globe/circle-accurate-flat";
|
|
28
|
+
import { CircleCache as CircleCache3D } from "../programs/line-on-globe/circle-accurate-3d";
|
|
29
|
+
import { LinesColorInstancedFlatCache } from "../programs/line-on-globe/lines-color-instanced-flat";
|
|
30
|
+
import { BufferOrchestrator, BufferManager } from "../util/account";
|
|
31
|
+
// import { mapGetOrThrow } from "../util/check/get";
|
|
32
|
+
import { populateFloat32Array } from "../util/jshelpers/data-filler";
|
|
33
|
+
import { RingAccount, ringBigPaddingKeyMethod, ringKeyMethod } from "./ring-account";
|
|
34
|
+
import { CirclePadding3DCache } from "../programs/line-on-globe/degree-padding-around-circle-3d";
|
|
35
|
+
import { LineOnGlobeCache } from '../programs/line-on-globe/naive-accurate-flexible';
|
|
36
|
+
import RangeRingAngleText from "./rangeringangletext";
|
|
37
|
+
import { Z_ALPHA_MODE } from "../programs/line-on-globe/util";
|
|
38
|
+
import { ENUM_HIDE } from "./enum";
|
|
39
|
+
import { opacityCheck, mapGetOrThrow } from "../util/check/typecheck";
|
|
40
|
+
import { sphereCoord } from "../util/geometry/index";
|
|
41
|
+
const CIRCLE_FLAT_EDGE_COUNT = 362; // 360 + 2 for closing the circle and a cutting point
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* @typedef {string} centerID
|
|
46
|
+
*
|
|
47
|
+
* @typedef {Object} RangeRing
|
|
48
|
+
* @property {string} ringID
|
|
49
|
+
* @property {number} radius in range meters
|
|
50
|
+
* @property {number} padding badding range in meter
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* Array < centerID: string, long: number, lat: number, stepAngle: number, rgba: [4 numbers], rings: rings, hide, textHide
|
|
54
|
+
* @typedef {Object} RangeRingsItem
|
|
55
|
+
* @property {centerID} centerID
|
|
56
|
+
* @property {number} long
|
|
57
|
+
* @property {number} lat
|
|
58
|
+
* @property {number} stepAngle
|
|
59
|
+
* @property {number} altitude
|
|
60
|
+
* @property {number} hide
|
|
61
|
+
* @property {number} textHide
|
|
62
|
+
* @property {number} rgba
|
|
63
|
+
* @property {Array<RangeRing>} rings
|
|
64
|
+
*/
|
|
65
|
+
class RangeRings {
|
|
66
|
+
constructor(id, { oneDegreePadding = true, showNumbers = true, numbersStyle = null, opacity = 1, zAlphaOnDegreePadding = Z_ALPHA_MODE.ON } = {}, { textDataPreAdaptor = null, textWritersMap = new Map() } = {}) {
|
|
67
|
+
this.id = id;
|
|
68
|
+
this._oneDegreePadding = oneDegreePadding;
|
|
69
|
+
this._zAlphaOnDegreePadding = zAlphaOnDegreePadding;
|
|
70
|
+
this._showNumbers = showNumbers;
|
|
71
|
+
this._numbersStyle = numbersStyle;
|
|
72
|
+
this._opacity = opacity;
|
|
73
|
+
this._ringAccount = new RingAccount();
|
|
74
|
+
this._textWritersMap = textWritersMap;
|
|
75
|
+
this._textDataPreAdaptor = textDataPreAdaptor;
|
|
76
|
+
this._textWritersMap.forEach((textWriter) => textWriter.setKeyAdaptor((item) => item.__identity__));
|
|
77
|
+
}
|
|
78
|
+
// USER API
|
|
79
|
+
/**
|
|
80
|
+
* @method updateCentersCoordinate @param { Array < { centerID, long,lat } >} items
|
|
81
|
+
*/
|
|
82
|
+
updateCentersCoordinate(items, { textWriterIDs = [] } = {}) {
|
|
83
|
+
// Algorithm
|
|
84
|
+
/**
|
|
85
|
+
* 1. ask centerRingAccount for existing rings COORDINATE RELATED KEYS
|
|
86
|
+
* 2. update centers
|
|
87
|
+
* 3. update buffer orchestators
|
|
88
|
+
*/
|
|
89
|
+
this._ringAccount.updateCentersCoordinate(items);
|
|
90
|
+
const { globe, bufferOrchestrator, bufferManagersCompMap, paddingBufferOrchestrator, bufferManagersCompMapPadding } = this;
|
|
91
|
+
for (const { centerID } of items) {
|
|
92
|
+
const datas = this.__reconstructCentralRings(centerID);
|
|
93
|
+
bufferOrchestrator.updateBulk(datas, bufferManagersCompMap, ["centerCoords3d", "centerCoords2dflat", "targetCoords3d", "centerCoords2dflatForPadding"]);
|
|
94
|
+
const paddingDatas = this.__reconstructCentralRingsBigPaddings(centerID);
|
|
95
|
+
paddingBufferOrchestrator.updateBulk(paddingDatas, bufferManagersCompMapPadding, ["circlePoint2d", "paddingPoint2d", "circlePoint3d", "paddingPoint3d"]);
|
|
96
|
+
}
|
|
97
|
+
this.paddingTextPlugin?.updateCentersXY(items);
|
|
98
|
+
this.__contextTextWriterUpdate(items.map(({ centerID }) => centerID), textWriterIDs);
|
|
99
|
+
globe.DrawRender();
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @method insertBulk
|
|
103
|
+
* @param { Array < RangeRingsItem> } items
|
|
104
|
+
*/
|
|
105
|
+
insertBulk(items, { textWriterIDs = [] } = {}) {
|
|
106
|
+
// Algorithm
|
|
107
|
+
/**
|
|
108
|
+
* 1 ask centerRingAccount for existing rings
|
|
109
|
+
* 2. delete all existing keys with buffer orchestators
|
|
110
|
+
* 3. insert new centerRings to centerRingAccount
|
|
111
|
+
* 4. insert new keys with buffer orchestators
|
|
112
|
+
*/
|
|
113
|
+
const { globe, _ringAccount, bufferOrchestrator, bufferManagersCompMap, paddingBufferOrchestrator, bufferManagersCompMapPadding } = this;
|
|
114
|
+
for (const item of items) {
|
|
115
|
+
const existingKeys = _ringAccount.ringKeys(item.centerID);
|
|
116
|
+
if (existingKeys.length) {
|
|
117
|
+
bufferOrchestrator.deleteBulk(existingKeys, bufferManagersCompMap);
|
|
118
|
+
}
|
|
119
|
+
const paddingKeys = _ringAccount.ringBigPaddingKeys(item.centerID);
|
|
120
|
+
if (paddingKeys.length) {
|
|
121
|
+
paddingBufferOrchestrator.deleteBulk(paddingKeys, bufferManagersCompMapPadding);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (const item of items) {
|
|
125
|
+
_ringAccount.insertCenter(item);
|
|
126
|
+
const datas = this.__reconstructCentralRings(item.centerID);
|
|
127
|
+
bufferOrchestrator.insertBulk(datas, bufferManagersCompMap);
|
|
128
|
+
const paddingDatas = this.__reconstructCentralRingsBigPaddings(item.centerID);
|
|
129
|
+
paddingBufferOrchestrator.insertBulk(paddingDatas, bufferManagersCompMapPadding);
|
|
130
|
+
}
|
|
131
|
+
this.paddingTextPlugin?.insertBulk(items);
|
|
132
|
+
this.__contextTextWriterUpdate(items.map(({ centerID }) => centerID), textWriterIDs);
|
|
133
|
+
globe.DrawRender();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @method updateCentersColor @param { Array < { centerID, rgba: [4 numbers] } >} centerColors
|
|
137
|
+
*/
|
|
138
|
+
updateCentersColor(centerColors, { textWriterIDs = [] } = {}) {
|
|
139
|
+
// Algorithm
|
|
140
|
+
/**
|
|
141
|
+
* 1. ask centerRingAccount for existing rings COLOR KEYS
|
|
142
|
+
* 2. update centers
|
|
143
|
+
* 3. update buffer orchestators
|
|
144
|
+
*/
|
|
145
|
+
this._ringAccount.updateCentersColor(centerColors);
|
|
146
|
+
const { globe, bufferOrchestrator, bufferManagersCompMap, paddingBufferOrchestrator, bufferManagersCompMapPadding } = this;
|
|
147
|
+
for (const { centerID } of centerColors) {
|
|
148
|
+
const datas = this.__reconstructCentralProperties(centerID);
|
|
149
|
+
bufferOrchestrator.updateBulk(datas, bufferManagersCompMap, ["rgba", "rgbaMercator"]);
|
|
150
|
+
const paddingDatas = this.__reconstructCentralPaddingProperties(centerID);
|
|
151
|
+
paddingBufferOrchestrator.updateBulk(paddingDatas, bufferManagersCompMapPadding, ["rgba"]);
|
|
152
|
+
}
|
|
153
|
+
this.__contextTextWriterUpdate(centerColors.map(({ centerID }) => centerID), textWriterIDs);
|
|
154
|
+
globe.DrawRender();
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
*
|
|
158
|
+
* @method updateCentersHide @param { Array < { centerID, hide, textHide } >} centerHides
|
|
159
|
+
*/
|
|
160
|
+
updateCentersHide(centerHides, { textWriterIDs = [] } = {}) {
|
|
161
|
+
// Algorithm
|
|
162
|
+
/**
|
|
163
|
+
* Simple
|
|
164
|
+
* 1. update centers
|
|
165
|
+
* 2. reconstruct data,
|
|
166
|
+
* 3. update color buffer
|
|
167
|
+
* */
|
|
168
|
+
this._ringAccount.updateCentersHide(centerHides);
|
|
169
|
+
const { globe, bufferOrchestrator, bufferManagersCompMap, paddingBufferOrchestrator, bufferManagersCompMapPadding } = this;
|
|
170
|
+
for (const { centerID } of centerHides) {
|
|
171
|
+
const datas = this.__reconstructCentralProperties(centerID);
|
|
172
|
+
bufferOrchestrator.updateBulk(datas, bufferManagersCompMap, ["rgba", "rgbaMercator"]);
|
|
173
|
+
const paddingDatas0 = this.__reconstructCentralRings(centerID);
|
|
174
|
+
bufferOrchestrator.updateBulk(paddingDatas0, bufferManagersCompMap, ["radius3dsmall", "centerCoords2dflatForPadding"]);
|
|
175
|
+
const paddingDatas = this.__reconstructCentralPaddingProperties(centerID);
|
|
176
|
+
paddingBufferOrchestrator.updateBulk(paddingDatas, bufferManagersCompMapPadding, ["rgba"]);
|
|
177
|
+
}
|
|
178
|
+
this.paddingTextPlugin?.updateCentersHide(centerHides);
|
|
179
|
+
this.__contextTextWriterUpdate(centerHides.map(({ centerID }) => centerID), textWriterIDs);
|
|
180
|
+
globe.DrawRender();
|
|
181
|
+
/**
|
|
182
|
+
* Complicated
|
|
183
|
+
* 1. ask centerRingAccount for existing rings HIDE KEYS
|
|
184
|
+
* 2. delete from buffer orchestators
|
|
185
|
+
* 3. mark centers as hidden
|
|
186
|
+
*/
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @param {Array<string>} textWriterIDs textWritersMap keys to be used for writing text.
|
|
190
|
+
* @param {Array<string>} itemKeys if empty, all texts will be updated. Use {@link ringKeyMethod} method to get keys
|
|
191
|
+
*/
|
|
192
|
+
updateText(textWriterIDs = [], itemKeys = null) {
|
|
193
|
+
const textWritersMap = textWriterGetOrThrow(this._textWritersMap, textWriterIDs);
|
|
194
|
+
if (itemKeys === null) {
|
|
195
|
+
this._ringAccount.updateAllText(textWritersMap, this._textDataPreAdaptor);
|
|
196
|
+
this.globe.DrawRender();
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
itemKeys.forEach((key) => {
|
|
200
|
+
const item = this._ringAccount.getCenter(key);
|
|
201
|
+
if (item === undefined)
|
|
202
|
+
throw new Error("Center not found");
|
|
203
|
+
const textData = this._textDataPreAdaptor(item);
|
|
204
|
+
textWritersMap.forEach((textWriter) => textWriter.insertText(textData));
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
this.globe.DrawRender();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @method removeCenters @param { Array < { centerID } >} centerIDs
|
|
211
|
+
*/
|
|
212
|
+
removeCenters(centerIDs) {
|
|
213
|
+
const { globe, bufferOrchestrator, bufferManagersCompMap, paddingBufferOrchestrator, bufferManagersCompMapPadding, _ringAccount } = this;
|
|
214
|
+
for (const centerID of centerIDs) {
|
|
215
|
+
const existingKeys = _ringAccount.ringKeys(centerID);
|
|
216
|
+
if (existingKeys.length) {
|
|
217
|
+
bufferOrchestrator.deleteBulk(existingKeys, bufferManagersCompMap);
|
|
218
|
+
this._textWritersMap.forEach((textWriter) => textWriter.deleteTextBulk(existingKeys));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
for (const centerID of centerIDs) {
|
|
222
|
+
const paddingKeys = _ringAccount.ringBigPaddingKeys(centerID);
|
|
223
|
+
if (paddingKeys.length) {
|
|
224
|
+
paddingBufferOrchestrator.deleteBulk(paddingKeys, bufferManagersCompMapPadding);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
this.paddingTextPlugin?.removeCenters(centerIDs);
|
|
228
|
+
this._ringAccount.removeCenters(centerIDs);
|
|
229
|
+
globe.DrawRender();
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @method setOpacity @param { number } opacity
|
|
233
|
+
*/
|
|
234
|
+
setOpacity(opacity) {
|
|
235
|
+
opacityCheck(opacity);
|
|
236
|
+
this._opacity = opacity;
|
|
237
|
+
this.paddingTextPlugin?.setOpacity(opacity);
|
|
238
|
+
this._textWritersMap.forEach((writer) => writer.setOpacity(opacity));
|
|
239
|
+
this.globe.DrawRender();
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* @method setOneDegreePaddingOn // performance consuming, might be removed
|
|
243
|
+
*/
|
|
244
|
+
setOneDegreePaddingOn(isOneDegreePaddingOn) {
|
|
245
|
+
if (typeof isOneDegreePaddingOn !== "boolean")
|
|
246
|
+
throw new Error("Invalid value for one degree padding");
|
|
247
|
+
if (this._oneDegreePadding === isOneDegreePaddingOn)
|
|
248
|
+
return;
|
|
249
|
+
this._oneDegreePadding = isOneDegreePaddingOn;
|
|
250
|
+
this.globe.DrawRender();
|
|
251
|
+
}
|
|
252
|
+
setZAlphaOnDegreePadding(zAlphaOnDegreePadding) {
|
|
253
|
+
if (zAlphaOnDegreePadding !== 0 && zAlphaOnDegreePadding !== 1)
|
|
254
|
+
throw new Error("Invalid value for zAlphaOnDegreePadding");
|
|
255
|
+
if (this._zAlphaOnDegreePadding === zAlphaOnDegreePadding)
|
|
256
|
+
return;
|
|
257
|
+
this._zAlphaOnDegreePadding = zAlphaOnDegreePadding;
|
|
258
|
+
this.globe.DrawRender();
|
|
259
|
+
}
|
|
260
|
+
// PRIVATE METHODS
|
|
261
|
+
_initPrograms() {
|
|
262
|
+
const { globe } = this;
|
|
263
|
+
this._circleProgram2D = CircleCache2D.get(globe);
|
|
264
|
+
this._circleProgram3D = CircleCache3D.get(globe);
|
|
265
|
+
this._padding2dProgram = LinesColorInstancedFlatCache.get(globe);
|
|
266
|
+
this._padding3dProgram = CirclePadding3DCache.get(globe);
|
|
267
|
+
this._lineOnGlobe_bigPadding = LineOnGlobeCache.get(globe);
|
|
268
|
+
}
|
|
269
|
+
_initBufferManagers() {
|
|
270
|
+
const { gl } = this;
|
|
271
|
+
const initialCapacity = 10;
|
|
272
|
+
const bufferType = "DYNAMIC_DRAW";
|
|
273
|
+
// circle2d, circle3d, 1 degree paddings,
|
|
274
|
+
this.bufferOrchestrator = new BufferOrchestrator({ capacity: initialCapacity });
|
|
275
|
+
this.bufferManagersCompMap = new Map([
|
|
276
|
+
// circle 3D
|
|
277
|
+
["centerCoords3d", {
|
|
278
|
+
'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
279
|
+
'adaptor': (item) => new Float32Array(item.centerCoords3d),
|
|
280
|
+
}],
|
|
281
|
+
["targetCoords3d", {
|
|
282
|
+
'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
283
|
+
'adaptor': (item) => new Float32Array(item.targetCoords3d),
|
|
284
|
+
}],
|
|
285
|
+
["rgba", {
|
|
286
|
+
'bufferManager': new BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
287
|
+
'adaptor': (item) => new Float32Array(item.hide === ENUM_HIDE.HIDE ? [0, 0, 0, 0] : item.rgba)
|
|
288
|
+
}],
|
|
289
|
+
["radius3d", {
|
|
290
|
+
'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
291
|
+
'adaptor': (item) => new Float32Array([item.radius])
|
|
292
|
+
}],
|
|
293
|
+
["radius3dsmall", {
|
|
294
|
+
'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
295
|
+
'adaptor': (item) => {
|
|
296
|
+
if (item.hide === ENUM_HIDE.HIDE_1_DEGREE_PADDINGS)
|
|
297
|
+
return new Float32Array([item.radius]);
|
|
298
|
+
return new Float32Array([item.radius - item.padding / 3]);
|
|
299
|
+
}
|
|
300
|
+
}],
|
|
301
|
+
["circleDashAngle", {
|
|
302
|
+
'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
303
|
+
'adaptor': (item) => new Float32Array([1]),
|
|
304
|
+
}],
|
|
305
|
+
["dashOpacity", {
|
|
306
|
+
'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
307
|
+
'adaptor': (item) => new Float32Array([1]),
|
|
308
|
+
}],
|
|
309
|
+
// circle 2D
|
|
310
|
+
["centerCoords2dflatForPadding", {
|
|
311
|
+
'bufferManager': new BufferManager(gl, CIRCLE_FLAT_EDGE_COUNT * 2, { bufferType, initialCapacity }),
|
|
312
|
+
'adaptor': (item) => item.centerCoords2dflatForPadding,
|
|
313
|
+
}],
|
|
314
|
+
["centerCoords2dflat", {
|
|
315
|
+
'bufferManager': new BufferManager(gl, CIRCLE_FLAT_EDGE_COUNT * 2, { bufferType, initialCapacity }),
|
|
316
|
+
'adaptor': (item) => item.centerCoords2dflat,
|
|
317
|
+
}],
|
|
318
|
+
["rgbaMercator", {
|
|
319
|
+
'bufferManager': new BufferManager(gl, 4 * CIRCLE_FLAT_EDGE_COUNT, { bufferType, initialCapacity }),
|
|
320
|
+
'adaptor': (item) => populateFloat32Array.fillWithListData(CIRCLE_FLAT_EDGE_COUNT, item.hide === ENUM_HIDE.HIDE ? [0, 0, 0, 0] : item.rgba),
|
|
321
|
+
}],
|
|
322
|
+
["circleDashAngleMercator", {
|
|
323
|
+
'bufferManager': new BufferManager(gl, CIRCLE_FLAT_EDGE_COUNT, { bufferType, initialCapacity }),
|
|
324
|
+
'adaptor': (item) => populateFloat32Array.fillFloat32Array(CIRCLE_FLAT_EDGE_COUNT, 1),
|
|
325
|
+
}],
|
|
326
|
+
["dashOpacityMercator", {
|
|
327
|
+
'bufferManager': new BufferManager(gl, CIRCLE_FLAT_EDGE_COUNT, { bufferType, initialCapacity }),
|
|
328
|
+
'adaptor': (item) => populateFloat32Array.fillFloat32Array(CIRCLE_FLAT_EDGE_COUNT, 1),
|
|
329
|
+
}],
|
|
330
|
+
]);
|
|
331
|
+
const obj = function (bufferManagerComp, divisor = 1) {
|
|
332
|
+
if (bufferManagerComp === null)
|
|
333
|
+
return null;
|
|
334
|
+
return { 'buffer': bufferManagerComp.bufferManager.buffer, 'stride': 0, 'offset': 0, divisor };
|
|
335
|
+
};
|
|
336
|
+
this._circle2DVao = this._circleProgram2D.createVAO(...["centerCoords2dflat", "rgbaMercator", "circleDashAngleMercator", "dashOpacityMercator"].map(key => obj(this.bufferManagersCompMap.get(key))));
|
|
337
|
+
this._circle3DVao = this._circleProgram3D.createVAO(...["centerCoords3d", "targetCoords3d", "rgba", "circleDashAngle", "dashOpacity"].map(key => obj(this.bufferManagersCompMap.get(key))));
|
|
338
|
+
this._oneDegree2DPaddingVao = this._padding2dProgram.createVAO({ buffer: this.bufferManagersCompMap.get("centerCoords2dflat").bufferManager.buffer, size: 2, stride: 0, offset: 0 }, { buffer: this.bufferManagersCompMap.get("centerCoords2dflatForPadding").bufferManager.buffer, size: 2, stride: 0, offset: 0 }, { buffer: this.bufferManagersCompMap.get("rgbaMercator").bufferManager.buffer, size: 4, stride: 0, offset: 0 });
|
|
339
|
+
// PADDING
|
|
340
|
+
// this one needs glue to assosiate rings and their big paddings since the count for center is not fixed
|
|
341
|
+
this.paddingBufferOrchestrator = new BufferOrchestrator({ capacity: initialCapacity });
|
|
342
|
+
this.bufferManagersCompMapPadding = new Map([
|
|
343
|
+
["circlePoint2d", {
|
|
344
|
+
'bufferManager': new BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
345
|
+
'adaptor': (item) => item.circlePoint2d,
|
|
346
|
+
}],
|
|
347
|
+
["paddingPoint2d", {
|
|
348
|
+
'bufferManager': new BufferManager(gl, 2, { bufferType, initialCapacity }),
|
|
349
|
+
'adaptor': (item) => item.paddingPoint2d,
|
|
350
|
+
}],
|
|
351
|
+
["circlePoint3d", {
|
|
352
|
+
'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
353
|
+
'adaptor': (item) => item.circlePoint3d
|
|
354
|
+
}],
|
|
355
|
+
["paddingPoint3d", {
|
|
356
|
+
'bufferManager': new BufferManager(gl, 3, { bufferType, initialCapacity }),
|
|
357
|
+
'adaptor': (item) => item.paddingPoint3d
|
|
358
|
+
}],
|
|
359
|
+
["rgba", {
|
|
360
|
+
'bufferManager': new BufferManager(gl, 4, { bufferType, initialCapacity }),
|
|
361
|
+
'adaptor': (item) => new Float32Array(item.rgba)
|
|
362
|
+
}],
|
|
363
|
+
// ["dashOpacity", {
|
|
364
|
+
// 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
365
|
+
// 'adaptor': (item) => new Float32Array([1]),
|
|
366
|
+
// }],
|
|
367
|
+
// ["dashRatio", {
|
|
368
|
+
// 'bufferManager': new BufferManager(gl, 1, { bufferType, initialCapacity }),
|
|
369
|
+
// 'adaptor': (item) => new Float32Array([1]),
|
|
370
|
+
// }],
|
|
371
|
+
]);
|
|
372
|
+
this._bigPadding3dFlatVAO = this._lineOnGlobe_bigPadding.createVAO(//"dashRatio", "dashOpacity"
|
|
373
|
+
...["circlePoint2d", "circlePoint3d", "paddingPoint2d", "paddingPoint3d", null, null, "rgba",].map(key => (key === null) ? null : obj(this.bufferManagersCompMapPadding.get(key))));
|
|
374
|
+
this._padding3dOneDegreeVao = this._padding3dProgram.createVAO(...["centerCoords3d", "radius3d", "radius3dsmall", "rgba"].map(key => obj(this.bufferManagersCompMap.get(key))));
|
|
375
|
+
}
|
|
376
|
+
// IMPLICIT METHODS
|
|
377
|
+
__reconstructCentralRingsBigPaddings(centerID) {
|
|
378
|
+
const { globe } = this;
|
|
379
|
+
const centerItem = this._ringAccount.getCenter(centerID);
|
|
380
|
+
if (centerItem === undefined)
|
|
381
|
+
throw new Error("Center not found");
|
|
382
|
+
const { long, lat, stepAngle, rgba, rings, hide = 0, textHide = 0, altitude: centerAltitude = 0 } = centerItem;
|
|
383
|
+
const result = [];
|
|
384
|
+
const color = hide === 1 ? new Float32Array([0, 0, 0, 0]) : new Float32Array(rgba);
|
|
385
|
+
for (const { ringID, radius, padding, altitude = centerAltitude } of rings) {
|
|
386
|
+
let azimuthAngle = 0;
|
|
387
|
+
while (azimuthAngle < 360) {
|
|
388
|
+
const circlePoint = globe.Math.FindPointByPolar(long, lat, radius, azimuthAngle); // long lat
|
|
389
|
+
const paddingPoint = globe.Math.FindPointByPolar(long, lat, radius - padding, azimuthAngle); // long lat
|
|
390
|
+
result.push({
|
|
391
|
+
key: ringBigPaddingKeyMethod(centerID, ringID, azimuthAngle),
|
|
392
|
+
circlePoint2d: new Float32Array(globe.api_GetMercator2DPoint(circlePoint.long, circlePoint.lat)),
|
|
393
|
+
paddingPoint2d: new Float32Array(globe.api_GetMercator2DPoint(paddingPoint.long, paddingPoint.lat)),
|
|
394
|
+
circlePoint3d: sphereCoord(circlePoint.long, circlePoint.lat, globe, altitude / 1000),
|
|
395
|
+
paddingPoint3d: sphereCoord(paddingPoint.long, paddingPoint.lat, globe, altitude / 1000),
|
|
396
|
+
rgba: color,
|
|
397
|
+
hide,
|
|
398
|
+
textHide
|
|
399
|
+
});
|
|
400
|
+
azimuthAngle += stepAngle;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return result;
|
|
404
|
+
}
|
|
405
|
+
__reconstructCentralRings(centerID) {
|
|
406
|
+
const { globe } = this;
|
|
407
|
+
const centerItem = this._ringAccount.getCenter(centerID);
|
|
408
|
+
if (centerItem === undefined)
|
|
409
|
+
throw new Error("Center not found");
|
|
410
|
+
const { long, lat, rgba, rings, hide = 0, textHide = 0, altitude: centralAltitude = 0 } = centerItem;
|
|
411
|
+
const centerCoords3d = sphereCoord(long, lat, globe, centralAltitude / 1000);
|
|
412
|
+
const result = [];
|
|
413
|
+
for (const { ringID, radius, padding, __identity__, altitude = centralAltitude } of rings) {
|
|
414
|
+
const key = __identity__;
|
|
415
|
+
const centerCoords2dflat = centerCoords2dflatDataCreatorWithRadius(globe, long, lat, radius, { edgeCount: CIRCLE_FLAT_EDGE_COUNT });
|
|
416
|
+
const radiusPadding = hide === ENUM_HIDE.HIDE_1_DEGREE_PADDINGS ? radius : radius - padding / 3;
|
|
417
|
+
const targetPoint = globe.Math.FindPointByPolar(long, lat, radius, 0); // long lat
|
|
418
|
+
const targetCoords3d = sphereCoord(targetPoint.long, targetPoint.lat, globe, altitude / 1000);
|
|
419
|
+
const centerCoords2dflatForPadding = centerCoords2dflatDataCreatorWithRadius(globe, long, lat, radiusPadding, { edgeCount: CIRCLE_FLAT_EDGE_COUNT });
|
|
420
|
+
result.push({
|
|
421
|
+
key,
|
|
422
|
+
centerCoords3d,
|
|
423
|
+
targetCoords3d,
|
|
424
|
+
centerCoords2dflat,
|
|
425
|
+
radius,
|
|
426
|
+
padding,
|
|
427
|
+
rgba,
|
|
428
|
+
centerCoords2dflatForPadding,
|
|
429
|
+
hide,
|
|
430
|
+
textHide
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
return result;
|
|
434
|
+
}
|
|
435
|
+
__reconstructCentralPaddingProperties(centerID) {
|
|
436
|
+
const centerItem = this._ringAccount.getCenter(centerID);
|
|
437
|
+
if (centerItem === undefined)
|
|
438
|
+
throw new Error("Center not found");
|
|
439
|
+
const { stepAngle, rgba, rings, hide = 0, textHide = 0 } = centerItem;
|
|
440
|
+
const result = [];
|
|
441
|
+
for (const { ringID, } of rings) {
|
|
442
|
+
let angle = 0;
|
|
443
|
+
while (angle < 360) {
|
|
444
|
+
result.push({
|
|
445
|
+
key: ringBigPaddingKeyMethod(centerID, ringID, angle),
|
|
446
|
+
rgba: hide === 1 ? new Float32Array([0, 0, 0, 0]) : rgba,
|
|
447
|
+
textHide
|
|
448
|
+
});
|
|
449
|
+
angle += stepAngle;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return result;
|
|
453
|
+
}
|
|
454
|
+
__reconstructCentralProperties(centerID) {
|
|
455
|
+
const centerItem = this._ringAccount.getCenter(centerID);
|
|
456
|
+
if (centerItem === undefined)
|
|
457
|
+
throw new Error("Center not found");
|
|
458
|
+
const { rgba, rings, hide = 0, textHide = 0 } = centerItem;
|
|
459
|
+
const result = [];
|
|
460
|
+
for (const { ringID, __identity__ } of rings) {
|
|
461
|
+
const key = __identity__;
|
|
462
|
+
result.push({
|
|
463
|
+
key,
|
|
464
|
+
rgba: hide === ENUM_HIDE.HIDE ? new Float32Array([0, 0, 0, 0]) : rgba,
|
|
465
|
+
textHide
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
return result;
|
|
469
|
+
}
|
|
470
|
+
// GLOBE API
|
|
471
|
+
init(globe, gl) {
|
|
472
|
+
this.globe = globe;
|
|
473
|
+
this.gl = gl;
|
|
474
|
+
this._initPrograms();
|
|
475
|
+
this._initBufferManagers();
|
|
476
|
+
if (this._showNumbers) {
|
|
477
|
+
this.paddingTextPlugin = new RangeRingAngleText(globe, this.id + "text", { style: this._numbersStyle, opacity: this._opacity });
|
|
478
|
+
delete this._numbersStyle;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
draw3D() {
|
|
482
|
+
const { globe, gl, _circleProgram2D, _circleProgram3D, _padding2dProgram, _padding3dProgram, _lineOnGlobe_bigPadding, _circle2DVao, _circle3DVao, _oneDegree2DPaddingVao, _padding3dOneDegreeVao, _bigPadding3dFlatVAO, bufferOrchestrator, paddingBufferOrchestrator, _opacity, _oneDegreePadding, _zAlphaOnDegreePadding } = this;
|
|
483
|
+
gl.disable(gl.DEPTH_TEST);
|
|
484
|
+
const is3D = globe.api_GetCurrentGeometry() === 0;
|
|
485
|
+
// const lod = globe.api_GetCurrentLOD();
|
|
486
|
+
if (is3D) {
|
|
487
|
+
_circleProgram3D.draw(_circle3DVao, bufferOrchestrator.length, _opacity);
|
|
488
|
+
if (_oneDegreePadding)
|
|
489
|
+
_padding3dProgram.draw(_padding3dOneDegreeVao, bufferOrchestrator.length, 360, 1, _opacity, _zAlphaOnDegreePadding);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
_circleProgram2D.draw(_circle2DVao, bufferOrchestrator.length, CIRCLE_FLAT_EDGE_COUNT, _opacity);
|
|
493
|
+
// _padding2dProgram.draw(bigPaddingVAO, paddingBufferOrchestrator.length, _opacity);
|
|
494
|
+
if (_oneDegreePadding)
|
|
495
|
+
_padding2dProgram.draw(_oneDegree2DPaddingVao, bufferOrchestrator.length * CIRCLE_FLAT_EDGE_COUNT, _opacity, _zAlphaOnDegreePadding);
|
|
496
|
+
}
|
|
497
|
+
const drawOptions = { drawRange: { first: 0, count: paddingBufferOrchestrator.length } };
|
|
498
|
+
_lineOnGlobe_bigPadding.draw(_bigPadding3dFlatVAO, drawOptions, _opacity);
|
|
499
|
+
this._textWritersMap.forEach((textWriter) => textWriter.draw());
|
|
500
|
+
gl.enable(gl.DEPTH_TEST);
|
|
501
|
+
}
|
|
502
|
+
free() {
|
|
503
|
+
if (this._isFreed)
|
|
504
|
+
return;
|
|
505
|
+
const { globe } = this;
|
|
506
|
+
this.bufferManagersCompMap.forEach(({ bufferManager }) => bufferManager.free());
|
|
507
|
+
this.bufferManagersCompMapPadding.forEach(({ bufferManager }) => bufferManager.free());
|
|
508
|
+
// delete vaos
|
|
509
|
+
this.gl.deleteVertexArray(this._circle2DVao);
|
|
510
|
+
this.gl.deleteVertexArray(this._circle3DVao);
|
|
511
|
+
this.gl.deleteVertexArray(this._oneDegree2DPaddingVao);
|
|
512
|
+
this.gl.deleteVertexArray(this._padding3dOneDegreeVao);
|
|
513
|
+
this.gl.deleteVertexArray(this._bigPadding3dFlatVAO);
|
|
514
|
+
// delete programs
|
|
515
|
+
CircleCache2D.release(globe);
|
|
516
|
+
CircleCache3D.release(globe);
|
|
517
|
+
LinesColorInstancedFlatCache.release(globe);
|
|
518
|
+
CirclePadding3DCache.release(globe);
|
|
519
|
+
LineOnGlobeCache.release(globe);
|
|
520
|
+
this._circleProgram2D = null;
|
|
521
|
+
this._circleProgram3D = null;
|
|
522
|
+
this._padding2dProgram = null;
|
|
523
|
+
this._padding3dProgram = null;
|
|
524
|
+
this._lineOnGlobe_bigPadding = null;
|
|
525
|
+
this.paddingTextPlugin?.free();
|
|
526
|
+
this._isFreed = true;
|
|
527
|
+
}
|
|
528
|
+
__contextTextWriterUpdate(centerIDs, textWriterIDs = null) {
|
|
529
|
+
let textWriters = null;
|
|
530
|
+
if (textWriterIDs === null) {
|
|
531
|
+
textWriters = Array.from(this._textWritersMap.values());
|
|
532
|
+
}
|
|
533
|
+
else if (textWriterIDs.length === 0) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
textWriters = textWriterGetOrThrow(this._textWritersMap, textWriterIDs);
|
|
538
|
+
}
|
|
539
|
+
centerIDs.forEach((centerID) => { this._ringAccount.textUpdate(centerID, textWriters, this._textDataPreAdaptor); });
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
const textWriterGetOrThrow = mapGetOrThrow("textWriterIDs is invalid");
|
|
543
|
+
export { RangeRings, Z_ALPHA_MODE };
|