@pirireis/webglobeplugins 0.9.11 → 0.9.12
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 +8 -8
- package/Math/arc.js +18 -18
- package/Math/bounds/line-bbox.js +78 -80
- package/Math/constants.js +3 -3
- package/Math/juction/arc-plane.js +23 -23
- package/Math/juction/line-sphere.js +11 -11
- package/Math/juction/plane-plane.js +11 -11
- package/Math/line.js +14 -16
- package/Math/methods.js +65 -70
- package/Math/plane.js +16 -18
- package/Math/quaternion.js +45 -49
- package/Math/utils.js +2 -2
- package/Math/vec3.js +42 -45
- package/algorithms/search-binary.js +4 -4
- package/altitude-locator/draw-subset-obj.js +7 -8
- package/altitude-locator/plugin.js +98 -114
- package/arrowfield/adaptor.js +3 -4
- package/arrowfield/index.js +2 -2
- package/arrowfield/plugin.js +62 -65
- package/bearing-line/index.js +1 -1
- package/bearing-line/plugin.js +200 -226
- package/circle-line-chain/chain-list-map.js +82 -88
- package/circle-line-chain/plugin.js +134 -165
- package/circle-line-chain/util.js +1 -1
- package/compass-rose/compass-rose-padding-flat.js +108 -133
- package/compass-rose/compass-text-writer.js +62 -70
- package/compass-rose/index.js +2 -2
- package/compassrose/compassrose.js +46 -50
- package/compassrose/index.js +1 -1
- package/heatwave/index.js +2 -2
- package/heatwave/isobar/objectarraylabels.js +44 -48
- package/heatwave/isobar/plugin.js +104 -123
- package/heatwave/isobar/quadtreecontours.js +76 -92
- package/heatwave/plugins/heatwaveglobeshell.js +69 -87
- package/index.js +11 -11
- package/package.json +1 -1
- package/partialrings/buffer-manager.js +32 -64
- package/partialrings/index.js +1 -1
- package/partialrings/plugin.js +48 -84
- package/partialrings/program.js +136 -47
- package/pin/pin-object-array.js +83 -86
- package/pin/pin-point-totem.js +21 -22
- package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
- package/point-heat-map/plugin-webworker.js +40 -45
- package/point-heat-map/point-to-heat-map-flow.js +40 -42
- package/point-tracks/key-methods.js +1 -1
- package/point-tracks/plugin.js +137 -162
- package/programs/arrowfield/index.js +1 -1
- package/programs/arrowfield/logic.js +170 -62
- package/programs/arrowfield/object.js +33 -35
- package/programs/data2legend/density-to-legend.js +45 -21
- package/programs/data2legend/point-to-density-texture.js +52 -27
- package/programs/float2legendwithratio/index.js +1 -1
- package/programs/float2legendwithratio/logic.js +88 -42
- package/programs/float2legendwithratio/object.js +43 -46
- package/programs/globe-util/is-globe-moved.js +10 -11
- package/programs/globeshell/index.js +1 -1
- package/programs/globeshell/wiggle/index.js +1 -1
- package/programs/globeshell/wiggle/logic.js +191 -98
- package/programs/globeshell/wiggle/object.js +33 -35
- package/programs/helpers/blender/program.js +36 -19
- package/programs/helpers/fadeaway/index.js +1 -1
- package/programs/helpers/fadeaway/logic.js +35 -13
- package/programs/helpers/fadeaway/object.js +9 -10
- package/programs/helpers/index.js +1 -1
- package/programs/index.js +8 -8
- package/programs/line-on-globe/angled-line.js +91 -32
- package/programs/line-on-globe/circle-accurate-3d.js +82 -32
- package/programs/line-on-globe/circle-accurate-flat.js +108 -50
- package/programs/line-on-globe/circle-accurate.js +103 -33
- package/programs/line-on-globe/circle.js +97 -32
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
- package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
- package/programs/line-on-globe/linestrip.js +111 -45
- package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
- package/programs/line-on-globe/to-the-surface.js +58 -29
- package/programs/line-on-globe/util.js +1 -1
- package/programs/picking/pickable-renderer.js +117 -33
- package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
- package/programs/point-on-globe/element-point-glow.js +103 -35
- package/programs/point-on-globe/square-pixel-point.js +76 -27
- package/programs/programcache.js +13 -13
- package/programs/rings/distancering/circleflatprogram.js +63 -21
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
- package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
- package/programs/rings/distancering/index.js +4 -4
- package/programs/rings/distancering/paddyflatprogram.js +73 -20
- package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
- package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
- package/programs/rings/partial-ring/piece-of-pie.js +137 -35
- package/programs/totems/camerauniformblock.js +64 -51
- package/programs/totems/canvas-webglobe-info.js +48 -40
- package/programs/totems/gpu-selection-uniform-block.js +44 -40
- package/programs/totems/index.js +1 -1
- package/programs/two-d/pixel-padding-for-compass.js +90 -29
- package/programs/util.js +6 -7
- package/programs/vectorfields/index.js +1 -1
- package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
- package/programs/vectorfields/logics/index.js +3 -3
- package/programs/vectorfields/logics/pixelbased.js +91 -35
- package/programs/vectorfields/logics/ubo.js +31 -25
- package/programs/vectorfields/pingpongbuffermanager.js +30 -34
- package/rangerings/index.js +4 -4
- package/rangerings/plugin.js +202 -258
- package/rangerings/rangeringangletext.js +108 -120
- package/rangerings/ring-account.js +52 -69
- package/shaders/fragment-toy/firework.js +55 -1
- package/shaders/fragment-toy/singularity.js +55 -1
- package/timetracks/adaptors-line-strip.js +26 -37
- package/timetracks/adaptors.js +47 -61
- package/timetracks/index.js +4 -4
- package/timetracks/plugin-line-strip.js +63 -71
- package/timetracks/plugin.js +69 -77
- package/timetracks/program-line-strip.js +296 -103
- package/timetracks/program.js +419 -113
- package/timetracks/programpoint-line-strip.js +97 -44
- package/timetracks/programpoint.js +90 -44
- package/util/account/bufferoffsetmanager.js +72 -95
- package/util/account/index.js +1 -1
- package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
- package/util/account/single-attribute-buffer-management/index.js +3 -3
- package/util/account/single-attribute-buffer-management/object-store.js +29 -30
- package/util/account/util.js +2 -4
- package/util/algorithms/search-binary.js +4 -4
- package/util/check/get.js +5 -5
- package/util/check/typecheck.js +13 -15
- package/util/geometry/index.js +9 -11
- package/util/gl-util/buffer/attribute-loader.js +8 -20
- package/util/gl-util/buffer/index.js +1 -1
- package/util/gl-util/draw-options/methods.js +8 -9
- package/util/gl-util/uniform-block/manager.js +67 -67
- package/util/heatwavedatamanager/datamanager.js +56 -116
- package/util/heatwavedatamanager/index.js +2 -2
- package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
- package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
- package/util/index.js +6 -6
- package/util/interpolation/timetrack/index.js +1 -1
- package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
- package/util/interpolation/timetrack/web-worker-str.js +179 -1
- package/util/interpolation/timetrack/web-worker.js +4 -4
- package/util/jshelpers/data-filler.js +7 -7
- package/util/jshelpers/timefilters.js +7 -7
- package/util/picking/fence.js +7 -7
- package/util/picking/picker-displayer.js +46 -52
- package/util/programs/draw-texture-on-canvas.js +39 -21
- package/util/programs/shapesonglobe.js +104 -64
- package/util/programs/supersampletotextures.js +45 -39
- package/util/programs/texturetoglobe.js +98 -48
- package/util/shaderfunctions/geometrytransformations.js +322 -27
- package/util/shaderfunctions/nodata.js +7 -1
- package/util/shaderfunctions/noisefunctions.js +39 -9
- package/util/surface-line-data/arcs-to-cuts.js +20 -23
- package/util/webglobe/rasteroverlay.js +35 -37
- package/util/webglobjectbuilders.js +55 -60
- package/util/webglobjectbuilders1.js +48 -49
- package/waveparticles/adaptor.js +6 -7
- package/waveparticles/index.js +2 -2
- package/waveparticles/plugin.js +79 -84
- package/wind/imagetovectorfieldandmagnitude.js +15 -15
- package/wind/index.js +4 -4
- package/wind/plugin.js +453 -251
- package/wind/vectorfieldimage.js +5 -5
- package/write-text/attached-text-writer.js +46 -48
- package/write-text/context-text.js +51 -58
- package/write-text/context-text3.js +69 -74
package/partialrings/program.js
CHANGED
|
@@ -4,31 +4,122 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.programCache = exports.Logic = exports.ITEM_SIZE = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const util_1 = require("../util");
|
|
8
|
+
const programs_1 = require("../programs");
|
|
9
|
+
const buffer_manager_1 = __importDefault(require("./buffer-manager"));
|
|
10
|
+
const geometrytransformations_1 = require("../util/shaderfunctions/geometrytransformations");
|
|
11
11
|
/**
|
|
12
12
|
* TODO:
|
|
13
13
|
* 1. Triangle face looks at screen. if rotation angle is positive the last vertex must be the faintest.
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
const drawModeMap = Object.freeze({
|
|
17
17
|
LINE_STRIP: 0,
|
|
18
18
|
TRIANGLE_FAN: 1,
|
|
19
19
|
});
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const vertexShaderSource = `#version 300 es
|
|
21
|
+
|
|
22
|
+
${programs_1.CameraUniformBlockString}
|
|
23
|
+
${geometrytransformations_1.PI}
|
|
24
|
+
${geometrytransformations_1.longLatRadToMercator}
|
|
25
|
+
${geometrytransformations_1.mercatorXYToGLPosition}
|
|
26
|
+
${geometrytransformations_1.longLatRadToCartesian3D}
|
|
27
|
+
${geometrytransformations_1.circleLimpFromLongLatRadCenterCartesian3D}
|
|
28
|
+
${geometrytransformations_1.circleLimpFromLongLatRadCenterMercatorRealDistance}
|
|
29
|
+
${geometrytransformations_1.cartesian3DToGLPosition}
|
|
30
|
+
|
|
31
|
+
uniform float edge_count;
|
|
32
|
+
uniform int draw_mode; // %2 => 0: LINE_STRIP, 1: TRIANGLE_FAN
|
|
33
|
+
uniform float plugin_alpha_multiplier;
|
|
34
|
+
//, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode
|
|
35
|
+
in vec2 center; // long, lat in radian
|
|
36
|
+
in float start_angle; // the start of partial circle from bearing point
|
|
37
|
+
in float tail_angle; // the rotation of the partial circle
|
|
38
|
+
in vec4 color;
|
|
39
|
+
in float radius; // in meter
|
|
40
|
+
in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
41
|
+
// flat out int vid;
|
|
42
|
+
// flat out float v_phase;
|
|
43
|
+
out vec2 v_pos;
|
|
44
|
+
out vec4 v_color;
|
|
45
|
+
// flat out float v_angle;
|
|
46
|
+
|
|
47
|
+
void main() {
|
|
48
|
+
// vid = gl_VertexID;
|
|
49
|
+
if (color_mode == 2.0 || radius == 0.0) { return; }
|
|
50
|
+
float color_mode_ = color_mode;
|
|
51
|
+
if ( draw_mode == 0 && color_mode == 1.0) {color_mode_ = 0.0;}
|
|
52
|
+
float vertexID = float(gl_VertexID);
|
|
53
|
+
float radius_ = radius;
|
|
54
|
+
float alpha = plugin_alpha_multiplier;
|
|
55
|
+
if (draw_mode == 1) { // TRIANGLE_FAN
|
|
56
|
+
if (gl_VertexID == 0) {
|
|
57
|
+
radius_ = 0.0;
|
|
58
|
+
if ( color_mode == 1.0 ) { alpha = 0.0; }
|
|
59
|
+
}
|
|
60
|
+
vertexID -= 1.0;
|
|
61
|
+
}
|
|
62
|
+
float phase = ( vertexID / (edge_count - 1.0) );
|
|
63
|
+
// v_angle = tail_angle;
|
|
64
|
+
|
|
65
|
+
if ( color_mode_ == 1.0 ) {
|
|
66
|
+
if ( tail_angle < 0.0 ) {
|
|
67
|
+
v_color = vec4( color.rgb , color.a * ( 1.0 - phase ) * alpha );
|
|
68
|
+
} else {
|
|
69
|
+
v_color = vec4( color.rgb , color.a * phase * alpha );
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
v_color = vec4( color.rgb , color.a * alpha );
|
|
73
|
+
}
|
|
74
|
+
if ( color_mode == 0.0 && draw_mode == 1 ) {
|
|
75
|
+
v_color.a /= 2.0;
|
|
76
|
+
}
|
|
77
|
+
float angle;
|
|
78
|
+
if ( tail_angle > 0.0 ) {
|
|
79
|
+
angle = tail_angle * (-phase + 1.0) + start_angle;
|
|
80
|
+
} else {
|
|
81
|
+
angle = tail_angle * phase + start_angle;
|
|
82
|
+
}
|
|
83
|
+
if (is3D) {
|
|
84
|
+
|
|
85
|
+
vec3 pos = circleLimpFromLongLatRadCenterCartesian3D(center, radius_, angle);
|
|
86
|
+
v_pos = vec2(0.0, 0.0);
|
|
87
|
+
gl_Position = cartesian3DToGLPosition(pos);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
|
|
91
|
+
vec2 pos = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
|
|
92
|
+
v_pos = pos;
|
|
93
|
+
gl_Position = mercatorXYToGLPosition(pos);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
gl_PointSize = 10.0;
|
|
97
|
+
}`;
|
|
98
|
+
const fragmentShaderSource = `#version 300 es` + geometrytransformations_1.POLE + geometrytransformations_1.PI + `
|
|
99
|
+
precision highp float;
|
|
100
|
+
// flat in int vid;
|
|
101
|
+
in vec4 v_color;
|
|
102
|
+
in vec2 v_pos;
|
|
103
|
+
// flat in float v_phase;
|
|
104
|
+
// in float v_angle;
|
|
105
|
+
out vec4 outColor;
|
|
106
|
+
void main() {
|
|
107
|
+
// if( vid % 2 == 0 ) { discard; }
|
|
108
|
+
// if ( mod(v_angle, PI / 36.0 ) < (PI / 72.0)) { discard; }
|
|
109
|
+
// if ( mod(v_angle * v_phase, PI / 90.0 ) < (PI / 180.0)) { discard; }
|
|
110
|
+
if ( v_pos.x < -POLE || v_pos.x > POLE || v_pos.y < -POLE || v_pos.y > POLE ) { discard; }
|
|
111
|
+
outColor = v_color;
|
|
112
|
+
}`;
|
|
22
113
|
exports.ITEM_SIZE = 10;
|
|
23
|
-
|
|
24
|
-
|
|
114
|
+
class Logic {
|
|
115
|
+
constructor(globe) {
|
|
25
116
|
this.globe = globe;
|
|
26
117
|
this.gl = globe.gl;
|
|
27
118
|
this._lastMode = 0;
|
|
28
119
|
this._lastEdgeCount = 64;
|
|
29
120
|
this._lastAlphaMultiplier = 1.0;
|
|
30
121
|
this.program = (0, util_1.createProgram)(this.gl, vertexShaderSource, fragmentShaderSource);
|
|
31
|
-
|
|
122
|
+
const { gl, program } = this;
|
|
32
123
|
{ // set attributes locations
|
|
33
124
|
gl.bindAttribLocation(program, 0, 'center');
|
|
34
125
|
gl.bindAttribLocation(program, 1, 'start_angle');
|
|
@@ -43,20 +134,20 @@ var Logic = /** @class */ (function () {
|
|
|
43
134
|
this._edgeCountLocation = gl.getUniformLocation(program, 'edge_count');
|
|
44
135
|
this._draw_modeLocation = gl.getUniformLocation(program, 'draw_mode');
|
|
45
136
|
this._plugin_alpha_multiplierLocation = gl.getUniformLocation(program, 'plugin_alpha_multiplier');
|
|
46
|
-
|
|
137
|
+
const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
47
138
|
gl.useProgram(program);
|
|
48
139
|
gl.uniform1i(this._draw_modeLocation, this._lastMode);
|
|
49
140
|
gl.uniform1f(this._edgeCountLocation, this._lastEdgeCount);
|
|
50
141
|
gl.uniform1f(this._plugin_alpha_multiplierLocation, 1.0);
|
|
51
142
|
this.cameraBlockBindingPoint = 0;
|
|
52
143
|
this.cameraBlockTotem = programs_1.globeProgramCache.getProgram(globe, programs_1.CameraUniformBlockTotem);
|
|
53
|
-
|
|
144
|
+
const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
|
|
54
145
|
gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
55
146
|
gl.useProgram(currentProgram);
|
|
56
147
|
}
|
|
57
148
|
}
|
|
58
|
-
|
|
59
|
-
|
|
149
|
+
draw(length, vao, edgeCount, alphaMultiplier, drawMode) {
|
|
150
|
+
const { gl, program, cameraBlockTotem, cameraBlockBindingPoint } = this;
|
|
60
151
|
// gl.disable(gl.DEPTH_TEST);
|
|
61
152
|
gl.useProgram(program);
|
|
62
153
|
if (drawMode !== this._lastMode) {
|
|
@@ -71,27 +162,27 @@ var Logic = /** @class */ (function () {
|
|
|
71
162
|
gl.uniform1f(this._plugin_alpha_multiplierLocation, alphaMultiplier);
|
|
72
163
|
this._lastAlphaMultiplier = alphaMultiplier;
|
|
73
164
|
}
|
|
74
|
-
|
|
165
|
+
const overdraw = drawModeMap[drawMode];
|
|
75
166
|
cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
76
167
|
gl.bindVertexArray(vao);
|
|
77
168
|
gl.drawArraysInstanced(gl[drawMode], 0, edgeCount + overdraw, length);
|
|
78
169
|
cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
79
170
|
gl.bindVertexArray(null);
|
|
80
171
|
// gl.enable(gl.DEPTH_TEST);
|
|
81
|
-
}
|
|
82
|
-
|
|
172
|
+
}
|
|
173
|
+
free() {
|
|
83
174
|
programs_1.noRegisterGlobeProgramCache.releaseProgram(this.globe, programs_1.CameraUniformBlockTotem);
|
|
84
175
|
this.gl.deleteProgram(this.program);
|
|
85
176
|
this.program = null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
177
|
+
}
|
|
178
|
+
getVaoBuffer() {
|
|
179
|
+
const { gl } = this;
|
|
180
|
+
const vao = gl.createVertexArray();
|
|
181
|
+
const buffer = gl.createBuffer();
|
|
91
182
|
gl.bindVertexArray(vao);
|
|
92
183
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
93
|
-
|
|
94
|
-
|
|
184
|
+
const stride = exports.ITEM_SIZE * 4;
|
|
185
|
+
let offset = 0;
|
|
95
186
|
gl.enableVertexAttribArray(0);
|
|
96
187
|
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
|
|
97
188
|
offset += 2 * 4;
|
|
@@ -118,10 +209,10 @@ var Logic = /** @class */ (function () {
|
|
|
118
209
|
gl.bindVertexArray(null);
|
|
119
210
|
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
120
211
|
return {
|
|
121
|
-
vao
|
|
122
|
-
buffer
|
|
212
|
+
vao,
|
|
213
|
+
buffer,
|
|
123
214
|
};
|
|
124
|
-
}
|
|
215
|
+
}
|
|
125
216
|
/**
|
|
126
217
|
* in vec2 center; // long, lat in radian
|
|
127
218
|
in float start_angle; // the start of partial circle from bearing point
|
|
@@ -130,47 +221,47 @@ in vec4 color;
|
|
|
130
221
|
in float radius; // in meter
|
|
131
222
|
in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
132
223
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
224
|
+
createVAO(centerObj, startAngleObj, tailAngleObj, colorObj, radiusObj, colorModeObj) {
|
|
225
|
+
const { gl } = this;
|
|
226
|
+
const vao = gl.createVertexArray();
|
|
136
227
|
gl.bindVertexArray(vao);
|
|
137
228
|
{
|
|
138
|
-
|
|
229
|
+
const { buffer, stride, offset } = centerObj;
|
|
139
230
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
140
231
|
gl.enableVertexAttribArray(0);
|
|
141
232
|
gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
|
|
142
233
|
gl.vertexAttribDivisor(0, 1);
|
|
143
234
|
}
|
|
144
235
|
{
|
|
145
|
-
|
|
236
|
+
const { buffer, stride, offset } = startAngleObj;
|
|
146
237
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
147
238
|
gl.enableVertexAttribArray(1);
|
|
148
239
|
gl.vertexAttribPointer(1, 1, gl.FLOAT, false, stride, offset);
|
|
149
240
|
gl.vertexAttribDivisor(1, 1);
|
|
150
241
|
}
|
|
151
242
|
{
|
|
152
|
-
|
|
243
|
+
const { buffer, stride, offset } = tailAngleObj;
|
|
153
244
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
154
245
|
gl.enableVertexAttribArray(2);
|
|
155
246
|
gl.vertexAttribPointer(2, 1, gl.FLOAT, false, stride, offset);
|
|
156
247
|
gl.vertexAttribDivisor(2, 1);
|
|
157
248
|
}
|
|
158
249
|
{
|
|
159
|
-
|
|
250
|
+
const { buffer, stride, offset } = colorObj;
|
|
160
251
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
161
252
|
gl.enableVertexAttribArray(3);
|
|
162
253
|
gl.vertexAttribPointer(3, 4, gl.FLOAT, false, stride, offset);
|
|
163
254
|
gl.vertexAttribDivisor(3, 1);
|
|
164
255
|
}
|
|
165
256
|
{
|
|
166
|
-
|
|
257
|
+
const { buffer, stride, offset } = radiusObj;
|
|
167
258
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
168
259
|
gl.enableVertexAttribArray(4);
|
|
169
260
|
gl.vertexAttribPointer(4, 1, gl.FLOAT, false, stride, offset);
|
|
170
261
|
gl.vertexAttribDivisor(4, 1);
|
|
171
262
|
}
|
|
172
263
|
{
|
|
173
|
-
|
|
264
|
+
const { buffer, stride, offset } = colorModeObj;
|
|
174
265
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
175
266
|
gl.enableVertexAttribArray(5);
|
|
176
267
|
gl.vertexAttribPointer(5, 1, gl.FLOAT, false, stride, offset);
|
|
@@ -179,19 +270,17 @@ in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
|
|
|
179
270
|
gl.bindVertexArray(null);
|
|
180
271
|
gl.bindBuffer(gl.ARRAY_BUFFER, null);
|
|
181
272
|
return vao;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var _e = this.getVaoBuffer(), vao = _e.vao, buffer = _e.buffer;
|
|
273
|
+
}
|
|
274
|
+
getBufferManagerAndVao({ capacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
|
|
275
|
+
const { vao, buffer } = this.getVaoBuffer();
|
|
186
276
|
return {
|
|
187
|
-
bufferManager: new buffer_manager_1.default(this.globe, this.gl, buffer, { capacity
|
|
188
|
-
vao
|
|
277
|
+
bufferManager: new buffer_manager_1.default(this.globe, this.gl, buffer, { capacity, bufferType }),
|
|
278
|
+
vao
|
|
189
279
|
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
}());
|
|
280
|
+
}
|
|
281
|
+
}
|
|
193
282
|
exports.Logic = Logic;
|
|
194
283
|
exports.programCache = Object.freeze({
|
|
195
|
-
get:
|
|
196
|
-
release:
|
|
284
|
+
get: (globe) => programs_1.noRegisterGlobeProgramCache.getProgram(globe, Logic),
|
|
285
|
+
release: (globe) => programs_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
|
|
197
286
|
});
|
package/pin/pin-object-array.js
CHANGED
|
@@ -21,8 +21,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const webglobe_1 = require("@pirireis/webglobe");
|
|
25
|
+
const AlarmTimeLineFadeInFadeOutPlugin_1 = __importDefault(require("../../plugins/alarms/alarmFadeInFadeOutPlugin/AlarmTimeLineFadeInFadeOutPlugin"));
|
|
26
26
|
/**
|
|
27
27
|
* @typedef {Object} IconPayload
|
|
28
28
|
* @property {string} app6DCode
|
|
@@ -44,25 +44,27 @@ var AlarmTimeLineFadeInFadeOutPlugin_1 = __importDefault(require("../../plugins/
|
|
|
44
44
|
* @property {number[]} coordsZ [z1, z2, ....]
|
|
45
45
|
* @property {PointPayload[]} attribs
|
|
46
46
|
*/
|
|
47
|
-
function addIconMap(globe, mapName, ICON_MAP_URL, ICON_MAP_JSON_URL) {
|
|
48
|
-
if (mapName === void 0) { mapName = "IconMapName"; }
|
|
47
|
+
function addIconMap(globe, mapName = "IconMapName", ICON_MAP_URL, ICON_MAP_JSON_URL) {
|
|
49
48
|
globe.api_AddIconMap('IconMapName', ICON_MAP_URL, ICON_MAP_JSON_URL);
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
class ObjectArray {
|
|
51
|
+
constructor(symbolSet, style) {
|
|
53
52
|
this.symbolSet = symbolSet;
|
|
54
53
|
this.style = style;
|
|
55
54
|
}
|
|
56
|
-
|
|
55
|
+
setSymbolSet(symbolSet) {
|
|
57
56
|
this.symbolSet = symbolSet;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class PinPointObjectArray {
|
|
60
|
+
constructor(id, globe, symbolSet, // iconMapName
|
|
61
|
+
style, callBacks = {
|
|
62
|
+
mouseDown: (pinItem, event) => { },
|
|
63
|
+
mouseMove: (pinItem, event) => { },
|
|
64
|
+
mouseUp: (pinItem, event) => { },
|
|
65
|
+
mouseClick: (pinItem, event) => { },
|
|
66
|
+
mouseDblClick: (pinItem, event) => { },
|
|
67
|
+
} = {}) {
|
|
66
68
|
this.id = id;
|
|
67
69
|
this.globe = globe;
|
|
68
70
|
this.symbolSet = symbolSet;
|
|
@@ -72,25 +74,25 @@ var PinPointObjectArray = /** @class */ (function () {
|
|
|
72
74
|
// this item will be used
|
|
73
75
|
this.currentItem = null;
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
insertPins(pins) {
|
|
78
|
+
}
|
|
79
|
+
deletePins(pinsIDs) {
|
|
80
|
+
const deleteBucket = {
|
|
79
81
|
coords: [],
|
|
80
82
|
coordsZ: [],
|
|
81
83
|
attribs: []
|
|
82
84
|
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
for (
|
|
88
|
-
|
|
85
|
+
}
|
|
86
|
+
_queryByScreenFindFirst() {
|
|
87
|
+
const { clientX, clientY } = this.globe.api_GetMousePos();
|
|
88
|
+
const allObjects = this.globe.queryByScreen(clientX, clientY);
|
|
89
|
+
for (let i = 0; i < allObjects.length; i++) {
|
|
90
|
+
const { obj, owner } = allObjects[i];
|
|
89
91
|
if (owner === this.objectArray) {
|
|
90
92
|
return obj;
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
|
-
}
|
|
95
|
+
}
|
|
94
96
|
// mouseDown(x, y, event) {
|
|
95
97
|
// return false
|
|
96
98
|
// }
|
|
@@ -108,29 +110,27 @@ var PinPointObjectArray = /** @class */ (function () {
|
|
|
108
110
|
// mouseDblClick() {
|
|
109
111
|
// return false
|
|
110
112
|
// }
|
|
111
|
-
|
|
113
|
+
free() {
|
|
112
114
|
this.globe.api_ClearMouseEvents(); // TODO
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
}
|
|
116
|
+
_setMouseEvent() {
|
|
117
|
+
const { globe } = this;
|
|
116
118
|
globe.api_SetMouseEvents();
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
}
|
|
120
|
+
_getIdForGlobe() {
|
|
121
|
+
const { globe, objectArray } = this;
|
|
122
|
+
const callback = () => {
|
|
123
|
+
const allObjects = globe.api_queryByScreen();
|
|
122
124
|
};
|
|
123
|
-
return
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var ObjectArrayLabels = /** @class */ (function () {
|
|
125
|
+
return `${this.id}_pinObjectArrayMouseEvent`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
class ObjectArrayLabels {
|
|
128
129
|
/**
|
|
129
130
|
* @param {number | string} id
|
|
130
131
|
* @param {CSGlobe} globe
|
|
131
132
|
*/
|
|
132
|
-
|
|
133
|
-
if (labelStyle === void 0) { labelStyle = null; }
|
|
133
|
+
constructor(id, globe, labelStyle = null) {
|
|
134
134
|
this.id = id;
|
|
135
135
|
this.setGlobe(globe);
|
|
136
136
|
this.data = [
|
|
@@ -151,7 +151,7 @@ var ObjectArrayLabels = /** @class */ (function () {
|
|
|
151
151
|
this._idCollector = new Set();
|
|
152
152
|
this._setStyle(labelStyle);
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
_setStyle(labelStyle) {
|
|
155
155
|
this.style = this.globe.ObjectArray.GetDefaultStyle();
|
|
156
156
|
if (labelStyle) {
|
|
157
157
|
this.style.labels[0] = labelStyle;
|
|
@@ -170,53 +170,52 @@ var ObjectArrayLabels = /** @class */ (function () {
|
|
|
170
170
|
this.style.labels[0].text = "${value}";
|
|
171
171
|
this.style.fidKey = this.primaryKey;
|
|
172
172
|
this.style.iconType = webglobe_1.CSIconTypes.NOICON; // milIcon ekleyebilmek için icon tipi MAP olmalı
|
|
173
|
-
}
|
|
173
|
+
}
|
|
174
174
|
/**
|
|
175
175
|
* @param {CSGlobe} [globe]
|
|
176
176
|
*/
|
|
177
|
-
|
|
177
|
+
setGlobe(globe) {
|
|
178
178
|
if (!globe)
|
|
179
179
|
return;
|
|
180
180
|
this.globe = globe;
|
|
181
|
-
}
|
|
182
|
-
|
|
181
|
+
}
|
|
182
|
+
addToMap() {
|
|
183
183
|
this.globe.ObjectArray.Add(this);
|
|
184
|
-
}
|
|
185
|
-
|
|
184
|
+
}
|
|
185
|
+
removeFromMap() {
|
|
186
186
|
this.flush();
|
|
187
187
|
this.globe.ObjectArray.Delete(this.id);
|
|
188
|
-
}
|
|
188
|
+
}
|
|
189
189
|
/**
|
|
190
190
|
* Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılır
|
|
191
191
|
* @param {PointObjectArray} data
|
|
192
192
|
*/
|
|
193
|
-
|
|
193
|
+
setData(data) {
|
|
194
194
|
this.globe.ObjectArray.SetData(this, [data]);
|
|
195
|
-
}
|
|
195
|
+
}
|
|
196
196
|
/**
|
|
197
197
|
* @param {PointObjectArray} data
|
|
198
198
|
* @param {CSObjectArrayUpdateTypes} operation
|
|
199
199
|
* @param {CanChangeOptions} [canChange]
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
updateData(data, operation, canChange) {
|
|
202
202
|
this.globe.ObjectArray.UpdateData(this, operation, [data], canChange);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
}
|
|
204
|
+
flush() {
|
|
205
|
+
const deleteBucket = {
|
|
206
206
|
coords: [],
|
|
207
207
|
coordsZ: [],
|
|
208
208
|
attribs: [],
|
|
209
209
|
};
|
|
210
210
|
this.setData(deleteBucket);
|
|
211
211
|
this._idCollector = new Set();
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
213
|
/**
|
|
214
214
|
* Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılmaz, ancak ön hesaplama maliyeti vardır
|
|
215
215
|
* @param {PointObjectArray} data
|
|
216
216
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
var paritalData = {
|
|
217
|
+
setControlledData(data) {
|
|
218
|
+
const paritalData = {
|
|
220
219
|
add: {
|
|
221
220
|
coords: [],
|
|
222
221
|
coordsZ: [],
|
|
@@ -244,19 +243,19 @@ var ObjectArrayLabels = /** @class */ (function () {
|
|
|
244
243
|
if (this._idCollector.size === 0) {
|
|
245
244
|
this.setData(data);
|
|
246
245
|
// Eklenen id'ler set edildi
|
|
247
|
-
for (
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
for (let i = 0; i < data.attribs.length; i++) {
|
|
247
|
+
const currentPayload = data.attribs[i];
|
|
248
|
+
const id = currentPayload[this.primaryKey];
|
|
250
249
|
this._idCollector.add(id);
|
|
251
250
|
}
|
|
252
251
|
return;
|
|
253
252
|
}
|
|
254
253
|
/** @type {Set<string>} */
|
|
255
|
-
|
|
256
|
-
for (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
const dataIds = new Set();
|
|
255
|
+
for (let i = 0; i < data.attribs.length; i++) {
|
|
256
|
+
const currentPayload = data.attribs[i];
|
|
257
|
+
const id = currentPayload[this.primaryKey];
|
|
258
|
+
let bucket = paritalData.add;
|
|
260
259
|
dataIds.add(id);
|
|
261
260
|
if (this._idCollector.has(id)) {
|
|
262
261
|
bucket = paritalData.update;
|
|
@@ -269,16 +268,15 @@ var ObjectArrayLabels = /** @class */ (function () {
|
|
|
269
268
|
bucket.attribs.push(currentPayload);
|
|
270
269
|
}
|
|
271
270
|
// Artık varolmayan elemenları sil
|
|
272
|
-
|
|
273
|
-
this._idCollector.forEach(
|
|
274
|
-
var _a;
|
|
271
|
+
const deleteBucket = paritalData.delete;
|
|
272
|
+
this._idCollector.forEach((id) => {
|
|
275
273
|
if (!dataIds.has(id)) {
|
|
276
|
-
|
|
274
|
+
this._idCollector.delete(id);
|
|
277
275
|
deleteBucket.coords.push(0, 0);
|
|
278
276
|
deleteBucket.coordsZ.push(0);
|
|
279
|
-
deleteBucket.attribs.push(
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
deleteBucket.attribs.push({
|
|
278
|
+
[this.primaryKey]: id,
|
|
279
|
+
});
|
|
282
280
|
}
|
|
283
281
|
});
|
|
284
282
|
if (paritalData.add.coords.length > 0) {
|
|
@@ -290,19 +288,18 @@ var ObjectArrayLabels = /** @class */ (function () {
|
|
|
290
288
|
if (paritalData.delete.coords.length > 0) {
|
|
291
289
|
this.updateData(paritalData.delete, webglobe_1.CSObjectArrayUpdateTypes.DELETE);
|
|
292
290
|
}
|
|
293
|
-
}
|
|
294
|
-
|
|
291
|
+
}
|
|
292
|
+
setPrimarykey(key) {
|
|
295
293
|
this.primaryKey = key;
|
|
296
|
-
}
|
|
297
|
-
|
|
294
|
+
}
|
|
295
|
+
setSymbolSet(symbolSet) {
|
|
298
296
|
this.symbolSet = symbolSet;
|
|
299
|
-
}
|
|
300
|
-
|
|
297
|
+
}
|
|
298
|
+
getLabelStyle() {
|
|
301
299
|
return this.style.labels[0];
|
|
302
|
-
}
|
|
303
|
-
|
|
300
|
+
}
|
|
301
|
+
setLabelStyle(style) {
|
|
304
302
|
this.style.labels[0] = style;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
}());
|
|
303
|
+
}
|
|
304
|
+
}
|
|
308
305
|
exports.default = ObjectArrayLabels;
|
package/pin/pin-point-totem.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This class registered as globe plugin one for each globe. to the head of plugin call stack.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
class PinPointTotem {
|
|
6
|
+
constructor(globe) {
|
|
7
7
|
this.objectArrayMap = new Map();
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
@@ -18,44 +18,43 @@ var PinPointTotem = /** @class */ (function () {
|
|
|
18
18
|
* keyUp
|
|
19
19
|
* }
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
registerPinMap(objectArray, callbacks) {
|
|
22
22
|
this.objectArrayMap.set(objectArray, callbacks);
|
|
23
|
-
}
|
|
24
|
-
|
|
23
|
+
}
|
|
24
|
+
unregisterPinMap(objectArray) {
|
|
25
25
|
if (this.objectArrayMap.has(objectArray)) {
|
|
26
26
|
this.objectArrayMap.delete(objectArray);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
console.warn('PinPointTotem objectArrayMap does not contain the objectArray');
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
// GlobeMethods
|
|
33
33
|
// haritada sol butona basıldığında çağrılır
|
|
34
|
-
|
|
34
|
+
mouseDown(x, y, event) {
|
|
35
35
|
return false;
|
|
36
|
-
}
|
|
36
|
+
}
|
|
37
37
|
// mouse'a basılıp hareket ettirildiğinde, mouseDown'dan true dönmüşse çağrılır
|
|
38
|
-
|
|
39
|
-
}
|
|
38
|
+
mouseMove(x, y, event) {
|
|
39
|
+
}
|
|
40
40
|
// mouse up'ın left'i mouseDown'dan true dönmüşse çağrılır, edit mode içindir
|
|
41
41
|
// right'i ise sağ tıka basılıp bırakıldığında çağrılır
|
|
42
|
-
|
|
43
|
-
}
|
|
42
|
+
mouseUp(x, y, event) {
|
|
43
|
+
}
|
|
44
44
|
// harita üzerinde tıklandığında çağrılır
|
|
45
|
-
|
|
45
|
+
mouseClick(x, y, event) {
|
|
46
46
|
return false;
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
// harita üzerinde çift tıklandığında çağrılır
|
|
49
|
-
|
|
49
|
+
mouseDblClick(x, y, event) {
|
|
50
50
|
return false;
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
52
|
// klavyeden bir tuşa basıldığı anda ve tuşa basılı kalınmaya devam edildiği durumlarda çalışır
|
|
53
|
-
|
|
53
|
+
keyDown(event) {
|
|
54
54
|
return false;
|
|
55
|
-
}
|
|
55
|
+
}
|
|
56
56
|
// klavyedeki bir tuştan parmak çekildiği anda çalışır
|
|
57
|
-
|
|
57
|
+
keyUp(event) {
|
|
58
58
|
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}());
|
|
59
|
+
}
|
|
60
|
+
}
|