@pirireis/webglobeplugins 0.9.6 → 0.9.7

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 (226) hide show
  1. package/package.json +5 -2
  2. package/Math/angle-calculation.js +0 -14
  3. package/Math/arc.ts +0 -76
  4. package/Math/bounds/line-bbox.js +0 -225
  5. package/Math/constants.ts +0 -11
  6. package/Math/frustum/camera.ts +0 -32
  7. package/Math/frustum/from-globeinfo.ts +0 -63
  8. package/Math/frustum/types.ts +0 -11
  9. package/Math/globe-util/horizon-plane.ts +0 -137
  10. package/Math/index.js +0 -0
  11. package/Math/juction/arc-plane.ts +0 -114
  12. package/Math/juction/line-sphere.ts +0 -30
  13. package/Math/juction/plane-plane.ts +0 -66
  14. package/Math/line.ts +0 -70
  15. package/Math/matrix4.ts +0 -0
  16. package/Math/methods.js +0 -237
  17. package/Math/plane.ts +0 -86
  18. package/Math/quaternion.ts +0 -120
  19. package/Math/roadmap.md +0 -10
  20. package/Math/types.ts +0 -45
  21. package/Math/utils.js +0 -3
  22. package/Math/vec3.ts +0 -155
  23. package/algorithms/search-binary.js +0 -14
  24. package/altitude-locator/adaptors.js +0 -0
  25. package/altitude-locator/draw-subset-obj.js +0 -27
  26. package/altitude-locator/keymethod.js +0 -0
  27. package/altitude-locator/plugin.js +0 -439
  28. package/altitude-locator/types.js +0 -26
  29. package/arrowfield/adaptor.js +0 -11
  30. package/arrowfield/index.js +0 -3
  31. package/arrowfield/plugin.js +0 -128
  32. package/bearing-line/index.js +0 -2
  33. package/bearing-line/plugin.js +0 -512
  34. package/circle-line-chain/chain-list-map.js +0 -221
  35. package/circle-line-chain/init.js +0 -0
  36. package/circle-line-chain/plugin.js +0 -469
  37. package/circle-line-chain/readme.md +0 -57
  38. package/circle-line-chain/util.js +0 -1
  39. package/compass-rose/compass-rose-padding-flat.js +0 -266
  40. package/compass-rose/compass-text-writer.js +0 -173
  41. package/compass-rose/index.js +0 -3
  42. package/compassrose/compassrose.js +0 -341
  43. package/compassrose/index.js +0 -2
  44. package/depth-locator/readme.md +0 -26
  45. package/globe-types.ts +0 -13
  46. package/heatwave/index.js +0 -4
  47. package/heatwave/isobar/objectarraylabels.js +0 -247
  48. package/heatwave/isobar/plugin.js +0 -340
  49. package/heatwave/isobar/quadtreecontours.js +0 -336
  50. package/heatwave/plugins/heatwaveglobeshell.js +0 -258
  51. package/jest.config.js +0 -6
  52. package/partialrings/buffer-manager.js +0 -89
  53. package/partialrings/goals.md +0 -17
  54. package/partialrings/index.js +0 -3
  55. package/partialrings/plugin.js +0 -160
  56. package/partialrings/program.js +0 -324
  57. package/pin/pin-object-array.js +0 -381
  58. package/pin/pin-point-totem.js +0 -77
  59. package/point-heat-map/adaptors/timetracksplugin-format-to-this.js +0 -78
  60. package/point-heat-map/index.js +0 -0
  61. package/point-heat-map/plugin-webworker.js +0 -151
  62. package/point-heat-map/point-to-heat-map-flow.js +0 -150
  63. package/point-heat-map/readme.md +0 -15
  64. package/point-tracks/key-methods.js +0 -3
  65. package/point-tracks/plugin.js +0 -394
  66. package/programs/arrowfield/index.js +0 -2
  67. package/programs/arrowfield/logic.js +0 -286
  68. package/programs/arrowfield/object.js +0 -89
  69. package/programs/data2legend/density-to-legend.js +0 -115
  70. package/programs/data2legend/point-to-density-texture.js +0 -114
  71. package/programs/float2legendwithratio/index.js +0 -3
  72. package/programs/float2legendwithratio/logic.js +0 -194
  73. package/programs/float2legendwithratio/object.js +0 -141
  74. package/programs/globe-util/is-globe-moved.js +0 -27
  75. package/programs/globeshell/index.js +0 -2
  76. package/programs/globeshell/noise/noises.js +0 -0
  77. package/programs/globeshell/wiggle/index.js +0 -6
  78. package/programs/globeshell/wiggle/logic.js +0 -371
  79. package/programs/globeshell/wiggle/object.js +0 -93
  80. package/programs/helpers/blender/index.js +0 -0
  81. package/programs/helpers/blender/program.js +0 -91
  82. package/programs/helpers/fadeaway/index.js +0 -3
  83. package/programs/helpers/fadeaway/logic.js +0 -76
  84. package/programs/helpers/fadeaway/object.js +0 -20
  85. package/programs/helpers/index.js +0 -2
  86. package/programs/index.js +0 -21
  87. package/programs/interface.ts +0 -7
  88. package/programs/line-on-globe/angled-line.js +0 -206
  89. package/programs/line-on-globe/circle-accurate-3d.js +0 -167
  90. package/programs/line-on-globe/circle-accurate-flat.js +0 -262
  91. package/programs/line-on-globe/circle-accurate.js +0 -202
  92. package/programs/line-on-globe/circle.js +0 -191
  93. package/programs/line-on-globe/degree-padding-around-circle-3d.js +0 -188
  94. package/programs/line-on-globe/index.js +0 -0
  95. package/programs/line-on-globe/lines-color-instanced-flat.js +0 -151
  96. package/programs/line-on-globe/linestrip.ts +0 -228
  97. package/programs/line-on-globe/naive-accurate-flexible.js +0 -239
  98. package/programs/line-on-globe/to-the-surface.js +0 -129
  99. package/programs/line-on-globe/util.js +0 -8
  100. package/programs/picking/pickable-renderer.js +0 -216
  101. package/programs/point-on-globe/element-globe-surface-glow.js +0 -168
  102. package/programs/point-on-globe/element-point-glow.js +0 -184
  103. package/programs/point-on-globe/square-pixel-point.js +0 -189
  104. package/programs/programcache.ts +0 -131
  105. package/programs/rings/distancering/circleflatprogram.js +0 -136
  106. package/programs/rings/distancering/circlepaddingfreeangleprogram.js +0 -378
  107. package/programs/rings/distancering/circlepaddysharedbuffer.js +0 -420
  108. package/programs/rings/distancering/index.js +0 -5
  109. package/programs/rings/distancering/paddyflatprogram.js +0 -146
  110. package/programs/rings/distancering/paddyflatprogram2d.js +0 -150
  111. package/programs/rings/distancering/paddyflatprogram3d.js +0 -146
  112. package/programs/rings/distancering/shader.js +0 -0
  113. package/programs/rings/index.js +0 -1
  114. package/programs/rings/partial-ring/piece-of-pie.js +0 -315
  115. package/programs/totems/camerauniformblock.d.ts +0 -48
  116. package/programs/totems/camerauniformblock.js +0 -197
  117. package/programs/totems/canvas-webglobe-info.js +0 -136
  118. package/programs/totems/gpu-selection-uniform-block.js +0 -132
  119. package/programs/totems/index.ts +0 -2
  120. package/programs/two-d/pixel-circle.js +0 -0
  121. package/programs/two-d/pixel-padding-for-compass.js +0 -174
  122. package/programs/util.js +0 -20
  123. package/programs/vectorfields/index.js +0 -3
  124. package/programs/vectorfields/logics/drawrectangleparticles.js +0 -125
  125. package/programs/vectorfields/logics/index.js +0 -5
  126. package/programs/vectorfields/logics/pixelbased.js +0 -161
  127. package/programs/vectorfields/logics/ubo.js +0 -64
  128. package/programs/vectorfields/pingpongbuffermanager.js +0 -80
  129. package/publish.bat +0 -60
  130. package/rangerings/enum.js +0 -3
  131. package/rangerings/index.js +0 -5
  132. package/rangerings/plugin.js +0 -649
  133. package/rangerings/rangeringangletext.js +0 -368
  134. package/rangerings/ring-account.js +0 -129
  135. package/shaders/fragment-toy/firework.js +0 -55
  136. package/shaders/fragment-toy/singularity.js +0 -59
  137. package/shape-on-terrain/arc/naive/plugin.ts +0 -304
  138. package/shape-on-terrain/goal.md +0 -12
  139. package/tests/Math/junction/arc-plane.test.ts +0 -133
  140. package/tests/Math/junction/plane-plane.test.ts +0 -82
  141. package/tests/Math/plane.test.ts +0 -43
  142. package/tests/Math/vec3.test.ts +0 -14
  143. package/timetracks/adaptors-line-strip.js +0 -80
  144. package/timetracks/adaptors.js +0 -133
  145. package/timetracks/index.js +0 -6
  146. package/timetracks/plugin-line-strip.js +0 -295
  147. package/timetracks/plugin.js +0 -304
  148. package/timetracks/program-line-strip.js +0 -688
  149. package/timetracks/program.js +0 -850
  150. package/timetracks/programpoint-line-strip.js +0 -175
  151. package/timetracks/programpoint.js +0 -168
  152. package/timetracks/readme.md +0 -1
  153. package/tsconfig.json +0 -22
  154. package/types.ts +0 -17
  155. package/util/account/bufferoffsetmanager.js +0 -209
  156. package/util/account/index.js +0 -6
  157. package/util/account/single-attribute-buffer-management/buffer-manager.ts +0 -119
  158. package/util/account/single-attribute-buffer-management/buffer-orchestrator.ts +0 -173
  159. package/util/account/single-attribute-buffer-management/index.ts +0 -13
  160. package/util/account/single-attribute-buffer-management/object-store.ts +0 -65
  161. package/util/account/single-attribute-buffer-management/types.ts +0 -39
  162. package/util/account/util.js +0 -22
  163. package/util/algorithms/index.js +0 -0
  164. package/util/algorithms/search-binary.js +0 -26
  165. package/util/check/get.js +0 -13
  166. package/util/check/index.js +0 -0
  167. package/util/check/typecheck.js +0 -39
  168. package/util/geometry/index.js +0 -53
  169. package/util/gl-util/buffer/attribute-loader.ts +0 -85
  170. package/util/gl-util/buffer/index.ts +0 -6
  171. package/util/gl-util/buffer/types.ts +0 -13
  172. package/util/gl-util/draw-options/methods.ts +0 -66
  173. package/util/gl-util/draw-options/types.ts +0 -28
  174. package/util/gl-util/uniform-block/manager.ts +0 -187
  175. package/util/gl-util/uniform-block/roadmap.md +0 -70
  176. package/util/gl-util/uniform-block/shader.js +0 -0
  177. package/util/gl-util/uniform-block/types.ts +0 -27
  178. package/util/heatwavedatamanager/datamanager.js +0 -168
  179. package/util/heatwavedatamanager/index.js +0 -3
  180. package/util/heatwavedatamanager/pointcoordinatesdatacalculator.js +0 -133
  181. package/util/heatwavedatamanager/pointcoordsmeta.js +0 -22
  182. package/util/index.js +0 -13
  183. package/util/interpolation/index.js +0 -0
  184. package/util/interpolation/timetrack/index.js +0 -9
  185. package/util/interpolation/timetrack/timetrack-interpolator.js +0 -88
  186. package/util/interpolation/timetrack/web-worker-str.js +0 -180
  187. package/util/interpolation/timetrack/web-worker.js +0 -51
  188. package/util/jshelpers/data-filler.js +0 -19
  189. package/util/jshelpers/equality.js +0 -17
  190. package/util/jshelpers/index.js +0 -1
  191. package/util/jshelpers/timefilters.js +0 -32
  192. package/util/picking/fence.js +0 -46
  193. package/util/picking/picker-displayer.js +0 -177
  194. package/util/programs/draw-texture-on-canvas.js +0 -102
  195. package/util/programs/index.js +0 -1
  196. package/util/programs/shapesonglobe.js +0 -246
  197. package/util/programs/supersampletotextures.js +0 -142
  198. package/util/programs/texturetoglobe.js +0 -203
  199. package/util/shaderfunctions/geometrytransformations.ts +0 -388
  200. package/util/shaderfunctions/index.js +0 -2
  201. package/util/shaderfunctions/nodata.js +0 -10
  202. package/util/shaderfunctions/noisefunctions.js +0 -44
  203. package/util/surface-line-data/arc-bboxes.ts +0 -42
  204. package/util/surface-line-data/arcs-to-cuts.js +0 -74
  205. package/util/surface-line-data/cut-arc.js +0 -0
  206. package/util/surface-line-data/flow.ts +0 -52
  207. package/util/surface-line-data/rbush-manager.js +0 -0
  208. package/util/surface-line-data/types.ts +0 -27
  209. package/util/surface-line-data/web-worker.js +0 -0
  210. package/util/webglobe/gldefaultstates.js +0 -5
  211. package/util/webglobe/index.js +0 -2
  212. package/util/webglobe/rasteroverlay.js +0 -96
  213. package/util/webglobjectbuilders.ts +0 -456
  214. package/util/webglobjectbuilders1.js +0 -271
  215. package/waveparticles/adaptor.js +0 -16
  216. package/waveparticles/index.js +0 -3
  217. package/waveparticles/plugin.js +0 -313
  218. package/wind/imagetovectorfieldandmagnitude.js +0 -39
  219. package/wind/index.js +0 -5
  220. package/wind/plugin.js +0 -1057
  221. package/wind/vectorfieldimage.js +0 -27
  222. package/write-text/attached-text-writer.js +0 -105
  223. package/write-text/context-text.js +0 -125
  224. package/write-text/context-text3.js +0 -178
  225. package/write-text/index.js +0 -1
  226. package/write-text/writer-plugin.js +0 -7
@@ -1,324 +0,0 @@
1
- import { createProgram, shaderfunctions } from "../util";
2
- import { CameraUniformBlockTotem, CameraUniformBlockString, noRegisterGlobeProgramCache, globeProgramCache } from "../programs";
3
- import BufferManager from "./buffer-manager";
4
- import {
5
- POLE,
6
- PI,
7
- longLatRadToMercator,
8
- mercatorXYToGLPosition,
9
- longLatRadToCartesian3D,
10
- circleLimpFromLongLatRadCenterCartesian3D,
11
- circleLimpFromLongLatRadCenterMercatorRealDistance,
12
- cartesian3DToGLPosition
13
-
14
-
15
- } from "../util/shaderfunctions/geometrytransformations";
16
-
17
-
18
- /**
19
- * TODO:
20
- * 1. Triangle face looks at screen. if rotation angle is positive the last vertex must be the faintest.
21
- *
22
- */
23
-
24
- const drawModeMap = Object.freeze({
25
- LINE_STRIP: 0,
26
- TRIANGLE_FAN: 1,
27
- });
28
-
29
-
30
-
31
- const vertexShaderSource = `#version 300 es
32
-
33
- ${CameraUniformBlockString}
34
- ${PI}
35
- ${longLatRadToMercator}
36
- ${mercatorXYToGLPosition}
37
- ${longLatRadToCartesian3D}
38
- ${circleLimpFromLongLatRadCenterCartesian3D}
39
- ${circleLimpFromLongLatRadCenterMercatorRealDistance}
40
- ${cartesian3DToGLPosition}
41
-
42
- uniform float edge_count;
43
- uniform int draw_mode; // %2 => 0: LINE_STRIP, 1: TRIANGLE_FAN
44
- uniform float plugin_alpha_multiplier;
45
- //, lat, startAngle, tailAngle, ...rgba, radius, rgbaMode
46
- in vec2 center; // long, lat in radian
47
- in float start_angle; // the start of partial circle from bearing point
48
- in float tail_angle; // the rotation of the partial circle
49
- in vec4 color;
50
- in float radius; // in meter
51
- in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
52
- // flat out int vid;
53
- // flat out float v_phase;
54
- out vec2 v_pos;
55
- out vec4 v_color;
56
- // flat out float v_angle;
57
-
58
- void main() {
59
- // vid = gl_VertexID;
60
- if (color_mode == 2.0 || radius == 0.0) { return; }
61
- float color_mode_ = color_mode;
62
- if ( draw_mode == 0 && color_mode == 1.0) {color_mode_ = 0.0;}
63
- float vertexID = float(gl_VertexID);
64
- float radius_ = radius;
65
- float alpha = plugin_alpha_multiplier;
66
- if (draw_mode == 1) { // TRIANGLE_FAN
67
- if (gl_VertexID == 0) {
68
- radius_ = 0.0;
69
- if ( color_mode == 1.0 ) { alpha = 0.0; }
70
- }
71
- vertexID -= 1.0;
72
- }
73
- float phase = ( vertexID / (edge_count - 1.0) );
74
- // v_angle = tail_angle;
75
-
76
- if ( color_mode_ == 1.0 ) {
77
- if ( tail_angle < 0.0 ) {
78
- v_color = vec4( color.rgb , color.a * ( 1.0 - phase ) * alpha );
79
- } else {
80
- v_color = vec4( color.rgb , color.a * phase * alpha );
81
- }
82
- } else {
83
- v_color = vec4( color.rgb , color.a * alpha );
84
- }
85
- if ( color_mode == 0.0 && draw_mode == 1 ) {
86
- v_color.a /= 2.0;
87
- }
88
- float angle;
89
- if ( tail_angle > 0.0 ) {
90
- angle = tail_angle * (-phase + 1.0) + start_angle;
91
- } else {
92
- angle = tail_angle * phase + start_angle;
93
- }
94
- if (is3D) {
95
-
96
- vec3 pos = circleLimpFromLongLatRadCenterCartesian3D(center, radius_, angle);
97
- v_pos = vec2(0.0, 0.0);
98
- gl_Position = cartesian3DToGLPosition(pos);
99
- }
100
- else {
101
-
102
- vec2 pos = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius_, angle);
103
- v_pos = pos;
104
- gl_Position = mercatorXYToGLPosition(pos);
105
- }
106
-
107
- gl_PointSize = 10.0;
108
- }`;
109
-
110
-
111
- const fragmentShaderSource = `#version 300 es` + POLE + PI + `
112
- precision highp float;
113
- // flat in int vid;
114
- in vec4 v_color;
115
- in vec2 v_pos;
116
- // flat in float v_phase;
117
- // in float v_angle;
118
- out vec4 outColor;
119
- void main() {
120
- // if( vid % 2 == 0 ) { discard; }
121
- // if ( mod(v_angle, PI / 36.0 ) < (PI / 72.0)) { discard; }
122
- // if ( mod(v_angle * v_phase, PI / 90.0 ) < (PI / 180.0)) { discard; }
123
- if ( v_pos.x < -POLE || v_pos.x > POLE || v_pos.y < -POLE || v_pos.y > POLE ) { discard; }
124
- outColor = v_color;
125
- }`;
126
-
127
- export const ITEM_SIZE = 10;
128
-
129
- export class Logic {
130
-
131
- constructor(globe) {
132
- this.globe = globe;
133
- this.gl = globe.gl;
134
- this._lastMode = 0;
135
- this._lastEdgeCount = 64;
136
- this._lastAlphaMultiplier = 1.0;
137
-
138
- this.program = createProgram(this.gl, vertexShaderSource, fragmentShaderSource);
139
- const { gl, program } = this;
140
- { // set attributes locations
141
- gl.bindAttribLocation(program, 0, 'center');
142
- gl.bindAttribLocation(program, 1, 'start_angle');
143
- gl.bindAttribLocation(program, 2, 'tail_angle');
144
- gl.bindAttribLocation(program, 3, 'color');
145
- gl.bindAttribLocation(program, 4, 'radius');
146
- gl.bindAttribLocation(program, 5, 'color_mode');
147
- // vao
148
- // instanced draw read 1
149
- }
150
- { // Uniforms
151
- this._edgeCountLocation = gl.getUniformLocation(program, 'edge_count');
152
- this._draw_modeLocation = gl.getUniformLocation(program, 'draw_mode');
153
- this._plugin_alpha_multiplierLocation = gl.getUniformLocation(program, 'plugin_alpha_multiplier');
154
- const currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
155
- gl.useProgram(program);
156
- gl.uniform1i(this._draw_modeLocation, this._lastMode);
157
- gl.uniform1f(this._edgeCountLocation, this._lastEdgeCount);
158
- gl.uniform1f(this._plugin_alpha_multiplierLocation, 1.0);
159
-
160
- this.cameraBlockBindingPoint = 0;
161
- this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
162
- const cameraBlockIndex = gl.getUniformBlockIndex(program, "CameraUniformBlock");
163
- gl.uniformBlockBinding(program, cameraBlockIndex, this.cameraBlockBindingPoint);
164
-
165
- gl.useProgram(currentProgram);
166
- }
167
-
168
- }
169
-
170
-
171
-
172
- draw(length, vao, edgeCount, alphaMultiplier, drawMode) {
173
- const { gl, program, cameraBlockTotem, cameraBlockBindingPoint } = this
174
-
175
- // gl.disable(gl.DEPTH_TEST);
176
- gl.useProgram(program);
177
- if (drawMode !== this._lastMode) {
178
- gl.uniform1i(this._draw_modeLocation, drawModeMap[drawMode]);
179
- this._lastMode = drawMode;
180
- }
181
- if (edgeCount !== this._lastEdgeCount) {
182
- gl.uniform1f(this._edgeCountLocation, edgeCount);
183
- this._lastEdgeCount = edgeCount;
184
- }
185
- if (alphaMultiplier !== this._lastAlphaMultiplier) {
186
- gl.uniform1f(this._plugin_alpha_multiplierLocation, alphaMultiplier);
187
- this._lastAlphaMultiplier = alphaMultiplier;
188
- }
189
- const overdraw = drawModeMap[drawMode];
190
- cameraBlockTotem.bind(cameraBlockBindingPoint);
191
- gl.bindVertexArray(vao);
192
- gl.drawArraysInstanced(gl[drawMode], 0, edgeCount + overdraw, length);
193
- cameraBlockTotem.unbind(cameraBlockBindingPoint);
194
- gl.bindVertexArray(null);
195
- // gl.enable(gl.DEPTH_TEST);
196
- }
197
-
198
-
199
- free() {
200
- noRegisterGlobeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
201
- this.gl.deleteProgram(this.program);
202
- this.program = null;
203
- }
204
-
205
-
206
- getVaoBuffer() {
207
- const { gl } = this;
208
- const vao = gl.createVertexArray();
209
- const buffer = gl.createBuffer();
210
- gl.bindVertexArray(vao);
211
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
212
-
213
- const stride = ITEM_SIZE * 4;
214
- let offset = 0;
215
- gl.enableVertexAttribArray(0);
216
- gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
217
- offset += 2 * 4;
218
- gl.enableVertexAttribArray(1);
219
- gl.vertexAttribPointer(1, 1, gl.FLOAT, false, stride, offset);
220
- offset += 1 * 4;
221
- gl.enableVertexAttribArray(2);
222
- gl.vertexAttribPointer(2, 1, gl.FLOAT, false, stride, offset);
223
- offset += 1 * 4;
224
- gl.enableVertexAttribArray(3);
225
- gl.vertexAttribPointer(3, 4, gl.FLOAT, false, stride, offset);
226
- offset += 4 * 4;
227
- gl.enableVertexAttribArray(4);
228
- gl.vertexAttribPointer(4, 1, gl.FLOAT, false, stride, offset);
229
- offset += 1 * 4;
230
- gl.enableVertexAttribArray(5);
231
- gl.vertexAttribPointer(5, 1, gl.FLOAT, false, stride, offset);
232
-
233
- gl.vertexAttribDivisor(0, 1);
234
- gl.vertexAttribDivisor(1, 1);
235
- gl.vertexAttribDivisor(2, 1);
236
- gl.vertexAttribDivisor(3, 1);
237
- gl.vertexAttribDivisor(4, 1);
238
- gl.vertexAttribDivisor(5, 1);
239
- gl.bindVertexArray(null);
240
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
241
-
242
- return {
243
- vao,
244
- buffer,
245
- }
246
- }
247
-
248
- /**
249
- * in vec2 center; // long, lat in radian
250
- in float start_angle; // the start of partial circle from bearing point
251
- in float tail_angle; // the rotation of the partial circle
252
- in vec4 color;
253
- in float radius; // in meter
254
- in float color_mode; // 0.0: constant, 1.0: fading, 2.0: hide
255
- */
256
-
257
- createVAO(centerObj, startAngleObj, tailAngleObj, colorObj, radiusObj, colorModeObj) {
258
-
259
- const { gl } = this;
260
- const vao = gl.createVertexArray();
261
- gl.bindVertexArray(vao);
262
-
263
- {
264
- const { buffer, stride, offset } = centerObj;
265
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
266
- gl.enableVertexAttribArray(0);
267
- gl.vertexAttribPointer(0, 2, gl.FLOAT, false, stride, offset);
268
- gl.vertexAttribDivisor(0, 1);
269
- }
270
-
271
- {
272
- const { buffer, stride, offset } = startAngleObj;
273
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
274
- gl.enableVertexAttribArray(1);
275
- gl.vertexAttribPointer(1, 1, gl.FLOAT, false, stride, offset);
276
- gl.vertexAttribDivisor(1, 1);
277
- }
278
- {
279
- const { buffer, stride, offset } = tailAngleObj;
280
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
281
- gl.enableVertexAttribArray(2);
282
- gl.vertexAttribPointer(2, 1, gl.FLOAT, false, stride, offset);
283
- gl.vertexAttribDivisor(2, 1);
284
- }
285
- {
286
- const { buffer, stride, offset } = colorObj;
287
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
288
- gl.enableVertexAttribArray(3);
289
- gl.vertexAttribPointer(3, 4, gl.FLOAT, false, stride, offset);
290
- gl.vertexAttribDivisor(3, 1);
291
- }
292
- {
293
- const { buffer, stride, offset } = radiusObj;
294
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
295
- gl.enableVertexAttribArray(4);
296
- gl.vertexAttribPointer(4, 1, gl.FLOAT, false, stride, offset);
297
- gl.vertexAttribDivisor(4, 1);
298
- }
299
- {
300
- const { buffer, stride, offset } = colorModeObj;
301
- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
302
- gl.enableVertexAttribArray(5);
303
- gl.vertexAttribPointer(5, 1, gl.FLOAT, false, stride, offset);
304
- gl.vertexAttribDivisor(5, 1);
305
- }
306
- gl.bindVertexArray(null);
307
- gl.bindBuffer(gl.ARRAY_BUFFER, null);
308
- return vao;
309
- }
310
-
311
-
312
- getBufferManagerAndVao({ capacity = 10, bufferType = "DYNAMIC_DRAW" } = {}) {
313
- const { vao, buffer } = this.getVaoBuffer();
314
- return {
315
- bufferManager: new BufferManager(this.globe, this.gl, buffer, { capacity, bufferType }),
316
- vao
317
- };
318
- }
319
- }
320
-
321
- export const programCache = Object.freeze({
322
- get: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
323
- release: (globe) => noRegisterGlobeProgramCache.releaseProgram(globe, Logic)
324
- });
@@ -1,381 +0,0 @@
1
-
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
-
21
- import {
22
- CSGlobe,
23
- CSIconTypes,
24
- CSObjectTypes,
25
- CSObjectArrayUpdateTypes,
26
- } from "@pirireis/webglobe";
27
- import AlarmTimeLineFadeInFadeOut from "../../plugins/alarms/alarmFadeInFadeOutPlugin/AlarmTimeLineFadeInFadeOutPlugin";
28
-
29
- /**
30
- * @typedef {Object} IconPayload
31
- * @property {string} app6DCode
32
- * @property {string} accsCode
33
- */
34
-
35
- /**
36
- * @typedef {IconPayload & Object.<string, any>} PointPayload
37
- */
38
-
39
- /**
40
- * @typedef {Object} CanChangeOptions
41
- * @property {boolean} [attribs=false]
42
- * @property {boolean} [icon=false]
43
- * @property {boolean} [label=false]
44
- * @property {boolean} [heading=false]
45
- */
46
-
47
- /**
48
- * @typedef {Object} PointObjectArray
49
- * @property {number[]} coords [longitude1, latitude1, longitude2, latitude2, ....]
50
- * @property {number[]} coordsZ [z1, z2, ....]
51
- * @property {PointPayload[]} attribs
52
- */
53
-
54
- function addIconMap(globe, mapName = "IconMapName", ICON_MAP_URL, ICON_MAP_JSON_URL) {
55
- globe.api_AddIconMap('IconMapName', ICON_MAP_URL, ICON_MAP_JSON_URL);
56
- }
57
-
58
- class ObjectArray {
59
- constructor(symbolSet, style) {
60
- this.symbolSet = symbolSet;
61
- this.style = style;
62
- }
63
-
64
- setSymbolSet(symbolSet) {
65
- this.symbolSet = symbolSet;
66
- }
67
-
68
-
69
- }
70
-
71
-
72
- class PinPointObjectArray {
73
- constructor(id,
74
- globe,
75
- symbolSet, // iconMapName
76
- style,
77
- callBacks = {
78
- mouseDown: (pinItem, event) => { },
79
- mouseMove: (pinItem, event) => { },
80
- mouseUp: (pinItem, event) => { },
81
- mouseClick: (pinItem, event) => { },
82
- mouseDblClick: (pinItem, event) => { },
83
-
84
- } = {}) {
85
- this.id = id
86
- this.globe = globe;
87
- this.symbolSet = symbolSet;
88
- this.style = style;
89
- this.iconMapName = iconMapName;
90
- this.callBacks = callBacks;
91
-
92
- // this item will be used
93
-
94
- this.currentItem = null
95
- }
96
-
97
-
98
- insertPins(pins) {
99
-
100
- }
101
-
102
- deletePins(pinsIDs) {
103
- const deleteBucket = {
104
- coords: [],
105
- coordsZ: [],
106
- attribs: []
107
- }
108
- }
109
-
110
-
111
- _queryByScreenFindFirst() {
112
- const { clientX, clientY } = this.globe.api_GetMousePos();
113
- const allObjects = this.globe.queryByScreen(clientX, clientY);
114
- for (let i = 0; i < allObjects.length; i++) {
115
- const { obj, owner } = allObjects[i];
116
- if (owner === this.objectArray) {
117
- return obj;
118
- }
119
- }
120
- }
121
-
122
- // mouseDown(x, y, event) {
123
- // return false
124
- // }
125
-
126
-
127
- // // mouse'a basılıp hareket ettirildiğinde, mouseDown'dan true dönmüşse çağrılır
128
- // mouseMove(x, y, event) {
129
-
130
- // }
131
-
132
- // // mouse bırakıldığında çağrılır
133
- // mouseUp(x, y, event) {
134
-
135
- // }
136
-
137
- // // harita üzerinde tıklandığında çağrılır
138
- // mouseClick() {
139
- // return false
140
- // }
141
-
142
- // // harita üzerinde çift tıklandığında çağrılır
143
- // mouseDblClick() {
144
- // return false
145
- // }
146
-
147
-
148
- free() {
149
- this.globe.api_ClearMouseEvents() // TODO
150
- }
151
-
152
- _setMouseEvent() {
153
- const { globe } = this;
154
- globe.api_SetMouseEvents()
155
- }
156
-
157
- _getIdForGlobe() {
158
- const { globe, objectArray } = this;
159
- const callback = () => {
160
- const allObjects = globe.api_queryByScreen()
161
- }
162
- return `${this.id}_pinObjectArrayMouseEvent`;
163
- }
164
- }
165
-
166
- class ObjectArrayLabels {
167
- /**
168
- * @param {number | string} id
169
- * @param {CSGlobe} globe
170
- */
171
- constructor(id, globe, labelStyle = null) {
172
- this.id = id;
173
- this.setGlobe(globe);
174
-
175
- this.data = [
176
- {
177
- coords: [],
178
- coordsZ: [],
179
- attribs: [],
180
- },
181
- ];
182
-
183
- this.primaryKey = "id";
184
-
185
- this.objectType = CSObjectTypes.POINT;
186
- this.filter = null;
187
- this.bbox = null;
188
- this.startLod = 2;
189
- this.endLod = 19;
190
- this.query = true;
191
- this.reportObj = function (values, mouseEvent) { };
192
- this._idCollector = new Set();
193
- this._setStyle(labelStyle);
194
- }
195
-
196
-
197
-
198
- _setStyle(labelStyle) {
199
- this.style = this.globe.ObjectArray.GetDefaultStyle();
200
-
201
- if (labelStyle) {
202
- this.style.labels[0] = labelStyle;
203
- } else {
204
- this.style.labels[0].vAlignment = 2 // dikey olarak tam noktanın ortası
205
- this.style.labels[0].hAlignment = 2 // yatay olarak tam noktanın ortası
206
- this.style.labels[0].size = 11;
207
- this.style.labels[0].drawAlways = true;
208
- this.style.labels[0].fontFamily.name = "arial";
209
- this.style.labels[0].fontFamily.bold = false;
210
- this.style.labels[0].fontFamily.hollow = true;
211
- this.style.labels[0].fontFamily.hollowWidth = 1;
212
- this.style.labels[0].fontFamily.hollowOpacity = 1;
213
- }
214
-
215
- this.style.labels[0].text = "${value}";
216
- this.style.fidKey = this.primaryKey;
217
-
218
- this.style.iconType = CSIconTypes.NOICON; // milIcon ekleyebilmek için icon tipi MAP olmalı
219
- }
220
- /**
221
- * @param {CSGlobe} [globe]
222
- */
223
- setGlobe(globe) {
224
- if (!globe) return;
225
- this.globe = globe;
226
- }
227
-
228
- addToMap() {
229
- this.globe.ObjectArray.Add(this);
230
- }
231
-
232
- removeFromMap() {
233
- this.flush();
234
- this.globe.ObjectArray.Delete(this.id);
235
- }
236
-
237
- /**
238
- * Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılır
239
- * @param {PointObjectArray} data
240
- */
241
- setData(data) {
242
- this.globe.ObjectArray.SetData(this, [data]);
243
- }
244
-
245
- /**
246
- * @param {PointObjectArray} data
247
- * @param {CSObjectArrayUpdateTypes} operation
248
- * @param {CanChangeOptions} [canChange]
249
- */
250
- updateData(data, operation, canChange) {
251
- this.globe.ObjectArray.UpdateData(this, operation, [data], canChange);
252
- }
253
-
254
- flush() {
255
- const deleteBucket = {
256
- coords: [],
257
- coordsZ: [],
258
- attribs: [],
259
- };
260
- this.setData(deleteBucket);
261
- this._idCollector = new Set();
262
- }
263
-
264
- /**
265
- * Haritaya kullanılacak veriyi verir. Her çağrıldığında tüm hesaplamalar yeniden yapılmaz, ancak ön hesaplama maliyeti vardır
266
- * @param {PointObjectArray} data
267
- */
268
- setControlledData(data) {
269
- const paritalData = {
270
- add: {
271
- coords: [],
272
- coordsZ: [],
273
- attribs: [],
274
- },
275
- update: {
276
- coords: [],
277
- coordsZ: [],
278
- attribs: [],
279
- },
280
- delete: {
281
- coords: [],
282
- coordsZ: [],
283
- attribs: [],
284
- },
285
- canChange: {
286
- // Tüm değişimler gözardı edilecek
287
- attribs: false,
288
- icon: false,
289
- label: false,
290
- heading: false,
291
- },
292
- };
293
- // İlk toplu ekleme adımı
294
- if (this._idCollector.size === 0) {
295
- this.setData(data);
296
-
297
- // Eklenen id'ler set edildi
298
- for (let i = 0; i < data.attribs.length; i++) {
299
- const currentPayload = data.attribs[i];
300
- const id = currentPayload[this.primaryKey];
301
-
302
- this._idCollector.add(id);
303
- }
304
-
305
- return;
306
- }
307
-
308
- /** @type {Set<string>} */
309
- const dataIds = new Set();
310
-
311
- for (let i = 0; i < data.attribs.length; i++) {
312
- const currentPayload = data.attribs[i];
313
- const id = currentPayload[this.primaryKey];
314
-
315
- let bucket = paritalData.add;
316
-
317
- dataIds.add(id);
318
-
319
- if (this._idCollector.has(id)) {
320
- bucket = paritalData.update;
321
- } else {
322
- this._idCollector.add(id);
323
- }
324
-
325
- bucket.coords.push(data.coords[2 * i], data.coords[2 * i + 1]);
326
- bucket.coordsZ.push(data.coordsZ[i]);
327
- bucket.attribs.push(currentPayload);
328
- }
329
-
330
- // Artık varolmayan elemenları sil
331
- const deleteBucket = paritalData.delete;
332
- this._idCollector.forEach((id) => {
333
- if (!dataIds.has(id)) {
334
- this._idCollector.delete(id);
335
-
336
- deleteBucket.coords.push(0, 0);
337
- deleteBucket.coordsZ.push(0);
338
- deleteBucket.attribs.push({
339
- [this.primaryKey]: id,
340
- });
341
- }
342
- });
343
-
344
- if (paritalData.add.coords.length > 0) {
345
- this.updateData(paritalData.add, CSObjectArrayUpdateTypes.ADD);
346
- }
347
-
348
- if (paritalData.update.coords.length > 0) {
349
- this.updateData(
350
- paritalData.update,
351
- CSObjectArrayUpdateTypes.UPDATE,
352
- paritalData.canChange
353
- );
354
- }
355
-
356
- if (paritalData.delete.coords.length > 0) {
357
- this.updateData(paritalData.delete, CSObjectArrayUpdateTypes.DELETE);
358
- }
359
- }
360
-
361
-
362
- setPrimarykey(key) {
363
- this.primaryKey = key;
364
- }
365
-
366
- setSymbolSet(symbolSet) {
367
- this.symbolSet = symbolSet;
368
- }
369
-
370
- getLabelStyle() {
371
- return this.style.labels[0];
372
- }
373
-
374
- setLabelStyle(style) {
375
- this.style.labels[0] = style;
376
-
377
- }
378
- }
379
-
380
- export default ObjectArrayLabels;
381
-