From a9516a0c842c226cf4e7481cc87476f5fb52e575 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 10 Oct 2024 21:00:16 +1100 Subject: [PATCH] Move SharedAsset[Depot] to CesiumAsync. --- Cesium3DTilesSelection/src/TilesetContentManager.h | 1 - .../include/CesiumAsync}/SharedAsset.h | 8 ++++---- .../include/CesiumAsync}/SharedAssetDepot.h | 9 +++++---- CesiumGltf/include/CesiumGltf/Image.h | 2 +- CesiumGltf/include/CesiumGltf/ImageCesium.h | 5 +++-- CesiumGltf/include/CesiumGltf/SharedAssetSystem.h | 7 ++++--- CesiumGltf/include/CesiumGltf/TextureView.h | 1 - CesiumGltf/src/SharedAssetSystem.cpp | 5 +++-- CesiumGltfReader/src/GltfReader.cpp | 2 +- 9 files changed, 21 insertions(+), 19 deletions(-) rename {CesiumGltf/include/CesiumGltf => CesiumAsync/include/CesiumAsync}/SharedAsset.h (95%) rename {CesiumGltf/include/CesiumGltf => CesiumAsync/include/CesiumAsync}/SharedAssetDepot.h (98%) diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.h b/Cesium3DTilesSelection/src/TilesetContentManager.h index 5a58e77d6..4a4ec286f 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.h +++ b/Cesium3DTilesSelection/src/TilesetContentManager.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff --git a/CesiumGltf/include/CesiumGltf/SharedAsset.h b/CesiumAsync/include/CesiumAsync/SharedAsset.h similarity index 95% rename from CesiumGltf/include/CesiumGltf/SharedAsset.h rename to CesiumAsync/include/CesiumAsync/SharedAsset.h index b53bcb2b3..3a34cfda8 100644 --- a/CesiumGltf/include/CesiumGltf/SharedAsset.h +++ b/CesiumAsync/include/CesiumAsync/SharedAsset.h @@ -1,12 +1,12 @@ #pragma once -#include +#include #include #include #include -namespace CesiumGltf { +namespace CesiumAsync { /** * @brief An asset that is potentially shared between multiple objects, such as @@ -21,7 +21,7 @@ namespace CesiumGltf { * `class MyClass : public SharedAsset { ... };` */ template -class CESIUMGLTF_API SharedAsset : public CesiumUtility::ExtensibleObject { +class CESIUMASYNC_API SharedAsset : public CesiumUtility::ExtensibleObject { public: // Assets can be copied, but the fresh instance has no references and is not // in the asset depot. @@ -120,4 +120,4 @@ class CESIUMGLTF_API SharedAsset : public CesiumUtility::ExtensibleObject { friend class SharedAssetDepot; }; -} // namespace CesiumGltf +} // namespace CesiumAsync diff --git a/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h b/CesiumAsync/include/CesiumAsync/SharedAssetDepot.h similarity index 98% rename from CesiumGltf/include/CesiumGltf/SharedAssetDepot.h rename to CesiumAsync/include/CesiumAsync/SharedAssetDepot.h index 63d1c4956..0c3932122 100644 --- a/CesiumGltf/include/CesiumGltf/SharedAssetDepot.h +++ b/CesiumAsync/include/CesiumAsync/SharedAssetDepot.h @@ -16,7 +16,7 @@ #include #include -namespace CesiumGltf { +namespace CesiumAsync { template class SharedAsset; @@ -26,8 +26,9 @@ template class SharedAsset; * be derived from {@link SharedAsset}. */ template -class SharedAssetDepot : public CesiumUtility::ReferenceCountedThreadSafe< - SharedAssetDepot> { +class CESIUMASYNC_API SharedAssetDepot + : public CesiumUtility::ReferenceCountedThreadSafe< + SharedAssetDepot> { public: /** * @brief The maximum total byte usage of assets that have been loaded but are @@ -273,4 +274,4 @@ class SharedAssetDepot : public CesiumUtility::ReferenceCountedThreadSafe< friend class SharedAsset; }; -} // namespace CesiumGltf +} // namespace CesiumAsync diff --git a/CesiumGltf/include/CesiumGltf/Image.h b/CesiumGltf/include/CesiumGltf/Image.h index 701836eff..b2a45c046 100644 --- a/CesiumGltf/include/CesiumGltf/Image.h +++ b/CesiumGltf/include/CesiumGltf/Image.h @@ -4,7 +4,7 @@ #include "CesiumGltf/ImageSpec.h" #include "CesiumGltf/Library.h" -#include +#include namespace CesiumGltf { /** @copydoc ImageSpec */ diff --git a/CesiumGltf/include/CesiumGltf/ImageCesium.h b/CesiumGltf/include/CesiumGltf/ImageCesium.h index 55d146dea..6feedf656 100644 --- a/CesiumGltf/include/CesiumGltf/ImageCesium.h +++ b/CesiumGltf/include/CesiumGltf/ImageCesium.h @@ -1,8 +1,8 @@ #pragma once +#include "CesiumAsync/SharedAsset.h" #include "CesiumGltf/Ktx2TranscodeTargets.h" #include "CesiumGltf/Library.h" -#include "CesiumGltf/SharedAsset.h" #include #include @@ -30,7 +30,8 @@ struct CESIUMGLTF_API ImageCesiumMipPosition { * @brief Holds {@link Image} properties that are specific to the glTF loader * rather than part of the glTF spec. */ -struct CESIUMGLTF_API ImageCesium final : public SharedAsset { +struct CESIUMGLTF_API ImageCesium final + : public CesiumAsync::SharedAsset { /** * @brief The width of the image in pixels. */ diff --git a/CesiumGltf/include/CesiumGltf/SharedAssetSystem.h b/CesiumGltf/include/CesiumGltf/SharedAssetSystem.h index 5e38dde0f..b8abb23ec 100644 --- a/CesiumGltf/include/CesiumGltf/SharedAssetSystem.h +++ b/CesiumGltf/include/CesiumGltf/SharedAssetSystem.h @@ -1,7 +1,7 @@ #pragma once +#include #include -#include namespace CesiumGltf { @@ -36,10 +36,11 @@ class SharedAssetSystem ->getOrFetch(asyncSystem, pAssetAccessor, factory, uri, headers); } - const SharedAssetDepot& image(); + const CesiumAsync::SharedAssetDepot& image(); private: - CesiumUtility::IntrusivePointer> + CesiumUtility::IntrusivePointer< + CesiumAsync::SharedAssetDepot> _pImages; }; diff --git a/CesiumGltf/include/CesiumGltf/TextureView.h b/CesiumGltf/include/CesiumGltf/TextureView.h index 35faa8938..22f677cef 100644 --- a/CesiumGltf/include/CesiumGltf/TextureView.h +++ b/CesiumGltf/include/CesiumGltf/TextureView.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include diff --git a/CesiumGltf/src/SharedAssetSystem.cpp b/CesiumGltf/src/SharedAssetSystem.cpp index a07c324b9..aac4114ac 100644 --- a/CesiumGltf/src/SharedAssetSystem.cpp +++ b/CesiumGltf/src/SharedAssetSystem.cpp @@ -4,11 +4,12 @@ namespace CesiumGltf { SharedAssetSystem::SharedAssetSystem() noexcept - : _pImages(new SharedAssetDepot()) {} + : _pImages(new CesiumAsync::SharedAssetDepot()) {} SharedAssetSystem::~SharedAssetSystem() noexcept = default; -const SharedAssetDepot& SharedAssetSystem::image() { +const CesiumAsync::SharedAssetDepot& +SharedAssetSystem::image() { return *this->_pImages; } diff --git a/CesiumGltfReader/src/GltfReader.cpp b/CesiumGltfReader/src/GltfReader.cpp index 0d52739b8..5914cc980 100644 --- a/CesiumGltfReader/src/GltfReader.cpp +++ b/CesiumGltfReader/src/GltfReader.cpp @@ -11,11 +11,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include