@pirireis/webglobeplugins 0.9.10 → 0.9.11

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