@pirireis/webglobeplugins 0.11.0-alpha → 0.12.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 +252 -0
- package/Math/{arc-generate-points.js → arc-generate-points copy.js } +4 -0
- package/Math/arc-generate-points-exponantial.js +254 -0
- package/Math/arc.js +5 -5
- package/Math/circle-cdf-points.js +249 -0
- package/Math/circle.js +39 -0
- package/Math/methods.js +13 -3
- package/Math/vec3.js +3 -3
- package/package.json +1 -1
- package/point-heat-map/plugin-webworker.js +1 -2
- package/programs/line-on-globe/linestrip.js +5 -6
- package/programs/totems/camerauniformblock.js +35 -8
- package/programs/totems/canvas-webglobe-info.js +55 -20
- package/programs/totems/{camerauniformblock1.js → canvas-webglobe-info1.js} +11 -76
- package/programs/vectorfields/logics/pixelbased.js +1 -1
- package/shape-on-terrain/arc/naive/plugin.js +204 -288
- package/shape-on-terrain/circle/plugin.js +252 -0
- package/util/account/single-attribute-buffer-management/buffer-orchestrator.js +2 -2
- package/util/build-strategy/general-strategy.js +62 -0
- package/util/build-strategy/static-dynamic.js +31 -0
- package/util/gl-util/draw-options/types.js +1 -1
- package/globe-types.js +0 -1
- package/programs/interface.js +0 -1
- package/programs/totems/camerauniformblock copy.js +0 -171
|
@@ -1,289 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// import "../../../programs/interface";
|
|
4
|
-
// import { createBufferAndReadInfo } from '../../../util/gl-util/buffer/attribute-loader';
|
|
1
|
+
import { LineStripProgramCache } from "../../../programs/line-on-globe/linestrip";
|
|
2
|
+
import { createBufferAndReadInfo } from '../../../util/gl-util/buffer/attribute-loader';
|
|
5
3
|
// import { populateFloat32Array } from "../../../util/jshelpers/data-filler";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// // lat: 1
|
|
209
|
-
// // }
|
|
210
|
-
// // let counter = 0;
|
|
211
|
-
// // for (const [key, arc] of _arcMap) {
|
|
212
|
-
// // // const isArc = arc.intersectionMedium(_screenPlane, _0arc) as Arc;
|
|
213
|
-
// // _0arc.copy(arc);
|
|
214
|
-
// // const isArc = arcFrustumPlanesIntersection(_0arc, planes, _0arc);
|
|
215
|
-
// // if (!isArc) {
|
|
216
|
-
// // continue;
|
|
217
|
-
// // }
|
|
218
|
-
// // counter++;
|
|
219
|
-
// // const longLatArr = new Float32Array(2 * VERTEX_COUNT);
|
|
220
|
-
// // // const _3Dpoints = _0arc.populatePoints3DInRespectToCamera(cameraPostition, VERTEX_COUNT);
|
|
221
|
-
// // const _3Dpoints = _0arc.populatePoints3D(VERTEX_COUNT);
|
|
222
|
-
// // for (let i = 0; i < _3Dpoints.length / 3; i++) {
|
|
223
|
-
// // _0vector.set(_3Dpoints[i * 3], _3Dpoints[i * 3 + 1], _3Dpoints[i * 3 + 2]).toLongLat(longLat);
|
|
224
|
-
// // longLatArr.set([longLat.long / RADIANS, longLat.lat / RADIANS], i * 2);
|
|
225
|
-
// // }
|
|
226
|
-
// // result.push({
|
|
227
|
-
// // key: key,
|
|
228
|
-
// // longLatArr: longLatArr,
|
|
229
|
-
// // });
|
|
230
|
-
// // // if (!arc.imaginaryPlane.equals(_0arc.imaginaryPlane) || !arc.imaginaryPlane.equalsReverseOriantation(_0arc.imaginaryPlane)) {
|
|
231
|
-
// // // // console.log("Arc with key", key, "has imaginary plane equal to the original arc's imaginary plane.");
|
|
232
|
-
// // // throw new Error("The arc segment is not on the parent arc")
|
|
233
|
-
// // // }
|
|
234
|
-
// // }
|
|
235
|
-
// // interval += 1;
|
|
236
|
-
// // if (interval === 100) {
|
|
237
|
-
// // interval = 1;
|
|
238
|
-
// // console.log("Arc count on screen:", counter);
|
|
239
|
-
// // }
|
|
240
|
-
// // // update buffer
|
|
241
|
-
// // this._bufferOrchestrator.resetWithCapacity(this._bufferManagersCompMap, result.length);
|
|
242
|
-
// // this._bufferOrchestrator.insertBulk(result, this._bufferManagersCompMap);
|
|
243
|
-
// // this._doBuild = false;
|
|
244
|
-
// // this._checkIfCorrupted(); // check if any arc is corrupted
|
|
245
|
-
// // }
|
|
246
|
-
// draw3D() {
|
|
247
|
-
// // Drawing logic here
|
|
248
|
-
// this._buildArcs() // can be async
|
|
249
|
-
// const { gl, program, _bufferOrchestrator } = this;
|
|
250
|
-
// gl.disable(gl.DEPTH_TEST);
|
|
251
|
-
// const drawOptionTest = {
|
|
252
|
-
// drawRange: {
|
|
253
|
-
// first: 0,
|
|
254
|
-
// count: this._testOrchestrator.length * (VERTEX_COUNT + 1)
|
|
255
|
-
// },
|
|
256
|
-
// indexes: null
|
|
257
|
-
// }
|
|
258
|
-
// program.draw(
|
|
259
|
-
// this._vaoAllTest,
|
|
260
|
-
// drawOptionTest,
|
|
261
|
-
// this._opacity,
|
|
262
|
-
// this._ubohandlerAllTest
|
|
263
|
-
// );
|
|
264
|
-
// const drawOptions = {
|
|
265
|
-
// drawRange: {
|
|
266
|
-
// first: 0,
|
|
267
|
-
// count: _bufferOrchestrator.length * (VERTEX_COUNT + 1)
|
|
268
|
-
// },
|
|
269
|
-
// indexes: null
|
|
270
|
-
// }
|
|
271
|
-
// program.draw(
|
|
272
|
-
// this._vao,
|
|
273
|
-
// drawOptions,
|
|
274
|
-
// this._opacity,
|
|
275
|
-
// this._arcUBOHandler
|
|
276
|
-
// );
|
|
277
|
-
// gl.enable(gl.DEPTH_TEST);
|
|
278
|
-
// }
|
|
279
|
-
// _checkIfCorrupted() {
|
|
280
|
-
// for (const [key, arc] of this._arcMap) {
|
|
281
|
-
// if (!arc.p0.equals(arc.p1)) {
|
|
282
|
-
// continue; // valid arc
|
|
283
|
-
// }
|
|
284
|
-
// console.warn(`Arc with key ${key} is corrupted: p0 and p1 are the same point.`);
|
|
285
|
-
// // this._arcMap.delete(key);
|
|
286
|
-
// // this._arcMapTest.delete(key);
|
|
287
|
-
// }
|
|
288
|
-
// }
|
|
289
|
-
// }
|
|
4
|
+
import { BufferManager, BufferOrchestrator } from "../../../util/account/single-attribute-buffer-management/index";
|
|
5
|
+
import { globe3Dcoordinates, globe2Dcoordinates, RADIANS } from "../../../Math/methods";
|
|
6
|
+
import { generateArcPoints } from "../../../Math/arc-cdf-points";
|
|
7
|
+
import * as vec3 from "../../../Math/vec3";
|
|
8
|
+
import * as arc from "../../../Math/arc";
|
|
9
|
+
import { CameraUniformBlockTotemCache } from "../../../programs/totems/camerauniformblock";
|
|
10
|
+
import { WORLD_RADIUS_3D } from "../../../Math/constants";
|
|
11
|
+
const VERTEX_COUNT = 70;
|
|
12
|
+
const INITAL_CAPACITY = 10;
|
|
13
|
+
const _0vector = [0, 0, 0];
|
|
14
|
+
const _attractionPoint = [0, 0, 0];
|
|
15
|
+
const _start = [0, 0, 0];
|
|
16
|
+
const _end = [0, 0, 0];
|
|
17
|
+
const _0arc = arc.create([1, 0, 0], [0, 1, 0]); // zero arc for intersection tests
|
|
18
|
+
let interval = 1;
|
|
19
|
+
export class NaiveLineOnTerrainPlugin {
|
|
20
|
+
id;
|
|
21
|
+
program = null;
|
|
22
|
+
_bufferManagersCompMap = null;
|
|
23
|
+
_bufferManagersCompMapTest = null;
|
|
24
|
+
_bufferOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
|
|
25
|
+
_testOrchestrator = new BufferOrchestrator({ capacity: INITAL_CAPACITY });
|
|
26
|
+
_opacity = 1;
|
|
27
|
+
_arcUBOHandler = null;
|
|
28
|
+
_vao = null;
|
|
29
|
+
_vaoAllTest = null;
|
|
30
|
+
_ubohandlerAllTest = null;
|
|
31
|
+
globe = null;
|
|
32
|
+
gl = null;
|
|
33
|
+
_arcMap;
|
|
34
|
+
_arcMapTest;
|
|
35
|
+
_doBuild = false;
|
|
36
|
+
_cameraUniformBlock = null;
|
|
37
|
+
_attractionStrength = 8;
|
|
38
|
+
constructor(id) {
|
|
39
|
+
this.id = id;
|
|
40
|
+
this._arcMap = new Map();
|
|
41
|
+
this._arcMapTest = new Map();
|
|
42
|
+
}
|
|
43
|
+
insertArcFromLongLat(key, startPoint, endPoint) {
|
|
44
|
+
if (this._arcMap.has(key)) {
|
|
45
|
+
this._arcMap.delete(key);
|
|
46
|
+
}
|
|
47
|
+
vec3.fromLongLatToUnitVector(_start, [startPoint.long * RADIANS, startPoint.lat * RADIANS]);
|
|
48
|
+
vec3.fromLongLatToUnitVector(_end, [endPoint.long * RADIANS, endPoint.lat * RADIANS]);
|
|
49
|
+
const _arc = arc.create(_start, _end);
|
|
50
|
+
this._arcMap.set(key, _arc);
|
|
51
|
+
this._arcMapTest.set(key, arc.clone(_arc));
|
|
52
|
+
this._doBuild = true;
|
|
53
|
+
this.globe.DrawRender();
|
|
54
|
+
}
|
|
55
|
+
deleteArcs(keys) {
|
|
56
|
+
for (const key of keys) {
|
|
57
|
+
if (this._arcMap.has(key)) {
|
|
58
|
+
this._arcMap.delete(key);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
this._doBuild = true;
|
|
62
|
+
this.globe.DrawRender();
|
|
63
|
+
}
|
|
64
|
+
init(globe, gl) {
|
|
65
|
+
this.globe = globe;
|
|
66
|
+
this.gl = gl;
|
|
67
|
+
this.program = LineStripProgramCache.get(globe);
|
|
68
|
+
const g3D = globe3Dcoordinates(globe, 30);
|
|
69
|
+
const g2D = globe2Dcoordinates(globe);
|
|
70
|
+
this._cameraUniformBlock = CameraUniformBlockTotemCache.get(globe);
|
|
71
|
+
this._bufferManagersCompMap = new Map([
|
|
72
|
+
["position3d", {
|
|
73
|
+
bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
|
|
74
|
+
adaptor: (item) => {
|
|
75
|
+
const { longLatArr } = item;
|
|
76
|
+
const result = g3D(longLatArr, { paddingCount: 1 });
|
|
77
|
+
// console.log("result", result);
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
}],
|
|
81
|
+
["position2d", {
|
|
82
|
+
bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
|
|
83
|
+
adaptor: (item) => {
|
|
84
|
+
const { longLatArr } = item;
|
|
85
|
+
return g2D(longLatArr, { paddingCount: 1 });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
]);
|
|
90
|
+
this._bufferManagersCompMapTest = new Map([
|
|
91
|
+
["positionTest3d", {
|
|
92
|
+
bufferManager: new BufferManager(gl, 3 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
|
|
93
|
+
adaptor: (item) => {
|
|
94
|
+
const { longLatArr } = item;
|
|
95
|
+
const result = g3D(longLatArr, { paddingCount: 1 });
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
}],
|
|
99
|
+
["positionTest2d", {
|
|
100
|
+
bufferManager: new BufferManager(gl, 2 * (VERTEX_COUNT + 1), { bufferType: "DYNAMIC_DRAW", initialCapacity: INITAL_CAPACITY }),
|
|
101
|
+
adaptor: (item) => {
|
|
102
|
+
const { longLatArr } = item;
|
|
103
|
+
return g2D(longLatArr, { paddingCount: 1 });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
]);
|
|
108
|
+
this._bufferOrchestrator = new BufferOrchestrator();
|
|
109
|
+
this._arcUBOHandler = this.program.createUBO();
|
|
110
|
+
this._arcUBOHandler.update(new Map([
|
|
111
|
+
["u_color", new Float32Array([1, 0, 0, 1])],
|
|
112
|
+
]));
|
|
113
|
+
this._ubohandlerAllTest = this.program.createUBO();
|
|
114
|
+
this._ubohandlerAllTest.update(new Map([
|
|
115
|
+
["u_color", new Float32Array([0, 0, 1, 1])],
|
|
116
|
+
]));
|
|
117
|
+
this._vao = this.program.createVAO(createBufferAndReadInfo(this._bufferManagersCompMap.get("position3d")?.bufferManager.buffer), createBufferAndReadInfo(this._bufferManagersCompMap.get("position2d")?.bufferManager.buffer), null, null, null);
|
|
118
|
+
this._vaoAllTest = this.program.createVAO(createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest3d")?.bufferManager.buffer), createBufferAndReadInfo(this._bufferManagersCompMapTest.get("positionTest2d")?.bufferManager.buffer), null, null, null);
|
|
119
|
+
}
|
|
120
|
+
draw3D() {
|
|
121
|
+
// Drawing logic here
|
|
122
|
+
this._buildArcs(); // can be async
|
|
123
|
+
const { gl, program, _bufferOrchestrator, _vao, _arcUBOHandler, _vaoAllTest, _ubohandlerAllTest, _testOrchestrator } = this;
|
|
124
|
+
if (!gl || !program || !_bufferOrchestrator || !_vao || !_arcUBOHandler
|
|
125
|
+
|| !_vaoAllTest || !_ubohandlerAllTest || !_testOrchestrator) {
|
|
126
|
+
console.warn("WebGL context, program, or buffer orchestrator is not initialized.");
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
gl.disable(gl.DEPTH_TEST);
|
|
130
|
+
const drawOptions = {
|
|
131
|
+
drawRange: {
|
|
132
|
+
first: 0,
|
|
133
|
+
count: _bufferOrchestrator.length * (VERTEX_COUNT + 1)
|
|
134
|
+
},
|
|
135
|
+
indexes: null
|
|
136
|
+
};
|
|
137
|
+
program.draw(_vao, drawOptions, this._opacity, _arcUBOHandler);
|
|
138
|
+
gl.enable(gl.DEPTH_TEST);
|
|
139
|
+
}
|
|
140
|
+
_buildArcs() {
|
|
141
|
+
if (!this._doBuild)
|
|
142
|
+
return; // if not needed to build, return early
|
|
143
|
+
const { globe, _arcMap, _cameraUniformBlock, _bufferManagersCompMap } = this;
|
|
144
|
+
if (!globe || !_cameraUniformBlock || !_bufferManagersCompMap) {
|
|
145
|
+
console.warn("Globe or camera uniform block is not initialized.");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const lookAtPosition = _cameraUniformBlock.getLookAtVector();
|
|
149
|
+
const cameraPosition = _cameraUniformBlock.getCameraVector();
|
|
150
|
+
vec3.divideScalar(cameraPosition, cameraPosition, WORLD_RADIUS_3D);
|
|
151
|
+
vec3.add(cameraPosition, cameraPosition, lookAtPosition);
|
|
152
|
+
// vec3.normalize(cameraPosition, cameraPosition);
|
|
153
|
+
vec3.divideScalar(cameraPosition, cameraPosition, 2);
|
|
154
|
+
// vec3.multiplyScalar(cameraPosition, cameraPosition, 1.3);
|
|
155
|
+
const _attractionStrength = (() => {
|
|
156
|
+
const lod = globe.api_GetCurrentLODWithDecimal();
|
|
157
|
+
if (lod < 11) {
|
|
158
|
+
return 1;
|
|
159
|
+
}
|
|
160
|
+
return lod * (lod - 8.5);
|
|
161
|
+
})();
|
|
162
|
+
console.log("Attraction strength: ", _attractionStrength);
|
|
163
|
+
const result = [];
|
|
164
|
+
const longLat = [0, 0];
|
|
165
|
+
for (const [key, arcInstance] of _arcMap) {
|
|
166
|
+
arc.copy(_0arc, arcInstance);
|
|
167
|
+
const isOnArc = arc.closestPoint(_attractionPoint, _0arc, cameraPosition);
|
|
168
|
+
if (!isOnArc) {
|
|
169
|
+
if (vec3.distanceSquared(cameraPosition, _0arc.p0) < vec3.distanceSquared(cameraPosition, _0arc.p1)) {
|
|
170
|
+
vec3.copy(_attractionPoint, _0arc.p0);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
vec3.copy(_attractionPoint, _0arc.p1);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const generatedPoints = generateArcPoints(_0arc.p0, _0arc.p1, _0arc.normal, _attractionPoint, VERTEX_COUNT, _attractionStrength);
|
|
177
|
+
const longLatArr = new Float32Array(2 * VERTEX_COUNT);
|
|
178
|
+
for (let i = 0; i < generatedPoints.length; i++) {
|
|
179
|
+
const point = generatedPoints[i];
|
|
180
|
+
vec3.fromUnitVectorToLongLat(longLat, point);
|
|
181
|
+
longLatArr.set([longLat[0] / RADIANS, longLat[1] / RADIANS], i * 2);
|
|
182
|
+
}
|
|
183
|
+
result.push({
|
|
184
|
+
key: key,
|
|
185
|
+
longLatArr: longLatArr,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
this._bufferOrchestrator.resetWithCapacity(_bufferManagersCompMap, result.length);
|
|
189
|
+
this._bufferOrchestrator.insertBulk(result, _bufferManagersCompMap);
|
|
190
|
+
this._doBuild = false; // reset build flag
|
|
191
|
+
this._checkIfCorrupted(); // check if any arc is corrupted
|
|
192
|
+
}
|
|
193
|
+
_checkIfCorrupted() {
|
|
194
|
+
for (const [key, arcInstance] of this._arcMap) {
|
|
195
|
+
const copyarc = this._arcMapTest.get(key);
|
|
196
|
+
if (!copyarc) {
|
|
197
|
+
console.warn(`Arc with key ${key} is missing in the test map.`);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (!arc.equals(arcInstance, copyarc)) {
|
|
201
|
+
console.warn(`Arc with key ${key} is corrupted: p0 and p1 are the same point.`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|