@pirireis/webglobeplugins 0.9.8 → 0.9.9

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