Merge branch 'main' into tms-update
This commit is contained in:
commit
9a44105685
|
|
@ -15,6 +15,7 @@
|
|||
- [3DTILES_implicit_tiling](https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling)
|
||||
- [3DTILES_metadata](https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_metadata)
|
||||
- [3DTILES_content_gltf](https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_content_gltf)
|
||||
- Romoved the API `Tileset::getSupportsRasterOverlays` since the boolean `supportsRasterOverlays` is no longer relevant and is always true as all tilesets now support raster overlays.
|
||||
|
||||
##### Additions :tada:
|
||||
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ public:
|
|||
*/
|
||||
void notifyTileUnloading(Tile* pTile) noexcept;
|
||||
|
||||
float computeLoadProgress() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Loads a tile tree from a tileset.json file.
|
||||
*
|
||||
|
|
@ -263,16 +265,6 @@ public:
|
|||
*/
|
||||
int64_t getTotalDataBytes() const noexcept;
|
||||
|
||||
/**
|
||||
* @brief Determines if this tileset supports raster overlays.
|
||||
*
|
||||
* Currently, raster overlays can only be draped over quantized-mesh terrain
|
||||
* tilesets.
|
||||
*/
|
||||
bool supportsRasterOverlays() const noexcept {
|
||||
return this->_supportsRasterOverlays;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the value indicating the glTF up-axis.
|
||||
*
|
||||
|
|
@ -586,13 +578,12 @@ private:
|
|||
_subtreeLoadsInProgress; // TODO: does this need to be atomic?
|
||||
|
||||
Tile::LoadedLinkedList _loadedTiles;
|
||||
std::atomic<uint32_t> _loadedTilesCount;
|
||||
|
||||
RasterOverlayCollection _overlays;
|
||||
|
||||
int64_t _tileDataBytes;
|
||||
|
||||
bool _supportsRasterOverlays;
|
||||
|
||||
/**
|
||||
* @brief The axis that was declared as the "up-axis" for glTF content.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -852,8 +852,7 @@ void Tile::update(
|
|||
}
|
||||
}
|
||||
|
||||
if (this->getState() == LoadState::Done &&
|
||||
this->getTileset()->supportsRasterOverlays() && this->getContent() &&
|
||||
if (this->getState() == LoadState::Done && this->getContent() &&
|
||||
this->getContent()->model) {
|
||||
bool moreRasterDetailAvailable = false;
|
||||
bool skippedUnknown = false;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ Tileset::Tileset(
|
|||
_subtreeLoadsInProgress(0),
|
||||
_overlays(*this),
|
||||
_tileDataBytes(0),
|
||||
_supportsRasterOverlays(false),
|
||||
_gltfUpAxis(CesiumGeometry::Axis::Y),
|
||||
_distances(),
|
||||
_childOcclusionProxies() {
|
||||
|
|
@ -101,7 +100,6 @@ Tileset::Tileset(
|
|||
_subtreeLoadsInProgress(0),
|
||||
_overlays(*this),
|
||||
_tileDataBytes(0),
|
||||
_supportsRasterOverlays(false),
|
||||
_gltfUpAxis(CesiumGeometry::Axis::Y),
|
||||
_distances(),
|
||||
_childOcclusionProxies() {
|
||||
|
|
@ -242,11 +240,6 @@ Tileset::updateView(const std::vector<ViewState>& frustums) {
|
|||
return result;
|
||||
}
|
||||
|
||||
if (!this->supportsRasterOverlays() && this->_overlays.size() > 0) {
|
||||
this->_externals.pLogger->warn(
|
||||
"Only quantized-mesh terrain tilesets currently support overlays.");
|
||||
}
|
||||
|
||||
this->_loadQueueHigh.clear();
|
||||
this->_loadQueueMedium.clear();
|
||||
this->_loadQueueLow.clear();
|
||||
|
|
@ -357,6 +350,7 @@ void Tileset::notifyTileStartLoading(Tile* pTile) noexcept {
|
|||
void Tileset::notifyTileDoneLoading(Tile* pTile) noexcept {
|
||||
assert(this->_loadsInProgress > 0);
|
||||
--this->_loadsInProgress;
|
||||
++this->_loadedTilesCount;
|
||||
|
||||
if (pTile) {
|
||||
this->_tileDataBytes += pTile->computeByteSize();
|
||||
|
|
@ -369,9 +363,22 @@ void Tileset::notifyTileDoneLoading(Tile* pTile) noexcept {
|
|||
void Tileset::notifyTileUnloading(Tile* pTile) noexcept {
|
||||
if (pTile) {
|
||||
this->_tileDataBytes -= pTile->computeByteSize();
|
||||
--this->_loadedTilesCount;
|
||||
}
|
||||
}
|
||||
|
||||
float Tileset::computeLoadProgress() noexcept {
|
||||
uint32_t queueSizeSum = (uint32_t)(this->_loadQueueLow.size() +
|
||||
this->_loadQueueMedium.size() +
|
||||
this->_loadQueueHigh.size());
|
||||
// we ignore _subtreeLoadsInProgress for now
|
||||
uint32_t inProgressSum = (this->_loadsInProgress + queueSizeSum);
|
||||
uint32_t totalNum = this->_loadedTilesCount + inProgressSum;
|
||||
float percentage = static_cast<float>(this->_loadedTilesCount) /
|
||||
static_cast<float>(totalNum);
|
||||
return (percentage * 100.f);
|
||||
}
|
||||
|
||||
void Tileset::loadTilesFromJson(
|
||||
Tile& rootTile,
|
||||
std::vector<std::unique_ptr<TileContext>>& newContexts,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ namespace {
|
|||
struct LoadResult {
|
||||
std::unique_ptr<TileContext> pContext;
|
||||
std::unique_ptr<Tile> pRootTile;
|
||||
bool supportsRasterOverlays;
|
||||
std::optional<TilesetLoadFailureDetails> failure;
|
||||
};
|
||||
|
||||
|
|
@ -117,8 +116,6 @@ CesiumAsync::Future<void> Tileset::LoadTilesetDotJson::start(
|
|||
.thenInMainThread(
|
||||
[&tileset](LoadResult&& loadResult)
|
||||
-> std::optional<TilesetLoadFailureDetails> {
|
||||
tileset._supportsRasterOverlays =
|
||||
loadResult.supportsRasterOverlays;
|
||||
tileset.addContext(std::move(loadResult.pContext));
|
||||
tileset._pRootTile = std::move(loadResult.pRootTile);
|
||||
return loadResult.failure;
|
||||
|
|
@ -192,7 +189,6 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
return asyncSystem.createResolvedFuture(LoadResult{
|
||||
std::move(pContext),
|
||||
nullptr,
|
||||
false,
|
||||
TilesetLoadFailureDetails{
|
||||
pTileset,
|
||||
TilesetLoadType::TilesetJson,
|
||||
|
|
@ -210,7 +206,6 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
return asyncSystem.createResolvedFuture(LoadResult{
|
||||
std::move(pContext),
|
||||
nullptr,
|
||||
false,
|
||||
TilesetLoadFailureDetails{
|
||||
pTileset,
|
||||
TilesetLoadType::TilesetJson,
|
||||
|
|
@ -234,7 +229,6 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
return asyncSystem.createResolvedFuture(LoadResult{
|
||||
std::move(pContext),
|
||||
nullptr,
|
||||
false,
|
||||
TilesetLoadFailureDetails{
|
||||
pTileset,
|
||||
TilesetLoadType::TilesetJson,
|
||||
|
|
@ -250,8 +244,6 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
const auto rootIt = tileset.FindMember("root");
|
||||
const auto formatIt = tileset.FindMember("format");
|
||||
|
||||
bool supportsRasterOverlays = false;
|
||||
|
||||
if (rootIt != tileset.MemberEnd()) {
|
||||
const rapidjson::Value& rootJson = rootIt->value;
|
||||
std::vector<std::unique_ptr<TileContext>> newContexts;
|
||||
|
|
@ -269,8 +261,6 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
pContext->pTileset->addContext(std::move(pNewContext));
|
||||
}
|
||||
|
||||
supportsRasterOverlays = true;
|
||||
|
||||
} else if (
|
||||
formatIt != tileset.MemberEnd() && formatIt->value.IsString() &&
|
||||
std::string(formatIt->value.GetString()) == "quantized-mesh-1.0") {
|
||||
|
|
@ -286,16 +276,12 @@ Tileset::LoadTilesetDotJson::Private::workerThreadHandleResponse(
|
|||
return LoadResult{
|
||||
std::move(pContext),
|
||||
std::move(pRootTile),
|
||||
true,
|
||||
std::nullopt};
|
||||
});
|
||||
}
|
||||
|
||||
return asyncSystem.createResolvedFuture(LoadResult{
|
||||
std::move(pContext),
|
||||
std::move(pRootTile),
|
||||
supportsRasterOverlays,
|
||||
std::nullopt});
|
||||
return asyncSystem.createResolvedFuture(
|
||||
LoadResult{std::move(pContext), std::move(pRootTile), std::nullopt});
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
@ -460,10 +446,13 @@ Future<void> Tileset::LoadTilesetDotJson::Private::workerThreadLoadTileContext(
|
|||
|
||||
if (attributionIt != layerJson.MemberEnd() &&
|
||||
attributionIt->value.IsString()) {
|
||||
context.implicitContext->credit = std::make_optional<Credit>(
|
||||
context.pTileset->getExternals().pCreditSystem->createCredit(
|
||||
attributionIt->value.GetString(),
|
||||
context.pTileset->_options.showCreditsOnScreen));
|
||||
std::string attribution = attributionIt->value.GetString();
|
||||
if (attribution.size() > 0) {
|
||||
context.implicitContext->credit = std::make_optional<Credit>(
|
||||
context.pTileset->getExternals().pCreditSystem->createCredit(
|
||||
attribution,
|
||||
context.pTileset->_options.showCreditsOnScreen));
|
||||
}
|
||||
}
|
||||
|
||||
std::string parentUrl =
|
||||
|
|
|
|||
|
|
@ -62,7 +62,15 @@ IJsonHandler* JsonObjectJsonHandler::readDouble(double d) {
|
|||
}
|
||||
|
||||
IJsonHandler* JsonObjectJsonHandler::readString(const std::string_view& str) {
|
||||
*this->_stack.back() = std::string(str);
|
||||
CesiumUtility::JsonValue& current = *this->_stack.back();
|
||||
CesiumUtility::JsonValue::Array* pArray =
|
||||
std::get_if<CesiumUtility::JsonValue::Array>(¤t.value);
|
||||
if (pArray) {
|
||||
pArray->emplace_back(std::string(str));
|
||||
} else {
|
||||
current = std::string(str);
|
||||
}
|
||||
|
||||
return this->doneElement();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cesium-native",
|
||||
"version": "0.13.0",
|
||||
"version": "0.17.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue