@loaders.gl/tiles 4.0.0-alpha.17 → 4.0.0-alpha.19
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/dist/dist.min.js +75 -38
- package/dist/es5/tileset/tileset-traverser.js +1 -1
- package/dist/es5/tileset/tileset-traverser.js.map +1 -1
- package/dist/esm/tileset/tileset-traverser.js +1 -1
- package/dist/esm/tileset/tileset-traverser.js.map +1 -1
- package/dist/tileset/tileset-traverser.js +1 -1
- package/package.json +4 -4
- package/src/tileset/tileset-traverser.ts +1 -1
package/dist/dist.min.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
(() => {
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
8
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
4
9
|
var __esm = (fn, res) => function __init() {
|
|
5
10
|
return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
|
|
@@ -12,6 +17,17 @@
|
|
|
12
17
|
for (var name in all)
|
|
13
18
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
19
|
};
|
|
20
|
+
var __reExport = (target, module, desc) => {
|
|
21
|
+
if (module && typeof module === "object" || typeof module === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(module))
|
|
23
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
24
|
+
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return target;
|
|
27
|
+
};
|
|
28
|
+
var __toModule = (module) => {
|
|
29
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
|
|
30
|
+
};
|
|
15
31
|
|
|
16
32
|
// ../../node_modules/@math.gl/core/dist/esm/lib/assert.js
|
|
17
33
|
function assert(condition, message) {
|
|
@@ -4832,55 +4848,55 @@
|
|
|
4832
4848
|
return this._length;
|
|
4833
4849
|
}
|
|
4834
4850
|
add(item) {
|
|
4835
|
-
const
|
|
4851
|
+
const node3 = new DoublyLinkedListNode(item, this.tail, null);
|
|
4836
4852
|
if (this.tail) {
|
|
4837
|
-
this.tail.next =
|
|
4838
|
-
this.tail =
|
|
4853
|
+
this.tail.next = node3;
|
|
4854
|
+
this.tail = node3;
|
|
4839
4855
|
} else {
|
|
4840
|
-
this.head =
|
|
4841
|
-
this.tail =
|
|
4856
|
+
this.head = node3;
|
|
4857
|
+
this.tail = node3;
|
|
4842
4858
|
}
|
|
4843
4859
|
++this._length;
|
|
4844
|
-
return
|
|
4860
|
+
return node3;
|
|
4845
4861
|
}
|
|
4846
|
-
remove(
|
|
4847
|
-
if (!
|
|
4862
|
+
remove(node3) {
|
|
4863
|
+
if (!node3) {
|
|
4848
4864
|
return;
|
|
4849
4865
|
}
|
|
4850
|
-
if (
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
} else if (
|
|
4854
|
-
|
|
4855
|
-
this.tail =
|
|
4856
|
-
} else if (
|
|
4857
|
-
|
|
4858
|
-
this.head =
|
|
4866
|
+
if (node3.previous && node3.next) {
|
|
4867
|
+
node3.previous.next = node3.next;
|
|
4868
|
+
node3.next.previous = node3.previous;
|
|
4869
|
+
} else if (node3.previous) {
|
|
4870
|
+
node3.previous.next = null;
|
|
4871
|
+
this.tail = node3.previous;
|
|
4872
|
+
} else if (node3.next) {
|
|
4873
|
+
node3.next.previous = null;
|
|
4874
|
+
this.head = node3.next;
|
|
4859
4875
|
} else {
|
|
4860
4876
|
this.head = null;
|
|
4861
4877
|
this.tail = null;
|
|
4862
4878
|
}
|
|
4863
|
-
|
|
4864
|
-
|
|
4879
|
+
node3.next = null;
|
|
4880
|
+
node3.previous = null;
|
|
4865
4881
|
--this._length;
|
|
4866
4882
|
}
|
|
4867
|
-
splice(
|
|
4868
|
-
if (
|
|
4883
|
+
splice(node3, nextNode) {
|
|
4884
|
+
if (node3 === nextNode) {
|
|
4869
4885
|
return;
|
|
4870
4886
|
}
|
|
4871
4887
|
this.remove(nextNode);
|
|
4872
|
-
this._insert(
|
|
4888
|
+
this._insert(node3, nextNode);
|
|
4873
4889
|
}
|
|
4874
|
-
_insert(
|
|
4875
|
-
const oldNodeNext =
|
|
4876
|
-
|
|
4877
|
-
if (this.tail ===
|
|
4890
|
+
_insert(node3, nextNode) {
|
|
4891
|
+
const oldNodeNext = node3.next;
|
|
4892
|
+
node3.next = nextNode;
|
|
4893
|
+
if (this.tail === node3) {
|
|
4878
4894
|
this.tail = nextNode;
|
|
4879
4895
|
} else {
|
|
4880
4896
|
oldNodeNext.previous = nextNode;
|
|
4881
4897
|
}
|
|
4882
4898
|
nextNode.next = oldNodeNext;
|
|
4883
|
-
nextNode.previous =
|
|
4899
|
+
nextNode.previous = node3;
|
|
4884
4900
|
++this._length;
|
|
4885
4901
|
}
|
|
4886
4902
|
};
|
|
@@ -4902,9 +4918,9 @@
|
|
|
4902
4918
|
this._list.splice(this._list.tail, this._sentinel);
|
|
4903
4919
|
}
|
|
4904
4920
|
touch(tile) {
|
|
4905
|
-
const
|
|
4906
|
-
if (
|
|
4907
|
-
this._list.splice(this._sentinel,
|
|
4921
|
+
const node3 = tile._cacheNode;
|
|
4922
|
+
if (node3) {
|
|
4923
|
+
this._list.splice(this._sentinel, node3);
|
|
4908
4924
|
}
|
|
4909
4925
|
}
|
|
4910
4926
|
add(tileset, tile, addCallback) {
|
|
@@ -4916,11 +4932,11 @@
|
|
|
4916
4932
|
}
|
|
4917
4933
|
}
|
|
4918
4934
|
unloadTile(tileset, tile, unloadCallback) {
|
|
4919
|
-
const
|
|
4920
|
-
if (!
|
|
4935
|
+
const node3 = tile._cacheNode;
|
|
4936
|
+
if (!node3) {
|
|
4921
4937
|
return;
|
|
4922
4938
|
}
|
|
4923
|
-
this._list.remove(
|
|
4939
|
+
this._list.remove(node3);
|
|
4924
4940
|
tile._cacheNode = null;
|
|
4925
4941
|
if (unloadCallback) {
|
|
4926
4942
|
unloadCallback(tileset, tile);
|
|
@@ -4932,10 +4948,10 @@
|
|
|
4932
4948
|
const list = this._list;
|
|
4933
4949
|
const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
|
|
4934
4950
|
const sentinel = this._sentinel;
|
|
4935
|
-
let
|
|
4936
|
-
while (
|
|
4937
|
-
const tile =
|
|
4938
|
-
|
|
4951
|
+
let node3 = list.head;
|
|
4952
|
+
while (node3 !== sentinel && (tileset.gpuMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
|
|
4953
|
+
const tile = node3.item;
|
|
4954
|
+
node3 = node3.next;
|
|
4939
4955
|
this.unloadTile(tileset, tile, unloadCallback);
|
|
4940
4956
|
}
|
|
4941
4957
|
}
|
|
@@ -5902,18 +5918,38 @@
|
|
|
5902
5918
|
}
|
|
5903
5919
|
});
|
|
5904
5920
|
|
|
5921
|
+
// (disabled):../core/src/lib/fetch/fetch-file.node
|
|
5922
|
+
var require_fetch_file = __commonJS({
|
|
5923
|
+
"(disabled):../core/src/lib/fetch/fetch-file.node"() {
|
|
5924
|
+
}
|
|
5925
|
+
});
|
|
5926
|
+
|
|
5905
5927
|
// ../core/src/lib/fetch/fetch-file.ts
|
|
5928
|
+
function isNodePath(url) {
|
|
5929
|
+
return !isRequestURL(url) && !isDataURL(url);
|
|
5930
|
+
}
|
|
5931
|
+
function isRequestURL(url) {
|
|
5932
|
+
return url.startsWith("http:") || url.startsWith("https:");
|
|
5933
|
+
}
|
|
5934
|
+
function isDataURL(url) {
|
|
5935
|
+
return url.startsWith("data:");
|
|
5936
|
+
}
|
|
5906
5937
|
async function fetchFile(urlOrData, fetchOptions) {
|
|
5907
5938
|
if (typeof urlOrData === "string") {
|
|
5908
5939
|
const url = resolvePath(urlOrData);
|
|
5940
|
+
if (isNodePath(url) && node2?.fetchFileNode) {
|
|
5941
|
+
return node2.fetchFileNode(url, fetchOptions);
|
|
5942
|
+
}
|
|
5909
5943
|
return await fetch(url, fetchOptions);
|
|
5910
5944
|
}
|
|
5911
5945
|
return await makeResponse(urlOrData);
|
|
5912
5946
|
}
|
|
5947
|
+
var node2;
|
|
5913
5948
|
var init_fetch_file = __esm({
|
|
5914
5949
|
"../core/src/lib/fetch/fetch-file.ts"() {
|
|
5915
5950
|
init_src2();
|
|
5916
5951
|
init_response_utils();
|
|
5952
|
+
node2 = __toModule(require_fetch_file());
|
|
5917
5953
|
}
|
|
5918
5954
|
});
|
|
5919
5955
|
|
|
@@ -6577,6 +6613,7 @@
|
|
|
6577
6613
|
mimeType: void 0,
|
|
6578
6614
|
nothrow: false,
|
|
6579
6615
|
log: new ConsoleLog(),
|
|
6616
|
+
useLocalLibraries: false,
|
|
6580
6617
|
CDN: "https://unpkg.com/@loaders.gl",
|
|
6581
6618
|
worker: true,
|
|
6582
6619
|
maxConcurrency: 3,
|
|
@@ -7946,7 +7983,7 @@
|
|
|
7946
7983
|
}
|
|
7947
7984
|
stack.push(child);
|
|
7948
7985
|
}
|
|
7949
|
-
} else if (!tile.contentAvailable) {
|
|
7986
|
+
} else if (!tile.contentAvailable && !tile.hasEmptyContent) {
|
|
7950
7987
|
allDescendantsLoaded = false;
|
|
7951
7988
|
}
|
|
7952
7989
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tileset-traverser.js","names":["_managedArray","require","_constants","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","DEFAULT_PROPS","loadSiblings","skipLevelOfDetail","maximumScreenSpaceError","updateTransforms","onTraversalEnd","viewportTraversersMap","basePath","exports","TilesetTraverser","options","_classCallCheck2","Date","getTime","ManagedArray","_createClass2","traversalFinished","frameState","traverse","root","reset","updateTile","_frameNumber","frameNumber","executeTraversal","requestedTiles","selectedTiles","emptyTiles","_traversalStack","_emptyTraversalStack","stack","_selectionDepth","tile","pop","shouldRefine","canTraverse","updateChildTiles","updateAndPushChildren","hasRenderContent","parent","parentRefines","Boolean","_shouldRefine","stoppedRefining","id","loadTile","selectTile","refine","TILE_REFINEMENT","ADD","REPLACE","touchTile","newTime","lastUpdate","updateDebounceTime","children","_iterator","_step","child","depth","_this$options","sort","compareDistanceToCamera","bind","checkRefines","hasVisibleChild","refines","_iterator2","_step2","isVisibleAndInRequestVolume","find","delete","childRefines","_inRequestVolume","executeEmptyTraversal","contentAvailable","updateTileVisibility","shouldSelectTile","_selectedFrame","shouldLoadTile","_requestedFrame","_priority","_getPriority","tileset","_cache","touch","_touchedFrame","useParentMetric","undefined","ignoreVisibility","hasChildren","hasTilesetContent","contentExpired","hasUnloadedContent","screenSpaceError","_screenSpaceError","getScreenSpaceError","viewportIds","viewport","updateVisibility","b","a","_distanceToCamera","anyChildrenVisible","anyVisible","_iterator3","_step3","allDescendantsLoaded","_iterator4","_step4"],"sources":["../../../src/tileset/tileset-traverser.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Tile3D} from './tile-3d';\nimport {ManagedArray} from '../utils/managed-array';\nimport {TILE_REFINEMENT} from '../constants';\nimport {FrameState} from './helpers/frame-state';\n\nexport type TilesetTraverserProps = {\n loadSiblings?: boolean;\n skipLevelOfDetail?: boolean;\n updateTransforms?: boolean;\n maximumScreenSpaceError?: number;\n onTraversalEnd?: (frameState) => any;\n viewportTraversersMap?: Record<string, any>;\n basePath?: string;\n};\n\nexport const DEFAULT_PROPS: Required<TilesetTraverserProps> = {\n loadSiblings: false,\n skipLevelOfDetail: false,\n maximumScreenSpaceError: 2,\n updateTransforms: true,\n onTraversalEnd: () => {},\n viewportTraversersMap: {},\n basePath: ''\n};\n\nexport class TilesetTraverser {\n options: Required<TilesetTraverserProps>;\n\n // fulfill in traverse call\n root: any = null;\n\n // tiles should be rendered\n selectedTiles: Record<string, Tile3D> = {};\n // tiles should be loaded from server\n requestedTiles: Record<string, Tile3D> = {};\n // tiles does not have render content\n emptyTiles: Record<string, Tile3D> = {};\n\n protected lastUpdate: number = new Date().getTime();\n protected readonly updateDebounceTime = 1000;\n /** temporary storage to hold the traversed tiles during a traversal */\n protected _traversalStack = new ManagedArray();\n protected _emptyTraversalStack = new ManagedArray();\n /** set in every traverse cycle */\n protected _frameNumber: number | null = null;\n\n // RESULT\n protected traversalFinished(frameState: FrameState): boolean {\n return true;\n }\n\n // TODO nested props\n constructor(options: TilesetTraverserProps) {\n this.options = {...DEFAULT_PROPS, ...options};\n }\n\n // tiles should be visible\n traverse(root, frameState, options) {\n this.root = root; // for root screen space error\n this.options = {...this.options, ...options};\n\n // reset result\n this.reset();\n\n // update tile (visibility and expiration)\n this.updateTile(root, frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.executeTraversal(root, frameState);\n }\n\n reset() {\n this.requestedTiles = {};\n this.selectedTiles = {};\n this.emptyTiles = {};\n this._traversalStack.reset();\n this._emptyTraversalStack.reset();\n }\n\n /**\n * Execute traverse\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * If skipLevelOfDetail is off then a tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n * Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n * all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n * and rendering children and parent tiles simultaneously.\n */\n /* eslint-disable-next-line complexity, max-statements */\n executeTraversal(root, frameState: FrameState): void {\n // stack to store traversed tiles, only visible tiles should be added to stack\n // visible: visible in the current view frustum\n const stack = this._traversalStack;\n root._selectionDepth = 1;\n\n stack.push(root);\n while (stack.length > 0) {\n // 1. pop tile\n const tile = stack.pop();\n\n // 2. check if tile needs to be refine, needs refine if a tile's LoD is not sufficient and tile has available children (available content)\n let shouldRefine = false;\n if (this.canTraverse(tile, frameState)) {\n this.updateChildTiles(tile, frameState);\n shouldRefine = this.updateAndPushChildren(\n tile,\n frameState,\n stack,\n tile.hasRenderContent ? tile._selectionDepth + 1 : tile._selectionDepth\n );\n }\n\n // 3. decide if should render (select) this tile\n // - tile does not have render content\n // - tile has render content and tile is `add` type (pointcloud)\n // - tile has render content and tile is `replace` type (photogrammetry) and can't refine any further\n const parent = tile.parent;\n const parentRefines = Boolean(!parent || parent._shouldRefine);\n const stoppedRefining = !shouldRefine;\n\n if (!tile.hasRenderContent) {\n this.emptyTiles[tile.id] = tile;\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n // additive tiles\n } else if (tile.refine === TILE_REFINEMENT.ADD) {\n // Additive tiles are always loaded and selected\n this.loadTile(tile, frameState);\n this.selectTile(tile, frameState);\n\n // replace tiles\n } else if (tile.refine === TILE_REFINEMENT.REPLACE) {\n // Always load tiles in the base traversal\n // Select tiles that can't refine further\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n }\n\n // 3. update cache, most recent touched tiles have higher priority to be fetched from server\n this.touchTile(tile, frameState);\n\n // 4. update tile refine prop and parent refinement status to trickle down to the descendants\n tile._shouldRefine = shouldRefine && parentRefines;\n }\n\n const newTime = new Date().getTime();\n if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {\n this.lastUpdate = newTime;\n this.options.onTraversalEnd(frameState);\n }\n }\n\n updateChildTiles(tile: Tile3D, frameState: FrameState): void {\n const children = tile.children;\n for (const child of children) {\n this.updateTile(child, frameState);\n }\n }\n\n /* eslint-disable complexity, max-statements */\n updateAndPushChildren(tile: Tile3D, frameState: FrameState, stack, depth): boolean {\n const {loadSiblings, skipLevelOfDetail} = this.options;\n\n const children = tile.children;\n\n // sort children tiles\n children.sort(this.compareDistanceToCamera.bind(this));\n\n // For traditional replacement refinement only refine if all children are loaded.\n // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n const checkRefines =\n tile.refine === TILE_REFINEMENT.REPLACE && tile.hasRenderContent && !skipLevelOfDetail;\n\n let hasVisibleChild = false;\n let refines = true;\n\n for (const child of children) {\n child._selectionDepth = depth;\n if (child.isVisibleAndInRequestVolume) {\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n hasVisibleChild = true;\n } else if (checkRefines || loadSiblings) {\n // Keep non-visible children loaded since they are still needed before the parent can refine.\n // Or loadSiblings is true so always load tiles regardless of visibility.\n this.loadTile(child, frameState);\n this.touchTile(child, frameState);\n }\n\n if (checkRefines) {\n let childRefines;\n if (!child._inRequestVolume) {\n childRefines = false;\n } else if (!child.hasRenderContent) {\n childRefines = this.executeEmptyTraversal(child, frameState);\n } else {\n childRefines = child.contentAvailable;\n }\n refines = refines && childRefines;\n\n if (!refines) {\n return false;\n }\n }\n }\n\n if (!hasVisibleChild) {\n refines = false;\n }\n return refines;\n }\n /* eslint-enable complexity, max-statements */\n\n updateTile(tile: Tile3D, frameState: FrameState): void {\n this.updateTileVisibility(tile, frameState);\n }\n\n // tile to render in the browser\n selectTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldSelectTile(tile)) {\n // The tile can be selected right away and does not require traverseAndSelect\n tile._selectedFrame = frameState.frameNumber;\n this.selectedTiles[tile.id] = tile;\n }\n }\n\n // tile to load from server\n loadTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldLoadTile(tile)) {\n tile._requestedFrame = frameState.frameNumber;\n tile._priority = tile._getPriority();\n this.requestedTiles[tile.id] = tile;\n }\n }\n\n // cache tile\n touchTile(tile: Tile3D, frameState: FrameState): void {\n tile.tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n }\n\n // tile should be visible\n // tile should have children\n // tile LoD (level of detail) is not sufficient under current viewport\n canTraverse(\n tile: Tile3D,\n frameState: FrameState,\n useParentMetric: boolean = false,\n ignoreVisibility: boolean = false\n ): boolean {\n if (!tile.hasChildren) {\n return false;\n }\n\n // cesium specific\n if (tile.hasTilesetContent) {\n // Traverse external this to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n\n if (!ignoreVisibility && !tile.isVisibleAndInRequestVolume) {\n return false;\n }\n\n return this.shouldRefine(tile, frameState, useParentMetric);\n }\n\n shouldLoadTile(tile: Tile3D): boolean {\n // if request tile is in current frame\n // and has unexpired render content\n return tile.hasUnloadedContent || tile.contentExpired;\n }\n\n shouldSelectTile(tile: Tile3D): boolean {\n // if select tile is in current frame\n // and content available\n return tile.contentAvailable && !this.options.skipLevelOfDetail;\n }\n\n /** Decide if tile LoD (level of detail) is not sufficient under current viewport */\n shouldRefine(tile: Tile3D, frameState: FrameState, useParentMetric: boolean = false): boolean {\n let screenSpaceError = tile._screenSpaceError;\n if (useParentMetric) {\n screenSpaceError = tile.getScreenSpaceError(frameState, true);\n }\n\n return screenSpaceError > this.options.maximumScreenSpaceError;\n }\n\n updateTileVisibility(tile: Tile3D, frameState: FrameState): void {\n const viewportIds: string[] = [];\n if (this.options.viewportTraversersMap) {\n for (const key in this.options.viewportTraversersMap) {\n const value = this.options.viewportTraversersMap[key];\n if (value === frameState.viewport.id) {\n viewportIds.push(key);\n }\n }\n } else {\n viewportIds.push(frameState.viewport.id);\n }\n tile.updateVisibility(frameState, viewportIds);\n }\n\n // UTILITIES\n\n compareDistanceToCamera(b: Tile3D, a: Tile3D): number {\n return b._distanceToCamera - a._distanceToCamera;\n }\n\n anyChildrenVisible(tile: Tile3D, frameState: FrameState): boolean {\n let anyVisible = false;\n for (const child of tile.children) {\n // @ts-expect-error\n child.updateVisibility(frameState);\n // @ts-expect-error\n anyVisible = anyVisible || child.isVisibleAndInRequestVolume;\n }\n return anyVisible;\n }\n\n // Depth-first traversal that checks if all nearest descendants with content are loaded.\n // Ignores visibility.\n executeEmptyTraversal(root: Tile3D, frameState: FrameState): boolean {\n let allDescendantsLoaded = true;\n const stack = this._emptyTraversalStack;\n\n stack.push(root);\n\n while (stack.length > 0 && allDescendantsLoaded) {\n const tile = stack.pop();\n\n this.updateTile(tile, frameState);\n\n if (!tile.isVisibleAndInRequestVolume) {\n // Load tiles that aren't visible since they are still needed for the parent to refine\n this.loadTile(tile, frameState);\n }\n\n this.touchTile(tile, frameState);\n\n // Only traverse if the tile is empty - traversal stop at descendants with content\n const traverse = !tile.hasRenderContent && this.canTraverse(tile, frameState, false, true);\n\n if (traverse) {\n const children = tile.children;\n for (const child of children) {\n // eslint-disable-next-line max-depth\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n }\n } else if (!tile.contentAvailable) {\n allDescendantsLoaded = false;\n }\n }\n\n return allDescendantsLoaded;\n }\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA6C,SAAAE,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,EAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,EAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,cAAA,IAAAD,CAAA,WAAAA,CAAA,CAAAQ,MAAA,qBAAAN,EAAA,EAAAF,CAAA,GAAAE,EAAA,MAAAO,CAAA,UAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,QAAAH,CAAA,IAAAT,CAAA,CA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AApG,GAAA;YAAAsJ,UAAA,CAAA5J,CAAA,CAAAM,GAAA;UAAA;YAAAsJ,UAAA,CAAA1J,CAAA;UAAA;QACH,CAAC,MAAM,IAAI,CAAC8E,IAAI,CAAC2C,gBAAgB,EAAE;UACjCgC,oBAAoB,GAAG,KAAK;QAC9B;MACF;MAEA,OAAOA,oBAAoB;IAC7B;EAAC;EAAA,OAAAlG,gBAAA;AAAA;AAAAD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
|
1
|
+
{"version":3,"file":"tileset-traverser.js","names":["_managedArray","require","_constants","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","DEFAULT_PROPS","loadSiblings","skipLevelOfDetail","maximumScreenSpaceError","updateTransforms","onTraversalEnd","viewportTraversersMap","basePath","exports","TilesetTraverser","options","_classCallCheck2","Date","getTime","ManagedArray","_createClass2","traversalFinished","frameState","traverse","root","reset","updateTile","_frameNumber","frameNumber","executeTraversal","requestedTiles","selectedTiles","emptyTiles","_traversalStack","_emptyTraversalStack","stack","_selectionDepth","tile","pop","shouldRefine","canTraverse","updateChildTiles","updateAndPushChildren","hasRenderContent","parent","parentRefines","Boolean","_shouldRefine","stoppedRefining","id","loadTile","selectTile","refine","TILE_REFINEMENT","ADD","REPLACE","touchTile","newTime","lastUpdate","updateDebounceTime","children","_iterator","_step","child","depth","_this$options","sort","compareDistanceToCamera","bind","checkRefines","hasVisibleChild","refines","_iterator2","_step2","isVisibleAndInRequestVolume","find","delete","childRefines","_inRequestVolume","executeEmptyTraversal","contentAvailable","updateTileVisibility","shouldSelectTile","_selectedFrame","shouldLoadTile","_requestedFrame","_priority","_getPriority","tileset","_cache","touch","_touchedFrame","useParentMetric","undefined","ignoreVisibility","hasChildren","hasTilesetContent","contentExpired","hasUnloadedContent","screenSpaceError","_screenSpaceError","getScreenSpaceError","viewportIds","viewport","updateVisibility","b","a","_distanceToCamera","anyChildrenVisible","anyVisible","_iterator3","_step3","allDescendantsLoaded","_iterator4","_step4","hasEmptyContent"],"sources":["../../../src/tileset/tileset-traverser.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Tile3D} from './tile-3d';\nimport {ManagedArray} from '../utils/managed-array';\nimport {TILE_REFINEMENT} from '../constants';\nimport {FrameState} from './helpers/frame-state';\n\nexport type TilesetTraverserProps = {\n loadSiblings?: boolean;\n skipLevelOfDetail?: boolean;\n updateTransforms?: boolean;\n maximumScreenSpaceError?: number;\n onTraversalEnd?: (frameState) => any;\n viewportTraversersMap?: Record<string, any>;\n basePath?: string;\n};\n\nexport const DEFAULT_PROPS: Required<TilesetTraverserProps> = {\n loadSiblings: false,\n skipLevelOfDetail: false,\n maximumScreenSpaceError: 2,\n updateTransforms: true,\n onTraversalEnd: () => {},\n viewportTraversersMap: {},\n basePath: ''\n};\n\nexport class TilesetTraverser {\n options: Required<TilesetTraverserProps>;\n\n // fulfill in traverse call\n root: any = null;\n\n // tiles should be rendered\n selectedTiles: Record<string, Tile3D> = {};\n // tiles should be loaded from server\n requestedTiles: Record<string, Tile3D> = {};\n // tiles does not have render content\n emptyTiles: Record<string, Tile3D> = {};\n\n protected lastUpdate: number = new Date().getTime();\n protected readonly updateDebounceTime = 1000;\n /** temporary storage to hold the traversed tiles during a traversal */\n protected _traversalStack = new ManagedArray();\n protected _emptyTraversalStack = new ManagedArray();\n /** set in every traverse cycle */\n protected _frameNumber: number | null = null;\n\n // RESULT\n protected traversalFinished(frameState: FrameState): boolean {\n return true;\n }\n\n // TODO nested props\n constructor(options: TilesetTraverserProps) {\n this.options = {...DEFAULT_PROPS, ...options};\n }\n\n // tiles should be visible\n traverse(root, frameState, options) {\n this.root = root; // for root screen space error\n this.options = {...this.options, ...options};\n\n // reset result\n this.reset();\n\n // update tile (visibility and expiration)\n this.updateTile(root, frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.executeTraversal(root, frameState);\n }\n\n reset() {\n this.requestedTiles = {};\n this.selectedTiles = {};\n this.emptyTiles = {};\n this._traversalStack.reset();\n this._emptyTraversalStack.reset();\n }\n\n /**\n * Execute traverse\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * If skipLevelOfDetail is off then a tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n * Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n * all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n * and rendering children and parent tiles simultaneously.\n */\n /* eslint-disable-next-line complexity, max-statements */\n executeTraversal(root, frameState: FrameState): void {\n // stack to store traversed tiles, only visible tiles should be added to stack\n // visible: visible in the current view frustum\n const stack = this._traversalStack;\n root._selectionDepth = 1;\n\n stack.push(root);\n while (stack.length > 0) {\n // 1. pop tile\n const tile = stack.pop();\n\n // 2. check if tile needs to be refine, needs refine if a tile's LoD is not sufficient and tile has available children (available content)\n let shouldRefine = false;\n if (this.canTraverse(tile, frameState)) {\n this.updateChildTiles(tile, frameState);\n shouldRefine = this.updateAndPushChildren(\n tile,\n frameState,\n stack,\n tile.hasRenderContent ? tile._selectionDepth + 1 : tile._selectionDepth\n );\n }\n\n // 3. decide if should render (select) this tile\n // - tile does not have render content\n // - tile has render content and tile is `add` type (pointcloud)\n // - tile has render content and tile is `replace` type (photogrammetry) and can't refine any further\n const parent = tile.parent;\n const parentRefines = Boolean(!parent || parent._shouldRefine);\n const stoppedRefining = !shouldRefine;\n\n if (!tile.hasRenderContent) {\n this.emptyTiles[tile.id] = tile;\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n // additive tiles\n } else if (tile.refine === TILE_REFINEMENT.ADD) {\n // Additive tiles are always loaded and selected\n this.loadTile(tile, frameState);\n this.selectTile(tile, frameState);\n\n // replace tiles\n } else if (tile.refine === TILE_REFINEMENT.REPLACE) {\n // Always load tiles in the base traversal\n // Select tiles that can't refine further\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n }\n\n // 3. update cache, most recent touched tiles have higher priority to be fetched from server\n this.touchTile(tile, frameState);\n\n // 4. update tile refine prop and parent refinement status to trickle down to the descendants\n tile._shouldRefine = shouldRefine && parentRefines;\n }\n\n const newTime = new Date().getTime();\n if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {\n this.lastUpdate = newTime;\n this.options.onTraversalEnd(frameState);\n }\n }\n\n updateChildTiles(tile: Tile3D, frameState: FrameState): void {\n const children = tile.children;\n for (const child of children) {\n this.updateTile(child, frameState);\n }\n }\n\n /* eslint-disable complexity, max-statements */\n updateAndPushChildren(tile: Tile3D, frameState: FrameState, stack, depth): boolean {\n const {loadSiblings, skipLevelOfDetail} = this.options;\n\n const children = tile.children;\n\n // sort children tiles\n children.sort(this.compareDistanceToCamera.bind(this));\n\n // For traditional replacement refinement only refine if all children are loaded.\n // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n const checkRefines =\n tile.refine === TILE_REFINEMENT.REPLACE && tile.hasRenderContent && !skipLevelOfDetail;\n\n let hasVisibleChild = false;\n let refines = true;\n\n for (const child of children) {\n child._selectionDepth = depth;\n if (child.isVisibleAndInRequestVolume) {\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n hasVisibleChild = true;\n } else if (checkRefines || loadSiblings) {\n // Keep non-visible children loaded since they are still needed before the parent can refine.\n // Or loadSiblings is true so always load tiles regardless of visibility.\n this.loadTile(child, frameState);\n this.touchTile(child, frameState);\n }\n\n if (checkRefines) {\n let childRefines;\n if (!child._inRequestVolume) {\n childRefines = false;\n } else if (!child.hasRenderContent) {\n childRefines = this.executeEmptyTraversal(child, frameState);\n } else {\n childRefines = child.contentAvailable;\n }\n refines = refines && childRefines;\n\n if (!refines) {\n return false;\n }\n }\n }\n\n if (!hasVisibleChild) {\n refines = false;\n }\n return refines;\n }\n /* eslint-enable complexity, max-statements */\n\n updateTile(tile: Tile3D, frameState: FrameState): void {\n this.updateTileVisibility(tile, frameState);\n }\n\n // tile to render in the browser\n selectTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldSelectTile(tile)) {\n // The tile can be selected right away and does not require traverseAndSelect\n tile._selectedFrame = frameState.frameNumber;\n this.selectedTiles[tile.id] = tile;\n }\n }\n\n // tile to load from server\n loadTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldLoadTile(tile)) {\n tile._requestedFrame = frameState.frameNumber;\n tile._priority = tile._getPriority();\n this.requestedTiles[tile.id] = tile;\n }\n }\n\n // cache tile\n touchTile(tile: Tile3D, frameState: FrameState): void {\n tile.tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n }\n\n // tile should be visible\n // tile should have children\n // tile LoD (level of detail) is not sufficient under current viewport\n canTraverse(\n tile: Tile3D,\n frameState: FrameState,\n useParentMetric: boolean = false,\n ignoreVisibility: boolean = false\n ): boolean {\n if (!tile.hasChildren) {\n return false;\n }\n\n // cesium specific\n if (tile.hasTilesetContent) {\n // Traverse external this to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n\n if (!ignoreVisibility && !tile.isVisibleAndInRequestVolume) {\n return false;\n }\n\n return this.shouldRefine(tile, frameState, useParentMetric);\n }\n\n shouldLoadTile(tile: Tile3D): boolean {\n // if request tile is in current frame\n // and has unexpired render content\n return tile.hasUnloadedContent || tile.contentExpired;\n }\n\n shouldSelectTile(tile: Tile3D): boolean {\n // if select tile is in current frame\n // and content available\n return tile.contentAvailable && !this.options.skipLevelOfDetail;\n }\n\n /** Decide if tile LoD (level of detail) is not sufficient under current viewport */\n shouldRefine(tile: Tile3D, frameState: FrameState, useParentMetric: boolean = false): boolean {\n let screenSpaceError = tile._screenSpaceError;\n if (useParentMetric) {\n screenSpaceError = tile.getScreenSpaceError(frameState, true);\n }\n\n return screenSpaceError > this.options.maximumScreenSpaceError;\n }\n\n updateTileVisibility(tile: Tile3D, frameState: FrameState): void {\n const viewportIds: string[] = [];\n if (this.options.viewportTraversersMap) {\n for (const key in this.options.viewportTraversersMap) {\n const value = this.options.viewportTraversersMap[key];\n if (value === frameState.viewport.id) {\n viewportIds.push(key);\n }\n }\n } else {\n viewportIds.push(frameState.viewport.id);\n }\n tile.updateVisibility(frameState, viewportIds);\n }\n\n // UTILITIES\n\n compareDistanceToCamera(b: Tile3D, a: Tile3D): number {\n return b._distanceToCamera - a._distanceToCamera;\n }\n\n anyChildrenVisible(tile: Tile3D, frameState: FrameState): boolean {\n let anyVisible = false;\n for (const child of tile.children) {\n // @ts-expect-error\n child.updateVisibility(frameState);\n // @ts-expect-error\n anyVisible = anyVisible || child.isVisibleAndInRequestVolume;\n }\n return anyVisible;\n }\n\n // Depth-first traversal that checks if all nearest descendants with content are loaded.\n // Ignores visibility.\n executeEmptyTraversal(root: Tile3D, frameState: FrameState): boolean {\n let allDescendantsLoaded = true;\n const stack = this._emptyTraversalStack;\n\n stack.push(root);\n\n while (stack.length > 0 && allDescendantsLoaded) {\n const tile = stack.pop();\n\n this.updateTile(tile, frameState);\n\n if (!tile.isVisibleAndInRequestVolume) {\n // Load tiles that aren't visible since they are still needed for the parent to refine\n this.loadTile(tile, frameState);\n }\n\n this.touchTile(tile, frameState);\n\n // Only traverse if the tile is empty - traversal stop at descendants with content\n const traverse = !tile.hasRenderContent && this.canTraverse(tile, frameState, false, true);\n\n if (traverse) {\n const children = tile.children;\n for (const child of children) {\n // eslint-disable-next-line max-depth\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n }\n } else if (!tile.contentAvailable && !tile.hasEmptyContent) {\n allDescendantsLoaded = false;\n }\n }\n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I,IAAI,CAACH,WAAW,CAACH,IAAI,EAAEf,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC;QAE1F,IAAIC,QAAQ,EAAE;UACZ,IAAMqC,QAAQ,GAAGvB,IAAI,CAACuB,QAAQ;UAAC,IAAAqD,UAAA,GAAA5K,0BAAA,CACXuH,QAAQ;YAAAsD,MAAA;UAAA;YAA5B,KAAAD,UAAA,CAAAhK,CAAA,MAAAiK,MAAA,GAAAD,UAAA,CAAA/J,CAAA,IAAAC,IAAA,GAA8B;cAAA,IAAnB4G,KAAK,GAAAmD,MAAA,CAAA9J,KAAA;cAEd,IAAI+E,KAAK,CAACwC,IAAI,CAACZ,KAAK,CAAC,EAAE;gBACrB5B,KAAK,CAACyC,MAAM,CAACb,KAAK,CAAC;cACrB;cACA5B,KAAK,CAAC3C,IAAI,CAACuE,KAAK,CAAC;YACnB;UAAC,SAAApG,GAAA;YAAAsJ,UAAA,CAAA5J,CAAA,CAAAM,GAAA;UAAA;YAAAsJ,UAAA,CAAA1J,CAAA;UAAA;QACH,CAAC,MAAM,IAAI,CAAC8E,IAAI,CAAC2C,gBAAgB,IAAI,CAAC3C,IAAI,CAAC8E,eAAe,EAAE;UAC1DH,oBAAoB,GAAG,KAAK;QAC9B;MACF;MAEA,OAAOA,oBAAoB;IAC7B;EAAC;EAAA,OAAAlG,gBAAA;AAAA;AAAAD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tileset-traverser.js","names":["ManagedArray","TILE_REFINEMENT","DEFAULT_PROPS","loadSiblings","skipLevelOfDetail","maximumScreenSpaceError","updateTransforms","onTraversalEnd","viewportTraversersMap","basePath","TilesetTraverser","traversalFinished","frameState","constructor","options","_defineProperty","Date","getTime","traverse","root","reset","updateTile","_frameNumber","frameNumber","executeTraversal","requestedTiles","selectedTiles","emptyTiles","_traversalStack","_emptyTraversalStack","stack","_selectionDepth","push","length","tile","pop","shouldRefine","canTraverse","updateChildTiles","updateAndPushChildren","hasRenderContent","parent","parentRefines","Boolean","_shouldRefine","stoppedRefining","id","loadTile","selectTile","refine","ADD","REPLACE","touchTile","newTime","lastUpdate","updateDebounceTime","children","child","depth","sort","compareDistanceToCamera","bind","checkRefines","hasVisibleChild","refines","isVisibleAndInRequestVolume","find","delete","childRefines","_inRequestVolume","executeEmptyTraversal","contentAvailable","updateTileVisibility","shouldSelectTile","_selectedFrame","shouldLoadTile","_requestedFrame","_priority","_getPriority","tileset","_cache","touch","_touchedFrame","useParentMetric","arguments","undefined","ignoreVisibility","hasChildren","hasTilesetContent","contentExpired","hasUnloadedContent","screenSpaceError","_screenSpaceError","getScreenSpaceError","viewportIds","key","value","viewport","updateVisibility","b","a","_distanceToCamera","anyChildrenVisible","anyVisible","allDescendantsLoaded"],"sources":["../../../src/tileset/tileset-traverser.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Tile3D} from './tile-3d';\nimport {ManagedArray} from '../utils/managed-array';\nimport {TILE_REFINEMENT} from '../constants';\nimport {FrameState} from './helpers/frame-state';\n\nexport type TilesetTraverserProps = {\n loadSiblings?: boolean;\n skipLevelOfDetail?: boolean;\n updateTransforms?: boolean;\n maximumScreenSpaceError?: number;\n onTraversalEnd?: (frameState) => any;\n viewportTraversersMap?: Record<string, any>;\n basePath?: string;\n};\n\nexport const DEFAULT_PROPS: Required<TilesetTraverserProps> = {\n loadSiblings: false,\n skipLevelOfDetail: false,\n maximumScreenSpaceError: 2,\n updateTransforms: true,\n onTraversalEnd: () => {},\n viewportTraversersMap: {},\n basePath: ''\n};\n\nexport class TilesetTraverser {\n options: Required<TilesetTraverserProps>;\n\n // fulfill in traverse call\n root: any = null;\n\n // tiles should be rendered\n selectedTiles: Record<string, Tile3D> = {};\n // tiles should be loaded from server\n requestedTiles: Record<string, Tile3D> = {};\n // tiles does not have render content\n emptyTiles: Record<string, Tile3D> = {};\n\n protected lastUpdate: number = new Date().getTime();\n protected readonly updateDebounceTime = 1000;\n /** temporary storage to hold the traversed tiles during a traversal */\n protected _traversalStack = new ManagedArray();\n protected _emptyTraversalStack = new ManagedArray();\n /** set in every traverse cycle */\n protected _frameNumber: number | null = null;\n\n // RESULT\n protected traversalFinished(frameState: FrameState): boolean {\n return true;\n }\n\n // TODO nested props\n constructor(options: TilesetTraverserProps) {\n this.options = {...DEFAULT_PROPS, ...options};\n }\n\n // tiles should be visible\n traverse(root, frameState, options) {\n this.root = root; // for root screen space error\n this.options = {...this.options, ...options};\n\n // reset result\n this.reset();\n\n // update tile (visibility and expiration)\n this.updateTile(root, frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.executeTraversal(root, frameState);\n }\n\n reset() {\n this.requestedTiles = {};\n this.selectedTiles = {};\n this.emptyTiles = {};\n this._traversalStack.reset();\n this._emptyTraversalStack.reset();\n }\n\n /**\n * Execute traverse\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * If skipLevelOfDetail is off then a tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n * Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n * all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n * and rendering children and parent tiles simultaneously.\n */\n /* eslint-disable-next-line complexity, max-statements */\n executeTraversal(root, frameState: FrameState): void {\n // stack to store traversed tiles, only visible tiles should be added to stack\n // visible: visible in the current view frustum\n const stack = this._traversalStack;\n root._selectionDepth = 1;\n\n stack.push(root);\n while (stack.length > 0) {\n // 1. pop tile\n const tile = stack.pop();\n\n // 2. check if tile needs to be refine, needs refine if a tile's LoD is not sufficient and tile has available children (available content)\n let shouldRefine = false;\n if (this.canTraverse(tile, frameState)) {\n this.updateChildTiles(tile, frameState);\n shouldRefine = this.updateAndPushChildren(\n tile,\n frameState,\n stack,\n tile.hasRenderContent ? tile._selectionDepth + 1 : tile._selectionDepth\n );\n }\n\n // 3. decide if should render (select) this tile\n // - tile does not have render content\n // - tile has render content and tile is `add` type (pointcloud)\n // - tile has render content and tile is `replace` type (photogrammetry) and can't refine any further\n const parent = tile.parent;\n const parentRefines = Boolean(!parent || parent._shouldRefine);\n const stoppedRefining = !shouldRefine;\n\n if (!tile.hasRenderContent) {\n this.emptyTiles[tile.id] = tile;\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n // additive tiles\n } else if (tile.refine === TILE_REFINEMENT.ADD) {\n // Additive tiles are always loaded and selected\n this.loadTile(tile, frameState);\n this.selectTile(tile, frameState);\n\n // replace tiles\n } else if (tile.refine === TILE_REFINEMENT.REPLACE) {\n // Always load tiles in the base traversal\n // Select tiles that can't refine further\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n }\n\n // 3. update cache, most recent touched tiles have higher priority to be fetched from server\n this.touchTile(tile, frameState);\n\n // 4. update tile refine prop and parent refinement status to trickle down to the descendants\n tile._shouldRefine = shouldRefine && parentRefines;\n }\n\n const newTime = new Date().getTime();\n if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {\n this.lastUpdate = newTime;\n this.options.onTraversalEnd(frameState);\n }\n }\n\n updateChildTiles(tile: Tile3D, frameState: FrameState): void {\n const children = tile.children;\n for (const child of children) {\n this.updateTile(child, frameState);\n }\n }\n\n /* eslint-disable complexity, max-statements */\n updateAndPushChildren(tile: Tile3D, frameState: FrameState, stack, depth): boolean {\n const {loadSiblings, skipLevelOfDetail} = this.options;\n\n const children = tile.children;\n\n // sort children tiles\n children.sort(this.compareDistanceToCamera.bind(this));\n\n // For traditional replacement refinement only refine if all children are loaded.\n // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n const checkRefines =\n tile.refine === TILE_REFINEMENT.REPLACE && tile.hasRenderContent && !skipLevelOfDetail;\n\n let hasVisibleChild = false;\n let refines = true;\n\n for (const child of children) {\n child._selectionDepth = depth;\n if (child.isVisibleAndInRequestVolume) {\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n hasVisibleChild = true;\n } else if (checkRefines || loadSiblings) {\n // Keep non-visible children loaded since they are still needed before the parent can refine.\n // Or loadSiblings is true so always load tiles regardless of visibility.\n this.loadTile(child, frameState);\n this.touchTile(child, frameState);\n }\n\n if (checkRefines) {\n let childRefines;\n if (!child._inRequestVolume) {\n childRefines = false;\n } else if (!child.hasRenderContent) {\n childRefines = this.executeEmptyTraversal(child, frameState);\n } else {\n childRefines = child.contentAvailable;\n }\n refines = refines && childRefines;\n\n if (!refines) {\n return false;\n }\n }\n }\n\n if (!hasVisibleChild) {\n refines = false;\n }\n return refines;\n }\n /* eslint-enable complexity, max-statements */\n\n updateTile(tile: Tile3D, frameState: FrameState): void {\n this.updateTileVisibility(tile, frameState);\n }\n\n // tile to render in the browser\n selectTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldSelectTile(tile)) {\n // The tile can be selected right away and does not require traverseAndSelect\n tile._selectedFrame = frameState.frameNumber;\n this.selectedTiles[tile.id] = tile;\n }\n }\n\n // tile to load from server\n loadTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldLoadTile(tile)) {\n tile._requestedFrame = frameState.frameNumber;\n tile._priority = tile._getPriority();\n this.requestedTiles[tile.id] = tile;\n }\n }\n\n // cache tile\n touchTile(tile: Tile3D, frameState: FrameState): void {\n tile.tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n }\n\n // tile should be visible\n // tile should have children\n // tile LoD (level of detail) is not sufficient under current viewport\n canTraverse(\n tile: Tile3D,\n frameState: FrameState,\n useParentMetric: boolean = false,\n ignoreVisibility: boolean = false\n ): boolean {\n if (!tile.hasChildren) {\n return false;\n }\n\n // cesium specific\n if (tile.hasTilesetContent) {\n // Traverse external this to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n\n if (!ignoreVisibility && !tile.isVisibleAndInRequestVolume) {\n return false;\n }\n\n return this.shouldRefine(tile, frameState, useParentMetric);\n }\n\n shouldLoadTile(tile: Tile3D): boolean {\n // if request tile is in current frame\n // and has unexpired render content\n return tile.hasUnloadedContent || tile.contentExpired;\n }\n\n shouldSelectTile(tile: Tile3D): boolean {\n // if select tile is in current frame\n // and content available\n return tile.contentAvailable && !this.options.skipLevelOfDetail;\n }\n\n /** Decide if tile LoD (level of detail) is not sufficient under current viewport */\n shouldRefine(tile: Tile3D, frameState: FrameState, useParentMetric: boolean = false): boolean {\n let screenSpaceError = tile._screenSpaceError;\n if (useParentMetric) {\n screenSpaceError = tile.getScreenSpaceError(frameState, true);\n }\n\n return screenSpaceError > this.options.maximumScreenSpaceError;\n }\n\n updateTileVisibility(tile: Tile3D, frameState: FrameState): void {\n const viewportIds: string[] = [];\n if (this.options.viewportTraversersMap) {\n for (const key in this.options.viewportTraversersMap) {\n const value = this.options.viewportTraversersMap[key];\n if (value === frameState.viewport.id) {\n viewportIds.push(key);\n }\n }\n } else {\n viewportIds.push(frameState.viewport.id);\n }\n tile.updateVisibility(frameState, viewportIds);\n }\n\n // UTILITIES\n\n compareDistanceToCamera(b: Tile3D, a: Tile3D): number {\n return b._distanceToCamera - a._distanceToCamera;\n }\n\n anyChildrenVisible(tile: Tile3D, frameState: FrameState): boolean {\n let anyVisible = false;\n for (const child of tile.children) {\n // @ts-expect-error\n child.updateVisibility(frameState);\n // @ts-expect-error\n anyVisible = anyVisible || child.isVisibleAndInRequestVolume;\n }\n return anyVisible;\n }\n\n // Depth-first traversal that checks if all nearest descendants with content are loaded.\n // Ignores visibility.\n executeEmptyTraversal(root: Tile3D, frameState: FrameState): boolean {\n let allDescendantsLoaded = true;\n const stack = this._emptyTraversalStack;\n\n stack.push(root);\n\n while (stack.length > 0 && allDescendantsLoaded) {\n const tile = stack.pop();\n\n this.updateTile(tile, frameState);\n\n if (!tile.isVisibleAndInRequestVolume) {\n // Load tiles that aren't visible since they are still needed for the parent to refine\n this.loadTile(tile, frameState);\n }\n\n this.touchTile(tile, frameState);\n\n // Only traverse if the tile is empty - traversal stop at descendants with content\n const traverse = !tile.hasRenderContent && this.canTraverse(tile, frameState, false, true);\n\n if (traverse) {\n const children = tile.children;\n for (const child of children) {\n // eslint-disable-next-line max-depth\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n }\n } else if (!tile.contentAvailable) {\n allDescendantsLoaded = false;\n }\n }\n\n return allDescendantsLoaded;\n }\n}\n"],"mappings":";AAGA,SAAQA,YAAY,QAAO,wBAAwB;AACnD,SAAQC,eAAe,QAAO,cAAc;AAa5C,OAAO,MAAMC,aAA8C,GAAG;EAC5DC,YAAY,EAAE,KAAK;EACnBC,iBAAiB,EAAE,KAAK;EACxBC,uBAAuB,EAAE,CAAC;EAC1BC,gBAAgB,EAAE,IAAI;EACtBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAE,CAAC,CAAC;EACzBC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,gBAAgB,CAAC;EAsBlBC,iBAAiBA,CAACC,UAAsB,EAAW;IAC3D,OAAO,IAAI;EACb;EAGAC,WAAWA,CAACC,OAA8B,EAAE;IAAAC,eAAA;IAAAA,eAAA,eAvBhC,IAAI;IAAAA,eAAA,wBAGwB,CAAC,CAAC;IAAAA,eAAA,yBAED,CAAC,CAAC;IAAAA,eAAA,qBAEN,CAAC,CAAC;IAAAA,eAAA,qBAER,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;IAAAF,eAAA,6BACX,IAAI;IAAAA,eAAA,0BAEhB,IAAIf,YAAY,CAAC,CAAC;IAAAe,eAAA,+BACb,IAAIf,YAAY,CAAC,CAAC;IAAAe,eAAA,uBAEX,IAAI;IAS1C,IAAI,CAACD,OAAO,GAAG;MAAC,GAAGZ,aAAa;MAAE,GAAGY;IAAO,CAAC;EAC/C;EAGAI,QAAQA,CAACC,IAAI,EAAEP,UAAU,EAAEE,OAAO,EAAE;IAClC,IAAI,CAACK,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACL,OAAO,GAAG;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AM,GAAG,CAAC,IAAIuE,oBAAoB,EAAE;MAC/C,MAAMtE,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAAC,CAAC;MAExB,IAAI,CAACd,UAAU,CAACa,IAAI,EAAEtB,UAAU,CAAC;MAEjC,IAAI,CAACsB,IAAI,CAAC+B,2BAA2B,EAAE;QAErC,IAAI,CAAClB,QAAQ,CAACb,IAAI,EAAEtB,UAAU,CAAC;MACjC;MAEA,IAAI,CAACwC,SAAS,CAAClB,IAAI,EAAEtB,UAAU,CAAC;MAGhC,MAAMM,QAAQ,GAAG,CAACgB,IAAI,CAACM,gBAAgB,IAAI,IAAI,CAACH,WAAW,CAACH,IAAI,EAAEtB,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC;MAE1F,IAAIM,QAAQ,EAAE;QACZ,MAAMsC,QAAQ,GAAGtB,IAAI,CAACsB,QAAQ;QAC9B,KAAK,MAAMC,KAAK,IAAID,QAAQ,EAAE;UAE5B,IAAI1B,KAAK,CAACoC,IAAI,CAACT,KAAK,CAAC,EAAE;YACrB3B,KAAK,CAACqC,MAAM,CAACV,KAAK,CAAC;UACrB;UACA3B,KAAK,CAACE,IAAI,CAACyB,KAAK,CAAC;QACnB;MACF,CAAC,MAAM,IAAI,CAACvB,IAAI,CAACqC,gBAAgB,EAAE;QACjCiC,oBAAoB,GAAG,KAAK;MAC9B;IACF;IAEA,OAAOA,oBAAoB;EAC7B;AACF"}
|
|
1
|
+
{"version":3,"file":"tileset-traverser.js","names":["ManagedArray","TILE_REFINEMENT","DEFAULT_PROPS","loadSiblings","skipLevelOfDetail","maximumScreenSpaceError","updateTransforms","onTraversalEnd","viewportTraversersMap","basePath","TilesetTraverser","traversalFinished","frameState","constructor","options","_defineProperty","Date","getTime","traverse","root","reset","updateTile","_frameNumber","frameNumber","executeTraversal","requestedTiles","selectedTiles","emptyTiles","_traversalStack","_emptyTraversalStack","stack","_selectionDepth","push","length","tile","pop","shouldRefine","canTraverse","updateChildTiles","updateAndPushChildren","hasRenderContent","parent","parentRefines","Boolean","_shouldRefine","stoppedRefining","id","loadTile","selectTile","refine","ADD","REPLACE","touchTile","newTime","lastUpdate","updateDebounceTime","children","child","depth","sort","compareDistanceToCamera","bind","checkRefines","hasVisibleChild","refines","isVisibleAndInRequestVolume","find","delete","childRefines","_inRequestVolume","executeEmptyTraversal","contentAvailable","updateTileVisibility","shouldSelectTile","_selectedFrame","shouldLoadTile","_requestedFrame","_priority","_getPriority","tileset","_cache","touch","_touchedFrame","useParentMetric","arguments","undefined","ignoreVisibility","hasChildren","hasTilesetContent","contentExpired","hasUnloadedContent","screenSpaceError","_screenSpaceError","getScreenSpaceError","viewportIds","key","value","viewport","updateVisibility","b","a","_distanceToCamera","anyChildrenVisible","anyVisible","allDescendantsLoaded","hasEmptyContent"],"sources":["../../../src/tileset/tileset-traverser.ts"],"sourcesContent":["// loaders.gl, MIT license\n\nimport type {Tile3D} from './tile-3d';\nimport {ManagedArray} from '../utils/managed-array';\nimport {TILE_REFINEMENT} from '../constants';\nimport {FrameState} from './helpers/frame-state';\n\nexport type TilesetTraverserProps = {\n loadSiblings?: boolean;\n skipLevelOfDetail?: boolean;\n updateTransforms?: boolean;\n maximumScreenSpaceError?: number;\n onTraversalEnd?: (frameState) => any;\n viewportTraversersMap?: Record<string, any>;\n basePath?: string;\n};\n\nexport const DEFAULT_PROPS: Required<TilesetTraverserProps> = {\n loadSiblings: false,\n skipLevelOfDetail: false,\n maximumScreenSpaceError: 2,\n updateTransforms: true,\n onTraversalEnd: () => {},\n viewportTraversersMap: {},\n basePath: ''\n};\n\nexport class TilesetTraverser {\n options: Required<TilesetTraverserProps>;\n\n // fulfill in traverse call\n root: any = null;\n\n // tiles should be rendered\n selectedTiles: Record<string, Tile3D> = {};\n // tiles should be loaded from server\n requestedTiles: Record<string, Tile3D> = {};\n // tiles does not have render content\n emptyTiles: Record<string, Tile3D> = {};\n\n protected lastUpdate: number = new Date().getTime();\n protected readonly updateDebounceTime = 1000;\n /** temporary storage to hold the traversed tiles during a traversal */\n protected _traversalStack = new ManagedArray();\n protected _emptyTraversalStack = new ManagedArray();\n /** set in every traverse cycle */\n protected _frameNumber: number | null = null;\n\n // RESULT\n protected traversalFinished(frameState: FrameState): boolean {\n return true;\n }\n\n // TODO nested props\n constructor(options: TilesetTraverserProps) {\n this.options = {...DEFAULT_PROPS, ...options};\n }\n\n // tiles should be visible\n traverse(root, frameState, options) {\n this.root = root; // for root screen space error\n this.options = {...this.options, ...options};\n\n // reset result\n this.reset();\n\n // update tile (visibility and expiration)\n this.updateTile(root, frameState);\n\n this._frameNumber = frameState.frameNumber;\n this.executeTraversal(root, frameState);\n }\n\n reset() {\n this.requestedTiles = {};\n this.selectedTiles = {};\n this.emptyTiles = {};\n this._traversalStack.reset();\n this._emptyTraversalStack.reset();\n }\n\n /**\n * Execute traverse\n * Depth-first traversal that traverses all visible tiles and marks tiles for selection.\n * If skipLevelOfDetail is off then a tile does not refine until all children are loaded.\n * This is the traditional replacement refinement approach and is called the base traversal.\n * Tiles that have a greater screen space error than the base screen space error are part of the base traversal,\n * all other tiles are part of the skip traversal. The skip traversal allows for skipping levels of the tree\n * and rendering children and parent tiles simultaneously.\n */\n /* eslint-disable-next-line complexity, max-statements */\n executeTraversal(root, frameState: FrameState): void {\n // stack to store traversed tiles, only visible tiles should be added to stack\n // visible: visible in the current view frustum\n const stack = this._traversalStack;\n root._selectionDepth = 1;\n\n stack.push(root);\n while (stack.length > 0) {\n // 1. pop tile\n const tile = stack.pop();\n\n // 2. check if tile needs to be refine, needs refine if a tile's LoD is not sufficient and tile has available children (available content)\n let shouldRefine = false;\n if (this.canTraverse(tile, frameState)) {\n this.updateChildTiles(tile, frameState);\n shouldRefine = this.updateAndPushChildren(\n tile,\n frameState,\n stack,\n tile.hasRenderContent ? tile._selectionDepth + 1 : tile._selectionDepth\n );\n }\n\n // 3. decide if should render (select) this tile\n // - tile does not have render content\n // - tile has render content and tile is `add` type (pointcloud)\n // - tile has render content and tile is `replace` type (photogrammetry) and can't refine any further\n const parent = tile.parent;\n const parentRefines = Boolean(!parent || parent._shouldRefine);\n const stoppedRefining = !shouldRefine;\n\n if (!tile.hasRenderContent) {\n this.emptyTiles[tile.id] = tile;\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n // additive tiles\n } else if (tile.refine === TILE_REFINEMENT.ADD) {\n // Additive tiles are always loaded and selected\n this.loadTile(tile, frameState);\n this.selectTile(tile, frameState);\n\n // replace tiles\n } else if (tile.refine === TILE_REFINEMENT.REPLACE) {\n // Always load tiles in the base traversal\n // Select tiles that can't refine further\n this.loadTile(tile, frameState);\n if (stoppedRefining) {\n this.selectTile(tile, frameState);\n }\n }\n\n // 3. update cache, most recent touched tiles have higher priority to be fetched from server\n this.touchTile(tile, frameState);\n\n // 4. update tile refine prop and parent refinement status to trickle down to the descendants\n tile._shouldRefine = shouldRefine && parentRefines;\n }\n\n const newTime = new Date().getTime();\n if (this.traversalFinished(frameState) || newTime - this.lastUpdate > this.updateDebounceTime) {\n this.lastUpdate = newTime;\n this.options.onTraversalEnd(frameState);\n }\n }\n\n updateChildTiles(tile: Tile3D, frameState: FrameState): void {\n const children = tile.children;\n for (const child of children) {\n this.updateTile(child, frameState);\n }\n }\n\n /* eslint-disable complexity, max-statements */\n updateAndPushChildren(tile: Tile3D, frameState: FrameState, stack, depth): boolean {\n const {loadSiblings, skipLevelOfDetail} = this.options;\n\n const children = tile.children;\n\n // sort children tiles\n children.sort(this.compareDistanceToCamera.bind(this));\n\n // For traditional replacement refinement only refine if all children are loaded.\n // Empty tiles are exempt since it looks better if children stream in as they are loaded to fill the empty space.\n const checkRefines =\n tile.refine === TILE_REFINEMENT.REPLACE && tile.hasRenderContent && !skipLevelOfDetail;\n\n let hasVisibleChild = false;\n let refines = true;\n\n for (const child of children) {\n child._selectionDepth = depth;\n if (child.isVisibleAndInRequestVolume) {\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n hasVisibleChild = true;\n } else if (checkRefines || loadSiblings) {\n // Keep non-visible children loaded since they are still needed before the parent can refine.\n // Or loadSiblings is true so always load tiles regardless of visibility.\n this.loadTile(child, frameState);\n this.touchTile(child, frameState);\n }\n\n if (checkRefines) {\n let childRefines;\n if (!child._inRequestVolume) {\n childRefines = false;\n } else if (!child.hasRenderContent) {\n childRefines = this.executeEmptyTraversal(child, frameState);\n } else {\n childRefines = child.contentAvailable;\n }\n refines = refines && childRefines;\n\n if (!refines) {\n return false;\n }\n }\n }\n\n if (!hasVisibleChild) {\n refines = false;\n }\n return refines;\n }\n /* eslint-enable complexity, max-statements */\n\n updateTile(tile: Tile3D, frameState: FrameState): void {\n this.updateTileVisibility(tile, frameState);\n }\n\n // tile to render in the browser\n selectTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldSelectTile(tile)) {\n // The tile can be selected right away and does not require traverseAndSelect\n tile._selectedFrame = frameState.frameNumber;\n this.selectedTiles[tile.id] = tile;\n }\n }\n\n // tile to load from server\n loadTile(tile: Tile3D, frameState: FrameState): void {\n if (this.shouldLoadTile(tile)) {\n tile._requestedFrame = frameState.frameNumber;\n tile._priority = tile._getPriority();\n this.requestedTiles[tile.id] = tile;\n }\n }\n\n // cache tile\n touchTile(tile: Tile3D, frameState: FrameState): void {\n tile.tileset._cache.touch(tile);\n tile._touchedFrame = frameState.frameNumber;\n }\n\n // tile should be visible\n // tile should have children\n // tile LoD (level of detail) is not sufficient under current viewport\n canTraverse(\n tile: Tile3D,\n frameState: FrameState,\n useParentMetric: boolean = false,\n ignoreVisibility: boolean = false\n ): boolean {\n if (!tile.hasChildren) {\n return false;\n }\n\n // cesium specific\n if (tile.hasTilesetContent) {\n // Traverse external this to visit its root tile\n // Don't traverse if the subtree is expired because it will be destroyed\n return !tile.contentExpired;\n }\n\n if (!ignoreVisibility && !tile.isVisibleAndInRequestVolume) {\n return false;\n }\n\n return this.shouldRefine(tile, frameState, useParentMetric);\n }\n\n shouldLoadTile(tile: Tile3D): boolean {\n // if request tile is in current frame\n // and has unexpired render content\n return tile.hasUnloadedContent || tile.contentExpired;\n }\n\n shouldSelectTile(tile: Tile3D): boolean {\n // if select tile is in current frame\n // and content available\n return tile.contentAvailable && !this.options.skipLevelOfDetail;\n }\n\n /** Decide if tile LoD (level of detail) is not sufficient under current viewport */\n shouldRefine(tile: Tile3D, frameState: FrameState, useParentMetric: boolean = false): boolean {\n let screenSpaceError = tile._screenSpaceError;\n if (useParentMetric) {\n screenSpaceError = tile.getScreenSpaceError(frameState, true);\n }\n\n return screenSpaceError > this.options.maximumScreenSpaceError;\n }\n\n updateTileVisibility(tile: Tile3D, frameState: FrameState): void {\n const viewportIds: string[] = [];\n if (this.options.viewportTraversersMap) {\n for (const key in this.options.viewportTraversersMap) {\n const value = this.options.viewportTraversersMap[key];\n if (value === frameState.viewport.id) {\n viewportIds.push(key);\n }\n }\n } else {\n viewportIds.push(frameState.viewport.id);\n }\n tile.updateVisibility(frameState, viewportIds);\n }\n\n // UTILITIES\n\n compareDistanceToCamera(b: Tile3D, a: Tile3D): number {\n return b._distanceToCamera - a._distanceToCamera;\n }\n\n anyChildrenVisible(tile: Tile3D, frameState: FrameState): boolean {\n let anyVisible = false;\n for (const child of tile.children) {\n // @ts-expect-error\n child.updateVisibility(frameState);\n // @ts-expect-error\n anyVisible = anyVisible || child.isVisibleAndInRequestVolume;\n }\n return anyVisible;\n }\n\n // Depth-first traversal that checks if all nearest descendants with content are loaded.\n // Ignores visibility.\n executeEmptyTraversal(root: Tile3D, frameState: FrameState): boolean {\n let allDescendantsLoaded = true;\n const stack = this._emptyTraversalStack;\n\n stack.push(root);\n\n while (stack.length > 0 && allDescendantsLoaded) {\n const tile = stack.pop();\n\n this.updateTile(tile, frameState);\n\n if (!tile.isVisibleAndInRequestVolume) {\n // Load tiles that aren't visible since they are still needed for the parent to refine\n this.loadTile(tile, frameState);\n }\n\n this.touchTile(tile, frameState);\n\n // Only traverse if the tile is empty - traversal stop at descendants with content\n const traverse = !tile.hasRenderContent && this.canTraverse(tile, frameState, false, true);\n\n if (traverse) {\n const children = tile.children;\n for (const child of children) {\n // eslint-disable-next-line max-depth\n if (stack.find(child)) {\n stack.delete(child);\n }\n stack.push(child);\n }\n } else if (!tile.contentAvailable && !tile.hasEmptyContent) {\n allDescendantsLoaded = false;\n }\n }\n\n return allDescendantsLoaded;\n }\n}\n"],"mappings":";AAGA,SAAQA,YAAY,QAAO,wBAAwB;AACnD,SAAQC,eAAe,QAAO,cAAc;AAa5C,OAAO,MAAMC,aAA8C,GAAG;EAC5DC,YAAY,EAAE,KAAK;EACnBC,iBAAiB,EAAE,KAAK;EACxBC,uBAAuB,EAAE,CAAC;EAC1BC,gBAAgB,EAAE,IAAI;EACtBC,cAAc,EAAEA,CAAA,KAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAE,CAAC,CAAC;EACzBC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,gBAAgB,CAAC;EAsBlBC,iBAAiBA,CAACC,UAAsB,EAAW;IAC3D,OAAO,IAAI;EACb;EAGAC,WAAWA,CAACC,OAA8B,EAAE;IAAAC,eAAA;IAAAA,eAAA,eAvBhC,IAAI;IAAAA,eAAA,wBAGwB,CAAC,CAAC;IAAAA,eAAA,yBAED,CAAC,CAAC;IAAAA,eAAA,qBAEN,CAAC,CAAC;IAAAA,eAAA,qBAER,IAAIC,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC;IAAAF,eAAA,6BACX,IAAI;IAAAA,eAAA,0BAEhB,IAAIf,YAAY,CAAC,CAAC;IAAAe,eAAA,+BACb,IAAIf,YAAY,CAAC,CAAC;IAAAe,eAAA,uBAEX,IAAI;IAS1C,IAAI,CAACD,OAAO,GAAG;MAAC,GAAGZ,aAAa;MAAE,GAAGY;IAAO,CAAC;EAC/C;EAGAI,QAAQA,CAACC,IAAI,EAAEP,UAAU,EAAEE,OAAO,EAAE;IAClC,IAAI,CAACK,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACL,OAAO,GA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,MAAM,GAAG,CAAC,IAAIuE,oBAAoB,EAAE;MAC/C,MAAMtE,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAAC,CAAC;MAExB,IAAI,CAACd,UAAU,CAACa,IAAI,EAAEtB,UAAU,CAAC;MAEjC,IAAI,CAACsB,IAAI,CAAC+B,2BAA2B,EAAE;QAErC,IAAI,CAAClB,QAAQ,CAACb,IAAI,EAAEtB,UAAU,CAAC;MACjC;MAEA,IAAI,CAACwC,SAAS,CAAClB,IAAI,EAAEtB,UAAU,CAAC;MAGhC,MAAMM,QAAQ,GAAG,CAACgB,IAAI,CAACM,gBAAgB,IAAI,IAAI,CAACH,WAAW,CAACH,IAAI,EAAEtB,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC;MAE1F,IAAIM,QAAQ,EAAE;QACZ,MAAMsC,QAAQ,GAAGtB,IAAI,CAACsB,QAAQ;QAC9B,KAAK,MAAMC,KAAK,IAAID,QAAQ,EAAE;UAE5B,IAAI1B,KAAK,CAACoC,IAAI,CAACT,KAAK,CAAC,EAAE;YACrB3B,KAAK,CAACqC,MAAM,CAACV,KAAK,CAAC;UACrB;UACA3B,KAAK,CAACE,IAAI,CAACyB,KAAK,CAAC;QACnB;MACF,CAAC,MAAM,IAAI,CAACvB,IAAI,CAACqC,gBAAgB,IAAI,CAACrC,IAAI,CAACuE,eAAe,EAAE;QAC1DD,oBAAoB,GAAG,KAAK;MAC9B;IACF;IAEA,OAAOA,oBAAoB;EAC7B;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tiles",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.19",
|
|
4
4
|
"description": "Common components for different tiles loaders.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
37
|
-
"@loaders.gl/math": "4.0.0-alpha.
|
|
36
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.19",
|
|
37
|
+
"@loaders.gl/math": "4.0.0-alpha.19",
|
|
38
38
|
"@math.gl/core": "^3.5.1",
|
|
39
39
|
"@math.gl/culling": "^3.5.1",
|
|
40
40
|
"@math.gl/geospatial": "^3.5.1",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@deck.gl/core": "^8.9.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "2ca50ec4e1d312c124eb7c93c60ab6fd17ee833e"
|
|
51
51
|
}
|