-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
333 additions
and
203 deletions.
There are no files selected for viewing
This file contains 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 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 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
84 changes: 84 additions & 0 deletions
84
Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetViewGroup.h
This file contains 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,84 @@ | ||
#pragma once | ||
|
||
#include <Cesium3DTilesSelection/TileSelectionState.h> | ||
#include <CesiumUtility/IntrusivePointer.h> | ||
|
||
#include <unordered_map> | ||
|
||
namespace Cesium3DTilesSelection { | ||
|
||
class Tile; | ||
class Tileset; | ||
class TilesetContentManager; | ||
|
||
/** | ||
* @brief A group of views that select tiles from a particular {@link Tileset} | ||
* together. | ||
* | ||
* Create an instance of this class by calling {@link Tileset::createViewGroup}. | ||
*/ | ||
class CESIUM3DTILESSELECTION_API TilesetViewGroup final { | ||
public: | ||
TilesetViewGroup(const TilesetViewGroup& rhs) noexcept; | ||
TilesetViewGroup(TilesetViewGroup&& rhs) noexcept; | ||
~TilesetViewGroup() noexcept; | ||
|
||
/** | ||
* @brief Returns the previous {@link TileSelectionState} of this tile last | ||
* time this view group was updated. | ||
* | ||
* This function is not supposed to be called by clients. | ||
* | ||
* @return The previous selection state | ||
*/ | ||
TileSelectionState getPreviousSelectionState(const Tile& tile) const noexcept; | ||
|
||
/** | ||
* @brief Returns the current {@link TileSelectionState} of this tile during | ||
* the current update of this view group. | ||
* | ||
* This function is not supposed to be called by clients. | ||
* | ||
* @return The current selection state | ||
*/ | ||
TileSelectionState getCurrentSelectionState(const Tile& tile) const noexcept; | ||
|
||
/** | ||
* @brief Set the {@link TileSelectionState} of this tile. | ||
* | ||
* This function is not supposed to be called by clients. | ||
* | ||
* @param newState The new state | ||
*/ | ||
void setCurrentSelectionState( | ||
const Tile& tile, | ||
const TileSelectionState& newState) noexcept; | ||
|
||
void kick(const Tile& tile) noexcept; | ||
|
||
/** | ||
* @brief Finishes the current frame by making the current tile selection | ||
* state the previous one and releasing references to tiles in the old previous | ||
* one. | ||
*/ | ||
void finishFrame(); | ||
|
||
private: | ||
/** | ||
* @brief Constructs a new instance. | ||
* | ||
* @param tileset The tileset that this view group views. | ||
*/ | ||
TilesetViewGroup(const CesiumUtility::IntrusivePointer<TilesetContentManager>& | ||
pTilesetContentManager); | ||
|
||
CesiumUtility::IntrusivePointer<TilesetContentManager> | ||
_pTilesetContentManager; | ||
std::unordered_map<const Tile*, TileSelectionState> _previousSelectionStates; | ||
std::unordered_map<const Tile*, TileSelectionState> _currentSelectionStates; | ||
|
||
// So that the Tileset can create instances of this class. | ||
friend class Tileset; | ||
}; | ||
|
||
} // namespace Cesium3DTilesSelection |
58 changes: 0 additions & 58 deletions
58
Cesium3DTilesSelection/include/Cesium3DTilesSelection/ViewGroup.h
This file was deleted.
Oops, something went wrong.
This file contains 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.