-
Notifications
You must be signed in to change notification settings - Fork 242
Add support for selecting tiles for multiple independent views #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 122 commits
Commits
Show all changes
163 commits
Select commit
Hold shift + click to select a range
243cae3
Move last selection state out of Tile in the simplest way possible.
kring 4bed3c8
Merge remote-tracking branch 'origin/main' into multiple-views
kring 6e0a355
Call startNextFrame on all ViewGroups.
kring 3f7fed8
Don't check frame number.
kring 9bdf470
Merge remote-tracking branch 'origin/main' into multiple-views
kring e60c349
Merge remote-tracking branch 'origin/unload-external-tilesets-2' into…
kring caf4668
New Tile unload approach.
kring 0613cfa
Merge remote-tracking branch 'origin/main' into multiple-views
kring 1326242
New loaded tile enumeration.
kring ff24bad
TilesetContentManger owns LoadedTileEnumerator.
kring 83ecea4
Less fiddly updating of LoadedTileEnumerator's root tile.
kring b3c0999
More natural tile reference counting.
kring c7fc9c3
Remove unused frame number from TileSelectionState.
kring 8a626df
Remove unused frame number parameters.
kring 0092b7b
Merge remote-tracking branch 'origin/main' into multiple-views
kring a81e7f3
Move load queues into TilesetViewGroup.
kring 076fcbc
Add ITileLoadRequester, register with TilesetContentManager.
kring 865d8af
Register in remaining TilesetViewGroup constructor.
kring 49783e0
Weighted round robin worker thread tile loading.
kring db5602c
Settable weights.
kring a2dc5fd
Weighted round robin for main thread loading, too.
kring c5b5841
Fix height queries.
kring be14e13
Fix clang warning.
kring 7bcb43e
Merge remote-tracking branch 'origin/main' into multiple-views
kring a5e5bee
Doc, make needs*Loading methods accessible.
kring 88f23da
Rename ITileLoadRequester.h to TileLoadRequester.h.
kring f31eddd
Rename ITileLoadRequester to TileLoadRequester.
kring 5c3fe54
Less magic for registration of TileLoadRequesters.
kring cb5b39d
Remove createViewGroup method.
kring a64daea
Process height queries in loadTiles instead of updateView.
kring 420ee78
Fix clang error, hopefully.
kring 9b1efc6
Clean up LoadedTileEnumerator.
kring 74d17e5
Formatting.
kring 9f170ee
Remove invalid use of `static`.
kring 556d803
Documentation.
kring 06914b4
More missing doc.
kring 1c15340
clang-tidy warnings.
kring e4e563a
More clang-tidy.
kring 19ff299
Include <functional> for std::hash.
kring 58aaffa
Rename local variable.
kring d7f36bd
Fix DebugTileStateDatabase.
kring 35a924f
DebugTileStateDatabse logs previous selection state.
kring 600dc3e
Tile cleanup.
kring 27c384b
Doc.
kring daed0a1
Make Tileset not a friend of TilesetViewGroup.
kring 8df7f2a
Improve names, add doc.
kring c5d9fe9
Clang-tidy.
kring 87b9ac2
More clang-tidy.
kring 54a63e4
Move ViewUpdateResult to TilesetViewGroup.
kring e782ba4
Fix incorrect comment.
kring a213d8a
Re-renable TilesetContentManager tests.
kring 8010ede
Reactivate TilesetSelectionAlgorithm tests.
kring 0ce7e6d
WIP optimized selection state tracking.
kring 2e05881
Improve TreeTraversalState, write tests.
kring 34d49b5
Much cleaner TreeTraversalState, more tests.
kring eec5a52
Remove commented-out code, add doc.
kring a286796
Fix DebugTileStateDatabase, add doc.
kring 1f1055f
Reactivate LOD transitions.
kring e837652
Remove commented-out code.
kring 85e2066
Avoid nested traversals.
kring 3fc4df5
Fix release build warning.
kring bd4d058
Formatting.
kring 4ae0596
Fix clang-tidy warnings.
kring 6894914
Fix doc errors.
kring e4f25aa
Fix warnings.
kring 1c2914e
Fix clang warnings.
kring a845666
Fix comment characters.
kring fd2359c
Re-enable selection tests.
kring eb77e8d
Fix ref count bug with LOD transitions enabled.
kring 2d82e6e
Merge pull request #1129 from CesiumGS/multiple-views-faster
kring 1522a65
Merge remote-tracking branch 'origin/main' into multiple-views
kring 2445c49
Add support for querying TilesetViewGroup load progress.
kring 4ca1a11
Fix clang warning.
kring 4bbb7e4
clang-tidy warnings.
kring e9eb9e9
New retained mode CreditSystem.
kring 024d8c8
Qualify with this.
kring 260e803
Merge remote-tracking branch 'origin/main' into multiple-views
kring 4141a83
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring 3499dee
Start making TilesetViewGroups update credits.
kring e623a7d
Better TilesetViewGroup credit tracking.
kring 9a2b6c6
Re-add the rest of the credits.
kring f2975cf
Formatting.
kring b3d9044
Fix warning.
kring cea2af7
Fix doc problems.
kring 9468252
Merge remote-tracking branch 'origin/main' into multiple-views
kring 5b4c3a0
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring b4056a9
Merge remote-tracking branch 'origin/downgrade-cmake-more' into multi…
kring bca8184
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring 2e7bf0a
Add missing header.
kring 7f2ef34
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring d64469f
clang-tidy.
kring abd17be
More clang-tidy.
kring 05e3ae1
Merge pull request #1152 from CesiumGS/multiple-views-credits
kring f45fb3f
Merge remote-tracking branch 'origin/main' into multiple-views
kring 398ae77
Doc tweaks.
kring 7e5c7df
CreditReferencer copy/move operations.
kring cf6cf7f
Fix clang-tidy warning.
kring bb53be1
Add CreditReferencer tests.
kring 499ef05
Add TileLoadRequester tests.
kring 91090b8
Test cleanup.
kring 2d1a624
CreditSystem cleanup.
kring 9c0dc55
Fix clang warning.
kring 994858e
Update CHANGES.md.
kring 65587cd
Doc updates.
kring e7b0ded
Start progress at 0 instead of 100.
kring bec5ae2
Remove frame number from Tileset.
kring c09bd48
Add basic TilesetViewGroup test.
kring 1f4d3b1
Small cleanup, mostly doc.
kring 2720437
Simplify tile enumeration.
kring e4e8d62
Tile initialization cleanup.
kring f778da7
Tileset cleanup.
kring b1d8456
Better TileLoadTask ordering.
kring eb6a647
More efficient swap, doc tweaks.
kring d0a70e0
Missing "this->"
kring a25233b
Changes from review.
kring abb8d33
Don't enumerate root tile if it / descendants are not loaded.
kring 97dcc14
Doc improvements.
kring 1c184cc
Use member function pointers instead of templates / lambdas.
kring 3dd746b
Rename _tilesAlreadyLoading -> _tilesAlreadyLoadingOrUnloading.
kring 3da6ea1
Improvements from review.
kring a6e9fde
Only store one reference count on Tile.
kring c31e1da
Fix broken link in doc.
kring 6e4b13f
Fix clang-tidy warnings.
kring ae2b985
Update msys links.
kring 34dbe5e
Merge remote-tracking branch 'origin/main' into multiple-views
kring d82c165
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring 818e4fc
More reference counting doc.
kring 41889dc
Tile::Pointer and other cleanup.
kring 8413448
Hold IntrusivePointer during Tile loading.
kring 6ee6210
Remove CESIUM_DEBUG_TILE_UNLOADING.
kring a2657e3
Remove rambling and redundant comment.
kring 4f29c7b
Assert that content isn't set twice.
kring 5fc9ed5
Rename functions.
kring 23fc5b2
Comment tweak.
kring 0b0cb86
clang-tidy
kring 79bfe21
Add some assertions.
kring 9a4a3e3
Revert "Remove CESIUM_DEBUG_TILE_UNLOADING."
kring a973df4
Keep TilesetContentManager alive while Tiles are alive.
kring 00c575d
More ref count cleanup, fix tests.
kring ba8d790
Fix assertion failure.
kring 6415b9a
Remove unnecessary changes.
kring 463b91b
Add some doc, simplify some logic.
kring 4de9c08
More cleanup.
kring 4d2241d
Fix clang warnings.
kring c19cbe1
Clang-tidy
kring 37cbd9c
clang-tidy.
kring c6c498e
Merge remote-tracking branch 'origin/main' into multiple-views
kring 74b919d
Merge remote-tracking branch 'origin/multiple-views' into multiple-vi…
kring 6107fec
Add updateViewGroupOffline method.
kring cc4e1a5
Deprecate updateView / updateViewOffline.
kring 2a7d6b0
Update CHANGES.md.
kring 87c9ae7
Doc improvements.
kring bec1332
Update doc for correct method
j9liu ce2c0b4
Address review comments.
kring d94e7d4
Merge remote-tracking branch 'origin/multiple-views-one-reference-cou…
kring 8a43074
Use hasReferencingContent in assert
j9liu be4a0ab
Merge pull request #1156 from CesiumGS/multiple-views-one-reference-c…
j9liu ad575e3
Merge pull request #1160 from CesiumGS/multiple-views-more
j9liu cd5d4af
Merge remote-tracking branch 'origin/main' into multiple-views
kring fc83ace
Merge branch 'main' into multiple-views
j9liu 70b97bb
Fix failing unit test
j9liu c0fd95b
Merge branch 'main' into multiple-views
j9liu 2dcabd6
Remove calls to ViewState::create
j9liu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
198 changes: 198 additions & 0 deletions
198
Cesium3DTilesSelection/include/Cesium3DTilesSelection/LoadedTileEnumerator.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
#pragma once | ||
|
||
#include <iterator> | ||
#include <vector> | ||
|
||
namespace Cesium3DTilesSelection { | ||
|
||
class Tile; | ||
class TilesetContentManager; | ||
|
||
// The LoadedConstTileEnumerator and LoadedTileEnumerator could probably be | ||
// replaced with ranges, except that we need to support Android and range | ||
// support prior to NDK r26 is shaky. Unreal Engine 5.5 uses r25b and Unity | ||
// 2022.3 uses r23b. See here: https://github.com/android/ndk/issues/1530 | ||
|
||
/** | ||
* @brief A "virtual collection" that allows enumeration through the loaded | ||
* tiles in a subtree rooted at a given {@link Tile}. | ||
* | ||
* For the purposes of this enumeration, a loaded tile is one that is in a | ||
* {@link TileLoadState} other than {@link TileLoadState::Unloaded}, or that | ||
* has any children (or other descendants) that meet this criteria. We check the | ||
* latter criteria by looking at {@link Tile::getDoNotUnloadSubtreeCount}. | ||
j9liu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
*/ | ||
class LoadedConstTileEnumerator { | ||
public: | ||
/** | ||
* @brief An iterator over constant {@link Tile} instances. | ||
*/ | ||
class const_iterator { | ||
public: | ||
/** | ||
* @brief The iterator category tag denoting this is a forward iterator. | ||
*/ | ||
using iterator_category = std::forward_iterator_tag; | ||
/** | ||
* @brief The type of value that is being iterated over. | ||
*/ | ||
using value_type = const Tile; | ||
/** | ||
* @brief The type used to identify distance between iterators. | ||
* | ||
* This is `void` because there is no meaningful measure of distance between | ||
* tiles. | ||
*/ | ||
using difference_type = void; | ||
/** | ||
* @brief A pointer to the type being iterated over. | ||
*/ | ||
using pointer = const Tile*; | ||
/** | ||
* @brief A reference to the type being iterated over. | ||
*/ | ||
using reference = const Tile&; | ||
|
||
/** | ||
* @brief Returns a reference to the current item being iterated. | ||
*/ | ||
const Tile& operator*() const noexcept; | ||
/** | ||
* @brief Returns a pointer to the current item being iterated. | ||
*/ | ||
const Tile* operator->() const noexcept; | ||
|
||
/** | ||
* @brief Advances the iterator to the next item (pre-incrementing). | ||
*/ | ||
const_iterator& operator++() noexcept; | ||
/** | ||
* @brief Advances the iterator to the next item (post-incrementing). | ||
*/ | ||
const_iterator operator++(int) noexcept; | ||
|
||
/** @brief Checks if two iterators are at the same item. */ | ||
bool operator==(const const_iterator& rhs) const noexcept; | ||
/** @brief Checks if two iterators are not at the same item. */ | ||
bool operator!=(const const_iterator& rhs) const noexcept; | ||
|
||
private: | ||
explicit const_iterator(const Tile* pRootTile) noexcept; | ||
|
||
std::vector<const Tile*> _traversalStack; | ||
|
||
friend class LoadedTileEnumerator; | ||
friend class LoadedConstTileEnumerator; | ||
}; | ||
|
||
/** | ||
* @brief Creates a new instance to enumerate loaded tiles in the subtree | ||
* rooted at `pRootTile`. | ||
* | ||
* If `pRootTile` is `nullptr`, then the iteration is empty (`begin==end`). | ||
* Otherwise, the iteration will include at least `pRootTile`, even if it is | ||
* not loaded. | ||
* | ||
* @param pRootTile The root tile of the subtree. | ||
*/ | ||
explicit LoadedConstTileEnumerator(const Tile* pRootTile) noexcept; | ||
|
||
/** @brief Returns an iterator starting at the first tile. */ | ||
const_iterator begin() const noexcept; | ||
/** @brief Returns an iterator starting after the last tile. */ | ||
const_iterator end() const noexcept; | ||
|
||
private: | ||
const Tile* _pRootTile; | ||
|
||
template <typename TIterator> static TIterator& increment(TIterator& it); | ||
friend class LoadedTileEnumerator; | ||
}; | ||
|
||
/** @copydoc LoadedConstTileEnumerator */ | ||
class LoadedTileEnumerator { | ||
public: | ||
/** | ||
* @brief An iterator over constant {@link Tile} instances. | ||
*/ | ||
using const_iterator = LoadedConstTileEnumerator::const_iterator; | ||
|
||
/** | ||
* @brief An iterator over {@link Tile} instances. | ||
*/ | ||
class iterator { | ||
public: | ||
/** | ||
* @brief The iterator category tag denoting this is a forward iterator. | ||
*/ | ||
using iterator_category = std::forward_iterator_tag; | ||
/** | ||
* @brief The type of value that is being iterated over. | ||
*/ | ||
using value_type = Tile; | ||
/** | ||
* @brief The type used to identify distance between iterators. | ||
* | ||
* This is `void` because there is no meaningful measure of distance between | ||
* tiles. | ||
*/ | ||
using difference_type = void; | ||
/** | ||
* @brief A pointer to the type being iterated over. | ||
*/ | ||
using pointer = Tile*; | ||
/** | ||
* @brief A reference to the type being iterated over. | ||
*/ | ||
using reference = Tile&; | ||
|
||
/** | ||
* @brief Returns a reference to the current item being iterated. | ||
*/ | ||
Tile& operator*() const noexcept; | ||
/** | ||
* @brief Returns a pointer to the current item being iterated. | ||
*/ | ||
Tile* operator->() const noexcept; | ||
|
||
/** | ||
* @brief Advances the iterator to the next item (pre-incrementing). | ||
*/ | ||
iterator& operator++() noexcept; | ||
/** | ||
* @brief Advances the iterator to the next item (post-incrementing). | ||
*/ | ||
iterator operator++(int) noexcept; | ||
|
||
/** @brief Checks if two iterators are at the same item. */ | ||
bool operator==(const iterator& rhs) const noexcept; | ||
/** @brief Checks if two iterators are not at the same item. */ | ||
bool operator!=(const iterator& rhs) const noexcept; | ||
|
||
private: | ||
explicit iterator(Tile* pRootTile) noexcept; | ||
|
||
std::vector<Tile*> _traversalStack; | ||
|
||
friend class LoadedTileEnumerator; | ||
friend class LoadedConstTileEnumerator; | ||
}; | ||
|
||
/** @copydoc LoadedConstTileEnumerator::LoadedConstTileEnumerator */ | ||
explicit LoadedTileEnumerator(Tile* pRootTile) noexcept; | ||
|
||
/** @brief Returns an iterator starting at the first tile. */ | ||
const_iterator begin() const noexcept; | ||
/** @brief Returns an iterator starting after the last tile. */ | ||
const_iterator end() const noexcept; | ||
|
||
/** @brief Returns an iterator starting at the first tile. */ | ||
iterator begin() noexcept; | ||
/** @brief Returns an iterator starting after the last tile. */ | ||
iterator end() noexcept; | ||
|
||
private: | ||
Tile* _pRootTile; | ||
}; | ||
|
||
} // namespace Cesium3DTilesSelection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.