@pirireis/webglobeplugins 0.15.2-alpha → 0.15.4-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.
@@ -397,8 +397,9 @@ export default class BearingLinePlugin {
397
397
  const drawRange = { first: 0, count: this.bufferOrchestrator.length };
398
398
  this.lineProgram.draw(this.lineVao, { drawRange }, this._opacity);
399
399
  if (this.drawAngleRing) {
400
- this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity * 0.8, RINGPARTIAL_DRAW_MODE.TRIANGLE_FAN);
401
- this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, this._opacity * 0.8, RINGPARTIAL_DRAW_MODE.LINE_STRIP);
400
+ this.pieceOfPieProgram._defaultFlexibleUBO.updateSingle("u_opacity", this._opacity * 0.8);
401
+ this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, RINGPARTIAL_DRAW_MODE.TRIANGLE_FAN);
402
+ this.pieceOfPieProgram.draw(this.bufferOrchestrator.length, this.ringVao, 360, RINGPARTIAL_DRAW_MODE.LINE_STRIP);
402
403
  }
403
404
  if (this.drawBearingLine) {
404
405
  // this.lineProgram.draw(this.bearingLineVAO, this.bufferOrchestrator.length, this._opacity );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "0.15.2-alpha",
3
+ "version": "0.15.4-alpha",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -87,10 +87,10 @@ export class ChainListMap {
87
87
  this._chainMap.set(chainKey, newChain);
88
88
  return deleteKeys;
89
89
  }
90
- deleteChainAndReturnChainKeys(chainKey, writers) {
90
+ deleteChainAndReturnChainKeys(chainKey, textWritersMap = null) {
91
91
  const keys = this.getNodeKeysOfChain(chainKey);
92
- if (writers.size > 0) {
93
- writers.forEach((writer) => {
92
+ if (textWritersMap && textWritersMap.size > 0) {
93
+ textWritersMap.forEach((writer) => {
94
94
  writer.deleteTextBulk(keys);
95
95
  });
96
96
  }
@@ -175,6 +175,19 @@ export class ChainListMap {
175
175
  getChainProperties(chainKey) {
176
176
  return this._chainSideProperties.get(chainKey);
177
177
  }
178
+ deleteTexts(chainKeys, textWriters) {
179
+ if (!textWriters || textWriters.size === 0)
180
+ return;
181
+ textWriters.forEach((writer) => {
182
+ chainKeys.forEach((chainKey) => {
183
+ const chain = this._chainMap.get(chainKey);
184
+ if (!chain)
185
+ return;
186
+ const keys = chain.map((node) => node.__identity__);
187
+ writer.deleteTextBulk(keys);
188
+ });
189
+ });
190
+ }
178
191
  /**
179
192
  *
180
193
  * @param chainKey
@@ -176,19 +176,19 @@ export class CircleLineChainPlugin {
176
176
  this._updateTexts(chainKeys, Array.from(this._textWritersMap.keys()));
177
177
  }
178
178
  }
179
- deleteNodes(keysAndNodes, { textWriterIDs = [] } = {}) {
179
+ deleteNodes(keysAndNodes) {
180
180
  if (this._freed) {
181
181
  console.warn("CircleLineChainPlugin is freed, cannot delete nodes.");
182
182
  return;
183
183
  }
184
- const chainKeysToReconstruct = [];
184
+ const chainKeysToReconstruct = keysAndNodes.map(({ chainKey }) => chainKey);
185
+ // this._chainListMap.deleteTexts(chainKeysToReconstruct, this._textWritersMap); // TODO: delete this method from chain-list-map
186
+ this._cleanChainsFromSemiPlugins(chainKeysToReconstruct);
185
187
  keysAndNodes.forEach(({ chainKey, nodeKeys }) => {
186
188
  this._chainListMap.deleteNodesBelongToAChain(chainKey, nodeKeys);
187
- chainKeysToReconstruct.push(chainKey);
188
189
  });
189
- this._cleanChainsFromSemiPlugins(chainKeysToReconstruct);
190
190
  this._reconstructChains(chainKeysToReconstruct);
191
- this._updateTexts(chainKeysToReconstruct, textWriterIDs);
191
+ this._updateTexts(chainKeysToReconstruct, Array.from(this._textWritersMap.keys()));
192
192
  this.globe?.DrawRender();
193
193
  }
194
194
  updateNodesProperties(chainKey, nodesAndPropertyMap, { textWriterIDs = [] } = {}) {
@@ -295,6 +295,10 @@ export class CircleLineChainPlugin {
295
295
  // Clean chains from text writers
296
296
  const nodeKeys = this._chainListMap.getNodeKeysOfChain(chainKey);
297
297
  nodeKeys.pop(); // Remove the last key which is destination of the last circle
298
+ this._textWritersMap.forEach((writer) => {
299
+ writer.deleteTextBulk(nodeKeys);
300
+ });
301
+ // Clean chains from semi-plugins
298
302
  this.circlePlugin?.deleteBulk(nodeKeys);
299
303
  this.linePlugin?.deleteBulk(nodeKeys);
300
304
  this.arcPlugin?.deleteBulk(nodeKeys);