@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.
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 +78 -80
  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 +14 -16
  9. package/Math/methods.js +65 -70
  10. package/Math/plane.js +16 -18
  11. package/Math/quaternion.js +45 -49
  12. package/Math/utils.js +2 -2
  13. package/Math/vec3.js +42 -45
  14. package/algorithms/search-binary.js +4 -4
  15. package/altitude-locator/draw-subset-obj.js +7 -8
  16. package/altitude-locator/plugin.js +98 -114
  17. package/arrowfield/adaptor.js +3 -4
  18. package/arrowfield/index.js +2 -2
  19. package/arrowfield/plugin.js +62 -65
  20. package/bearing-line/index.js +1 -1
  21. package/bearing-line/plugin.js +200 -226
  22. package/circle-line-chain/chain-list-map.js +82 -88
  23. package/circle-line-chain/plugin.js +134 -165
  24. package/circle-line-chain/util.js +1 -1
  25. package/compass-rose/compass-rose-padding-flat.js +108 -133
  26. package/compass-rose/compass-text-writer.js +62 -70
  27. package/compass-rose/index.js +2 -2
  28. package/compassrose/compassrose.js +46 -50
  29. package/compassrose/index.js +1 -1
  30. package/heatwave/index.js +2 -2
  31. package/heatwave/isobar/objectarraylabels.js +44 -48
  32. package/heatwave/isobar/plugin.js +104 -123
  33. package/heatwave/isobar/quadtreecontours.js +76 -92
  34. package/heatwave/plugins/heatwaveglobeshell.js +69 -87
  35. package/index.js +11 -11
  36. package/package.json +1 -1
  37. package/partialrings/buffer-manager.js +32 -64
  38. package/partialrings/index.js +1 -1
  39. package/partialrings/plugin.js +48 -84
  40. package/partialrings/program.js +136 -47
  41. package/pin/pin-object-array.js +83 -86
  42. package/pin/pin-point-totem.js +21 -22
  43. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +10 -10
  44. package/point-heat-map/plugin-webworker.js +40 -45
  45. package/point-heat-map/point-to-heat-map-flow.js +40 -42
  46. package/point-tracks/key-methods.js +1 -1
  47. package/point-tracks/plugin.js +137 -162
  48. package/programs/arrowfield/index.js +1 -1
  49. package/programs/arrowfield/logic.js +170 -62
  50. package/programs/arrowfield/object.js +33 -35
  51. package/programs/data2legend/density-to-legend.js +45 -21
  52. package/programs/data2legend/point-to-density-texture.js +52 -27
  53. package/programs/float2legendwithratio/index.js +1 -1
  54. package/programs/float2legendwithratio/logic.js +88 -42
  55. package/programs/float2legendwithratio/object.js +43 -46
  56. package/programs/globe-util/is-globe-moved.js +10 -11
  57. package/programs/globeshell/index.js +1 -1
  58. package/programs/globeshell/wiggle/index.js +1 -1
  59. package/programs/globeshell/wiggle/logic.js +191 -98
  60. package/programs/globeshell/wiggle/object.js +33 -35
  61. package/programs/helpers/blender/program.js +36 -19
  62. package/programs/helpers/fadeaway/index.js +1 -1
  63. package/programs/helpers/fadeaway/logic.js +35 -13
  64. package/programs/helpers/fadeaway/object.js +9 -10
  65. package/programs/helpers/index.js +1 -1
  66. package/programs/index.js +8 -8
  67. package/programs/line-on-globe/angled-line.js +91 -32
  68. package/programs/line-on-globe/circle-accurate-3d.js +82 -32
  69. package/programs/line-on-globe/circle-accurate-flat.js +108 -50
  70. package/programs/line-on-globe/circle-accurate.js +103 -33
  71. package/programs/line-on-globe/circle.js +97 -32
  72. package/programs/line-on-globe/degree-padding-around-circle-3d.js +83 -33
  73. package/programs/line-on-globe/lines-color-instanced-flat.js +79 -34
  74. package/programs/line-on-globe/linestrip.js +111 -45
  75. package/programs/line-on-globe/naive-accurate-flexible.js +120 -50
  76. package/programs/line-on-globe/to-the-surface.js +58 -29
  77. package/programs/line-on-globe/util.js +1 -1
  78. package/programs/picking/pickable-renderer.js +117 -33
  79. package/programs/point-on-globe/element-globe-surface-glow.js +78 -38
  80. package/programs/point-on-globe/element-point-glow.js +103 -35
  81. package/programs/point-on-globe/square-pixel-point.js +76 -27
  82. package/programs/programcache.js +13 -13
  83. package/programs/rings/distancering/circleflatprogram.js +63 -21
  84. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +156 -145
  85. package/programs/rings/distancering/circlepaddysharedbuffer.js +121 -197
  86. package/programs/rings/distancering/index.js +4 -4
  87. package/programs/rings/distancering/paddyflatprogram.js +73 -20
  88. package/programs/rings/distancering/paddyflatprogram2d.js +75 -22
  89. package/programs/rings/distancering/paddyflatprogram3d.js +73 -20
  90. package/programs/rings/partial-ring/piece-of-pie.js +137 -35
  91. package/programs/totems/camerauniformblock.js +64 -51
  92. package/programs/totems/canvas-webglobe-info.js +48 -40
  93. package/programs/totems/gpu-selection-uniform-block.js +44 -40
  94. package/programs/totems/index.js +1 -1
  95. package/programs/two-d/pixel-padding-for-compass.js +90 -29
  96. package/programs/util.js +6 -7
  97. package/programs/vectorfields/index.js +1 -1
  98. package/programs/vectorfields/logics/drawrectangleparticles.js +70 -29
  99. package/programs/vectorfields/logics/index.js +3 -3
  100. package/programs/vectorfields/logics/pixelbased.js +91 -35
  101. package/programs/vectorfields/logics/ubo.js +31 -25
  102. package/programs/vectorfields/pingpongbuffermanager.js +30 -34
  103. package/rangerings/index.js +4 -4
  104. package/rangerings/plugin.js +202 -258
  105. package/rangerings/rangeringangletext.js +108 -120
  106. package/rangerings/ring-account.js +52 -69
  107. package/shaders/fragment-toy/firework.js +55 -1
  108. package/shaders/fragment-toy/singularity.js +55 -1
  109. package/timetracks/adaptors-line-strip.js +26 -37
  110. package/timetracks/adaptors.js +47 -61
  111. package/timetracks/index.js +4 -4
  112. package/timetracks/plugin-line-strip.js +63 -71
  113. package/timetracks/plugin.js +69 -77
  114. package/timetracks/program-line-strip.js +296 -103
  115. package/timetracks/program.js +419 -113
  116. package/timetracks/programpoint-line-strip.js +97 -44
  117. package/timetracks/programpoint.js +90 -44
  118. package/util/account/bufferoffsetmanager.js +72 -95
  119. package/util/account/index.js +1 -1
  120. package/util/account/single-attribute-buffer-management/buffer-manager.js +44 -44
  121. package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +68 -94
  122. package/util/account/single-attribute-buffer-management/index.js +3 -3
  123. package/util/account/single-attribute-buffer-management/object-store.js +29 -30
  124. package/util/account/util.js +2 -4
  125. package/util/algorithms/search-binary.js +4 -4
  126. package/util/check/get.js +5 -5
  127. package/util/check/typecheck.js +13 -15
  128. package/util/geometry/index.js +9 -11
  129. package/util/gl-util/buffer/attribute-loader.js +8 -20
  130. package/util/gl-util/buffer/index.js +1 -1
  131. package/util/gl-util/draw-options/methods.js +8 -9
  132. package/util/gl-util/uniform-block/manager.js +67 -67
  133. package/util/heatwavedatamanager/datamanager.js +56 -116
  134. package/util/heatwavedatamanager/index.js +2 -2
  135. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +37 -40
  136. package/util/heatwavedatamanager/pointcoordsmeta.js +9 -10
  137. package/util/index.js +6 -6
  138. package/util/interpolation/timetrack/index.js +1 -1
  139. package/util/interpolation/timetrack/timetrack-interpolator.js +27 -29
  140. package/util/interpolation/timetrack/web-worker-str.js +179 -1
  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 +46 -52
  146. package/util/programs/draw-texture-on-canvas.js +39 -21
  147. package/util/programs/shapesonglobe.js +104 -64
  148. package/util/programs/supersampletotextures.js +45 -39
  149. package/util/programs/texturetoglobe.js +98 -48
  150. package/util/shaderfunctions/geometrytransformations.js +322 -27
  151. package/util/shaderfunctions/nodata.js +7 -1
  152. package/util/shaderfunctions/noisefunctions.js +39 -9
  153. package/util/surface-line-data/arcs-to-cuts.js +20 -23
  154. package/util/webglobe/rasteroverlay.js +35 -37
  155. package/util/webglobjectbuilders.js +55 -60
  156. package/util/webglobjectbuilders1.js +48 -49
  157. package/waveparticles/adaptor.js +6 -7
  158. package/waveparticles/index.js +2 -2
  159. package/waveparticles/plugin.js +79 -84
  160. package/wind/imagetovectorfieldandmagnitude.js +15 -15
  161. package/wind/index.js +4 -4
  162. package/wind/plugin.js +453 -251
  163. package/wind/vectorfieldimage.js +5 -5
  164. package/write-text/attached-text-writer.js +46 -48
  165. package/write-text/context-text.js +51 -58
  166. package/write-text/context-text3.js +69 -74
@@ -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
- 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");
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
- var drawModeMap = Object.freeze({
16
+ const drawModeMap = Object.freeze({
17
17
  LINE_STRIP: 0,
18
18
  TRIANGLE_FAN: 1,
19
19
  });
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}";
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
- var Logic = /** @class */ (function () {
24
- function Logic(globe) {
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
- var _a = this, gl = _a.gl, program = _a.program;
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
- var currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
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
- var cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
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
- 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;
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
- var overdraw = drawModeMap[drawMode];
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
- Logic.prototype.free = function () {
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
- Logic.prototype.getVaoBuffer = function () {
88
- var gl = this.gl;
89
- var vao = gl.createVertexArray();
90
- var buffer = gl.createBuffer();
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
- var stride = exports.ITEM_SIZE * 4;
94
- var offset = 0;
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: vao,
122
- buffer: 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
- Logic.prototype.createVAO = function (centerObj, startAngleObj, tailAngleObj, colorObj, radiusObj, colorModeObj) {
134
- var gl = this.gl;
135
- var vao = gl.createVertexArray();
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
- var buffer = centerObj.buffer, stride = centerObj.stride, offset = centerObj.offset;
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
- var buffer = startAngleObj.buffer, stride = startAngleObj.stride, offset = startAngleObj.offset;
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
- var buffer = tailAngleObj.buffer, stride = tailAngleObj.stride, offset = tailAngleObj.offset;
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
- var buffer = colorObj.buffer, stride = colorObj.stride, offset = colorObj.offset;
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
- var buffer = radiusObj.buffer, stride = radiusObj.stride, offset = radiusObj.offset;
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
- var buffer = colorModeObj.buffer, stride = colorModeObj.stride, offset = colorModeObj.offset;
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
- 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;
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: capacity, bufferType: bufferType }),
188
- vao: vao
277
+ bufferManager: new buffer_manager_1.default(this.globe, this.gl, buffer, { capacity, bufferType }),
278
+ vao
189
279
  };
190
- };
191
- return Logic;
192
- }());
280
+ }
281
+ }
193
282
  exports.Logic = Logic;
194
283
  exports.programCache = Object.freeze({
195
- get: function (globe) { return programs_1.noRegisterGlobeProgramCache.getProgram(globe, Logic); },
196
- release: function (globe) { return programs_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
284
+ get: (globe) => programs_1.noRegisterGlobeProgramCache.getProgram(globe, Logic),
285
+ release: (globe) => programs_1.noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
197
286
  });
@@ -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
- var webglobe_1 = require("@pirireis/webglobe");
25
- var AlarmTimeLineFadeInFadeOutPlugin_1 = __importDefault(require("../../plugins/alarms/alarmFadeInFadeOutPlugin/AlarmTimeLineFadeInFadeOutPlugin"));
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
- var ObjectArray = /** @class */ (function () {
52
- function ObjectArray(symbolSet, style) {
50
+ class ObjectArray {
51
+ constructor(symbolSet, style) {
53
52
  this.symbolSet = symbolSet;
54
53
  this.style = style;
55
54
  }
56
- ObjectArray.prototype.setSymbolSet = function (symbolSet) {
55
+ setSymbolSet(symbolSet) {
57
56
  this.symbolSet = symbolSet;
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); }
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
- PinPointObjectArray.prototype.insertPins = function (pins) {
76
- };
77
- PinPointObjectArray.prototype.deletePins = function (pinsIDs) {
78
- var deleteBucket = {
77
+ insertPins(pins) {
78
+ }
79
+ deletePins(pinsIDs) {
80
+ const deleteBucket = {
79
81
  coords: [],
80
82
  coordsZ: [],
81
83
  attribs: []
82
84
  };
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;
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
- PinPointObjectArray.prototype.free = function () {
113
+ free() {
112
114
  this.globe.api_ClearMouseEvents(); // TODO
113
- };
114
- PinPointObjectArray.prototype._setMouseEvent = function () {
115
- var globe = this.globe;
115
+ }
116
+ _setMouseEvent() {
117
+ const { globe } = this;
116
118
  globe.api_SetMouseEvents();
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();
119
+ }
120
+ _getIdForGlobe() {
121
+ const { globe, objectArray } = this;
122
+ const callback = () => {
123
+ const allObjects = globe.api_queryByScreen();
122
124
  };
123
- return "".concat(this.id, "_pinObjectArrayMouseEvent");
124
- };
125
- return PinPointObjectArray;
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
- function ObjectArrayLabels(id, globe, labelStyle) {
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
- ObjectArrayLabels.prototype._setStyle = function (labelStyle) {
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
- ObjectArrayLabels.prototype.setGlobe = function (globe) {
177
+ setGlobe(globe) {
178
178
  if (!globe)
179
179
  return;
180
180
  this.globe = globe;
181
- };
182
- ObjectArrayLabels.prototype.addToMap = function () {
181
+ }
182
+ addToMap() {
183
183
  this.globe.ObjectArray.Add(this);
184
- };
185
- ObjectArrayLabels.prototype.removeFromMap = function () {
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
- ObjectArrayLabels.prototype.setData = function (data) {
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
- ObjectArrayLabels.prototype.updateData = function (data, operation, canChange) {
201
+ updateData(data, operation, canChange) {
202
202
  this.globe.ObjectArray.UpdateData(this, operation, [data], canChange);
203
- };
204
- ObjectArrayLabels.prototype.flush = function () {
205
- var deleteBucket = {
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
- ObjectArrayLabels.prototype.setControlledData = function (data) {
218
- var _this = this;
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 (var i = 0; i < data.attribs.length; i++) {
248
- var currentPayload = data.attribs[i];
249
- var id = currentPayload[this.primaryKey];
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
- 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;
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
- var deleteBucket = paritalData.delete;
273
- this._idCollector.forEach(function (id) {
274
- var _a;
271
+ const deleteBucket = paritalData.delete;
272
+ this._idCollector.forEach((id) => {
275
273
  if (!dataIds.has(id)) {
276
- _this._idCollector.delete(id);
274
+ this._idCollector.delete(id);
277
275
  deleteBucket.coords.push(0, 0);
278
276
  deleteBucket.coordsZ.push(0);
279
- deleteBucket.attribs.push((_a = {},
280
- _a[_this.primaryKey] = id,
281
- _a));
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
- ObjectArrayLabels.prototype.setPrimarykey = function (key) {
291
+ }
292
+ setPrimarykey(key) {
295
293
  this.primaryKey = key;
296
- };
297
- ObjectArrayLabels.prototype.setSymbolSet = function (symbolSet) {
294
+ }
295
+ setSymbolSet(symbolSet) {
298
296
  this.symbolSet = symbolSet;
299
- };
300
- ObjectArrayLabels.prototype.getLabelStyle = function () {
297
+ }
298
+ getLabelStyle() {
301
299
  return this.style.labels[0];
302
- };
303
- ObjectArrayLabels.prototype.setLabelStyle = function (style) {
300
+ }
301
+ setLabelStyle(style) {
304
302
  this.style.labels[0] = style;
305
- };
306
- return ObjectArrayLabels;
307
- }());
303
+ }
304
+ }
308
305
  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
- var PinPointTotem = /** @class */ (function () {
6
- function PinPointTotem(globe) {
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
- PinPointTotem.prototype.registerPinMap = function (objectArray, callbacks) {
21
+ registerPinMap(objectArray, callbacks) {
22
22
  this.objectArrayMap.set(objectArray, callbacks);
23
- };
24
- PinPointTotem.prototype.unregisterPinMap = function (objectArray) {
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
- PinPointTotem.prototype.mouseDown = function (x, y, event) {
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
- PinPointTotem.prototype.mouseMove = function (x, y, event) {
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
- PinPointTotem.prototype.mouseUp = function (x, y, event) {
43
- };
42
+ mouseUp(x, y, event) {
43
+ }
44
44
  // harita üzerinde tıklandığında çağrılır
45
- PinPointTotem.prototype.mouseClick = function (x, y, event) {
45
+ mouseClick(x, y, event) {
46
46
  return false;
47
- };
47
+ }
48
48
  // harita üzerinde çift tıklandığında çağrılır
49
- PinPointTotem.prototype.mouseDblClick = function (x, y, event) {
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
- PinPointTotem.prototype.keyDown = function (event) {
53
+ keyDown(event) {
54
54
  return false;
55
- };
55
+ }
56
56
  // klavyedeki bir tuştan parmak çekildiği anda çalışır
57
- PinPointTotem.prototype.keyUp = function (event) {
57
+ keyUp(event) {
58
58
  return false;
59
- };
60
- return PinPointTotem;
61
- }());
59
+ }
60
+ }