diff --git a/CHANGES.md b/CHANGES.md index 90cbc6a8f3..cfebdda7a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,10 +2,15 @@ ### ? - ? +##### Breaking Changes :mega: + +- `CesiumRasterOverlays::GeoJsonDocumentRasterOverlay` has been moved to the `CesiumVectorOverlays` library and namespace. + ##### Additions :tada: - Added support for [`EXT_mesh_primitive_edge_visibility`](https://github.com/KhronosGroup/glTF/pull/2479) in `CesiumGltf`, `CesiumGltfReader`, and `CesiumGltfWriter`. - Added support for [`3DTILES_content_conditional`](https://github.com/CesiumGS/3d-tiles/pull/834) in `Cesium3DTiles`, `Cesium3DTilesReader`, and `Cesium3DTilesWriter`. +- Added `CesiumVectorOverlays::VectorTilesRasterOverlay` supporting vector data loaded from 3D Tiles tilesets. ### v0.60.0 - 2026-05-01 diff --git a/CMakeLists.txt b/CMakeLists.txt index f16184f392..16e90cd1ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -437,6 +437,7 @@ add_subdirectory(CesiumIonClient) add_subdirectory(CesiumITwinClient) add_subdirectory(CesiumQuantizedMeshTerrain) add_subdirectory(CesiumVectorData) +add_subdirectory(CesiumVectorOverlays) if(NOT CESIUM_DISABLE_CURL) add_subdirectory(CesiumCurl) diff --git a/Cesium3DTilesSelection/CMakeLists.txt b/Cesium3DTilesSelection/CMakeLists.txt index f710dff595..26ca91fcac 100644 --- a/Cesium3DTilesSelection/CMakeLists.txt +++ b/Cesium3DTilesSelection/CMakeLists.txt @@ -52,7 +52,6 @@ target_link_libraries(Cesium3DTilesSelection CesiumQuantizedMeshTerrain CesiumRasterOverlays CesiumUtility - CesiumVectorData spdlog::spdlog # PRIVATE libmorton::libmorton diff --git a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayCollection.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayCollection.h index 34d2cef8ba..f7678a05a7 100644 --- a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayCollection.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayCollection.h @@ -229,6 +229,8 @@ class CESIUM3DTILESSELECTION_API RasterOverlayCollection final { */ size_t size() const noexcept; + void tick() noexcept; + private: struct GetOverlayFunctor { CesiumUtility::IntrusivePointer @@ -244,6 +246,9 @@ class CESIUM3DTILESSELECTION_API RasterOverlayCollection final { std::vector> _activatedOverlays; + std::vector> + _tickableOverlays; CESIUM_TRACE_DECLARE_TRACK_SET(_loadingSlots, "Raster Overlay Loading Slot") }; diff --git a/Cesium3DTilesSelection/src/RasterOverlayUpsampler.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayUpsampler.h similarity index 100% rename from Cesium3DTilesSelection/src/RasterOverlayUpsampler.h rename to Cesium3DTilesSelection/include/Cesium3DTilesSelection/RasterOverlayUpsampler.h diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetContentManager.h similarity index 99% rename from Cesium3DTilesSelection/src/TilesetContentManager.h rename to Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetContentManager.h index 9d14ae76f2..ea55913d05 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TilesetContentManager.h @@ -1,9 +1,8 @@ #pragma once -#include "RasterOverlayUpsampler.h" - #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/GltfModifier.cpp b/Cesium3DTilesSelection/src/GltfModifier.cpp index df640725e9..235bf7099d 100644 --- a/Cesium3DTilesSelection/src/GltfModifier.cpp +++ b/Cesium3DTilesSelection/src/GltfModifier.cpp @@ -1,5 +1,3 @@ -#include "TilesetContentManager.h" - #include #include #include @@ -7,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/RasterOverlayCollection.cpp b/Cesium3DTilesSelection/src/RasterOverlayCollection.cpp index 12626d6c5b..c7e8f22b7e 100644 --- a/Cesium3DTilesSelection/src/RasterOverlayCollection.cpp +++ b/Cesium3DTilesSelection/src/RasterOverlayCollection.cpp @@ -31,7 +31,8 @@ RasterOverlayCollection::RasterOverlayCollection( : _loadedTiles(loadedTiles), _externals{externals}, _ellipsoid(ellipsoid), - _activatedOverlays() {} + _activatedOverlays(), + _tickableOverlays() {} RasterOverlayCollection::~RasterOverlayCollection() noexcept { for (int64_t i = static_cast(this->_activatedOverlays.size()) - 1; @@ -64,6 +65,10 @@ void RasterOverlayCollection::add( .pLogger = this->_externals.pLogger}, this->_ellipsoid)); + if (this->_activatedOverlays.back()->isTickable()) { + this->_tickableOverlays.emplace_back(this->_activatedOverlays.back()); + } + CesiumRasterOverlays::RasterOverlayTile* pPlaceholderTile = this->_activatedOverlays.back()->getPlaceholderTile(); @@ -151,6 +156,16 @@ void RasterOverlayCollection::remove( } this->_activatedOverlays.erase(it); + + it = std::find( + this->_tickableOverlays.begin(), + this->_tickableOverlays.end(), + pActivated); + if (it == this->_tickableOverlays.end()) { + return; + } + + this->_tickableOverlays.erase(it); } std::vector @@ -259,4 +274,10 @@ size_t RasterOverlayCollection::size() const noexcept { return this->_activatedOverlays.size(); } +void RasterOverlayCollection::tick() noexcept { + for (const auto& pOverlay : this->_tickableOverlays) { + pOverlay->tick(); + } +} + } // namespace Cesium3DTilesSelection diff --git a/Cesium3DTilesSelection/src/RasterOverlayUpsampler.cpp b/Cesium3DTilesSelection/src/RasterOverlayUpsampler.cpp index dcffc7c670..4b9bd783a3 100644 --- a/Cesium3DTilesSelection/src/RasterOverlayUpsampler.cpp +++ b/Cesium3DTilesSelection/src/RasterOverlayUpsampler.cpp @@ -1,6 +1,5 @@ -#include "RasterOverlayUpsampler.h" - #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/Tile.cpp b/Cesium3DTilesSelection/src/Tile.cpp index 36a05b34b3..b5214c0e5e 100644 --- a/Cesium3DTilesSelection/src/Tile.cpp +++ b/Cesium3DTilesSelection/src/Tile.cpp @@ -1,5 +1,3 @@ -#include "TilesetContentManager.h" - #include #include #include @@ -8,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/TileLoadRequester.cpp b/Cesium3DTilesSelection/src/TileLoadRequester.cpp index b1535f4b6d..c67d27e371 100644 --- a/Cesium3DTilesSelection/src/TileLoadRequester.cpp +++ b/Cesium3DTilesSelection/src/TileLoadRequester.cpp @@ -1,6 +1,5 @@ -#include "TilesetContentManager.h" - #include +#include #include #include diff --git a/Cesium3DTilesSelection/src/Tileset.cpp b/Cesium3DTilesSelection/src/Tileset.cpp index 4afc47a0f4..f0049dc328 100644 --- a/Cesium3DTilesSelection/src/Tileset.cpp +++ b/Cesium3DTilesSelection/src/Tileset.cpp @@ -1,4 +1,3 @@ -#include "TilesetContentManager.h" #include "TilesetHeightQuery.h" #include @@ -15,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -472,6 +473,11 @@ void Tileset::loadTiles() { this->_pTilesetContentManager->processWorkerThreadLoadRequests( this->_options); this->_pTilesetContentManager->processMainThreadLoadRequests(this->_options); + for (const IntrusivePointer& pOverlay : + this->_pTilesetContentManager->getRasterOverlayCollection() + .getActivatedOverlays()) { + pOverlay->tick(); + } } void Tileset::registerLoadRequester(TileLoadRequester& requester) { diff --git a/Cesium3DTilesSelection/src/TilesetContentLoader.cpp b/Cesium3DTilesSelection/src/TilesetContentLoader.cpp index 09782d740a..ec64c02b9c 100644 --- a/Cesium3DTilesSelection/src/TilesetContentLoader.cpp +++ b/Cesium3DTilesSelection/src/TilesetContentLoader.cpp @@ -1,8 +1,7 @@ -#include "TilesetContentManager.h" - #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.cpp b/Cesium3DTilesSelection/src/TilesetContentManager.cpp index 41835d3b09..f3a8e70036 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.cpp +++ b/Cesium3DTilesSelection/src/TilesetContentManager.cpp @@ -1,7 +1,4 @@ -#include "TilesetContentManager.h" - #include "LayerJsonTerrainLoader.h" -#include "RasterOverlayUpsampler.h" #include "TileContentLoadInfo.h" #include "TilesetJsonLoader.h" @@ -12,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/src/TilesetHeightQuery.cpp b/Cesium3DTilesSelection/src/TilesetHeightQuery.cpp index b30601d056..033c43077d 100644 --- a/Cesium3DTilesSelection/src/TilesetHeightQuery.cpp +++ b/Cesium3DTilesSelection/src/TilesetHeightQuery.cpp @@ -1,13 +1,12 @@ #include "TilesetHeightQuery.h" -#include "TilesetContentManager.h" - #include #include #include #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/test/TestGltfModifier.cpp b/Cesium3DTilesSelection/test/TestGltfModifier.cpp index f2e729345c..90144bf482 100644 --- a/Cesium3DTilesSelection/test/TestGltfModifier.cpp +++ b/Cesium3DTilesSelection/test/TestGltfModifier.cpp @@ -1,5 +1,4 @@ #include "MockTilesetContentManager.h" -#include "TilesetContentManager.h" #include #include @@ -7,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/Cesium3DTilesSelection/test/TestTilesetContentManager.cpp b/Cesium3DTilesSelection/test/TestTilesetContentManager.cpp index d8fffa7b29..b03043c3ce 100644 --- a/Cesium3DTilesSelection/test/TestTilesetContentManager.cpp +++ b/Cesium3DTilesSelection/test/TestTilesetContentManager.cpp @@ -1,6 +1,5 @@ #include "SimplePrepareRendererResource.h" #include "TestTilesetJsonLoader.h" -#include "TilesetContentManager.h" #include "TilesetJsonLoader.h" #include @@ -11,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/CesiumGeospatial/include/CesiumGeospatial/CartographicPolygon.h b/CesiumGeospatial/include/CesiumGeospatial/CartographicPolygon.h index 9417162f9d..39785b1a9d 100644 --- a/CesiumGeospatial/include/CesiumGeospatial/CartographicPolygon.h +++ b/CesiumGeospatial/include/CesiumGeospatial/CartographicPolygon.h @@ -32,6 +32,19 @@ class CESIUMGEOSPATIAL_API CartographicPolygon final { */ CartographicPolygon(const std::vector& polygon); + /** + * @brief Constructs a 2D polygon that can be rasterized onto {@link Cesium3DTilesSelection::Tileset} + * objects. + * + * @param vertices An array of longitude-latitude points in radians defining + * the perimeter of the 2D polygon. + * @param indices An array of indices representing a triangle decomposition of + * the polygon. The indices are in reference to the `vertices` array. + */ + CartographicPolygon( + std::vector&& vertices, + std::vector&& indices); + /** * @brief Returns the longitude-latitude vertices that define the * perimeter of the selected polygon. diff --git a/CesiumGeospatial/src/CartographicPolygon.cpp b/CesiumGeospatial/src/CartographicPolygon.cpp index 0e963d0b12..6c49d1da27 100644 --- a/CesiumGeospatial/src/CartographicPolygon.cpp +++ b/CesiumGeospatial/src/CartographicPolygon.cpp @@ -122,6 +122,13 @@ CartographicPolygon::CartographicPolygon(const std::vector& polygon) _indices(triangulatePolygon(polygon)), _boundingRectangle(computeBoundingRectangle(polygon)) {} +CartographicPolygon::CartographicPolygon( + std::vector&& polygon, + std::vector&& indices) + : _vertices(std::move(polygon)), + _indices(std::move(indices)), + _boundingRectangle(computeBoundingRectangle(this->_vertices)) {} + /*static*/ bool CartographicPolygon::rectangleIsWithinPolygons( const CesiumGeospatial::GlobeRectangle& rectangle, const std::vector& cartographicPolygons) noexcept { diff --git a/CesiumGltf/generated/include/CesiumGltf/ExtensionExtMeshPolygon.h b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtMeshPolygon.h new file mode 100644 index 0000000000..40abe2d26f --- /dev/null +++ b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtMeshPolygon.h @@ -0,0 +1,65 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include +#include + +#include + +namespace CesiumGltf { +/** + * @brief glTF extension adding an encoding of polygon primitive topology + */ +struct CESIUMGLTF_API ExtensionExtMeshPolygon final + : public CesiumUtility::ExtensibleObject { + /** + * @brief The original name of this type. + */ + static constexpr const char* TypeName = "ExtensionExtMeshPolygon"; + /** @brief The official name of the extension. This should be the same as its + * key in the `extensions` object. */ + static constexpr const char* ExtensionName = "EXT_mesh_polygon"; + + /** + * @brief Integer number of polygons encoded in the mesh primitive. + */ + int32_t count = -1; + + /** + * @brief Index of an accessor containing indices of the polygons' exterior + * and interior loops. The accessor MUST have SCALAR type and an unsigned + * integer component type. + */ + int32_t loopIndices = -1; + + /** + * @brief Index of an accessor containing one integer offset per polygon in + * the primitive, indicating the first index of the first linear ring + * associated with that polygon. + */ + int32_t loopIndicesOffsets = -1; + + /** + * @brief Index of an accessor containing one integer offset per polygon in + * the primitive, indicating the first index of the first triangle associated + * with that polygon. + */ + int32_t indicesOffsets = -1; + + /** + * @brief Calculates the size in bytes of this object, including the contents + * of all collections, pointers, and strings. This will NOT include the size + * of any extensions attached to the object. Calling this method may be slow + * as it requires traversing the object's entire structure. + */ + int64_t getSizeBytes() const { + int64_t accum = 0; + accum += int64_t(sizeof(ExtensionExtMeshPolygon)); + accum += CesiumUtility::ExtensibleObject::getSizeBytes() - + int64_t(sizeof(CesiumUtility::ExtensibleObject)); + + return accum; + } +}; +} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrGaussianSplatting.h b/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrGaussianSplatting.h index 40f83fddf1..01d5a3c83a 100644 --- a/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrGaussianSplatting.h +++ b/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrGaussianSplatting.h @@ -22,8 +22,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final static constexpr const char* ExtensionName = "KHR_gaussian_splatting"; /** - * @brief Known values for Property specifying parameters regarding the kernel - * used to generate the Gaussians. + * @brief Known values for The kernel used to generate the Gaussians. */ struct Kernel { /** @brief `ellipse` */ @@ -31,8 +30,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final }; /** - * @brief Known values for Property specifying the color space of the - * spherical harmonics. + * @brief Known values for The color space of the reconstructed color values. */ struct ColorSpace { /** @brief `srgb_rec709_display` */ @@ -43,9 +41,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final }; /** - * @brief Known values for Optional property specifying how to project the - * Gaussians to achieve a perspective correct value. This property defaults to - * perspective. + * @brief Known values for The projection method for rendering the Gaussians. */ struct Projection { /** @brief `perspective` */ @@ -53,8 +49,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final }; /** - * @brief Known values for Optional property specifying how to sort the - * Gaussians during rendering. This property defaults to cameraDistance. + * @brief Known values for The sorting method for rendering the Gaussians. */ struct SortingMethod { /** @brief `cameraDistance` */ @@ -62,8 +57,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final }; /** - * @brief Property specifying parameters regarding the kernel used to generate - * the Gaussians. + * @brief The kernel used to generate the Gaussians. * * Known values are defined in {@link Kernel}. * @@ -71,7 +65,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final std::string kernel = Kernel::ellipse; /** - * @brief Property specifying the color space of the spherical harmonics. + * @brief The color space of the reconstructed color values. * * Known values are defined in {@link ColorSpace}. * @@ -79,8 +73,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final std::string colorSpace = ColorSpace::srgb_rec709_display; /** - * @brief Optional property specifying how to project the Gaussians to achieve - * a perspective correct value. This property defaults to perspective. + * @brief The projection method for rendering the Gaussians. * * Known values are defined in {@link Projection}. * @@ -88,8 +81,7 @@ struct CESIUMGLTF_API ExtensionKhrGaussianSplatting final std::string projection = Projection::perspective; /** - * @brief Optional property specifying how to sort the Gaussians during - * rendering. This property defaults to cameraDistance. + * @brief The sorting method for rendering the Gaussians. * * Known values are defined in {@link SortingMethod}. * diff --git a/CesiumGltf/include/CesiumGltf/AccessorUtility.h b/CesiumGltf/include/CesiumGltf/AccessorUtility.h index 3cc23a96cc..a18589035c 100644 --- a/CesiumGltf/include/CesiumGltf/AccessorUtility.h +++ b/CesiumGltf/include/CesiumGltf/AccessorUtility.h @@ -154,6 +154,49 @@ typedef std::variant< IndexAccessorType getIndexAccessorView(const Model& model, const MeshPrimitive& primitive); +/** + * Retrieves an indices accessor view of the accessor at the given index. + */ +IndexAccessorType getIndexAccessorView(const Model& model, int32_t index); + +/** + * Visitor that returns the number of indices contained in an IndexAccessorType + * variant. + */ +struct NumIndicesFromAccessor { + /** + * @brief Attempts to obtain a number of indices from an empty + * IndexAccessorType, resulting in 0. + */ + int64_t operator()(std::monostate) { return 0; } + + /** + * @brief Attempts to obtain a number of indices from an \ref AccessorView. + */ + template int64_t operator()(const AccessorView& value) { + return value.size(); + } +}; + +/** + * @brief Returns the maximum possible index value for the given + * IndexAccessorType. + */ +struct MaxIndexValueFromAccessor { + /** + * @brief Attempts to obtain a maximum index value from an empty + * IndexAccessorType, resulting in -1. + */ + int64_t operator()(std::monostate) { return -1; } + + /** + * @brief Attempts to obtain a maximum index value from an \ref AccessorView. + */ + template int64_t operator()(const AccessorView& /*value*/) { + return static_cast(std::numeric_limits::max()); + } +}; + /** * Visitor that retrieves the vertex indices from the given accessor type * corresponding to a given face index. These indices are returned as an array diff --git a/CesiumGltf/src/AccessorUtility.cpp b/CesiumGltf/src/AccessorUtility.cpp index db5443b87b..8cb84c29fb 100644 --- a/CesiumGltf/src/AccessorUtility.cpp +++ b/CesiumGltf/src/AccessorUtility.cpp @@ -117,12 +117,15 @@ FeatureIdAccessorType getFeatureIdAccessorView( IndexAccessorType getIndexAccessorView(const Model& model, const MeshPrimitive& primitive) { - if (primitive.indices < 0) { + return getIndexAccessorView(model, primitive.indices); +} + +IndexAccessorType getIndexAccessorView(const Model& model, int32_t index) { + if (index < 0) { return IndexAccessorType(); } - const Accessor* pAccessor = - model.getSafe(&model.accessors, primitive.indices); + const Accessor* pAccessor = model.getSafe(&model.accessors, index); if (!pAccessor || pAccessor->type != Accessor::Type::SCALAR || pAccessor->normalized) { return AccessorView(); diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtMeshPolygonReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtMeshPolygonReader.h new file mode 100644 index 0000000000..489d60350a --- /dev/null +++ b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtMeshPolygonReader.h @@ -0,0 +1,76 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include +#include +#include +#include + +#include + +#include +#include + +namespace CesiumGltf { +struct ExtensionExtMeshPolygon; +} // namespace CesiumGltf + +namespace CesiumGltfReader { + +/** + * @brief Reads \ref CesiumGltf::ExtensionExtMeshPolygon + * "ExtensionExtMeshPolygon" instances from JSON. + */ +class CESIUMGLTFREADER_API ExtensionExtMeshPolygonReader { +public: + /** + * @brief Constructs a new instance. + */ + ExtensionExtMeshPolygonReader(); + + /** + * @brief Gets the options controlling how the JSON is read. + */ + CesiumJsonReader::JsonReaderOptions& getOptions(); + + /** + * @brief Gets the options controlling how the JSON is read. + */ + const CesiumJsonReader::JsonReaderOptions& getOptions() const; + + /** + * @brief Reads an instance of ExtensionExtMeshPolygon from a byte buffer. + * + * @param data The buffer from which to read the instance. + * @return The result of reading the instance. + */ + CesiumJsonReader::ReadJsonResult + readFromJson(const std::span& data) const; + + /** + * @brief Reads an instance of ExtensionExtMeshPolygon from a + * rapidJson::Value. + * + * @param value The value from which to read the instance. + * @return The result of reading the instance. + */ + CesiumJsonReader::ReadJsonResult + readFromJson(const rapidjson::Value& value) const; + + /** + * @brief Reads an array of instances of ExtensionExtMeshPolygon from a + * rapidJson::Value. + * + * @param value The value from which to read the array of instances. + * @return The result of reading the array of instances. + */ + CesiumJsonReader::ReadJsonResult< + std::vector> + readArrayFromJson(const rapidjson::Value& value) const; + +private: + CesiumJsonReader::JsonReaderOptions _options; +}; + +} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/ExtensionExtMeshPolygonJsonHandler.h b/CesiumGltfReader/generated/src/ExtensionExtMeshPolygonJsonHandler.h new file mode 100644 index 0000000000..2c54d88757 --- /dev/null +++ b/CesiumGltfReader/generated/src/ExtensionExtMeshPolygonJsonHandler.h @@ -0,0 +1,50 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include +#include +#include + +namespace CesiumJsonReader { +class JsonReaderOptions; +} // namespace CesiumJsonReader + +namespace CesiumGltfReader { +class ExtensionExtMeshPolygonJsonHandler + : public CesiumJsonReader::ExtensibleObjectJsonHandler, + public CesiumJsonReader::IExtensionJsonHandler { +public: + using ValueType = CesiumGltf::ExtensionExtMeshPolygon; + + static constexpr const char* ExtensionName = "EXT_mesh_polygon"; + + explicit ExtensionExtMeshPolygonJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept; + void reset( + IJsonHandler* pParentHandler, + CesiumGltf::ExtensionExtMeshPolygon* pObject); + + IJsonHandler* readObjectKey(const std::string_view& str) override; + + void reset( + IJsonHandler* pParentHandler, + CesiumUtility::ExtensibleObject& o, + const std::string_view& extensionName) override; + + IJsonHandler& getHandler() override { return *this; } + +protected: + IJsonHandler* readObjectKeyExtensionExtMeshPolygon( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionExtMeshPolygon& o); + +private: + CesiumGltf::ExtensionExtMeshPolygon* _pObject = nullptr; + CesiumJsonReader::IntegerJsonHandler _count; + CesiumJsonReader::IntegerJsonHandler _loopIndices; + CesiumJsonReader::IntegerJsonHandler _loopIndicesOffsets; + CesiumJsonReader::IntegerJsonHandler _indicesOffsets; +}; +} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp index 77f4458cb3..12e3fe0462 100644 --- a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp +++ b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp @@ -3367,6 +3367,135 @@ ExtensionExtMeshPrimitiveEdgeVisibilityReader::readArrayFromJson( return CesiumJsonReader::JsonReader::readJson(value, handler); } +} // namespace CesiumGltfReader +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +// NOLINTBEGIN(readability-duplicate-include) +#include "ExtensionExtMeshPolygonJsonHandler.h" +#include "registerReaderExtensions.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +// NOLINTEND(readability-duplicate-include) + +namespace CesiumGltfReader { + +ExtensionExtMeshPolygonJsonHandler::ExtensionExtMeshPolygonJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept + : CesiumJsonReader::ExtensibleObjectJsonHandler(options), + _count(), + _loopIndices(), + _loopIndicesOffsets(), + _indicesOffsets() {} + +void ExtensionExtMeshPolygonJsonHandler::reset( + CesiumJsonReader::IJsonHandler* pParentHandler, + CesiumGltf::ExtensionExtMeshPolygon* pObject) { + CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); + this->_pObject = pObject; +} + +CesiumJsonReader::IJsonHandler* +ExtensionExtMeshPolygonJsonHandler::readObjectKey(const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyExtensionExtMeshPolygon( + CesiumGltf::ExtensionExtMeshPolygon::TypeName, + str, + *this->_pObject); +} + +void ExtensionExtMeshPolygonJsonHandler::reset( + CesiumJsonReader::IJsonHandler* pParentHandler, + CesiumUtility::ExtensibleObject& o, + const std::string_view& extensionName) { + std::any& value = + o.extensions.emplace(extensionName, CesiumGltf::ExtensionExtMeshPolygon()) + .first->second; + this->reset( + pParentHandler, + &std::any_cast(value)); +} + +CesiumJsonReader::IJsonHandler* +ExtensionExtMeshPolygonJsonHandler::readObjectKeyExtensionExtMeshPolygon( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionExtMeshPolygon& o) { + using namespace std::string_literals; + + if ("count"s == str) { + return property("count", this->_count, o.count); + } + if ("loopIndices"s == str) { + return property("loopIndices", this->_loopIndices, o.loopIndices); + } + if ("loopIndicesOffsets"s == str) { + return property( + "loopIndicesOffsets", + this->_loopIndicesOffsets, + o.loopIndicesOffsets); + } + if ("indicesOffsets"s == str) { + return property("indicesOffsets", this->_indicesOffsets, o.indicesOffsets); + } + + return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); +} + +ExtensionExtMeshPolygonReader::ExtensionExtMeshPolygonReader() { + registerReaderExtensions(this->_options); +} + +CesiumJsonReader::JsonReaderOptions& +ExtensionExtMeshPolygonReader::getOptions() { + return this->_options; +} + +const CesiumJsonReader::JsonReaderOptions& +ExtensionExtMeshPolygonReader::getOptions() const { + return this->_options; +} + +CesiumJsonReader::ReadJsonResult +ExtensionExtMeshPolygonReader::readFromJson( + const std::span& data) const { + ExtensionExtMeshPolygonJsonHandler handler(this->_options); + return CesiumJsonReader::JsonReader::readJson(data, handler); +} + +CesiumJsonReader::ReadJsonResult +ExtensionExtMeshPolygonReader::readFromJson( + const rapidjson::Value& value) const { + ExtensionExtMeshPolygonJsonHandler handler(this->_options); + return CesiumJsonReader::JsonReader::readJson(value, handler); +} + +CesiumJsonReader::ReadJsonResult< + std::vector> +ExtensionExtMeshPolygonReader::readArrayFromJson( + const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler< + CesiumGltf::ExtensionExtMeshPolygon, + ExtensionExtMeshPolygonJsonHandler> + handler(this->_options); + return CesiumJsonReader::JsonReader::readJson(value, handler); +} + } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! diff --git a/CesiumGltfReader/generated/src/registerReaderExtensions.cpp b/CesiumGltfReader/generated/src/registerReaderExtensions.cpp index d6e4becf56..b5089a4829 100644 --- a/CesiumGltfReader/generated/src/registerReaderExtensions.cpp +++ b/CesiumGltfReader/generated/src/registerReaderExtensions.cpp @@ -13,6 +13,7 @@ #include "ExtensionExtInstanceFeaturesJsonHandler.h" #include "ExtensionExtMeshFeaturesJsonHandler.h" #include "ExtensionExtMeshGpuInstancingJsonHandler.h" +#include "ExtensionExtMeshPolygonJsonHandler.h" #include "ExtensionExtMeshPrimitiveEdgeVisibilityJsonHandler.h" #include "ExtensionExtPrimitiveVoxelsJsonHandler.h" #include "ExtensionExtStructuralMetadataJsonHandler.h" @@ -91,6 +92,9 @@ void registerReaderExtensions(CesiumJsonReader::JsonReaderOptions& options) { options.registerExtension< CesiumGltf::MeshPrimitive, ExtensionExtMeshPrimitiveEdgeVisibilityJsonHandler>(); + options.registerExtension< + CesiumGltf::MeshPrimitive, + ExtensionExtMeshPolygonJsonHandler>(); options.registerExtension< CesiumGltf::Node, ExtensionExtInstanceFeaturesJsonHandler>(); diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp index 240404a464..04426b4ccd 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -237,6 +238,11 @@ void writeJson( CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); +void writeJson( + const CesiumGltf::ExtensionExtMeshPolygon& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context); + void writeJson( const CesiumGltf::LineString& obj, CesiumJsonWriter::JsonWriter& jsonWriter, @@ -1268,6 +1274,37 @@ void writeJson( jsonWriter.EndObject(); } +void writeJson( + const CesiumGltf::ExtensionExtMeshPolygon& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context) { + jsonWriter.StartObject(); + + if (obj.count > -1) { + jsonWriter.Key("count"); + writeJson(obj.count, jsonWriter, context); + } + + if (obj.loopIndices > -1) { + jsonWriter.Key("loopIndices"); + writeJson(obj.loopIndices, jsonWriter, context); + } + + if (obj.loopIndicesOffsets > -1) { + jsonWriter.Key("loopIndicesOffsets"); + writeJson(obj.loopIndicesOffsets, jsonWriter, context); + } + + if (obj.indicesOffsets > -1) { + jsonWriter.Key("indicesOffsets"); + writeJson(obj.indicesOffsets, jsonWriter, context); + } + + writeExtensibleObject(obj, jsonWriter, context); + + jsonWriter.EndObject(); +} + void writeJson( const CesiumGltf::LineString& obj, CesiumJsonWriter::JsonWriter& jsonWriter, @@ -3028,6 +3065,13 @@ void ExtensionExtMeshPrimitiveEdgeVisibilityJsonWriter::write( writeJson(obj, jsonWriter, context); } +void ExtensionExtMeshPolygonJsonWriter::write( + const CesiumGltf::ExtensionExtMeshPolygon& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context) { + writeJson(obj, jsonWriter, context); +} + void LineStringJsonWriter::write( const CesiumGltf::LineString& obj, CesiumJsonWriter::JsonWriter& jsonWriter, diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.h b/CesiumGltfWriter/generated/src/ModelJsonWriter.h index 0c56af0650..1d07980f02 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.h +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.h @@ -37,6 +37,7 @@ struct ExtensionExtPrimitiveVoxels; struct ExtensionKhrGaussianSplatting; struct ExtensionKhrGaussianSplattingCompressionSpz2; struct ExtensionExtMeshPrimitiveEdgeVisibility; +struct ExtensionExtMeshPolygon; struct LineString; struct Padding; struct Shape; @@ -447,6 +448,19 @@ struct ExtensionExtMeshPrimitiveEdgeVisibilityJsonWriter { const CesiumJsonWriter::ExtensionWriterContext& context); }; +struct ExtensionExtMeshPolygonJsonWriter { + using ValueType = CesiumGltf::ExtensionExtMeshPolygon; + + /** @brief The official name of the extension. This should be the same as its + * key in the `extensions` object. */ + static constexpr const char* ExtensionName = "EXT_mesh_polygon"; + + static void write( + const CesiumGltf::ExtensionExtMeshPolygon& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context); +}; + struct LineStringJsonWriter { using ValueType = CesiumGltf::LineString; diff --git a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp index 26a2cb2fd2..7e1d6d5aac 100644 --- a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp +++ b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +97,9 @@ void registerWriterExtensions( context.registerExtension< CesiumGltf::MeshPrimitive, ExtensionExtMeshPrimitiveEdgeVisibilityJsonWriter>(); + context.registerExtension< + CesiumGltf::MeshPrimitive, + ExtensionExtMeshPolygonJsonWriter>(); context.registerExtension< CesiumGltf::Node, ExtensionExtInstanceFeaturesJsonWriter>(); diff --git a/CesiumNativeTests/CMakeLists.txt b/CesiumNativeTests/CMakeLists.txt index c98fd05a1f..6c0071c506 100644 --- a/CesiumNativeTests/CMakeLists.txt +++ b/CesiumNativeTests/CMakeLists.txt @@ -20,6 +20,7 @@ set(cesium_native_targets CesiumIonClient CesiumITwinClient CesiumVectorData + CesiumVectorOverlays CesiumQuantizedMeshTerrain CesiumRasterOverlays CesiumUtility diff --git a/CesiumRasterOverlays/include/CesiumRasterOverlays/ActivatedRasterOverlay.h b/CesiumRasterOverlays/include/CesiumRasterOverlays/ActivatedRasterOverlay.h index 7807aefe2c..f5b499fa78 100644 --- a/CesiumRasterOverlays/include/CesiumRasterOverlays/ActivatedRasterOverlay.h +++ b/CesiumRasterOverlays/include/CesiumRasterOverlays/ActivatedRasterOverlay.h @@ -259,6 +259,10 @@ class CESIUMRASTEROVERLAYS_API ActivatedRasterOverlay */ bool loadTileThrottled(RasterOverlayTile& tile); + void tick(); + + bool isTickable() const noexcept; + private: CesiumAsync::Future doLoad(RasterOverlayTile& tile, bool isThrottledLoad); diff --git a/CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h b/CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h index e9154acb97..6c9501804e 100644 --- a/CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h +++ b/CesiumRasterOverlays/include/CesiumRasterOverlays/RasterOverlayTileProvider.h @@ -263,6 +263,10 @@ class CESIUMRASTEROVERLAYS_API RasterOverlayTileProvider virtual void addCredits(CesiumUtility::CreditReferencer& creditReferencer) noexcept; + virtual bool isTickable() const noexcept { return false; } + + virtual void tick() {} + protected: /** * @brief Loads an image from a URL and optionally some request headers. diff --git a/CesiumRasterOverlays/src/ActivatedRasterOverlay.cpp b/CesiumRasterOverlays/src/ActivatedRasterOverlay.cpp index 4ef111cf30..94a0b30c09 100644 --- a/CesiumRasterOverlays/src/ActivatedRasterOverlay.cpp +++ b/CesiumRasterOverlays/src/ActivatedRasterOverlay.cpp @@ -78,6 +78,7 @@ void ActivatedRasterOverlay::setTileProvider( bool hadValue = this->_pTileProvider != nullptr; this->_pTileProvider = pTileProvider; + if (!hadValue && this->_pTileProvider != nullptr) { this->_readyPromise.resolve(); } @@ -343,6 +344,16 @@ void ActivatedRasterOverlay::finalizeTileLoad(bool isThrottledLoad) noexcept { } } +void ActivatedRasterOverlay::tick() { + if (this->_pTileProvider != nullptr) { + this->_pTileProvider->tick(); + } +} + +bool ActivatedRasterOverlay::isTickable() const noexcept { + return this->_pTileProvider != nullptr && this->_pTileProvider->isTickable(); +} + RasterOverlayTileLoadResult::RasterOverlayTileLoadResult( const CesiumUtility::IntrusivePointer& pActivated_, const CesiumUtility::IntrusivePointer& pTile_) noexcept diff --git a/CesiumVectorData/include/CesiumVectorData/VectorRasterizer.h b/CesiumVectorData/include/CesiumVectorData/VectorRasterizer.h index 6163db7bfd..f5195e31ff 100644 --- a/CesiumVectorData/include/CesiumVectorData/VectorRasterizer.h +++ b/CesiumVectorData/include/CesiumVectorData/VectorRasterizer.h @@ -3,10 +3,12 @@ #include "VectorStyle.h" #include +#include #include #include #include #include +#include #include #include #include @@ -78,6 +80,36 @@ class VectorRasterizer { void drawPolyline(const std::vector& points, const LineStyle& style); + /** + * @brief Draws a polyline (a set of multiple line segments) to the canvas. + * + * @param points The set of points making up the polyline. + * @param style The \ref LineStyle to use when drawing the polyline. + */ + void drawPolyline( + const std::vector& points, + const LineStyle& style); + + /** + * @brief Draws a set of points to the canvas. + * + * @param points The set of points to draw. The coordinates should be + * specified in degrees. + * @param style The \ref PointStyle to use when drawing the points. + */ + void + drawPoints(const std::vector& points, const PointStyle& style); + + /** + * @brief Draws a set of points to the canvas. + * + * @param points The set of points to draw. + * @param style The \ref PointStyle to use when drawing the points. + */ + void drawPoints( + const std::vector& points, + const PointStyle& style); + /** * @brief Rasterizes a `GeoJsonObject` to the canvas. * diff --git a/CesiumVectorData/include/CesiumVectorData/VectorStyle.h b/CesiumVectorData/include/CesiumVectorData/VectorStyle.h index 93f2edc876..5f97c70251 100644 --- a/CesiumVectorData/include/CesiumVectorData/VectorStyle.h +++ b/CesiumVectorData/include/CesiumVectorData/VectorStyle.h @@ -94,6 +94,22 @@ struct PolygonStyle { std::optional outline; }; +/** @brief The style used to draw a point. */ +struct PointStyle { + /** @brief The radius of the point in pixels. */ + double radius = 1.0; + /** + * @brief The color used to fill this point. If `std::nullopt`, the point + * will not be filled. + */ + std::optional fill; + /** + * @brief The style used to outline this point. If `std::nullopt`, the + * point will not be outlined. + */ + std::optional outline; +}; + /** * @brief Style information to use when drawing vector data. */ @@ -106,6 +122,10 @@ struct VectorStyle { * @brief The style to use when drawing polygons. */ PolygonStyle polygon; + /** + * @brief The style to use when drawing points. + */ + PointStyle point; /** * @brief Default constructor for VectorStyle. @@ -113,10 +133,18 @@ struct VectorStyle { VectorStyle() = default; /** - * @brief Initializes style information for all types. + * @brief Initializes style information for point and polygon types. */ VectorStyle(const LineStyle& lineStyle, const PolygonStyle& polygonStyle); + /** + * @brief Initializes style information for all types. + */ + VectorStyle( + const LineStyle& lineStyle, + const PolygonStyle& polygonStyle, + const PointStyle& pointStyle); + /** * @brief Initializes all styles to the given color. */ diff --git a/CesiumVectorData/src/VectorRasterizer.cpp b/CesiumVectorData/src/VectorRasterizer.cpp index 130f4eab4b..eee2f33a5b 100644 --- a/CesiumVectorData/src/VectorRasterizer.cpp +++ b/CesiumVectorData/src/VectorRasterizer.cpp @@ -1,3 +1,10 @@ +#include "CesiumGltf/AccessorView.h" +#include "CesiumGltf/Mesh.h" +#include "CesiumGltf/MeshPrimitive.h" +#include "CesiumGltf/Node.h" +#include "CesiumGltfContent/GltfUtilities.h" +#include "CesiumUtility/ExtensibleObject.h" + #include #include #include @@ -19,6 +26,7 @@ #include #include #include +#include #include #include @@ -220,6 +228,125 @@ void VectorRasterizer::drawPolyline( BLRgba32(style.getColor(seedForObject(points, 31)).toRgba32())); } +void VectorRasterizer::drawPolyline( + const std::vector& points, + const LineStyle& style) { + if (this->_finalized) { + return; + } + + std::vector vertices; + vertices.reserve(points.size()); + + for (const CesiumGeospatial::Cartographic& vertex : points) { + BLPoint point = radiansToPoint( + vertex.longitude, + vertex.latitude, + this->_bounds, + this->_context); + vertices.emplace_back(point); + } + + setStrokeWidth(this->_context, style, this->_ellipsoid, this->_bounds); + + this->_context.strokePolyline( + vertices.data(), + vertices.size(), + BLRgba32(style.getColor(seedForObject(points, 31)).toRgba32())); +} + +namespace { +void drawPointsImpl( + BLContext& context, + const CesiumGeospatial::Ellipsoid& ellipsoid, + const GlobeRectangle& bounds, + const std::vector& vertices, + const std::vector& seeds, + const PointStyle& style) { + if (style.fill) { + for (size_t i = 0; i < vertices.size(); i++) { + context.fillCircle( + BLCircle(vertices[i].x, vertices[i].y, style.radius), + BLRgba32(style.fill->getColor(seeds[i]).toRgba32())); + } + } + + if (style.outline) { + setStrokeWidth(context, *style.outline, ellipsoid, bounds); + + for (size_t i = 0; i < vertices.size(); i++) { + context.strokeCircle( + BLCircle(vertices[i].x, vertices[i].y, style.radius), + BLRgba32(style.outline->getColor(seeds[i] ^ 31).toRgba32())); + } + } +} +} // namespace + +void VectorRasterizer::drawPoints( + const std::vector& points, + const PointStyle& style) { + if (this->_finalized) { + return; + } + + std::vector vertices; + vertices.reserve(points.size()); + + std::vector seeds; + seeds.reserve(points.size()); + + for (const glm::dvec3& vertex : points) { + BLPoint point = radiansToPoint( + CesiumUtility::Math::degreesToRadians(vertex.x), + CesiumUtility::Math::degreesToRadians(vertex.y), + this->_bounds, + this->_context); + vertices.emplace_back(point); + seeds.emplace_back(seedForObject(vertex, 17)); + } + + drawPointsImpl( + this->_context, + this->_ellipsoid, + this->_bounds, + vertices, + seeds, + style); +} + +void VectorRasterizer::drawPoints( + const std::vector& points, + const PointStyle& style) { + if (this->_finalized) { + return; + } + + std::vector vertices; + vertices.reserve(points.size()); + + std::vector seeds; + seeds.reserve(points.size()); + + for (const CesiumGeospatial::Cartographic& vertex : points) { + BLPoint point = radiansToPoint( + vertex.longitude, + vertex.latitude, + this->_bounds, + this->_context); + vertices.emplace_back(point); + seeds.emplace_back(seedForObject(vertex, 17)); + } + + drawPointsImpl( + this->_context, + this->_ellipsoid, + this->_bounds, + vertices, + seeds, + style); +} + void VectorRasterizer::drawGeoJsonObject( const GeoJsonObject& geoJsonObject, const VectorStyle& style) { @@ -243,8 +370,12 @@ void VectorRasterizer::drawGeoJsonObject( rasterizer.drawPolygon(polygon, style.polygon); } } - void operator()(const GeoJsonPoint& /*catchAll*/) {} - void operator()(const GeoJsonMultiPoint& /*catchAll*/) {} + void operator()(const GeoJsonPoint& point) { + rasterizer.drawPoints({point.coordinates}, style.point); + } + void operator()(const GeoJsonMultiPoint& points) { + rasterizer.drawPoints(points.coordinates, style.point); + } void operator()(const GeoJsonFeature& /*catchAll*/) {} void operator()(const GeoJsonFeatureCollection& /*catchAll*/) {} void operator()(const GeoJsonGeometryCollection& /*catchAll*/) {} @@ -275,8 +406,8 @@ VectorRasterizer::finalize() { // We need to swap the channels to fix the values. // Blend2D provides BLPixelConverter for these sorts of operations, which // should be faster because it has SIMD support. But the current - // implementation seems to perform well as-is, likely thanks to the compiler's - // vectorization. + // implementation seems to perform well as-is, likely thanks to the + // compiler's vectorization. std::byte* pData = this->_mipLevel == 0 ? this->_imageAsset->pixelData.data() diff --git a/CesiumVectorData/src/VectorStyle.cpp b/CesiumVectorData/src/VectorStyle.cpp index 9a85d2b92b..dfe26f8e95 100644 --- a/CesiumVectorData/src/VectorStyle.cpp +++ b/CesiumVectorData/src/VectorStyle.cpp @@ -33,4 +33,9 @@ VectorStyle::VectorStyle( const LineStyle& lineStyle, const PolygonStyle& polygonStyle) : line(lineStyle), polygon(polygonStyle) {} +VectorStyle::VectorStyle( + const LineStyle& lineStyle, + const PolygonStyle& polygonStyle, + const PointStyle& pointStyle) + : line(lineStyle), polygon(polygonStyle), point(pointStyle) {} } // namespace CesiumVectorData \ No newline at end of file diff --git a/CesiumVectorOverlays/CMakeLists.txt b/CesiumVectorOverlays/CMakeLists.txt new file mode 100644 index 0000000000..93ff8e6b9d --- /dev/null +++ b/CesiumVectorOverlays/CMakeLists.txt @@ -0,0 +1,55 @@ +add_library(CesiumVectorOverlays "") + +configure_cesium_library(CesiumVectorOverlays) + +cesium_glob_files(CESIUM_VECTOR_OVERLAYS_SOURCES + ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp) +cesium_glob_files(CESIUM_VECTOR_OVERLAYS_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/src/*.h) +cesium_glob_files(CESIUM_VECTOR_OVERLAYS_PUBLIC_HEADERS + ${CMAKE_CURRENT_LIST_DIR}/include/CesiumVectorOverlays/*.h) +cesium_glob_files(CESIUM_VECTOR_OVERLAYS_TEST_SOURCES test/*.cpp) +cesium_glob_files(CESIUM_VECTOR_OVERLAYS_TEST_HEADERS test/*.h) + +set_target_properties(CesiumVectorOverlays + PROPERTIES + TEST_SOURCES "${CESIUM_VECTOR_OVERLAYS_TEST_SOURCES}" + TEST_HEADERS "${CESIUM_VECTOR_OVERLAYS_TEST_HEADERS}" + TEST_DATA_DIR ${CMAKE_CURRENT_LIST_DIR}/test/data +) + +set_target_properties(CesiumVectorOverlays + PROPERTIES + PUBLIC_HEADER "${CESIUM_VECTOR_OVERLAYS_PUBLIC_HEADERS}" +) + +target_sources( + CesiumVectorOverlays + PRIVATE + ${CESIUM_VECTOR_OVERLAYS_SOURCES} + ${CESIUM_VECTOR_OVERLAYS_HEADERS} + ${CESIUM_VECTOR_OVERLAYS_PUBLIC_HEADERS} +) + +cesium_target_include_directories( + TARGET + CesiumVectorOverlays + PUBLIC + $ + $ + PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/src +) + +target_link_libraries(CesiumVectorOverlays + PUBLIC + CesiumUtility + CesiumGeometry + CesiumGeospatial + CesiumAsync + CesiumGltf + CesiumGltfContent + CesiumVectorData + Cesium3DTilesSelection + CesiumRasterOverlays +) diff --git a/CesiumRasterOverlays/include/CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h b/CesiumVectorOverlays/include/CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h similarity index 85% rename from CesiumRasterOverlays/include/CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h rename to CesiumVectorOverlays/include/CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h index 896e85480a..acd1e7f119 100644 --- a/CesiumRasterOverlays/include/CesiumRasterOverlays/GeoJsonDocumentRasterOverlay.h +++ b/CesiumVectorOverlays/include/CesiumVectorOverlays/GeoJsonDocumentRasterOverlay.h @@ -1,10 +1,11 @@ #pragma once +#include "Library.h" + #include #include #include #include -#include #include #include #include @@ -18,7 +19,7 @@ #include #include -namespace CesiumRasterOverlays { +namespace CesiumVectorOverlays { /** * @brief A set of options for configuring a GeoJsonDocumentRasterOverlay. @@ -45,8 +46,8 @@ struct GeoJsonDocumentRasterOverlayOptions { * @brief A raster overlay made from rasterizing a \ref * CesiumVectorData::GeoJsonDocument. */ -class CESIUMRASTEROVERLAYS_API GeoJsonDocumentRasterOverlay final - : public RasterOverlay { +class CESIUMVECTOROVERLAYS_API GeoJsonDocumentRasterOverlay final + : public CesiumRasterOverlays::RasterOverlay { public: /** @@ -64,7 +65,7 @@ class CESIUMRASTEROVERLAYS_API GeoJsonDocumentRasterOverlay final const std::string& name, const std::shared_ptr& document, const GeoJsonDocumentRasterOverlayOptions& vectorOverlayOptions, - const RasterOverlayOptions& overlayOptions = {}); + const CesiumRasterOverlays::RasterOverlayOptions& overlayOptions = {}); /** * @brief Creates a new GeoJsonDocumentRasterOverlay from a future. @@ -81,17 +82,17 @@ class CESIUMRASTEROVERLAYS_API GeoJsonDocumentRasterOverlay final CesiumAsync::Future>&& documentFuture, const GeoJsonDocumentRasterOverlayOptions& vectorOverlayOptions, - const RasterOverlayOptions& overlayOptions = {}); + const CesiumRasterOverlays::RasterOverlayOptions& overlayOptions = {}); virtual ~GeoJsonDocumentRasterOverlay() override; virtual CesiumAsync::Future createTileProvider( - const CreateRasterOverlayTileProviderParameters& parameters) - const override; + const CesiumRasterOverlays::CreateRasterOverlayTileProviderParameters& + parameters) const override; private: CesiumAsync::Future> _documentFuture; GeoJsonDocumentRasterOverlayOptions _options; }; -} // namespace CesiumRasterOverlays +} // namespace CesiumVectorOverlays diff --git a/CesiumVectorOverlays/include/CesiumVectorOverlays/Library.h b/CesiumVectorOverlays/include/CesiumVectorOverlays/Library.h new file mode 100644 index 0000000000..ab240be335 --- /dev/null +++ b/CesiumVectorOverlays/include/CesiumVectorOverlays/Library.h @@ -0,0 +1,18 @@ +#pragma once + +/** + * @brief Raster overlays for displaying vector data. + * + * @mermaid-interactive{dependencies/CesiumVectorOverlays} + */ +namespace CesiumVectorOverlays {} + +#if defined(_WIN32) && defined(CESIUM_SHARED) +#ifdef CESIUMVECTOROVERLAYS_BUILDING +#define CESIUMVECTOROVERLAYS_API __declspec(dllexport) +#else +#define CESIUMVECTOROVERLAYS_API __declspec(dllimport) +#endif +#else +#define CESIUMVECTOROVERLAYS_API +#endif diff --git a/CesiumVectorOverlays/include/CesiumVectorOverlays/VectorTilesRasterOverlay.h b/CesiumVectorOverlays/include/CesiumVectorOverlays/VectorTilesRasterOverlay.h new file mode 100644 index 0000000000..796dd427ab --- /dev/null +++ b/CesiumVectorOverlays/include/CesiumVectorOverlays/VectorTilesRasterOverlay.h @@ -0,0 +1,81 @@ +#include "Library.h" + +#include +#include +#include + +namespace CesiumVectorOverlays { + +/** + * @brief Options for constructing a \ref VectorTilesRasterOverlay. + */ +struct VectorTilesRasterOverlayOptions { + /** + * @brief The default style to use for features in the vector tileset when no + * other style is specified. + */ + CesiumVectorData::VectorStyle defaultStyle; + /** + * @brief HTTP headers to attach to requests made for this tileset. + */ + std::vector requestHeaders; +}; + +/** + * @brief A raster overlay made from rasterizing a \ref + * CesiumVectorData::GeoJsonDocument. + */ +class CESIUMVECTOROVERLAYS_API VectorTilesRasterOverlay final + : public CesiumRasterOverlays::RasterOverlay { + +public: + /** + * @brief Parameters for loading a vector tiles tileset from ion. + */ + struct TilesetFromIon { + /** + * @brief The Ion asset ID. + */ + uint32_t ionAssetID; + /** + * @brief The Ion access token. + */ + std::string ionAccessToken; + /** + * @brief The Ion asset endpoint URL. + */ + std::string ionAssetEndpointUrl = "https://api.cesium.com/"; + }; + + /** + * @brief A source for a tileset, which can be either a URL or an Ion asset. + */ + using TilesetSource = std::variant; + + /** + * @brief Creates a new VectorTilesRasterOverlay. + * + * @param asyncSystem The async system to use. + * @param name The user-given name of this layer. + * @param source The source of the tileset. + * @param vectorOptions Options to configure this + * VectorTilesRasterOverlay. + * @param overlayOptions Options to use for this RasterOverlay. + */ + VectorTilesRasterOverlay( + const std::string& name, + const TilesetSource& source, + const VectorTilesRasterOverlayOptions& vectorOptions = {}, + const CesiumRasterOverlays::RasterOverlayOptions& overlayOptions = {}); + + virtual ~VectorTilesRasterOverlay() override = default; + + virtual CesiumAsync::Future createTileProvider( + const CesiumRasterOverlays::CreateRasterOverlayTileProviderParameters& + parameters) const override; + +private: + VectorTilesRasterOverlayOptions _vectorOptions; + TilesetSource _source; +}; +} // namespace CesiumVectorOverlays \ No newline at end of file diff --git a/CesiumRasterOverlays/src/GeoJsonDocumentRasterOverlay.cpp b/CesiumVectorOverlays/src/GeoJsonDocumentRasterOverlay.cpp similarity index 99% rename from CesiumRasterOverlays/src/GeoJsonDocumentRasterOverlay.cpp rename to CesiumVectorOverlays/src/GeoJsonDocumentRasterOverlay.cpp index c718f68aee..3b3aed8bb9 100644 --- a/CesiumRasterOverlays/src/GeoJsonDocumentRasterOverlay.cpp +++ b/CesiumVectorOverlays/src/GeoJsonDocumentRasterOverlay.cpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include #include @@ -26,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -47,11 +47,12 @@ using namespace CesiumGeometry; using namespace CesiumGeospatial; using namespace CesiumUtility; using namespace CesiumVectorData; +using namespace CesiumRasterOverlays; // We won't generate any quadtree nodes past this depth. const uint32_t DEPTH_LIMIT = 8; -namespace CesiumRasterOverlays { +namespace CesiumVectorOverlays { namespace { /** @@ -850,4 +851,4 @@ GeoJsonDocumentRasterOverlay::createTileProvider( }); } -} // namespace CesiumRasterOverlays +} // namespace CesiumVectorOverlays diff --git a/CesiumVectorOverlays/src/VectorTilesRasterOverlay.cpp b/CesiumVectorOverlays/src/VectorTilesRasterOverlay.cpp new file mode 100644 index 0000000000..b8fe844db7 --- /dev/null +++ b/CesiumVectorOverlays/src/VectorTilesRasterOverlay.cpp @@ -0,0 +1,773 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +using namespace Cesium3DTilesSelection; +using namespace CesiumRasterOverlays; +using namespace CesiumUtility; + +namespace CesiumVectorOverlays { +namespace { +struct VectorRenderContent { + CesiumVectorData::VectorStyle style; + + std::vector points; + std::vector> polylines; + std::vector polygons; +}; + +CesiumUtility::Result vectorizeModel( + CesiumGltf::Model& model, + const CesiumGeospatial::Ellipsoid& ellipsoid, + const glm::dmat4x4& gltfTransform, + const CesiumVectorData::VectorStyle& defaultStyle) { + + glm::dmat4x4 rootTransform = + CesiumGltfContent::GltfUtilities::applyRtcCenter(model, gltfTransform); + rootTransform = CesiumGltfContent::GltfUtilities::applyGltfUpAxisTransform( + model, + rootTransform); + + CesiumUtility::ErrorList errors; + + VectorRenderContent* content = new VectorRenderContent(); + content->style = defaultStyle; + + model.forEachPrimitiveInScene( + -1, + [content, rootTransform, &errors, &ellipsoid]( + const CesiumGltf::Model& model, + const CesiumGltf::Node& /*node*/, + const CesiumGltf::Mesh& /*mesh*/, + CesiumGltf::MeshPrimitive& primitive, + const glm::dmat4& nodeTransform) mutable { + const CesiumGltf::AccessorView positionView( + model, + primitive.attributes.at("POSITION")); + const CesiumGltf::IndexAccessorType indicesView = + CesiumGltf::getIndexAccessorView(model, primitive); + const int64_t numIndices = + std::visit(CesiumGltf::NumIndicesFromAccessor{}, indicesView); + const int64_t maxIndex = + std::visit(CesiumGltf::MaxIndexValueFromAccessor{}, indicesView); + + if (positionView.status() != CesiumGltf::AccessorViewStatus::Valid) { + errors.emplaceError( + "Cannot create valid position accessor for primitive."); + return; + } + + if (primitive.mode == CesiumGltf::MeshPrimitive::Mode::POINTS) { + for (int64_t i = 0; i < positionView.size(); i++) { + const glm::vec3 position = positionView[i]; + const glm::dvec4 transformedPosition = + rootTransform * nodeTransform * glm::dvec4(position, 1.0); + content->points.emplace_back( + ellipsoid + .cartesianToCartographic(glm::dvec3(transformedPosition)) + .value_or(CesiumGeospatial::Cartographic{0.0, 0.0, 0.0})); + } + return; + } else if ( + primitive.mode == CesiumGltf::MeshPrimitive::Mode::LINE_STRIP) { + if (numIndices < 2) { + errors.emplaceError( + "Primitive mode LINE_STRIP requires at least two indices."); + return; + } + + std::vector polyline; + for (int64_t i = 0; i < numIndices; i++) { + const int64_t idx = + std::visit(CesiumGltf::IndexFromAccessor{i}, indicesView); + if (idx == maxIndex) { + // Primitive restart. + if (polyline.size() >= 2) { + content->polylines.emplace_back(std::move(polyline)); + polyline.clear(); + } else { + errors.emplaceError("Primitive restart index encountered but " + "current polyline has less than 2 points."); + } + + continue; + } + + if (idx < 0 || idx >= positionView.size()) { + errors.emplaceError(fmt::format( + "Index {} out of bounds for position accessor size {}", + idx, + positionView.size())); + return; + } + + const glm::vec3 position = positionView[idx]; + const glm::dvec4 transformedPosition = + rootTransform * nodeTransform * glm::dvec4(position, 1.0); + polyline.emplace_back( + ellipsoid + .cartesianToCartographic(glm::dvec3(transformedPosition)) + .value_or(CesiumGeospatial::Cartographic{0.0, 0.0, 0.0})); + } + + if (polyline.size() >= 2) { + content->polylines.emplace_back(std::move(polyline)); + } else if (polyline.size() == 1) { + errors.emplaceWarning("LINE_STRIP primitive ended with a single " + "point unassigned to a line."); + } + } else if ( + primitive.mode >= CesiumGltf::MeshPrimitive::Mode::TRIANGLES && + primitive.mode <= CesiumGltf::MeshPrimitive::Mode::TRIANGLE_FAN) { + const CesiumGltf::ExtensionExtMeshPolygon* pPolygonExtension = + primitive.getExtension(); + if (pPolygonExtension == nullptr) { + errors.emplaceWarning( + fmt::format("Polygons found but no EXT_mesh_polygon extension " + "present on primitive. Skipping polygon.")); + return; + } + + CesiumGltf::IndexAccessorType loopIndicesView = + CesiumGltf::getIndexAccessorView( + model, + pPolygonExtension->loopIndices); + + CesiumGltf::IndexAccessorType loopIndicesOffsetsView = + CesiumGltf::getIndexAccessorView( + model, + pPolygonExtension->loopIndicesOffsets); + const int64_t numPolygons = pPolygonExtension->count; + const int64_t maxPolygonIndex = std::visit( + CesiumGltf::MaxIndexValueFromAccessor{}, + loopIndicesView); + content->polygons.reserve( + content->polygons.size() + static_cast(numPolygons)); + + for (int64_t i = 0; i < numPolygons; i++) { + const int64_t loopIndicesOffset = std::visit( + CesiumGltf::IndexFromAccessor{i}, + loopIndicesOffsetsView); + const int64_t nextLoopIndicesOffset = + i + 1 < numPolygons ? std::visit( + CesiumGltf::IndexFromAccessor{i + 1}, + loopIndicesOffsetsView) + : std::visit( + CesiumGltf::NumIndicesFromAccessor{}, + loopIndicesView); + std::vector vertices; + + for (int64_t j = loopIndicesOffset; j < nextLoopIndicesOffset; + j++) { + int64_t loopIndex = + std::visit(CesiumGltf::IndexFromAccessor{j}, loopIndicesView); + if (loopIndex == maxPolygonIndex) { + continue; + } + + const glm::vec3 position = positionView[loopIndex]; + const glm::dvec4 transformedPosition = + rootTransform * nodeTransform * glm::dvec4(position, 1.0); + const CesiumGeospatial::Cartographic cartographic = + ellipsoid + .cartesianToCartographic(glm::dvec3(transformedPosition)) + .value_or(CesiumGeospatial::Cartographic{0.0, 0.0, 0.0}); + vertices.emplace_back( + cartographic.longitude, + cartographic.latitude); + } + + std::vector indices; + content->polygons.emplace_back( + std::move(vertices), + std::move(indices)); + } + } else { + errors.emplaceWarning(fmt::format( + "Ignoring primitive with mode {} - only POINTS (0), LINE_STRIP " + "(3), and TRIANGLES (4) are supported.", + primitive.mode)); + } + }); + + return {content, errors}; +} + +struct LoadRequest { + CesiumAsync::Promise promise; + std::set requestedTiles; +}; + +struct SharedTileSelectionState { + std::vector workerThreadLoadQueue; + // Does not need to be concurrent because it is only accessed by the + // TilesetContentManager and the methods calling the TilesetContentManager. + std::vector tilesWaitingForWorker; + std::mutex loadRequestsMutex; + std::vector loadRequests; +}; + +class VectorTilesLoadRequester : public TileLoadRequester { + virtual double getWeight() const override { return this->_weight; } + + virtual bool hasMoreTilesToLoadInWorkerThread() const override { + return !this->_pSharedTileSelectionState->workerThreadLoadQueue.empty(); + } + + const Tile* getNextTileToLoadInWorkerThread() override { + if (this->_pSharedTileSelectionState->workerThreadLoadQueue.empty()) { + return nullptr; + } + + TileLoadTask& task = + this->_pSharedTileSelectionState->workerThreadLoadQueue.back(); + + this->_pSharedTileSelectionState->tilesWaitingForWorker.emplace_back( + task.pTile); + const Tile::Pointer pTile = task.pTile; + this->_pSharedTileSelectionState->workerThreadLoadQueue.pop_back(); + return pTile; + } + + bool hasMoreTilesToLoadInMainThread() const override { + // No main thread loading for vector tiles. + return false; + } + + const Tile* getNextTileToLoadInMainThread() override { return nullptr; } + +public: + VectorTilesLoadRequester( + std::shared_ptr pSharedTileSelectionState) + : _weight(1.0), + _pSharedTileSelectionState(std::move(pSharedTileSelectionState)) {} + +private: + float _weight = 1.0; + std::shared_ptr _pSharedTileSelectionState; +}; + +class VectorTilesPrepareRendererResources : public IPrepareRendererResources { +public: + virtual CesiumAsync::Future + prepareInLoadThread( + const CesiumAsync::AsyncSystem& asyncSystem, + TileLoadResult&& tileLoadResult, + const glm::dmat4& transform, + const std::any& /*rendererOptions*/) override { + CesiumGltf::Model* pModel = + std::get_if(&tileLoadResult.contentKind); + if (pModel == nullptr) { + return asyncSystem.createResolvedFuture( + TileLoadResultAndRenderResources{std::move(tileLoadResult), nullptr}); + } + + Result vectorizationResult = vectorizeModel( + *pModel, + tileLoadResult.ellipsoid, + transform, + this->defaultStyle); + if (vectorizationResult.errors.hasErrors()) { + if (vectorizationResult.value) { + delete *vectorizationResult.value; + } + + vectorizationResult.errors.log( + this->pLogger, + "Errors when vectorizing model:"); + return asyncSystem.createResolvedFuture( + TileLoadResultAndRenderResources{std::move(tileLoadResult), nullptr}); + } + + return asyncSystem.createResolvedFuture(TileLoadResultAndRenderResources{ + std::move(tileLoadResult), + vectorizationResult.value ? *vectorizationResult.value : nullptr}); + } + + void* prepareInMainThread(Tile& /*tile*/, void* pLoadThreadResult) override { + // No main thread preparation for vector tiles. + return pLoadThreadResult; + } + + void free( + Tile& /*tile*/, + void* pLoadThreadResult, + void* pMainThreadResult) noexcept override { + if (pLoadThreadResult != nullptr) { + VectorRenderContent* pContent = + static_cast(pLoadThreadResult); + delete pContent; + } + + if (pMainThreadResult != nullptr) { + VectorRenderContent* pContent = + static_cast(pMainThreadResult); + delete pContent; + } + } + + void attachRasterInMainThread( + const Tile& /*tile*/, + int32_t /*overlayTextureCoordinateID*/, + const CesiumRasterOverlays::RasterOverlayTile& /*rasterTile*/, + void* /*pMainThreadRendererResources*/, + const glm::dvec2& /*translation*/, + const glm::dvec2& /*scale*/) override {} + + void detachRasterInMainThread( + const Tile& /*tile*/, + int32_t /*overlayTextureCoordinateID*/, + const CesiumRasterOverlays::RasterOverlayTile& /*rasterTile*/, + void* /*pMainThreadRendererResources*/) noexcept override {} + + virtual void* prepareRasterInLoadThread( + CesiumGltf::ImageAsset& /*image*/, + const std::any& /*rendererOptions*/) override { + return nullptr; + } + + virtual void* prepareRasterInMainThread( + RasterOverlayTile& /*rasterTile*/, + void* /*pLoadThreadResult*/) override { + return nullptr; + } + + virtual void freeRaster( + const RasterOverlayTile& /*rasterTile*/, + void* /*pLoadThreadResult*/, + void* /*pMainThreadResult*/) noexcept override {} + + VectorTilesPrepareRendererResources( + std::shared_ptr pLogger, + CesiumVectorData::VectorStyle defaultStyle) + : defaultStyle(std::move(defaultStyle)), pLogger(std::move(pLogger)) {} + + CesiumVectorData::VectorStyle defaultStyle; + std::shared_ptr pLogger; +}; + +class VectorTilesRasterOverlayTileProvider final + : public RasterOverlayTileProvider { +private: + using TraversalState = + CesiumUtility::TreeTraversalState; + + CesiumUtility::IntrusivePointer + _pTilesetContentManager; + TilesetOptions _options; + + std::shared_ptr _pSharedTileSelectionState = + std::make_shared(); + VectorTilesLoadRequester _loadRequester{_pSharedTileSelectionState}; + std::shared_ptr + _pPrepareRendererResources; + +private: + struct LoadTileImageInformation { + CesiumGeospatial::GlobeRectangle tileRectangle; + glm::ivec2 textureSize; + std::vector tileLoadTasks; + std::vector tilesToRender; + }; + + CesiumAsync::Future addLoadRequest( + const CesiumAsync::AsyncSystem& asyncSystem, + const std::vector& tasks) { + std::set requestedTiles; + for (const TileLoadTask& task : tasks) { + this->_pSharedTileSelectionState->workerThreadLoadQueue.emplace_back( + task); + requestedTiles.insert(&*task.pTile); + } + + LoadRequest request{ + asyncSystem.createPromise(), + std::move(requestedTiles)}; + CesiumAsync::Future future = request.promise.getFuture(); + + std::scoped_lock lock( + this->_pSharedTileSelectionState->loadRequestsMutex); + this->_pSharedTileSelectionState->loadRequests.emplace_back( + std::move(request)); + + return future; + } + + bool meetsSse(const Tile& tile, LoadTileImageInformation& loadInfo) { + // TODO: is this SSE calculation actually correct? + const double geometricError = tile.getGeometricError(); + const double pixelsPerMeter = (double)loadInfo.textureSize.y / + (loadInfo.tileRectangle.computeHeight() * + this->_options.ellipsoid.getRadii().x); + + return (geometricError * pixelsPerMeter) < + this->_options.maximumScreenSpaceError; + } + + void visit(Tile& tile, LoadTileImageInformation& loadInfo) { + if (tile.getState() < TileLoadState::ContentLoaded) { + loadInfo.tileLoadTasks.emplace_back(&tile, TileLoadPriorityGroup::Normal); + return; + } + + if (tile.isRenderContent() && + (meetsSse(tile, loadInfo) || tile.getChildren().empty())) { + loadInfo.tilesToRender.emplace_back(&tile); + } else { + for (Tile& child : tile.getChildren()) { + this->visitIfNeeded(child, loadInfo); + } + } + } + + void visitIfNeeded(Tile& tile, LoadTileImageInformation& loadInfo) { + this->_pTilesetContentManager->updateTileContent(tile, _options); + + const std::optional rectangle = + estimateGlobeRectangle( + tile.getBoundingVolume(), + this->_options.ellipsoid); + if (!rectangle) { + // Invalid bounding rect, nothing to do with this. + return; + } + + if (rectangle->computeIntersection(loadInfo.tileRectangle)) { + this->visit(tile, loadInfo); + } + } + + CesiumAsync::Future findAndLoadTiles( + const CesiumGeospatial::GlobeRectangle& tileRectangle, + const glm::ivec2& textureSize) { + LoadTileImageInformation loadInfo{tileRectangle, textureSize, {}, {}}; + Tile* pRootTile = this->_pTilesetContentManager->getRootTile(); + + if (pRootTile == nullptr) { + return this->getAsyncSystem() + .createResolvedFuture(std::move(loadInfo)); + } + + visitIfNeeded(*pRootTile, loadInfo); + + if (!loadInfo.tileLoadTasks.empty()) { + // Add load request and re-run this function when all those tiles are + // loaded. We need to re-run since some of those tiles might have been + // external content and now we need to check their children. + return this + ->addLoadRequest(this->getAsyncSystem(), loadInfo.tileLoadTasks) + .thenImmediately([this, tileRectangle, textureSize]() mutable { + return this->findAndLoadTiles(tileRectangle, textureSize); + }); + } + + return this->getAsyncSystem() + .createResolvedFuture(std::move(loadInfo)); + } + + CesiumAsync::Future loadTileImageFromTileset( + const CesiumGeometry::Rectangle& rectangle, + const CesiumGeospatial::GlobeRectangle& tileRectangle, + const glm::ivec2& textureSize) { + return this->findAndLoadTiles(tileRectangle, textureSize) + .thenInWorkerThread([textureSize, + rectangle, + tileRectangle, + ellipsoid = this->_options.ellipsoid]( + LoadTileImageInformation&& loadInfo) { + // part 4 - rasterizing the tile + LoadedRasterOverlayImage result; + result.rectangle = rectangle; + if (loadInfo.tilesToRender.empty()) { + // No tiles to render, so return an empty image. + result.moreDetailAvailable = false; + result.pImage.emplace(); + result.pImage->width = 1; + result.pImage->height = 1; + result.pImage->channels = 4; + result.pImage->bytesPerChannel = 1; + result.pImage->pixelData = { + std::byte{0x00}, + std::byte{0x00}, + std::byte{0x00}, + std::byte{0x00}}; + } else { + result.moreDetailAvailable = true; + result.pImage.emplace(); + result.pImage->width = textureSize.x; + result.pImage->height = textureSize.y; + result.pImage->channels = 4; + result.pImage->bytesPerChannel = 1; + result.pImage->pixelData.resize( + (size_t)(result.pImage->width * result.pImage->height * + result.pImage->channels * + result.pImage->bytesPerChannel), + std::byte{0}); + CesiumVectorData::VectorRasterizer rasterizer( + tileRectangle, + result.pImage, + 0, + ellipsoid); + + for (const Tile::ConstPointer& pTile : loadInfo.tilesToRender) { + const TileRenderContent* pRenderContent = + pTile->getContent().getRenderContent(); + if (pRenderContent == nullptr) { + continue; + } + + const VectorRenderContent* pVectorContent = + static_cast( + pRenderContent->getRenderResources()); + if (pVectorContent == nullptr) { + continue; + } + + for (const CesiumGeospatial::CartographicPolygon& polygon : + pVectorContent->polygons) { + rasterizer.drawPolygon(polygon, pVectorContent->style.polygon); + } + + for (const std::vector& polyline : + pVectorContent->polylines) { + rasterizer.drawPolyline(polyline, pVectorContent->style.line); + } + + if (!pVectorContent->points.empty()) { + rasterizer.drawPoints( + pVectorContent->points, + pVectorContent->style.point); + } + } + + rasterizer.finalize(); + } + + return result; + }); + } + +public: + VectorTilesRasterOverlayTileProvider( + const IntrusivePointer& pCreator, + const CreateRasterOverlayTileProviderParameters& parameters, + const VectorTilesRasterOverlay::TilesetSource& source, + const VectorTilesRasterOverlayOptions& vectorOptions) + : RasterOverlayTileProvider( + pCreator, + parameters, + CesiumGeospatial::GeographicProjection( + CesiumGeospatial::Ellipsoid::WGS84), + projectRectangleSimple( + CesiumGeospatial::GeographicProjection( + CesiumGeospatial::Ellipsoid::WGS84), + CesiumGeospatial::GlobeRectangle::MAXIMUM)), + _options(), + _pPrepareRendererResources( + std::make_shared( + parameters.externals.pLogger, + vectorOptions.defaultStyle)) { + const RasterOverlayOptions& overlayOptions = + (parameters.pOwner ? parameters.pOwner : pCreator)->getOptions(); + this->_options.ellipsoid = overlayOptions.ellipsoid; + this->_options.maximumScreenSpaceError = + overlayOptions.maximumScreenSpaceError; + this->_options.maximumSimultaneousTileLoads = + static_cast(overlayOptions.maximumSimultaneousTileLoads); + this->_options.requestHeaders = vectorOptions.requestHeaders; + + const TilesetExternals externals{ + parameters.externals.pAssetAccessor, + this->_pPrepareRendererResources, + parameters.externals.asyncSystem, + parameters.externals.pCreditSystem, + parameters.externals.pLogger, + nullptr, + TilesetSharedAssetSystem::getDefault(), + nullptr}; + + struct TilesetContentManagerVisitor { + const TilesetExternals& externals; + const TilesetOptions& options; + + IntrusivePointer + operator()(const std::string& url) { + return TilesetContentManager::createFromUrl(externals, options, url); + } + + IntrusivePointer + operator()(const VectorTilesRasterOverlay::TilesetFromIon& ion) { + return TilesetContentManager::createFromCesiumIon( + externals, + options, + ion.ionAssetID, + ion.ionAccessToken, + ion.ionAssetEndpointUrl); + } + }; + + this->_pTilesetContentManager = std::visit( + TilesetContentManagerVisitor{externals, this->_options}, + source); + this->_pTilesetContentManager->registerTileRequester(this->_loadRequester); + } + + virtual CesiumAsync::Future + loadTileImage(const RasterOverlayTile& overlayTile) override { + const RasterOverlayOptions& options = this->getOwner().getOptions(); + glm::ivec2 textureSize = glm::min( + glm::ivec2( + overlayTile.getTargetScreenPixels() / + options.maximumScreenSpaceError), + glm::ivec2(options.maximumTextureSize)); + + const CesiumGeospatial::GlobeRectangle tileRectangle = + CesiumGeospatial::unprojectRectangleSimple( + this->getProjection(), + overlayTile.getRectangle()); + + // part 1 - selecting from scratch + if (this->_pTilesetContentManager->getRootTile() == nullptr) { + return this->_pTilesetContentManager->getRootTileAvailableEvent() + .thenInWorkerThread([this, + rectangle = overlayTile.getRectangle(), + tileRectangle, + textureSize]() mutable { + return this->loadTileImageFromTileset( + rectangle, + tileRectangle, + textureSize); + }); + } + + return loadTileImageFromTileset( + overlayTile.getRectangle(), + tileRectangle, + textureSize); + } + + // TODO: how does this get called? + virtual void tick() override { + this->_pTilesetContentManager->processWorkerThreadLoadRequests( + this->_options); + this->_pTilesetContentManager->processMainThreadLoadRequests( + this->_options); + + // Check and resolve load requests if possible. + std::vector> promisesToResolve; + { + std::scoped_lock lock( + this->_pSharedTileSelectionState->loadRequestsMutex); + for (const Tile::Pointer& pTile : + this->_pSharedTileSelectionState->tilesWaitingForWorker) { + TileLoadState state = pTile->getState(); + if (state == TileLoadState::FailedTemporarily) { + this->_pSharedTileSelectionState->workerThreadLoadQueue.emplace_back( + pTile.get(), + TileLoadPriorityGroup::Urgent, + 1.0); + } else if (state < TileLoadState::ContentLoaded) { + continue; + } + + for (LoadRequest& request : + this->_pSharedTileSelectionState->loadRequests) { + if (request.requestedTiles.erase(&*pTile) > 0) { + if (request.requestedTiles.empty()) { + // Keep list of promises to resolve until after we've unlocked the + // mutex. + promisesToResolve.emplace_back(std::move(request.promise)); + } + } + } + } + + // Erase completed load requests. + this->_pSharedTileSelectionState->loadRequests.erase( + std::remove_if( + this->_pSharedTileSelectionState->loadRequests.begin(), + this->_pSharedTileSelectionState->loadRequests.end(), + [](const LoadRequest& request) { + return request.requestedTiles.empty(); + }), + this->_pSharedTileSelectionState->loadRequests.end()); + } + + for (CesiumAsync::Promise& promise : promisesToResolve) { + promise.resolve(); + } + + // Erase tiles waiting for worker that are done. + this->_pSharedTileSelectionState->tilesWaitingForWorker.erase( + std::remove_if( + this->_pSharedTileSelectionState->tilesWaitingForWorker.begin(), + this->_pSharedTileSelectionState->tilesWaitingForWorker.end(), + [](const Tile::Pointer& pTile) { + return pTile->getState() >= TileLoadState::ContentLoaded || + pTile->getState() == TileLoadState::FailedTemporarily; + }), + this->_pSharedTileSelectionState->tilesWaitingForWorker.end()); + } + + virtual bool isTickable() const noexcept override { return true; } +}; +} // namespace + +VectorTilesRasterOverlay::VectorTilesRasterOverlay( + const std::string& name, + const TilesetSource& source, + const VectorTilesRasterOverlayOptions& vectorOptions, + const CesiumRasterOverlays::RasterOverlayOptions& overlayOptions) + : CesiumRasterOverlays::RasterOverlay(name, overlayOptions), + _vectorOptions(vectorOptions), + _source(source) {} + +CesiumAsync::Future +VectorTilesRasterOverlay::createTileProvider( + const CreateRasterOverlayTileProviderParameters& parameters) const { + + return parameters.externals.asyncSystem + .createResolvedFuture( + IntrusivePointer( + new VectorTilesRasterOverlayTileProvider( + this, + parameters, + this->_source, + this->_vectorOptions))); +} + +} // namespace CesiumVectorOverlays \ No newline at end of file diff --git a/CesiumRasterOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp b/CesiumVectorOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp similarity index 96% rename from CesiumRasterOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp rename to CesiumVectorOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp index fdf74525d8..6a8107864d 100644 --- a/CesiumRasterOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp +++ b/CesiumVectorOverlays/test/TestGeoJsonDocumentRasterOverlay.cpp @@ -9,10 +9,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -26,6 +26,7 @@ using namespace CesiumAsync; using namespace CesiumGeospatial; using namespace CesiumUtility; using namespace CesiumRasterOverlays; +using namespace CesiumVectorOverlays; using namespace CesiumVectorData; const size_t BENCHMARK_ITERATIONS = 100000; @@ -149,7 +150,7 @@ TEST_CASE( std::make_shared()); const std::filesystem::path testDataPath = - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "vienna-streets.geojson"; Result docResult = GeoJsonDocument::fromGeoJson(readFile(testDataPath)); @@ -243,7 +244,7 @@ TEST_CASE( TEST_CASE("GeoJsonDocumentRasterOverlay can render lines with bounding box " "height set by pixels") { const std::filesystem::path testDataPath = - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator.geojson"; GeoJsonDocumentRasterOverlayOptions options{ @@ -273,14 +274,14 @@ TEST_CASE("GeoJsonDocumentRasterOverlay can render lines with bounding box " CesiumNativeTests::checkFilesEqual( std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / "out-equator-meridian.tga", - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator-meridian.tga"); } TEST_CASE("GeoJsonDocumentRasterOverlay can render lines with bounding box " "height set by meters") { const std::filesystem::path testDataPath = - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator.geojson"; GeoJsonDocumentRasterOverlayOptions options{ @@ -321,14 +322,14 @@ TEST_CASE("GeoJsonDocumentRasterOverlay can render lines with bounding box " CesiumNativeTests::checkFilesEqual( std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / "out-equator-meridian-meters.tga", - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator-meridian-meters.tga"); } TEST_CASE("GeoJsonDocumentRasterOverlay can correctly rasterize line strings " "wrapping around the earth") { const std::filesystem::path testDataPath = - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator.geojson"; GeoJsonDocumentRasterOverlayOptions options{ @@ -357,7 +358,7 @@ TEST_CASE("GeoJsonDocumentRasterOverlay can correctly rasterize line strings " CesiumNativeTests::checkFilesEqual( std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / "out-equator-antimeridian-1.tga", - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator-antimeridian.tga"); } @@ -377,7 +378,7 @@ TEST_CASE("GeoJsonDocumentRasterOverlay can correctly rasterize line strings " CesiumNativeTests::checkFilesEqual( std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / "out-equator-antimeridian-2.tga", - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator-antimeridian.tga"); } @@ -397,7 +398,7 @@ TEST_CASE("GeoJsonDocumentRasterOverlay can correctly rasterize line strings " CesiumNativeTests::checkFilesEqual( std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / "out-equator-antimeridian-3.tga", - std::filesystem::path(CesiumRasterOverlays_TEST_DATA_DIR) / + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR) / "equator-antimeridian.tga"); } } diff --git a/CesiumVectorOverlays/test/TestVectorTilesRasterOverlay.cpp b/CesiumVectorOverlays/test/TestVectorTilesRasterOverlay.cpp new file mode 100644 index 0000000000..3ad44610c6 --- /dev/null +++ b/CesiumVectorOverlays/test/TestVectorTilesRasterOverlay.cpp @@ -0,0 +1,183 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using CesiumAsync::AsyncSystem; +using CesiumRasterOverlays::CreateRasterOverlayTileProviderParameters; +using CesiumRasterOverlays::RasterOverlayOptions; +using CesiumUtility::IntrusivePointer; +using CesiumVectorOverlays::VectorTilesRasterOverlay; + +TEST_CASE("Test VectorTilesRasterOverlay polylines") { + const std::filesystem::path dataPath = + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR); + const std::filesystem::path inputPath = + dataPath / "ViennaStreets" / "tileset.json"; + const std::filesystem::path referencePath = + dataPath / "ViennaStreets" / "rasterized.tga"; + const std::filesystem::path tempOutPath = + std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / + "vector-tile-polylines.tga"; + + const glm::dvec2 imageSize(256, 256); + + // A rough rectangle around the Albertgarten in Vienna, as an arbitrary + // testing area. + const CesiumGeospatial::GlobeRectangle& tileGlobeRectangle = + CesiumGeospatial::GlobeRectangle{ + 0.2852306824588304, + 0.8414742026919637, + 0.28529452339585826, + 0.8415167430037157}; + + std::shared_ptr pAssetAccessor = + std::make_shared( + CesiumNativeTests::FileAccessor{}); + AsyncSystem asyncSystem{ + std::make_shared()}; + + CreateRasterOverlayTileProviderParameters parameters{ + {pAssetAccessor, nullptr, asyncSystem}}; + IntrusivePointer pOverlay; + pOverlay.emplace( + "overlay0", + "file:///" + inputPath.string(), + CesiumVectorOverlays::VectorTilesRasterOverlayOptions{ + CesiumVectorData::VectorStyle{CesiumUtility::Color(255, 0, 0, 255)}, + {}}, + RasterOverlayOptions{}); + + IntrusivePointer pActivated = + pOverlay->activate( + CesiumRasterOverlays::RasterOverlayExternals{ + .pAssetAccessor = pAssetAccessor, + .pPrepareRendererResources = nullptr, + .asyncSystem = asyncSystem, + .pCreditSystem = nullptr, + .pLogger = spdlog::default_logger()}, + CesiumGeospatial::Ellipsoid::WGS84); + + pActivated->getReadyEvent().waitInMainThread(); + + REQUIRE(pActivated->getTileProvider() != nullptr); + CesiumGeospatial::GeographicProjection projection( + CesiumGeospatial::Ellipsoid::WGS84); + const CesiumGeometry::Rectangle tileRectangle = + projection.project(tileGlobeRectangle); + + IntrusivePointer pTile = + pActivated->getTile(tileRectangle, imageSize); + pActivated->loadTile(*pTile); + while (pTile->getState() != + CesiumRasterOverlays::RasterOverlayTile::LoadState::Loaded) { + asyncSystem.dispatchMainThreadTasks(); + pActivated->tick(); + } + + REQUIRE(pTile->getImage()->width > 1); + CesiumNativeTests::writeImageToTgaFile(*pTile->getImage(), tempOutPath); + + CesiumNativeTests::checkFilesEqual(tempOutPath, referencePath); +} + +TEST_CASE("Test VectorTilesRasterOverlay polygons") { + const std::filesystem::path dataPath = + std::filesystem::path(CesiumVectorOverlays_TEST_DATA_DIR); + const std::filesystem::path inputPath = + dataPath / "switzerland" / "tileset.json"; + const std::filesystem::path referencePath = + dataPath / "switzerland" / "rasterized.tga"; + const std::filesystem::path tempOutPath = + std::filesystem::path(CESIUM_NATIVE_TEMP_DIR) / + "vector-tile-polygons.tga"; + + const glm::dvec2 imageSize(256, 256); + + // A rough rectangle around the Albertgarten in Vienna, as an arbitrary + // testing area. + const CesiumGeospatial::BoundingRegion& tileRegion = + Cesium3DTilesContent::ImplicitTilingUtilities::computeBoundingVolume( + CesiumGeospatial::BoundingRegion{ + CesiumGeospatial::GlobeRectangle{ + 0.10511435661024317, + 0.7989584641142331, + 0.18225951525130435, + 0.8348054325550944}, + 0, + 0.005, + CesiumGeospatial::Ellipsoid::WGS84}, + CesiumGeometry::QuadtreeTileID(1, 0, 0), + CesiumGeospatial::Ellipsoid::WGS84); + const CesiumGeospatial::GlobeRectangle& tileGlobeRectangle = + tileRegion.getRectangle(); + + std::shared_ptr pAssetAccessor = + std::make_shared( + CesiumNativeTests::FileAccessor{}); + AsyncSystem asyncSystem{ + std::make_shared()}; + + CreateRasterOverlayTileProviderParameters parameters{ + {pAssetAccessor, nullptr, asyncSystem}}; + RasterOverlayOptions options; + + IntrusivePointer pOverlay; + pOverlay.emplace( + "overlay0", + "file:///" + inputPath.string(), + CesiumVectorOverlays::VectorTilesRasterOverlayOptions{ + CesiumVectorData::VectorStyle{CesiumUtility::Color(255, 0, 0, 255)}, + {}}, + options); + + IntrusivePointer pActivated = + pOverlay->activate( + CesiumRasterOverlays::RasterOverlayExternals{ + .pAssetAccessor = pAssetAccessor, + .pPrepareRendererResources = nullptr, + .asyncSystem = asyncSystem, + .pCreditSystem = nullptr, + .pLogger = spdlog::default_logger()}, + CesiumGeospatial::Ellipsoid::WGS84); + + pActivated->getReadyEvent().waitInMainThread(); + + REQUIRE(pActivated->getTileProvider() != nullptr); + CesiumGeospatial::GeographicProjection projection( + CesiumGeospatial::Ellipsoid::WGS84); + const CesiumGeometry::Rectangle tileRectangle = + projection.project(tileGlobeRectangle); + + IntrusivePointer pTile = + pActivated->getTile(tileRectangle, imageSize); + pActivated->loadTile(*pTile); + while (pTile->getState() != + CesiumRasterOverlays::RasterOverlayTile::LoadState::Loaded) { + asyncSystem.dispatchMainThreadTasks(); + pActivated->tick(); + } + + REQUIRE(pTile->getImage()->width > 1); + CesiumNativeTests::writeImageToTgaFile(*pTile->getImage(), tempOutPath); + + CesiumNativeTests::checkFilesEqual(tempOutPath, referencePath); +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/subtrees/0/0/0.subtree b/CesiumVectorOverlays/test/data/ViennaStreets/0/subtrees/0/0/0.subtree new file mode 100644 index 0000000000..17fd2398cb Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/subtrees/0/0/0.subtree differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/0/0/0.glb b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/0/0/0.glb new file mode 100644 index 0000000000..e01c6f5ce1 Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/0/0/0.glb differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/0.glb b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/0.glb new file mode 100644 index 0000000000..909f99ca51 Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/0.glb differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/1.glb b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/1.glb new file mode 100644 index 0000000000..396d3fe64d Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/0/1.glb differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/0.glb b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/0.glb new file mode 100644 index 0000000000..97460b1ef0 Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/0.glb differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/1.glb b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/1.glb new file mode 100644 index 0000000000..23e2b97550 Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/0/tiles/1/1/1.glb differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/rasterized.tga b/CesiumVectorOverlays/test/data/ViennaStreets/rasterized.tga new file mode 100644 index 0000000000..ec6fcd252b Binary files /dev/null and b/CesiumVectorOverlays/test/data/ViennaStreets/rasterized.tga differ diff --git a/CesiumVectorOverlays/test/data/ViennaStreets/tileset.json b/CesiumVectorOverlays/test/data/ViennaStreets/tileset.json new file mode 100644 index 0000000000..35951c130d --- /dev/null +++ b/CesiumVectorOverlays/test/data/ViennaStreets/tileset.json @@ -0,0 +1,38 @@ +{ + "asset": { + "version": "1.1" + }, + "geometricError": 3863.7859884626714, + "root": { + "boundingVolume": { + "region": [0.2847674617338015, 0.8410564758787692, 0.2867604043374349, 0.8416788934512869, 0.0, 0.005] + }, + "geometricError": 1931.8929942313357, + "refine": "REPLACE", + "children": [{ + "boundingVolume": { + "region": [0.2847674617338015, 0.8410564758787692, 0.2867604043374349, 0.8416788934512869, 0.0, 0.005] + }, + "geometricError": 965.9464971156679, + "refine": "REPLACE", + "content": { + "uri": "0/tiles/{level}/{x}/{y}.glb" + }, + "implicitTiling": { + "subdivisionScheme": "QUADTREE", + "subtreeLevels": 5, + "availableLevels": 1, + "subtrees": { + "uri": "0/subtrees/{level}/{x}/{y}.subtree" + } + } + }] + }, + "extensionsUsed": ["3DTILES_content_gltf"], + "extensions": { + "3DTILES_content_gltf": { + "extensionsRequired": ["CESIUM_mesh_vector"], + "extensionsUsed": ["CESIUM_mesh_vector"] + } + } +} \ No newline at end of file diff --git a/CesiumRasterOverlays/test/data/equator-antimeridian.tga b/CesiumVectorOverlays/test/data/equator-antimeridian.tga similarity index 100% rename from CesiumRasterOverlays/test/data/equator-antimeridian.tga rename to CesiumVectorOverlays/test/data/equator-antimeridian.tga diff --git a/CesiumRasterOverlays/test/data/equator-meridian-meters.tga b/CesiumVectorOverlays/test/data/equator-meridian-meters.tga similarity index 100% rename from CesiumRasterOverlays/test/data/equator-meridian-meters.tga rename to CesiumVectorOverlays/test/data/equator-meridian-meters.tga diff --git a/CesiumRasterOverlays/test/data/equator-meridian.tga b/CesiumVectorOverlays/test/data/equator-meridian.tga similarity index 100% rename from CesiumRasterOverlays/test/data/equator-meridian.tga rename to CesiumVectorOverlays/test/data/equator-meridian.tga diff --git a/CesiumRasterOverlays/test/data/equator.geojson b/CesiumVectorOverlays/test/data/equator.geojson similarity index 100% rename from CesiumRasterOverlays/test/data/equator.geojson rename to CesiumVectorOverlays/test/data/equator.geojson diff --git a/CesiumVectorOverlays/test/data/switzerland/0/subtrees/0/0/0.subtree b/CesiumVectorOverlays/test/data/switzerland/0/subtrees/0/0/0.subtree new file mode 100644 index 0000000000..466d7186d0 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/subtrees/0/0/0.subtree differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0.gltf new file mode 100644 index 0000000000..b10ae312e5 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0.gltf @@ -0,0 +1,248 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 63, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 24, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 1, + "type": "VEC3", + "max": [-62020.54296875, -13344.416015625, -314.996826171875], + "min": [-62020.54296875, -13344.416015625, -314.996826171875] + }, { + "bufferView": 16, + "componentType": 5126, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 6, + "componentType": 5126, + "count": 23, + "type": "VEC3", + "max": [228550.421875, 132681.453125, -452.6059265136719], + "min": [-109417.0390625, -96169.546875, -4170.73095703125] + }, { + "bufferView": 17, + "componentType": 5126, + "count": 23, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 1028 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 252, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 96 + }, { + "buffer": 0, + "byteOffset": 352, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 360, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 368, + "byteLength": 12 + }, { + "buffer": 0, + "byteOffset": 384, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 392, + "byteLength": 276 + }, { + "buffer": 0, + "byteOffset": 672, + "byteLength": 184 + }, { + "buffer": 0, + "byteOffset": 856, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 864, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 872, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 880, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 888, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 904, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 912, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 920, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 928, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 936, + "byteLength": 92 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "mode": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 1, + "attribute": 0, + "propertyTable": 0 + }] + } + } + }, { + "attributes": { + "_FEATURE_ID_0": 7, + "POSITION": 6 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 23, + "attribute": 0, + "propertyTable": 1 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.12952687403859836, 0.0, -0.9915759118200628, 0.0, -0.7209565861361307, 0.6865510672834926, 0.09417660494429031, 0.0, 0.6807675005526665, 0.7270815855266155, -0.08892681361309424, 0.0, 4349731.986851681, 4614553.887732251, -568193.7010031352, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + }, + "vector_point": { + "name": "vector_point", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_point", + "class": "vector_point", + "count": 1, + "properties": { + "_id": { + "values": 10, + "stringOffsets": 11 + }, + "name": { + "values": 8, + "stringOffsets": 9 + } + } + }, { + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 14, + "stringOffsets": 15 + }, + "name": { + "values": 12, + "stringOffsets": 13 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0_0.bin new file mode 100644 index 0000000000..d92c2cedeb Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/0/0/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0.gltf new file mode 100644 index 0000000000..86dc14d919 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0.gltf @@ -0,0 +1,248 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 21, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 10, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 1, + "type": "VEC3", + "max": [-14204.583984375, 11952.7431640625, -27.00537872314453], + "min": [-14204.583984375, 11952.7431640625, -27.00537872314453] + }, { + "bufferView": 16, + "componentType": 5126, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 6, + "componentType": 5126, + "count": 9, + "type": "VEC3", + "max": [109264.890625, 44526.6953125, -47.362091064453125], + "min": [-61392.5625, -70485.4609375, -1066.6416015625] + }, { + "bufferView": 17, + "componentType": 5126, + "count": 9, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 468 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 84, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 40 + }, { + "buffer": 0, + "byteOffset": 128, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 136, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 12 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 108 + }, { + "buffer": 0, + "byteOffset": 280, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 352, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 360, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 368, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 376, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 384, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 400, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 408, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 416, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 424, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 432, + "byteLength": 36 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "mode": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 1, + "attribute": 0, + "propertyTable": 0 + }] + } + } + }, { + "attributes": { + "_FEATURE_ID_0": 7, + "POSITION": 6 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 9, + "attribute": 0, + "propertyTable": 1 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.11873494091403396, 0.0, -0.9929259860665048, 0.0, -0.7191925127131569, 0.6894677980713533, 0.0860016574257457, 0.0, 0.6845904932611002, 0.7243163365703135, -0.08186391826613121, 0.0, 4374099.849918104, 4596941.764892813, -523058.61113531666, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + }, + "vector_point": { + "name": "vector_point", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_point", + "class": "vector_point", + "count": 1, + "properties": { + "_id": { + "values": 10, + "stringOffsets": 11 + }, + "name": { + "values": 8, + "stringOffsets": 9 + } + } + }, { + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 14, + "stringOffsets": 15 + }, + "name": { + "values": 12, + "stringOffsets": 13 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0_0.bin new file mode 100644 index 0000000000..b54f2b28e3 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1.gltf new file mode 100644 index 0000000000..bfa63bcc2c --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 15, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 8, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 7, + "type": "VEC3", + "max": [74803.3515625, 35316.1875, -22.49281120300293], + "min": [-85000.9921875, -55030.7890625, -801.9768676757813] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 7, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 324 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 60, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 104, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 84 + }, { + "buffer": 0, + "byteOffset": 200, + "byteLength": 56 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 272, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 280, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 288, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 296, + "byteLength": 28 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 7, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.12624497487083472, 0.0, -0.9919990959269378, 0.0, -0.7290713632581303, 0.6781195216436783, 0.09278395142846668, 0.0, 0.6726939524009367, 0.734951640834789, -0.08560918196932865, 0.0, 4298312.5650640875, 4664682.903230888, -547016.9922447944, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1_0.bin new file mode 100644 index 0000000000..58e97af0b6 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/0/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0.gltf new file mode 100644 index 0000000000..98813975ff --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 21, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 10, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 9, + "type": "VEC3", + "max": [99187.6171875, 51083.171875, -9.111007690429688], + "min": [-69046.234375, -38319.22265625, -974.8004150390625] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 9, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 404 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 84, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 40 + }, { + "buffer": 0, + "byteOffset": 128, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 136, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 108 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 328, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 344, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 352, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 360, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 368, + "byteLength": 36 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 9, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.1586035378654843, 0.0, -0.9873423508472388, 0.0, -0.7144309482207674, 0.690230152557063, 0.11476391734961425, 0.0, 0.6814934614513388, 0.7235898952452652, -0.10947294413698315, 0.0, 4354296.393426199, 4592315.111855932, -699460.3364473367, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0_0.bin new file mode 100644 index 0000000000..ed47faee77 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1.gltf new file mode 100644 index 0000000000..9f2fe4e016 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 24, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 11, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 10, + "type": "VEC3", + "max": [88501.859375, 65339.16015625, -37.538719177246094], + "min": [-80041.515625, -48569.6484375, -781.1781616210938] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 10, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 440 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 96, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 44 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 152, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 120 + }, { + "buffer": 0, + "byteOffset": 280, + "byteLength": 80 + }, { + "buffer": 0, + "byteOffset": 360, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 376, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 384, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 392, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 400, + "byteLength": 40 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 10, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.16128147399386858, 0.0, -0.9869084487156675, 0.0, -0.724657879143784, 0.6788568742224892, 0.1184242480056547, 0.0, 0.6699695846388837, 0.7342706206303448, -0.10948703730547328, 0.0, 4280890.283176197, 4660344.8545380365, -699586.9736196795, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1_0.bin new file mode 100644 index 0000000000..94482e53eb Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/1/1/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0.gltf new file mode 100644 index 0000000000..9ba7a9cbd3 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 9, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 8, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 7, + "type": "VEC3", + "max": [45092.48046875, 12190.2099609375, -13.150993347167969], + "min": [-40426.2265625, -36790.65234375, -265.3970947265625] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 7, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 300 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 36, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 40, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 72, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 84 + }, { + "buffer": 0, + "byteOffset": 176, + "byteLength": 56 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 264, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 272, + "byteLength": 28 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 7, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.11401954914563536, 0.0, -0.9934785062660522, 0.0, -0.7168398718616209, 0.6923670980460026, 0.08227028414179788, 0.0, 0.6878518303545038, 0.7215454258349623, -0.07894338436247712, 0.0, 4394878.586488654, 4579294.294776257, -504391.4607318632, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0_0.bin new file mode 100644 index 0000000000..1666c53ee2 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1.gltf new file mode 100644 index 0000000000..e61a534ff2 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1.gltf @@ -0,0 +1,248 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 18, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 9, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 1, + "type": "VEC3", + "max": [6867.89111328125, 1602.935791015625, -3.8928141593933105], + "min": [6867.89111328125, 1602.935791015625, -3.8928141593933105] + }, { + "bufferView": 16, + "componentType": 5126, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 6, + "componentType": 5126, + "count": 8, + "type": "VEC3", + "max": [44934.78125, 33390.08203125, -6.413372993469238], + "min": [-40169.8359375, -23850.353515625, -242.5794219970703] + }, { + "bufferView": 17, + "componentType": 5126, + "count": 8, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 424 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 72, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 72, + "byteLength": 36 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 120, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 128, + "byteLength": 12 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 152, + "byteLength": 96 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 64 + }, { + "buffer": 0, + "byteOffset": 312, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 320, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 328, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 336, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 344, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 360, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 368, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 376, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 384, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 392, + "byteLength": 32 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "mode": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 1, + "attribute": 0, + "propertyTable": 0 + }] + } + } + }, { + "attributes": { + "_FEATURE_ID_0": 7, + "POSITION": 6 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 8, + "attribute": 0, + "propertyTable": 1 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.11397460211319871, 0.0, -0.9934836637172945, 0.0, -0.720707232736441, 0.6882913051365256, 0.08268109792957277, 0.0, 0.6838061675317936, 0.7254344072853576, -0.07844772764090975, 0.0, 4369112.2934561875, 4604062.773495539, -501234.04482698743, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + }, + "vector_point": { + "name": "vector_point", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_point", + "class": "vector_point", + "count": 1, + "properties": { + "_id": { + "values": 10, + "stringOffsets": 11 + }, + "name": { + "values": 8, + "stringOffsets": 9 + } + } + }, { + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 14, + "stringOffsets": 15 + }, + "name": { + "values": 12, + "stringOffsets": 13 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1_0.bin new file mode 100644 index 0000000000..6c55d1a10e Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2.gltf new file mode 100644 index 0000000000..d61a758887 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 9, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 5, + "type": "VEC3", + "max": [26108.681640625, 23549.765625, -32.14739227294922], + "min": [-49352.8125, -33532.9765625, -278.1030578613281] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 5, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "2_0.bin", + "byteLength": 244 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 36, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 40, + "byteLength": 24 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 72, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 60 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 40 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 200, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 208, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 224, + "byteLength": 20 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 5, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.11815435504334383, 0.0, -0.9929952408668892, 0.0, -0.7274828656776483, 0.6806436420522631, 0.08656161204175233, 0.0, 0.6758758972842038, 0.7326146548724167, -0.08042101054103774, 0.0, 4318594.482147623, 4649796.656598669, -513860.21275030077, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2_0.bin new file mode 100644 index 0000000000..10d495f245 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/2_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3.gltf new file mode 100644 index 0000000000..56593ae85b --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 5, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [14246.310546875, 14692.236328125, -18.53329086303711], + "min": [-15254.6044921875, -10266.255859375, -35.1523551940918] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 4, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "3_0.bin", + "byteLength": 200 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 24, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 24, + "byteLength": 20 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 56, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 176, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 16 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 4, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.12081601693793728, 0.0, -0.9926749166022338, 0.0, -0.7308203989465292, 0.6767496519846399, 0.0889463491229665, 0.0, 0.6717924043444433, 0.7362132221976653, -0.08176219741691942, 0.0, 4292578.707351824, 4672719.199531177, -522439.1723223682, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3_0.bin new file mode 100644 index 0000000000..21773e6393 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/0/3_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0.gltf new file mode 100644 index 0000000000..004bedaf0c --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 12, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 7, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [46968.9296875, 29776.17578125, -46.734718322753906], + "min": [-38636.8359375, -27415.23046875, -241.14227294921875] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 6, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 280 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 48, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 28 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 240, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 24 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 6, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.13269007930091703, 0.0, -0.9911575772071344, 0.0, -0.7132691529966403, 0.6943551978049597, 0.09548808650659515, 0.0, 0.6882154155775443, 0.7196324473515876, -0.09213404625974402, 0.0, 4397160.915851431, 4567111.267709436, -588664.8541468867, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0_0.bin new file mode 100644 index 0000000000..c80c0ea6c5 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1.gltf new file mode 100644 index 0000000000..3fe85da8bd --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 5, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [42574.23046875, 28687.345703125, -203.79733276367188], + "min": [-42574.23046875, -28389.419921875, -205.11846923828125] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 4, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 200 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 24, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 24, + "byteLength": 20 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 56, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 176, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 16 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 4, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.13364274095011183, 0.0, -0.9910295746300114, 0.0, -0.7194286277914724, 0.6877573776068883, 0.09701669475598168, 0.0, 0.6815879013784066, 0.7259406239819455, -0.09191378105204562, 0.0, 4354949.647544767, 4607286.9132514205, -587275.518810719, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1_0.bin new file mode 100644 index 0000000000..662f0f1b3d Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2.gltf new file mode 100644 index 0000000000..8f1b06b718 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 5, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [42174.671875, 28689.7421875, -201.1509552001953], + "min": [-42174.671875, -28392.14453125, -202.47071838378906] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 4, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "2_0.bin", + "byteLength": 200 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 24, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 24, + "byteLength": 20 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 56, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 176, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 16 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 4, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.13364274095011183, 0.0, -0.9910295746300114, 0.0, -0.7255078715498803, 0.6812241543458747, 0.09783649551629783, 0.0, 0.6751132839090814, 0.7320748947585541, -0.09104066318820472, 0.0, 4313710.211392141, 4646358.539507289, -581714.2808580255, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2_0.bin new file mode 100644 index 0000000000..9b7ed1ea95 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/2_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3.gltf new file mode 100644 index 0000000000..19e560eed0 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 12, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 7, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [50608.42578125, 17447.7734375, -28.01176643371582], + "min": [-32934.796875, -16176.8701171875, -220.74705505371094] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 6, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "3_0.bin", + "byteLength": 280 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 48, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 28 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 240, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 24 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 6, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.13162068994743398, 0.0, -0.9913001533227771, 0.0, -0.7304385926832391, 0.6760572853465621, 0.09698458253127722, 0.0, 0.6701756906190275, 0.736849066586799, -0.08898312634130376, 0.0, 4282261.801468356, 4676769.596897343, -568580.818791906, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3_0.bin new file mode 100644 index 0000000000..15409442d3 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/1/3_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0.gltf new file mode 100644 index 0000000000..ad4a7523f7 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 12, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 7, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [42046.59375, 15763.6796875, -22.414377212524414], + "min": [-25055.978515625, -16087.126953125, -157.86013793945313] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 6, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "0_0.bin", + "byteLength": 280 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 48, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 28 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 240, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 24 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 6, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.14878931925554315, 0.0, -0.988868918752871, 0.0, -0.713127509825461, 0.6927740167681589, 0.10730012311757973, 0.0, 0.6850626929016125, 0.7211547418487316, -0.10307737435286257, 0.0, 4377049.71707511, 4576806.150635729, -658589.056042553, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0_0.bin new file mode 100644 index 0000000000..19430d56f2 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/0_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1.gltf new file mode 100644 index 0000000000..705b585098 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 12, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 7, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [33316.95703125, 33205.85546875, -40.15726089477539], + "min": [-51756.14453125, -24071.16796875, -292.2671203613281] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 6, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 280 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 48, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 28 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 240, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 24 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 6, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.15478506069611894, 0.0, -0.9879481691795876, 0.0, -0.7167169957433879, 0.688264205573533, 0.11229038845246785, 0.0, 0.679969361808215, 0.7254601183567801, -0.10653301683466533, 0.0, 4344597.944820786, 4604226.529050906, -680682.3248103786, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1_0.bin new file mode 100644 index 0000000000..634cf09d8b Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2.gltf new file mode 100644 index 0000000000..af0fe403dd --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 5, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 4, + "type": "VEC3", + "max": [42174.671875, 28689.7421875, -201.1509552001953], + "min": [-42174.671875, -28392.14453125, -202.47071838378906] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 4, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "2_0.bin", + "byteLength": 200 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 24, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 24, + "byteLength": 20 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 56, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 160, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 176, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 16 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 4, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.1527299853398251, 0.0, -0.9882679553532516, 0.0, -0.7234861594084832, 0.6812241543458746, 0.11180978794412798, 0.0, 0.6732320021526454, 0.7320748947585541, -0.1040433551063802, 0.0, 4301689.555723431, 4646358.539507289, -664796.4038733583, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2_0.bin new file mode 100644 index 0000000000..9b7ed1ea95 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/2_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3.gltf new file mode 100644 index 0000000000..9e5edf189d --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 12, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 7, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 6, + "type": "VEC3", + "max": [50975.00390625, 31387.6171875, -57.148521423339844], + "min": [-32568.201171875, -25620.048828125, -254.3312530517578] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 6, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "3_0.bin", + "byteLength": 280 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 48, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 48, + "byteLength": 28 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 88, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 72 + }, { + "buffer": 0, + "byteOffset": 168, + "byteLength": 48 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 232, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 240, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 248, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 24 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 6, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.15062986366752723, 0.0, -0.9885902306676423, 0.0, -0.729431546447959, 0.6749644525114558, 0.11114228219921447, 0.0, 0.6672632638007588, 0.7378502475746084, -0.10166980346222773, 0.0, 4263673.240851292, 4683147.305361349, -649648.8626623198, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3_0.bin new file mode 100644 index 0000000000..ef53e1a4ac Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/2/3_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1.gltf new file mode 100644 index 0000000000..e434a381db --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 9, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 5, + "type": "VEC3", + "max": [41827.92578125, 26806.783203125, -61.17095947265625], + "min": [-41493.96484375, -27694.400390625, -193.32501220703125] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 5, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "1_0.bin", + "byteLength": 244 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 36, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 40, + "byteLength": 24 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 72, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 60 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 40 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 200, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 208, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 224, + "byteLength": 20 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 5, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.17154025724543065, 0.0, -0.9851771110537291, 0.0, -0.7153798634785025, 0.6875432736342824, 0.12456282675715831, 0.0, 0.6773518960434457, 0.726143406552903, -0.11794135002659029, 0.0, 4327888.321725694, 4608578.460416425, -753577.2681972428, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1_0.bin new file mode 100644 index 0000000000..73ff5fd77f Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/1_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2.gltf new file mode 100644 index 0000000000..2520db5d33 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 15, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 8, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 7, + "type": "VEC3", + "max": [49305.31640625, 32848.734375, -18.5810604095459], + "min": [-34961.80078125, -24233.58203125, -226.5293731689453] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 7, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "2_0.bin", + "byteLength": 324 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 60, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 32 + }, { + "buffer": 0, + "byteOffset": 96, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 104, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 112, + "byteLength": 84 + }, { + "buffer": 0, + "byteOffset": 200, + "byteLength": 56 + }, { + "buffer": 0, + "byteOffset": 256, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 272, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 280, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 288, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 296, + "byteLength": 28 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 7, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.1701354534218595, 0.0, -0.9854206855393987, 0.0, -0.7209584031233043, 0.6817073185664577, 0.12447535008516826, 0.0, 0.6717684931989839, 0.7316249939777414, -0.1159825837453043, 0.0, 4292328.809932075, 4643492.821515282, -741081.7725160354, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2_0.bin new file mode 100644 index 0000000000..6a5fcadfc7 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/2_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3.gltf b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3.gltf new file mode 100644 index 0000000000..5ff53e2454 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3.gltf @@ -0,0 +1,163 @@ +{ + "extensionsUsed": ["EXT_mesh_features", "EXT_structural_metadata", "EXT_mesh_polygon"], + "accessors": [{ + "bufferView": 0, + "componentType": 5125, + "count": 9, + "type": "SCALAR" + }, { + "bufferView": 1, + "componentType": 5125, + "count": 6, + "type": "SCALAR" + }, { + "bufferView": 2, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 3, + "componentType": 5125, + "count": 1, + "type": "SCALAR" + }, { + "bufferView": 4, + "componentType": 5126, + "count": 5, + "type": "VEC3", + "max": [9794.4306640625, 19707.04296875, -12.741253852844238], + "min": [-12522.4755859375, -11530.8798828125, -42.62399673461914] + }, { + "bufferView": 10, + "componentType": 5126, + "count": 5, + "type": "SCALAR" + }], + "asset": { + "version": "2.0" + }, + "buffers": [{ + "uri": "3_0.bin", + "byteLength": 244 + }], + "bufferViews": [{ + "buffer": 0, + "byteLength": 36, + "target": 34963 + }, { + "buffer": 0, + "byteOffset": 40, + "byteLength": 24 + }, { + "buffer": 0, + "byteOffset": 64, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 72, + "byteLength": 4 + }, { + "buffer": 0, + "byteOffset": 80, + "byteLength": 60 + }, { + "buffer": 0, + "byteOffset": 144, + "byteLength": 40 + }, { + "buffer": 0, + "byteOffset": 184, + "byteLength": 11 + }, { + "buffer": 0, + "byteOffset": 200, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 208, + "byteLength": 3 + }, { + "buffer": 0, + "byteOffset": 216, + "byteLength": 8 + }, { + "buffer": 0, + "byteOffset": 224, + "byteLength": 20 + }], + "meshes": [{ + "primitives": [{ + "attributes": { + "_FEATURE_ID_0": 5, + "POSITION": 4 + }, + "indices": 0, + "extensions": { + "EXT_mesh_features": { + "featureIds": [{ + "featureCount": 5, + "attribute": 0, + "propertyTable": 0 + }] + }, + "EXT_mesh_polygon": { + "count": 1, + "loopIndices": 1, + "loopIndicesOffsets": 2, + "indicesOffsets": 3 + } + } + }] + }], + "nodes": [{ + "matrix": [-0.1651045772413886, 0.0, -0.9862760661062107, 0.0, -0.7262410538601671, 0.676604497445039, 0.12157419843544184, 0.0, 0.6673188220498627, 0.7363466262821785, -0.11171049951028536, 0.0, 4263996.494183882, 4673568.994774677, -713801.5031738383, 1.0], + "mesh": 0 + }], + "scene": 0, + "scenes": [{ + "nodes": [0] + }], + "extensions": { + "EXT_structural_metadata": { + "schema": { + "id": "schema_id", + "name": "schema_name", + "description": "description_vector", + "version": "version", + "classes": { + "vector_polygon": { + "name": "vector_polygon", + "description": "description", + "properties": { + "_id": { + "name": "_id", + "description": "attribute description", + "type": "STRING" + }, + "name": { + "name": "name", + "description": "attribute description", + "type": "STRING" + } + } + } + } + }, + "propertyTables": [{ + "name": "vector_polygon", + "class": "vector_polygon", + "count": 1, + "properties": { + "_id": { + "values": 8, + "stringOffsets": 9 + }, + "name": { + "values": 6, + "stringOffsets": 7 + } + } + }] + } + } +} \ No newline at end of file diff --git a/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3_0.bin b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3_0.bin new file mode 100644 index 0000000000..f6ca05f215 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/0/tiles/2/3/3_0.bin differ diff --git a/CesiumVectorOverlays/test/data/switzerland/rasterized.tga b/CesiumVectorOverlays/test/data/switzerland/rasterized.tga new file mode 100644 index 0000000000..67bd40f513 Binary files /dev/null and b/CesiumVectorOverlays/test/data/switzerland/rasterized.tga differ diff --git a/CesiumVectorOverlays/test/data/switzerland/tileset.json b/CesiumVectorOverlays/test/data/switzerland/tileset.json new file mode 100644 index 0000000000..612b4bc7d6 --- /dev/null +++ b/CesiumVectorOverlays/test/data/switzerland/tileset.json @@ -0,0 +1,37 @@ +{ + "asset": { + "version": "1.1" + }, + "geometricError": 157423.360580457, + "root": { + "boundingVolume": { + "region": [0.10511435661024317, 0.7989584641142331, 0.18225951525130435, 0.8348054325550944, 0.0, 0.005] + }, + "geometricError": 78711.6802902285, + "refine": "REPLACE", + "children": [{ + "boundingVolume": { + "region": [0.10511435661024317, 0.7989584641142331, 0.18225951525130435, 0.8348054325550944, 0.0, 0.005] + }, + "geometricError": 39355.84014511425, + "refine": "REPLACE", + "content": { + "uri": "0/tiles/{level}/{x}/{y}.gltf", + "extensions": { + "3DTILES_content_gltf_vector": { + "vector": true + } + } + }, + "implicitTiling": { + "subdivisionScheme": "QUADTREE", + "subtreeLevels": 2, + "availableLevels": 2, + "subtrees": { + "uri": "0/subtrees/{level}/{x}/{y}.subtree" + } + } + }] + }, + "extensionsUsed": ["3DTILES_content_gltf_vector"] +} \ No newline at end of file diff --git a/CesiumRasterOverlays/test/data/vienna-streets.geojson b/CesiumVectorOverlays/test/data/vienna-streets.geojson similarity index 100% rename from CesiumRasterOverlays/test/data/vienna-streets.geojson rename to CesiumVectorOverlays/test/data/vienna-streets.geojson diff --git a/README.md b/README.md index 3e1a65e32c..890e1bb831 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ Cesium Native powers Cesium's runtime integrations for [Cesium for Unreal](https | **CesiumRasterOverlays** | Classes for raster overlays, which allow draping massive 2D textures over a model. | | **CesiumUtility** | Utility functions for JSON parsing, URI processing, credits, etc. | | **CesiumVectorData** | Classes for loading vector data such as GeoJSON. | +| **CesiumVectorOverlays** | Raster overlays for displaying vector data. | ## đŸ“—License diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 015439bfe2..eb36a9d1e1 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -23,6 +23,7 @@ if(DOXYGEN_FOUND) ../CesiumClientCommon/include ../CesiumIonClient/include ../CesiumITwinClient/include + ../CesiumVectorOverlays/include ../CesiumVectorData/include ../CesiumJsonReader/include ../CesiumJsonWriter/include diff --git a/tools/generate-classes/glTF.json b/tools/generate-classes/glTF.json index a688029a89..d5d6dd600f 100644 --- a/tools/generate-classes/glTF.json +++ b/tools/generate-classes/glTF.json @@ -177,6 +177,9 @@ }, "EXT_mesh_primitive_edge_visibility glTF Mesh Primitive Extension": { "overrideName": "ExtensionExtMeshPrimitiveEdgeVisibility" + }, + "EXT_mesh_polygon glTF Mesh Primitive Extension": { + "overrideName": "ExtensionExtMeshPolygon" } }, "extensions": [ @@ -322,6 +325,13 @@ "attachTo": [ "mesh.primitive" ] + }, + { + "extensionName": "EXT_mesh_polygon", + "schema": "Vendor/EXT_mesh_polygon/EXT_mesh_polygon.schema.json", + "attachTo": [ + "mesh.primitive" + ] } ] }