@pirireis/webglobeplugins 0.16.4 → 0.17.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 +1 -0
- package/Math/arc.js +92 -2
- package/Math/circle-cdf-points.js +2 -2
- package/Math/circle.js +2 -2
- package/Math/contour/quadtreecontours.js +300 -0
- package/Math/finite-line-2d.js +58 -0
- package/Math/juction/arc-plane.js +67 -12
- package/Math/juction/line-sphere.js +6 -6
- package/Math/juction/plane-plane.js +4 -6
- package/Math/methods.js +5 -5
- package/Math/templete-shapes/grid-visually-equal.js +0 -1
- package/Math/tessellation/earcut/adapters.js +37 -0
- package/Math/tessellation/hybrid-triangle-tessellation-meta.js +123 -0
- package/Math/tessellation/methods.js +46 -0
- package/Math/tessellation/shred-input.js +18 -0
- package/Math/tessellation/tile-merger.js +56 -0
- package/Math/tessellation/tiler.js +50 -0
- package/Math/tessellation/triangle-tessellation-meta.js +516 -0
- package/Math/tessellation/triangle-tessellation.js +14 -0
- package/Math/tessellation/zoom-catch.js +1 -0
- package/Math/vec3.js +26 -1
- package/compass-rose/compass-text-writer.js +39 -33
- package/constants.js +3 -0
- package/{util/heatwavedatamanager → heatwave}/datamanager.js +1 -1
- package/heatwave/{plugins/heatwaveglobeshell.js → heatwave.js} +8 -6
- package/heatwave/index.js +5 -3
- package/heatwave/{isobar/plugin.js → isobar.js} +6 -5
- package/{util/heatwavedatamanager → heatwave}/texture-point-sampler.js +24 -3
- package/package.json +7 -3
- package/programs/arrowfield/{object.js → arrow-field.js} +1 -1
- package/programs/arrowfield/logic.js +1 -1
- package/programs/data2legend/density-to-legend.js +24 -29
- package/programs/data2legend/point-to-density-texture.js +14 -17
- package/programs/float2legendwithratio/logic.js +2 -2
- package/programs/float2legendwithratio/object.js +1 -1
- package/programs/helpers/{blender/program.js → blender.js} +1 -1
- package/programs/helpers/{fadeaway/logic.js → fadeaway.js} +11 -2
- package/programs/index.js +20 -9
- package/programs/line-on-globe/circle-accurate-3d.js +12 -14
- package/programs/line-on-globe/circle-accurate-flat.js +0 -1
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +13 -15
- package/programs/line-on-globe/lines-color-instanced-flat.js +15 -18
- package/programs/line-on-globe/naive-accurate-flexible.js +0 -1
- package/programs/picking/pickable-polygon-renderer.js +1 -1
- package/programs/picking/pickable-renderer.js +2 -2
- package/programs/point-on-globe/element-globe-surface-glow.js +2 -2
- package/programs/point-on-globe/element-point-glow.js +1 -1
- package/programs/point-on-globe/square-pixel-point.js +1 -1
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin-triangle.js +204 -0
- package/programs/polygon-on-globe/texture-dem-triangle-test-plugin.js +31 -10
- package/programs/polygon-on-globe/texture-dem-triangles.js +81 -12
- package/programs/rings/partial-ring/piece-of-pie.js +26 -29
- package/programs/totems/camerauniformblock.js +34 -45
- package/programs/two-d/pixel-padding-for-compass.js +14 -24
- package/programs/vectorfields/logics/drawrectangleparticles.js +1 -2
- package/programs/vectorfields/logics/pixelbased.js +1 -2
- package/programs/vectorfields/pingpongbuffermanager.js +1 -1
- package/range-tools-on-terrain/bearing-line/adapters.js +1 -1
- package/range-tools-on-terrain/circle-line-chain/adapters.js +0 -5
- package/range-tools-on-terrain/circle-line-chain/plugin.js +1 -1
- package/range-tools-on-terrain/range-ring/plugin.js +4 -6
- package/semiplugins/lightweight/line-plugin.js +0 -1
- package/semiplugins/shape-on-terrain/arc-plugin.js +5 -7
- package/semiplugins/shape-on-terrain/circle-plugin.js +2 -2
- package/semiplugins/shape-on-terrain/padding-1-degree.js +1 -2
- package/semiplugins/shell/bbox-renderer/index.js +2 -0
- package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/logic.js +101 -102
- package/{programs/globeshell/wiggle → semiplugins/shell/bbox-renderer}/object.js +6 -7
- package/semiplugins/utility/container-plugin.js +94 -0
- package/semiplugins/utility/object-pass-container-plugin.js +80 -0
- package/{point-heat-map → tracks/point-heat-map}/adaptors/timetracksplugin-format-to-this.js +1 -1
- package/{point-heat-map → tracks/point-heat-map}/plugin-webworker.js +3 -3
- package/{point-heat-map → tracks/point-heat-map}/point-to-heat-map-flow.js +11 -14
- package/{point-tracks → tracks/point-tracks}/plugin.js +5 -5
- package/{timetracks → tracks/timetracks}/adaptors-line-strip.js +1 -1
- package/{timetracks → tracks/timetracks}/program-line-strip.js +49 -49
- package/{timetracks → tracks/timetracks}/programpoint-line-strip.js +16 -13
- package/types.js +6 -0
- package/util/account/bufferoffsetmanager.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +9 -95
- package/util/gl-util/uniform-block/manager.js +4 -5
- package/util/gl-util/uniform-block/types.js +0 -7
- package/util/index.js +10 -13
- package/util/picking/fence.js +16 -18
- package/util/picking/picker-displayer.js +4 -6
- package/util/programs/{shapesonglobe.js → draw-from-pixel-coords.js} +4 -7
- package/util/programs/draw-texture-on-canvas.js +1 -1
- package/util/programs/texturetoglobe.js +3 -3
- package/util/shaderfunctions/geometrytransformations.js +6 -0
- package/util/webglobe/rasteroverlay.js +1 -0
- package/vectorfield/arrowfield/index.js +3 -0
- package/{arrowfield → vectorfield/arrowfield}/plugin.js +2 -2
- package/{waveparticles → vectorfield/waveparticles}/plugin.js +12 -12
- package/{wind → vectorfield/wind}/index.js +1 -1
- package/{wind → vectorfield/wind}/plugin.js +32 -32
- package/write-text/attached-text-writer.js +9 -1
- package/write-text/context-text3.js +0 -1
- package/write-text/objectarraylabels/index.js +2 -0
- package/Math/mesh/mapbox-delaunay.js +0 -544
- package/arrowfield/index.js +0 -3
- package/bearing-line/index.js +0 -2
- package/bearing-line/plugin.js +0 -444
- package/circle-line-chain/chain-list-map.js +0 -201
- package/circle-line-chain/plugin.js +0 -411
- package/circle-line-chain/util.js +0 -1
- package/compassrose/compassrose.js +0 -293
- package/compassrose/index.js +0 -2
- package/index.js +0 -12
- package/partialrings/buffer-manager.js +0 -75
- package/partialrings/index.js +0 -2
- package/partialrings/plugin.js +0 -128
- package/partialrings/program.js +0 -279
- package/programs/arrowfield/index.js +0 -2
- package/programs/globe-util/is-globe-moved.js +0 -19
- package/programs/globeshell/index.js +0 -2
- package/programs/globeshell/wiggle/index.js +0 -2
- package/programs/helpers/blender/index.js +0 -1
- package/programs/helpers/fadeaway/index.js +0 -2
- package/programs/helpers/fadeaway/object.js +0 -14
- package/programs/helpers/index.js +0 -2
- package/programs/rings/distancering/circleflatprogram.js +0 -116
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -326
- package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -368
- package/programs/rings/distancering/index.js +0 -6
- package/programs/rings/distancering/paddyflatprogram.js +0 -127
- package/programs/rings/distancering/paddyflatprogram2d.js +0 -129
- package/programs/rings/distancering/paddyflatprogram3d.js +0 -128
- package/programs/two-d/pixel-circle.js +0 -1
- package/programs/vectorfields/index.js +0 -3
- package/rangerings/enum.js +0 -2
- package/rangerings/index.js +0 -5
- package/rangerings/plugin.js +0 -543
- package/rangerings/rangeringangletext.js +0 -326
- package/rangerings/ring-account.js +0 -112
- package/timetracks/index.js +0 -1
- package/util/build-strategy/general-strategy.js +0 -62
- package/util/gl-util/uniform-block/shader.js +0 -1
- package/util/heatwavedatamanager/index.js +0 -2
- package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
- package/util/jshelpers/data-filler.js +0 -17
- package/util/jshelpers/equality.js +0 -18
- package/util/jshelpers/index.js +0 -2
- package/util/jshelpers/timefilters.js +0 -30
- package/util/programs/index.js +0 -1
- package/util/surface-line-data/arc-bboxes.js +0 -25
- package/util/surface-line-data/arcs-to-cuts.js +0 -50
- package/util/surface-line-data/cut-arc.js +0 -1
- package/util/surface-line-data/flow.js +0 -28
- package/util/surface-line-data/rbush-manager.js +0 -1
- package/util/surface-line-data/web-worker.js +0 -1
- package/write-text/context-text3old.js +0 -152
- package/write-text/index.js +0 -1
- package/write-text/writer-plugin.js +0 -8
- /package/{heatwave/isobar/quadtreecontours.js → Math/contour/quadtreecontours1.js} +0 -0
- /package/{util/surface-line-data → Math/tessellation}/types.js +0 -0
- /package/pin/{pin-object-array.js → pin-object-array1.js} +0 -0
- /package/pin/{pin-point-totem.js → pin-point-totem1.js} +0 -0
- /package/{circle-line-chain/init.js → programs/polygon-on-globe/partial-tesselation.js} +0 -0
- /package/{point-heat-map → tracks/point-heat-map}/index.js +0 -0
- /package/{point-tracks → tracks/point-tracks}/key-methods.js +0 -0
- /package/{timetracks → tracks/timetracks}/plugin-line-strip.js +0 -0
- /package/{arrowfield → vectorfield/arrowfield}/adaptor.js +0 -0
- /package/{waveparticles → vectorfield/waveparticles}/adaptor.js +0 -0
- /package/{waveparticles → vectorfield/waveparticles}/index.js +0 -0
- /package/{wind → vectorfield/wind}/imagetovectorfieldandmagnitude.js +0 -0
- /package/{wind → vectorfield/wind}/vectorfieldimage.js +0 -0
- /package/write-text/{context-text.js → context-textDELETE.js} +0 -0
- /package/{heatwave/isobar → write-text/objectarraylabels}/objectarraylabels.js +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { globeProgramCache } from "../programcache";
|
|
2
2
|
import { fromLongLatToUnitVector } from "../../Math/vec3";
|
|
3
|
-
import {
|
|
3
|
+
import { RADIAN } from "../../Math/methods";
|
|
4
4
|
import { GlobeChangeObserver } from "./globe-changes";
|
|
5
|
-
// import { approximatedZoomLevel } from "../../util/geometry/index";
|
|
6
5
|
export const CameraUniformBlockString = `
|
|
7
6
|
layout(std140) uniform CameraUniformBlock {
|
|
8
7
|
mat4 view; // 64 bytes 0
|
|
@@ -93,49 +92,39 @@ export class CameraUniformBlockTotem {
|
|
|
93
92
|
const globe = this.globe;
|
|
94
93
|
this._globeChangeObserver?.checkChanges();
|
|
95
94
|
gl.bindBuffer(gl.UNIFORM_BUFFER, ubo);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// mapWH
|
|
109
|
-
if (globe.api_GetCurrentGeometry() === 1) {
|
|
110
|
-
const { width, height } = globe.api_GetCurrentWorldWH();
|
|
111
|
-
mapWHFloat32.set([width, height]);
|
|
112
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 144, mapWHFloat32);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
{
|
|
116
|
-
// float world_distance; // 4 bytes 164
|
|
117
|
-
// float world_tilt; // 4 bytes 168
|
|
118
|
-
// float world_north_angle; // 4 bytes 172
|
|
119
|
-
// vec2 world_center_radian; // 8 bytes 180
|
|
120
|
-
const { CenterLong, CenterLat, Distance, Tilt, NorthAng } = globe.api_GetCurrentLookInfo();
|
|
121
|
-
gl.bufferSubData(gl.UNIFORM_BUFFER, 164, new Float32Array([
|
|
122
|
-
Distance,
|
|
123
|
-
Radian * Tilt,
|
|
124
|
-
Radian * NorthAng,
|
|
125
|
-
Radian * CenterLong,
|
|
126
|
-
Radian * CenterLat,
|
|
127
|
-
]));
|
|
95
|
+
// view, projection, translate
|
|
96
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 0, modelView);
|
|
97
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 64, projection);
|
|
98
|
+
traslateFloat32.set([translate.x, translate.y, translate.z], 0);
|
|
99
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 128, traslateFloat32);
|
|
100
|
+
// zoom level
|
|
101
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 160, new Float32Array([globe.api_GetCurrentLODWithDecimal()]));
|
|
102
|
+
// mapWH
|
|
103
|
+
if (globe.api_GetCurrentGeometry() === 1) {
|
|
104
|
+
const { width, height } = globe.api_GetCurrentWorldWH();
|
|
105
|
+
mapWHFloat32.set([width, height]);
|
|
106
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 144, mapWHFloat32);
|
|
128
107
|
}
|
|
108
|
+
// float world_distance; // 4 bytes 164
|
|
109
|
+
// float world_tilt; // 4 bytes 168
|
|
110
|
+
// float world_north_angle; // 4 bytes 172
|
|
111
|
+
// vec2 world_center_radian; // 8 bytes 180
|
|
112
|
+
const { CenterLong, CenterLat, Distance, Tilt, NorthAng } = globe.api_GetCurrentLookInfo();
|
|
113
|
+
gl.bufferSubData(gl.UNIFORM_BUFFER, 164, new Float32Array([
|
|
114
|
+
Distance,
|
|
115
|
+
Radian * Tilt,
|
|
116
|
+
Radian * NorthAng,
|
|
117
|
+
Radian * CenterLong,
|
|
118
|
+
Radian * CenterLat,
|
|
119
|
+
]));
|
|
129
120
|
// this._frustumPlanes = getFrustumPlanes(projection, translate);
|
|
130
121
|
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this._isMovedParams.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this._isMovedParams.lastLod = currentLOD;
|
|
138
|
-
}
|
|
122
|
+
// isMoved
|
|
123
|
+
const currentLOD = globe.api_GetCurrentLODWithDecimal();
|
|
124
|
+
this._isMovedParams.isMoved =
|
|
125
|
+
this._isMovedParams.lastLod !== currentLOD ||
|
|
126
|
+
globe.api_IsScreenMoving();
|
|
127
|
+
this._isMovedParams.lastLod = currentLOD;
|
|
139
128
|
this.__setCameraVectors();
|
|
140
129
|
// this._calculateAproximatedLOD();
|
|
141
130
|
}
|
|
@@ -146,7 +135,7 @@ export class CameraUniformBlockTotem {
|
|
|
146
135
|
const globe = this.globe;
|
|
147
136
|
const currentGeom = globe.api_GetCurrentGeometry();
|
|
148
137
|
if (currentGeom === 0) {
|
|
149
|
-
const { Fp
|
|
138
|
+
const { Fp } = globe; // FUPos
|
|
150
139
|
const cameraVector = [Fp.x, Fp.y, Fp.z];
|
|
151
140
|
const length = Math.sqrt(cameraVector.reduce((sum, val) => sum + val * val, 0));
|
|
152
141
|
this._normalizedCameraVector[0] = cameraVector[0] / length;
|
|
@@ -155,7 +144,7 @@ export class CameraUniformBlockTotem {
|
|
|
155
144
|
}
|
|
156
145
|
else if (currentGeom === 1) {
|
|
157
146
|
const { CenterLong, CenterLat } = globe.api_GetCurrentLookInfo();
|
|
158
|
-
fromLongLatToUnitVector(_0vec3, [CenterLong *
|
|
147
|
+
fromLongLatToUnitVector(_0vec3, [CenterLong * RADIAN, CenterLat * RADIAN]);
|
|
159
148
|
this._normalizedCameraVector[0] = _0vec3[0];
|
|
160
149
|
this._normalizedCameraVector[1] = _0vec3[1];
|
|
161
150
|
this._normalizedCameraVector[2] = _0vec3[2];
|
|
@@ -197,7 +186,7 @@ export class CameraUniformBlockTotem {
|
|
|
197
186
|
const globe = this.globe;
|
|
198
187
|
const { CenterLong, CenterLat } = globe.api_GetCurrentLookInfo();
|
|
199
188
|
const result = [0, 0, 0];
|
|
200
|
-
fromLongLatToUnitVector(result, [CenterLong *
|
|
189
|
+
fromLongLatToUnitVector(result, [CenterLong * RADIAN, CenterLat * RADIAN]);
|
|
201
190
|
return result;
|
|
202
191
|
}
|
|
203
192
|
getGlobeChanges() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createProgram } from "../../util";
|
|
1
|
+
import { createProgram } from "../../util/webglobjectbuilders";
|
|
2
2
|
import { CameraUniformBlockTotemCache, CameraUniformBlockString } from "../totems";
|
|
3
3
|
import { noRegisterGlobeProgramCache } from "../programcache";
|
|
4
4
|
const vertexCount = 720;
|
|
@@ -73,29 +73,19 @@ class Logic {
|
|
|
73
73
|
this._lastOpacity = 1;
|
|
74
74
|
this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
|
|
75
75
|
const { gl, program } = this;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
gl.useProgram(program);
|
|
90
|
-
gl.uniform1f(this._opacityLocation, this._lastOpacity);
|
|
91
|
-
gl.useProgram(currentProgram);
|
|
92
|
-
}
|
|
93
|
-
{
|
|
94
|
-
this.cameraBlockBindingPoint = 0;
|
|
95
|
-
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
96
|
-
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
97
|
-
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
98
|
-
}
|
|
76
|
+
gl.bindAttribLocation(program, 0, "screen_coordinate");
|
|
77
|
+
gl.bindAttribLocation(program, 1, "pixel_radius_small_ratio");
|
|
78
|
+
gl.bindAttribLocation(program, 2, "pixel_radius_big_ratio");
|
|
79
|
+
gl.bindAttribLocation(program, 3, "rgba");
|
|
80
|
+
this._opacityLocation = gl.getUniformLocation(program, "plugin_opacity");
|
|
81
|
+
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
82
|
+
gl.useProgram(program);
|
|
83
|
+
gl.uniform1f(this._opacityLocation, this._lastOpacity);
|
|
84
|
+
gl.useProgram(currentProgram);
|
|
85
|
+
this.cameraBlockBindingPoint = 0;
|
|
86
|
+
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
87
|
+
this.cameraBlockTotem = CameraUniformBlockTotemCache.get(globe);
|
|
88
|
+
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
99
89
|
}
|
|
100
90
|
draw(vao, length, opacity) {
|
|
101
91
|
const { globe, gl, program, cameraBlockTotem, cameraBlockBindingPoint, _opacityLocation } = this;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createProgram } from "../../../util";
|
|
2
|
-
import { UBO_BINDING_POINT, shaderUboSource } from "./ubo.js";
|
|
1
|
+
import { createProgram } from "../../../util/webglobjectbuilders";
|
|
3
2
|
import { glProgramCache } from "../../programcache";
|
|
4
3
|
import { SeaWaveUbo } from "./ubo-new";
|
|
5
4
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createShader } from "../../../util";
|
|
2
|
-
import { UBO_SIZE, UBO_BINDING_POINT, shaderUboSource } from "./ubo.js";
|
|
1
|
+
import { createShader } from "../../../util/webglobjectbuilders";
|
|
3
2
|
import { glProgramCache } from "../../programcache";
|
|
4
3
|
import { SeaWaveUbo } from "./ubo-new";
|
|
5
4
|
// program output is buffer
|
|
@@ -18,7 +18,7 @@ export const flatLinesInputAdapter = (bearingLine) => {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export const flatLinesBearingInputAdapter = (bearingLine) => {
|
|
21
|
-
const { long, lat, rgba, key, bearingLat = 0, bearingLong = 0
|
|
21
|
+
const { long, lat, rgba, key, bearingLat = 0, bearingLong = 0 } = bearingLine;
|
|
22
22
|
return {
|
|
23
23
|
key: key,
|
|
24
24
|
start: [long, lat],
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export const keyMethod = (chainKey, nodeKey) => `${chainKey}_${nodeKey}`;
|
|
2
|
-
const distance = (node1, node2) => {
|
|
3
|
-
const dx = node1.long - node2.long;
|
|
4
|
-
const dy = node1.lat - node2.lat;
|
|
5
|
-
return Math.sqrt(dx * dx + dy * dy);
|
|
6
|
-
};
|
|
7
2
|
export const circleDataAdaptor = (globe, chain) => {
|
|
8
3
|
const circleInputs = [];
|
|
9
4
|
const { chainKey, chainProperties, nodes } = chain;
|
|
@@ -102,7 +102,7 @@ export class CircleLineChainPlugin {
|
|
|
102
102
|
return;
|
|
103
103
|
const chainKeys = [];
|
|
104
104
|
const chainsToClean = [];
|
|
105
|
-
for (const { chainKey
|
|
105
|
+
for (const { chainKey } of chains) {
|
|
106
106
|
if (this._chainListMap.hasChain(chainKey)) {
|
|
107
107
|
chainsToClean.push(chainKey);
|
|
108
108
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CircleOnTerrainPlugin } from "../../semiplugins/shape-on-terrain/circle-plugin";
|
|
2
2
|
import { ArcOnTerrainPlugin } from "../../semiplugins/shape-on-terrain/arc-plugin";
|
|
3
3
|
import { Padding1DegreePlugin } from '../../semiplugins/shape-on-terrain/padding-1-degree';
|
|
4
|
-
import { padding1DegreeInputAdapter, rangeRingToArcInputAdapter, rangeRingToCircleInputAdapter, allCircleKeysAdapter, allArcKeysAdapter, createColorRatios } from "./adapters";
|
|
4
|
+
import { padding1DegreeInputAdapter, rangeRingToArcInputAdapter, rangeRingToCircleInputAdapter, allCircleKeysAdapter, allArcKeysAdapter, createColorRatios, } from "./adapters";
|
|
5
5
|
import RangeRingAngleText from "./rangeringangletext";
|
|
6
6
|
import { opacityCheck } from "../../util/check/typecheck";
|
|
7
7
|
export var ENUM_HIDE;
|
|
@@ -311,7 +311,7 @@ export class RangeRingPlugin {
|
|
|
311
311
|
if (this.draw1degrePadding) {
|
|
312
312
|
this.paddingPlugin?.draw3D();
|
|
313
313
|
}
|
|
314
|
-
for (const [
|
|
314
|
+
for (const [, writer] of this.textWritersMap) {
|
|
315
315
|
writer.draw();
|
|
316
316
|
}
|
|
317
317
|
}
|
|
@@ -338,7 +338,6 @@ export class RangeRingPlugin {
|
|
|
338
338
|
console.warn("Globe or WebGL context is not initialized, cannot update text");
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const globe = this.globe;
|
|
342
341
|
const textWritersMap = this.textWritersMap;
|
|
343
342
|
let keys = centerIDs ?? this._memory.keys();
|
|
344
343
|
for (const centerID of keys) {
|
|
@@ -351,7 +350,7 @@ export class RangeRingPlugin {
|
|
|
351
350
|
if (rangeRingData.textHide === ENUM_TEXT_HIDE.HIDE) {
|
|
352
351
|
continue;
|
|
353
352
|
}
|
|
354
|
-
for (const [
|
|
353
|
+
for (const [, writer] of textWritersMap) {
|
|
355
354
|
writer.insertText(rangeRingData);
|
|
356
355
|
}
|
|
357
356
|
}
|
|
@@ -365,13 +364,12 @@ export class RangeRingPlugin {
|
|
|
365
364
|
console.warn("Globe or WebGL context is not initialized, cannot delete text");
|
|
366
365
|
return;
|
|
367
366
|
}
|
|
368
|
-
const globe = this.globe;
|
|
369
367
|
const textWritersMap = this.textWritersMap;
|
|
370
368
|
for (const centerID of centerIDs) {
|
|
371
369
|
const rangeRingData = this._memory.get(centerID);
|
|
372
370
|
if (!rangeRingData)
|
|
373
371
|
continue;
|
|
374
|
-
for (const [
|
|
372
|
+
for (const [, writer] of textWritersMap) {
|
|
375
373
|
writer.deleteText(rangeRingData);
|
|
376
374
|
}
|
|
377
375
|
}
|
|
@@ -164,7 +164,6 @@ export class LinePlugin {
|
|
|
164
164
|
const globe = this.globe;
|
|
165
165
|
const { flatViewOn, globeViewOn, variativeColorsOn, dashedLineOpacityVariativeOn, dashedLineRatioVariativeOn, bufferType = "DYNAMIC_DRAW" } = this._options;
|
|
166
166
|
const m = this.bufferManagersMap;
|
|
167
|
-
const initialCapacity = this._options.initialCapacity;
|
|
168
167
|
if (flatViewOn) {
|
|
169
168
|
m.set("start_position", {
|
|
170
169
|
bufferManager: new BufferManager(globe.gl, 2, { bufferType, initialCapacity: this._options.initialCapacity }),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// import { ArcOnTerrainPluginOptions } from "./type";
|
|
2
2
|
import { LineStripProgramCache } from "../../programs/line-on-globe/linestrip/linestrip";
|
|
3
3
|
import { createBufferAndReadInfo } from "../../util/gl-util/buffer/attribute-loader";
|
|
4
|
-
// import { populateFloat32Array } from "../../util/jshelpers/data-filler";
|
|
5
4
|
import { BufferManager, BufferOrchestrator } from "../../util/account/single-attribute-buffer-management/index";
|
|
6
|
-
import { globe3Dcoordinates, globe2Dcoordinates,
|
|
5
|
+
import { globe3Dcoordinates, globe2Dcoordinates, RADIAN } from "../../Math/methods";
|
|
7
6
|
import { generateArcPoints, evenlySpacedArcPoints } from "../../Math/arc-cdf-points";
|
|
8
7
|
import { StaticDynamicState, StaticDynamicStrategy } from "../../util/build-strategy/static-dynamic";
|
|
9
8
|
import { opacityCheck } from "../../util/check/typecheck";
|
|
@@ -19,8 +18,8 @@ const _start = [0, 0, 0];
|
|
|
19
18
|
const _end = [0, 0, 0];
|
|
20
19
|
const _0arc = arc.create([1, 0, 0], [0, 1, 0]); // zero arc for intersection tests
|
|
21
20
|
function createArc(start, end) {
|
|
22
|
-
vec3.fromLongLatToUnitVector(_start, [start[0] *
|
|
23
|
-
vec3.fromLongLatToUnitVector(_end, [end[0] *
|
|
21
|
+
vec3.fromLongLatToUnitVector(_start, [start[0] * RADIAN, start[1] * RADIAN]);
|
|
22
|
+
vec3.fromLongLatToUnitVector(_end, [end[0] * RADIAN, end[1] * RADIAN]);
|
|
24
23
|
return arc.create(_start, _end);
|
|
25
24
|
}
|
|
26
25
|
export class ArcOnTerrainPlugin {
|
|
@@ -279,7 +278,6 @@ export class ArcOnTerrainPlugin {
|
|
|
279
278
|
if (!this.bufferManagersMap?.has(bufferKey[0]))
|
|
280
279
|
return;
|
|
281
280
|
const longLat = [0, 0];
|
|
282
|
-
const _attractionStrength = 0;
|
|
283
281
|
const longLatArr = new Float32Array(2 * this._options.vertexCount);
|
|
284
282
|
const data = [{
|
|
285
283
|
key: "staticArcs",
|
|
@@ -302,7 +300,7 @@ export class ArcOnTerrainPlugin {
|
|
|
302
300
|
for (let i = 0; i < generatedPoints.length; i++) {
|
|
303
301
|
const point = generatedPoints[i];
|
|
304
302
|
vec3.fromUnitVectorToLongLat(longLat, point);
|
|
305
|
-
longLatArr.set([longLat[0] /
|
|
303
|
+
longLatArr.set([longLat[0] / RADIAN, longLat[1] / RADIAN], i * 2);
|
|
306
304
|
}
|
|
307
305
|
data[0].key = key;
|
|
308
306
|
data[0].height = arcInput.height ?? this._options.defaultHeightFromGroundIn3D;
|
|
@@ -365,7 +363,7 @@ export class ArcOnTerrainPlugin {
|
|
|
365
363
|
for (let i = 0; i < generatedPoints.length; i++) {
|
|
366
364
|
const point = generatedPoints[i];
|
|
367
365
|
vec3.fromUnitVectorToLongLat(longLat, point);
|
|
368
|
-
longLatArr.set([longLat[0] /
|
|
366
|
+
longLatArr.set([longLat[0] / RADIAN, longLat[1] / RADIAN], i * 2);
|
|
369
367
|
}
|
|
370
368
|
result.push({
|
|
371
369
|
key: key,
|
|
@@ -297,7 +297,7 @@ export class CircleOnTerrainPlugin {
|
|
|
297
297
|
return;
|
|
298
298
|
const wrapper = [null];
|
|
299
299
|
for (const key of subSetIDs) {
|
|
300
|
-
const [circleInput,
|
|
300
|
+
const [circleInput,] = this.circleMap.get(key) || [];
|
|
301
301
|
if (circleInput) {
|
|
302
302
|
wrapper[0] = circleInput;
|
|
303
303
|
this.bufferOrchestrator.insertBulk(wrapper, this.bufferManagersMap, ["color"]);
|
|
@@ -393,7 +393,7 @@ export class CircleOnTerrainPlugin {
|
|
|
393
393
|
console.warn(`CircleOnTerrainPlugin: Circle ${key} not found in circleMap.`);
|
|
394
394
|
continue;
|
|
395
395
|
}
|
|
396
|
-
const [{ radius, center, height = null, color = null, msl = undefined },
|
|
396
|
+
const [{ radius, center, height = null, color = null, msl = undefined },] = this.circleMap.get(key);
|
|
397
397
|
const circlePointsLongLat = new Float64Array((CIRCLE_POINTS_COUNT) * 2);
|
|
398
398
|
CircleCDF.globeFindPointByPolarHalfCircle(circlePointsLongLat, globe, center[0], center[1], radius, zeroRotation, templateAngles);
|
|
399
399
|
datas.push({
|
|
@@ -437,7 +437,6 @@ export class Padding1DegreePlugin {
|
|
|
437
437
|
}
|
|
438
438
|
__innerCircle(subSetIDs = null) {
|
|
439
439
|
// Implement inner circle padding logic
|
|
440
|
-
console.log("innerCircle Level Update");
|
|
441
440
|
const datas = this._dataMap;
|
|
442
441
|
let keys;
|
|
443
442
|
if (subSetIDs) {
|
|
@@ -514,7 +513,7 @@ function preAdapter(globe, paddingInput, paddingRatio, outerCoords) {
|
|
|
514
513
|
paddingInput.radius * paddingRatio, // inner radius
|
|
515
514
|
i);
|
|
516
515
|
const longDifference = Math.abs(long - endLong);
|
|
517
|
-
const latDifference = Math.abs(lat - endLat);
|
|
516
|
+
// const latDifference = Math.abs(lat - endLat);
|
|
518
517
|
if (longDifference > 45) {
|
|
519
518
|
outerCoords[i] = null;
|
|
520
519
|
innerCoords[i] = null;
|