@pirireis/webglobeplugins 0.12.0-alpha → 0.14.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Math/arc-cdf-points.js +20 -0
- package/Math/arc-generate-points copy.js +1 -0
- package/Math/arc.js +21 -8
- package/Math/circle-cdf-points.js +0 -2
- package/Math/circle.js +35 -16
- package/Math/templete-shapes/grid-visually-equal.js +66 -0
- package/altitude-locator/plugin.js +3 -2
- package/bearing-line/plugin.js +1 -2
- package/circle-line-chain/plugin.js +4 -7
- package/compass-rose/compass-rose-padding-flat.js +12 -0
- package/package.json +1 -1
- package/programs/line-on-globe/degree-padding-around-circle-3d.js +1 -1
- package/programs/line-on-globe/linestrip/data.js +4 -0
- package/programs/line-on-globe/{linestrip.js → linestrip/linestrip.js} +37 -35
- package/programs/line-on-globe/naive-accurate-flexible.js +23 -16
- package/programs/picking/pickable-renderer.js +1 -2
- package/programs/rings/distancering/circleflatprogram.js +116 -120
- package/programs/rings/distancering/circlepaddingfreeangleprogram.js +1 -1
- package/programs/rings/distancering/circlepaddysharedbuffer.js +368 -354
- package/programs/rings/distancering/index.js +6 -5
- package/programs/rings/distancering/paddyflatprogram.js +127 -136
- package/programs/rings/distancering/paddyflatprogram2d.js +129 -138
- package/programs/rings/distancering/paddyflatprogram3d.js +128 -136
- package/programs/rings/partial-ring/piece-of-pie copy.js +286 -0
- package/programs/rings/partial-ring/piece-of-pie.js +26 -13
- package/programs/totems/camerauniformblock.js +1 -1
- package/programs/totems/index.js +1 -1
- package/programs/vectorfields/logics/pixelbased.js +5 -21
- package/range-tools-on-terrain/bearing-line/adapters.js +111 -0
- package/range-tools-on-terrain/bearing-line/plugin.js +360 -0
- package/range-tools-on-terrain/bearing-line/types.js +1 -0
- package/range-tools-on-terrain/circle-line-chain/adapters.js +83 -0
- package/range-tools-on-terrain/circle-line-chain/chain-list-map.js +351 -0
- package/range-tools-on-terrain/circle-line-chain/plugin.js +389 -0
- package/range-tools-on-terrain/circle-line-chain/types.js +1 -0
- package/range-tools-on-terrain/range-ring/adapters.js +25 -0
- package/range-tools-on-terrain/range-ring/plugin.js +31 -0
- package/range-tools-on-terrain/range-ring/types.js +1 -0
- package/rangerings/plugin.js +7 -11
- package/semiplugins/lightweight/line-plugin.js +195 -0
- package/semiplugins/lightweight/piece-of-pie-plugin.js +175 -0
- package/semiplugins/shape-on-terrain/arc-plugin.js +368 -0
- package/{shape-on-terrain/circle/plugin.js → semiplugins/shape-on-terrain/circle-plugin.js} +129 -68
- package/semiplugins/shape-on-terrain/derived/padding-plugin.js +96 -0
- package/semiplugins/type.js +1 -0
- package/types.js +0 -11
- package/util/account/create-buffermap-orchastration.js +39 -0
- package/util/account/index.js +2 -2
- package/util/account/single-attribute-buffer-management/buffer-manager.js +2 -3
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +14 -3
- package/util/build-strategy/static-dynamic.js +1 -1
- package/util/check/typecheck.js +15 -1
- package/util/geometry/index.js +3 -2
- package/util/gl-util/buffer/attribute-loader.js +2 -5
- package/util/gl-util/draw-options/methods.js +4 -5
- package/util/webglobjectbuilders.js +4 -9
- package/write-text/context-text3.js +17 -0
- package/write-text/context-text3old.js +152 -0
- package/programs/line-on-globe/circle-accurate.js +0 -175
- package/programs/line-on-globe/circle.js +0 -164
- package/programs/line-on-globe/to-the-surface.js +0 -109
- package/programs/rings/distancering/shader.js +0 -1
- package/programs/totems/canvas-webglobe-info1.js +0 -106
- package/shape-on-terrain/arc/naive/plugin.js +0 -205
- package/util/check/get.js +0 -14
- package/util/gl-util/buffer/types.js +0 -1
- package/util/gl-util/draw-options/types.js +0 -15
- package/util/webglobjectbuilders1.js +0 -219
|
@@ -1,120 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
uniform
|
|
19
|
-
|
|
20
|
-
uniform float opacity;
|
|
21
|
-
|
|
22
|
-
in
|
|
23
|
-
in
|
|
24
|
-
in
|
|
25
|
-
|
|
26
|
-
out
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
export const programCache = Object.freeze({
|
|
118
|
-
getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic); },
|
|
119
|
-
releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic); }
|
|
120
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO: Delete this file if it is not needed anymore.
|
|
3
|
+
// import { createProgram, shaderfunctions } from "../../../util";
|
|
4
|
+
// import CameraUniformBlockTotem, { CameraUniformBlockString } from "../../totems/camerauniformblock";
|
|
5
|
+
// import { noRegisterGlobeProgramCache, globeProgramCache } from "../../programcache";
|
|
6
|
+
// const CIRCLE_EDGE_COUNT = 360;
|
|
7
|
+
// const vertexShader = `#version 300 es ` +
|
|
8
|
+
// shaderfunctions.PI +
|
|
9
|
+
// shaderfunctions.R +
|
|
10
|
+
// shaderfunctions.POLE +
|
|
11
|
+
// CameraUniformBlockString +
|
|
12
|
+
// shaderfunctions.mercatorXYToGLPosition +
|
|
13
|
+
// shaderfunctions.longLatRadToMercator +
|
|
14
|
+
// shaderfunctions.longLatRadToCartesian3D +
|
|
15
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterCartesian3D +
|
|
16
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorCompass +
|
|
17
|
+
// shaderfunctions.circleLimpFromLongLatRadCenterMercatorRealDistance + `
|
|
18
|
+
// uniform int compass;
|
|
19
|
+
// uniform float circle_edge_count;
|
|
20
|
+
// uniform float opacity;
|
|
21
|
+
// in vec2 center;
|
|
22
|
+
// in float radius;
|
|
23
|
+
// in vec4 color;
|
|
24
|
+
// in float flag;
|
|
25
|
+
// out vec4 v_color;
|
|
26
|
+
// out vec2 v_limp;
|
|
27
|
+
// void main() {
|
|
28
|
+
// if( flag == 1.0 || radius == 0.0) return; // flag 1.0 is hide
|
|
29
|
+
// v_color = vec4(color.rgb, color.a * opacity);
|
|
30
|
+
// if ( gl_VertexID == 270 ) v_color.rgb += 0.2;
|
|
31
|
+
// float angle = 3.1415926535897932384626433832795 * 2.0 * (float(gl_VertexID) / circle_edge_count);
|
|
32
|
+
// if ( is3D ){
|
|
33
|
+
// gl_Position = projection * view * vec4(
|
|
34
|
+
// circleLimpFromLongLatRadCenterCartesian3D( center, radius, angle) - translate, 1.0);
|
|
35
|
+
// v_limp = vec2(0.0, 0.0);
|
|
36
|
+
// return;
|
|
37
|
+
// }
|
|
38
|
+
// vec2 limp;
|
|
39
|
+
// if ( compass == 1 ){
|
|
40
|
+
// limp = circleLimpFromLongLatRadCenterMercatorCompass(center, radius, angle);
|
|
41
|
+
// } else {
|
|
42
|
+
// limp = circleLimpFromLongLatRadCenterMercatorRealDistance(center, radius, angle);
|
|
43
|
+
// }
|
|
44
|
+
// v_limp = limp;
|
|
45
|
+
// gl_Position = mercatorXYToGLPosition(limp);
|
|
46
|
+
// }`;
|
|
47
|
+
// const fragmentShader = `#version 300 es
|
|
48
|
+
// precision highp float;` +
|
|
49
|
+
// shaderfunctions.POLE + `
|
|
50
|
+
// in vec4 v_color;
|
|
51
|
+
// in vec2 v_limp;
|
|
52
|
+
// out vec4 outColor;
|
|
53
|
+
// void main() {
|
|
54
|
+
// if ( v_limp.x < -POLE || v_limp.x > POLE || v_limp.y < -POLE || v_limp.y > POLE ){ discard; }
|
|
55
|
+
// outColor = v_color;
|
|
56
|
+
// }`;
|
|
57
|
+
// class Logic {
|
|
58
|
+
// constructor(globe) {
|
|
59
|
+
// this.globe = globe;
|
|
60
|
+
// this.gl = globe.gl;
|
|
61
|
+
// this.program = createProgram(this.gl, vertexShader, fragmentShader);
|
|
62
|
+
// { // bind positions so bufferManager can use them
|
|
63
|
+
// this.gl.bindAttribLocation(this.program, 0, "center");
|
|
64
|
+
// this.gl.bindAttribLocation(this.program, 1, "radius");
|
|
65
|
+
// this.gl.bindAttribLocation(this.program, 2, "color");
|
|
66
|
+
// this.gl.bindAttribLocation(this.program, 3, "flag");
|
|
67
|
+
// }
|
|
68
|
+
// this.cameraBlockBindingPoint = 0;
|
|
69
|
+
// this.cameraBlockTotem = globeProgramCache.getProgram(globe, CameraUniformBlockTotem);
|
|
70
|
+
// const cameraBlockIndex = this.gl.getUniformBlockIndex(this.program, "CameraUniformBlock");
|
|
71
|
+
// this.gl.uniformBlockBinding(this.program, cameraBlockIndex, this.cameraBlockBindingPoint);
|
|
72
|
+
// this._opacityLocation = this.gl.getUniformLocation(this.program, "opacity");
|
|
73
|
+
// this._compassLocation = this.gl.getUniformLocation(this.program, "compass");
|
|
74
|
+
// this._circleEdgeCountLocation = this.gl.getUniformLocation(this.program, "circle_edge_count");
|
|
75
|
+
// this._circleEdgeCount = CIRCLE_EDGE_COUNT;
|
|
76
|
+
// this._compassmode = 1;
|
|
77
|
+
// this._opacity = 1.0;
|
|
78
|
+
// {
|
|
79
|
+
// const currentProgram = this.gl.getParameter(this.gl.CURRENT_PROGRAM);
|
|
80
|
+
// this.gl.useProgram(this.program);
|
|
81
|
+
// this.gl.uniform1i(this._compassLocation, 1);
|
|
82
|
+
// this.gl.uniform1f(this._circleEdgeCountLocation, CIRCLE_EDGE_COUNT);
|
|
83
|
+
// this.gl.uniform1f(this._opacityLocation, 1.0);
|
|
84
|
+
// this.gl.useProgram(currentProgram);
|
|
85
|
+
// }
|
|
86
|
+
// }
|
|
87
|
+
// draw(attrBufferManager, compass, circleEdgeCount, opacity) {
|
|
88
|
+
// const { gl, program, cameraBlockTotem, cameraBlockBindingPoint } = this;
|
|
89
|
+
// gl.useProgram(program);
|
|
90
|
+
// cameraBlockTotem.bind(cameraBlockBindingPoint);
|
|
91
|
+
// attrBufferManager.bindCircleVAO();
|
|
92
|
+
// if (compass !== this._compassmode) {
|
|
93
|
+
// gl.uniform1i(this._compassLocation, compass);
|
|
94
|
+
// this._compassmode = compass;
|
|
95
|
+
// }
|
|
96
|
+
// if (opacity !== this._opacity) {
|
|
97
|
+
// gl.uniform1f(this._opacityLocation, opacity);
|
|
98
|
+
// this._opacity = opacity;
|
|
99
|
+
// }
|
|
100
|
+
// if (circleEdgeCount !== this._circleEdgeCount) {
|
|
101
|
+
// gl.uniform1f(this._circleEdgeCountLocation, circleEdgeCount);
|
|
102
|
+
// this._circleEdgeCount = circleEdgeCount;
|
|
103
|
+
// }
|
|
104
|
+
// gl.drawArraysInstanced(gl.LINE_LOOP, 0, circleEdgeCount, attrBufferManager.length);
|
|
105
|
+
// gl.bindVertexArray(null);
|
|
106
|
+
// cameraBlockTotem.unbind(cameraBlockBindingPoint);
|
|
107
|
+
// }
|
|
108
|
+
// free() {
|
|
109
|
+
// this.gl.deleteProgram(this.program);
|
|
110
|
+
// globeProgramCache.releaseProgram(this.globe, CameraUniformBlockTotem);
|
|
111
|
+
// }
|
|
112
|
+
// }
|
|
113
|
+
// export const programCache = Object.freeze({
|
|
114
|
+
// getProgram: (globe) => { return noRegisterGlobeProgramCache.getProgram(globe, Logic) },
|
|
115
|
+
// releaseProgram: (globe) => { noRegisterGlobeProgramCache.releaseProgram(globe, Logic) }
|
|
116
|
+
// });
|
|
@@ -120,7 +120,7 @@ class Logic {
|
|
|
120
120
|
return new BufferManager(this.gl, bufferType, initialRingCapacity);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
|
|
123
|
+
const PaddingFreeAngleCache = Object.freeze({
|
|
124
124
|
getProgram: (globe) => noRegisterGlobeProgramCache.getProgram(globe, Logic),
|
|
125
125
|
releaseProgram: (globe) => globeProgramCache.releaseProgram(globe, Logic)
|
|
126
126
|
});
|