From 7fdc99b26a85d070ad81d7fb762d6038c4ec0933 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 3 Dec 2024 18:38:31 +1100 Subject: [PATCH 01/33] Overlay tiles with a subset do not have more detail. --- .../src/QuadtreeRasterOverlayTileProvider.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp b/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp index 8c7c451aa..ca56a12d8 100644 --- a/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp +++ b/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp @@ -663,7 +663,11 @@ QuadtreeRasterOverlayTileProvider::combineImages( continue; } - result.moreDetailAvailable |= loaded.moreDetailAvailable; + // Tiles with a subset inherently have no more detail available (otherwise + // we wouldn't need the subset). + if (!it->subset) { + result.moreDetailAvailable |= loaded.moreDetailAvailable; + } blitImage( target, From b0066a30dd1b74302f7036e7e6ecb6e7e05ff6b4 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 3 Dec 2024 18:46:24 +1100 Subject: [PATCH 02/33] Overlay tiles with a subset do not have any more detail available. --- CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp b/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp index ca56a12d8..b7b19ae13 100644 --- a/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp +++ b/CesiumRasterOverlays/src/QuadtreeRasterOverlayTileProvider.cpp @@ -665,7 +665,7 @@ QuadtreeRasterOverlayTileProvider::combineImages( // Tiles with a subset inherently have no more detail available (otherwise // we wouldn't need the subset). - if (!it->subset) { + if (!it->pValue->subset) { result.moreDetailAvailable |= loaded.moreDetailAvailable; } From 201dd4e8bc5bfc495477efd4387d58ee06483a89 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 3 Dec 2024 18:48:44 +1100 Subject: [PATCH 03/33] Update CHANGES.md. --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f8dc996af..d7df6be65 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,9 @@ ### ? - ? ##### Fixes :wrench: + - Fixed a bug in `thenPassThrough` that caused a compiler error when given a value by r-value refrence. +- Fixed a raster overlay bug that could cause unnecessary upsampling with failed or missing overlay tiles. ### v0.42.0 - 2024-12-02 From 2cecb292494cc9bc3e1e5dd92a091d6c0d2d1c6d Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Tue, 3 Dec 2024 15:45:30 -0500 Subject: [PATCH 04/33] Add other libraries to README --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e910d3ad9..5a8f45da1 100644 --- a/README.md +++ b/README.md @@ -19,19 +19,23 @@ Cesium Native powers Cesium's runtime integrations for [Cesium for Unreal](https | Library | Description | | -- | -- | | **Cesium3DTiles** | Lightweight 3D Tiles classes. | +| **Cesium3DTilesContent** | Classes that support loading and converting 3D Tiles tile content. | | **Cesium3DTilesReader** | 3D Tiles deserialization, including 3D Tiles extension support. | | **Cesium3DTilesWriter** | 3D Tiles serialization, including 3D Tiles extension support. | -| **Cesium3DTilesSelection** | Runtime streaming, decoding, level of detail selection, culling, cache management, and decoding of 3D Tiles. | +| **Cesium3DTilesSelection** | Runtime streaming, level of detail selection, culling, cache management, and decoding of 3D Tiles. | | **CesiumAsync** | Classes for multi-threaded asynchronous tasks. | | **CesiumGeometry** | Common 3D geometry classes; and bounds testing, intersection testing, and spatial indexing algorithms. | | **CesiumGeospatial** | 3D geospatial math types and functions for ellipsoids, transforms, projections. | | **CesiumGltf** | Lightweight glTF processing and optimization functions. | +| **CesiumGltfContent** | Classes that support manipulating the content of a glTF. | | **CesiumGltfReader** | glTF deserialization / decoding, including glTF extension support (`KHR_draco_mesh_compression` etc). | | **CesiumGltfWriter** | glTF serialization / encoding, including glTF extension support. | | **CesiumIonClient** | Functions to access [Cesium ion](https://cesium.com/cesium-ion/) accounts and 3D tilesets using ion's REST API. | | **CesiumJsonReader** | Reads JSON from a buffer into statically-typed classes. | | **CesiumJsonWriter** | Writes JSON from statically-typed classes into a buffer. | -| **CesiumUtility** | Utility functions for JSON parsing, URI processing, etc. | +| **CesiumQuantizedMesh** | Classes for accessing terrain in the [quantized-mesh-1.0](https://github.com/CesiumGS/quantized-mesh) format. | +| **CesiumRasterOverlays** | Classes for raster overlays, which allow draping massive 2D textures over a model. | +| **CesiumUtility** | Utility functions for JSON parsing, URI processing, credits, etc. | ### 📗License @@ -101,12 +105,13 @@ Unit tests can also be run from this solution, under the cesium-native-tests pro #### Generate Documentation * Install [Doxygen](https://www.doxygen.nl/). +* Run: `npm install` * Run: `cmake --build build --target cesium-native-docs` * Open `build/doc/html/index.html` #### Regenerate glTF and 3D Tiles classes -Much of the code in `CesiumGltf`, `Cesium3DTiles`, `CesiumGltfReader`, and `Cesium3DTilesReader` is generated from the standards' JSON Schema specifications. To regenerate the code: +Much of the code in `CesiumGltf`, `Cesium3DTiles`, `CesiumGltfReader`, `Cesium3DTilesReader`, and `CesiumQuantizedMeshTerrain` is generated from the standards' JSON Schema specifications. To regenerate the code: * Make sure you have a relatively recent version of Node.js installed. * Install dependencies by running: From bb365c8aee315ddea850e3114235b3329daa0bda Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Wed, 4 Dec 2024 14:39:16 -0500 Subject: [PATCH 05/33] Dependency graph generation --- CMakeGraphVizOptions.cmake | 7 + Cesium3DTiles/include/Cesium3DTiles/Library.h | 2 + .../include/Cesium3DTilesContent/Library.h | 2 + .../include/Cesium3DTilesReader/Library.h | 2 + .../include/Cesium3DTilesSelection/Library.h | 2 + .../include/Cesium3DTilesWriter/Library.h | 2 + CesiumAsync/include/CesiumAsync/Library.h | 2 + .../include/CesiumGeometry/Library.h | 2 + CesiumGeospatial/CMakeLists.txt | 1 + .../include/CesiumGeospatial/Library.h | 2 + CesiumGltf/include/CesiumGltf/Library.h | 2 + .../include/CesiumGltfContent/Library.h | 2 + .../include/CesiumGltfReader/Library.h | 2 + .../include/CesiumGltfWriter/Library.h | 2 + .../include/CesiumIonClient/Library.h | 2 + .../include/CesiumJsonReader/Library.h | 2 + .../include/CesiumJsonWriter/Library.h | 2 + .../CesiumQuantizedMeshTerrain/Library.h | 2 + .../include/CesiumRasterOverlays/Library.h | 2 + CesiumUtility/include/CesiumUtility/Library.h | 2 + README.md | 104 +- doc/CMakeLists.txt | 5 + doc/diagrams/dependencies/Cesium3DTiles.mmd | 11 + .../dependencies/Cesium3DTilesContent.mmd | 30 + .../dependencies/Cesium3DTilesReader.mmd | 15 + .../dependencies/Cesium3DTilesSelection.mmd | 46 + .../dependencies/Cesium3DTilesWriter.mmd | 13 + doc/diagrams/dependencies/CesiumAsync.mmd | 20 + doc/diagrams/dependencies/CesiumGeometry.mmd | 11 + .../dependencies/CesiumGeospatial.mmd | 20 + doc/diagrams/dependencies/CesiumGltf.mmd | 11 + .../dependencies/CesiumGltfContent.mmd | 21 + .../dependencies/CesiumGltfReader.mmd | 30 + .../dependencies/CesiumGltfWriter.mmd | 16 + doc/diagrams/dependencies/CesiumIonClient.mmd | 22 + .../dependencies/CesiumJsonReader.mmd | 11 + .../dependencies/CesiumJsonWriter.mmd | 11 + .../CesiumQuantizedMeshTerrain.mmd | 23 + .../dependencies/CesiumRasterOverlays.mmd | 28 + doc/diagrams/dependencies/CesiumUtility.mmd | 18 + doc/diagrams/dependencies/all.mmd | 140 + doc/footer.html | 5 +- doc/img/dependency-graph.svg | 1 + package-lock.json | 7 + package.json | 3 +- tools/dep-graph-gen/.gitignore | 1 + tools/dep-graph-gen/index.js | 134 + tools/dep-graph-gen/package-lock.json | 4216 +++++++++++++++++ tools/dep-graph-gen/package.json | 17 + 49 files changed, 5008 insertions(+), 26 deletions(-) create mode 100644 CMakeGraphVizOptions.cmake create mode 100644 doc/diagrams/dependencies/Cesium3DTiles.mmd create mode 100644 doc/diagrams/dependencies/Cesium3DTilesContent.mmd create mode 100644 doc/diagrams/dependencies/Cesium3DTilesReader.mmd create mode 100644 doc/diagrams/dependencies/Cesium3DTilesSelection.mmd create mode 100644 doc/diagrams/dependencies/Cesium3DTilesWriter.mmd create mode 100644 doc/diagrams/dependencies/CesiumAsync.mmd create mode 100644 doc/diagrams/dependencies/CesiumGeometry.mmd create mode 100644 doc/diagrams/dependencies/CesiumGeospatial.mmd create mode 100644 doc/diagrams/dependencies/CesiumGltf.mmd create mode 100644 doc/diagrams/dependencies/CesiumGltfContent.mmd create mode 100644 doc/diagrams/dependencies/CesiumGltfReader.mmd create mode 100644 doc/diagrams/dependencies/CesiumGltfWriter.mmd create mode 100644 doc/diagrams/dependencies/CesiumIonClient.mmd create mode 100644 doc/diagrams/dependencies/CesiumJsonReader.mmd create mode 100644 doc/diagrams/dependencies/CesiumJsonWriter.mmd create mode 100644 doc/diagrams/dependencies/CesiumQuantizedMeshTerrain.mmd create mode 100644 doc/diagrams/dependencies/CesiumRasterOverlays.mmd create mode 100644 doc/diagrams/dependencies/CesiumUtility.mmd create mode 100644 doc/diagrams/dependencies/all.mmd create mode 100644 doc/img/dependency-graph.svg create mode 100644 tools/dep-graph-gen/.gitignore create mode 100644 tools/dep-graph-gen/index.js create mode 100644 tools/dep-graph-gen/package-lock.json create mode 100644 tools/dep-graph-gen/package.json diff --git a/CMakeGraphVizOptions.cmake b/CMakeGraphVizOptions.cmake new file mode 100644 index 000000000..50b68689e --- /dev/null +++ b/CMakeGraphVizOptions.cmake @@ -0,0 +1,7 @@ +set(GRAPHVIZ_GENERATE_PER_TARGET FALSE) +set(GRAPHVIZ_GENERATE_DEPENDERS FALSE) +set(GRAPHVIZ_OBJECT_LIBS FALSE) +list(APPEND GRAPHVIZ_IGNORE_TARGETS cesium-native-tests) +list(APPEND GRAPHVIZ_IGNORE_TARGETS "Catch2::*") +list(APPEND GRAPHVIZ_IGNORE_TARGETS "lib*.lib") +list(APPEND GRAPHVIZ_IGNORE_TARGETS "lib*.so") \ No newline at end of file diff --git a/Cesium3DTiles/include/Cesium3DTiles/Library.h b/Cesium3DTiles/include/Cesium3DTiles/Library.h index b68e1a484..924d24820 100644 --- a/Cesium3DTiles/include/Cesium3DTiles/Library.h +++ b/Cesium3DTiles/include/Cesium3DTiles/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for using [3D Tiles](https://github.com/CesiumGS/3d-tiles). + * + * @mermaid{dependencies/Cesium3DTiles} */ namespace Cesium3DTiles {} diff --git a/Cesium3DTilesContent/include/Cesium3DTilesContent/Library.h b/Cesium3DTilesContent/include/Cesium3DTilesContent/Library.h index 26f187703..4525eb28e 100644 --- a/Cesium3DTilesContent/include/Cesium3DTilesContent/Library.h +++ b/Cesium3DTilesContent/include/Cesium3DTilesContent/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes that support loading and converting 3D Tiles tile content. + * + * @mermaid{dependencies/Cesium3DTilesContent} */ namespace Cesium3DTilesContent {} diff --git a/Cesium3DTilesReader/include/Cesium3DTilesReader/Library.h b/Cesium3DTilesReader/include/Cesium3DTilesReader/Library.h index 8dc93b668..2584d5098 100644 --- a/Cesium3DTilesReader/include/Cesium3DTilesReader/Library.h +++ b/Cesium3DTilesReader/include/Cesium3DTilesReader/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for reading [3D Tiles](https://github.com/CesiumGS/3d-tiles). + * + * @mermaid{dependencies/Cesium3DTilesReader} */ namespace Cesium3DTilesReader {} diff --git a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Library.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Library.h index 7383da319..faded9753 100644 --- a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Library.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes that implement the 3D Tiles standard + * + * @mermaid{dependencies/Cesium3DTilesSelection} */ namespace Cesium3DTilesSelection {} diff --git a/Cesium3DTilesWriter/include/Cesium3DTilesWriter/Library.h b/Cesium3DTilesWriter/include/Cesium3DTilesWriter/Library.h index ea4f4c77d..aa815c82c 100644 --- a/Cesium3DTilesWriter/include/Cesium3DTilesWriter/Library.h +++ b/Cesium3DTilesWriter/include/Cesium3DTilesWriter/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for writing [3D Tiles](https://github.com/CesiumGS/3d-tiles). + * + * @mermaid{dependencies/Cesium3DTilesWriter} */ namespace Cesium3DTilesWriter {} diff --git a/CesiumAsync/include/CesiumAsync/Library.h b/CesiumAsync/include/CesiumAsync/Library.h index cd308e10b..39f3e18a3 100644 --- a/CesiumAsync/include/CesiumAsync/Library.h +++ b/CesiumAsync/include/CesiumAsync/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes that support asynchronous operations. + * + * @mermaid{dependencies/CesiumAsync} */ namespace CesiumAsync {} diff --git a/CesiumGeometry/include/CesiumGeometry/Library.h b/CesiumGeometry/include/CesiumGeometry/Library.h index 50a7029cc..a58380eb0 100644 --- a/CesiumGeometry/include/CesiumGeometry/Library.h +++ b/CesiumGeometry/include/CesiumGeometry/Library.h @@ -2,6 +2,8 @@ /** * @brief Basic geometry classes for Cesium + * + * @mermaid{dependencies/CesiumGeometry} */ namespace CesiumGeometry {} diff --git a/CesiumGeospatial/CMakeLists.txt b/CesiumGeospatial/CMakeLists.txt index ef89f439b..3301eefa1 100644 --- a/CesiumGeospatial/CMakeLists.txt +++ b/CesiumGeospatial/CMakeLists.txt @@ -43,6 +43,7 @@ PUBLIC earcut PRIVATE s2::s2 + absl::string_view ) target_compile_definitions(CesiumGeospatial PRIVATE GLM_ENABLE_EXPERIMENTAL) diff --git a/CesiumGeospatial/include/CesiumGeospatial/Library.h b/CesiumGeospatial/include/CesiumGeospatial/Library.h index 423b64ad8..215689c67 100644 --- a/CesiumGeospatial/include/CesiumGeospatial/Library.h +++ b/CesiumGeospatial/include/CesiumGeospatial/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for geospatial computations in Cesium + * + * @mermaid{dependencies/CesiumGeospatial} */ namespace CesiumGeospatial {} diff --git a/CesiumGltf/include/CesiumGltf/Library.h b/CesiumGltf/include/CesiumGltf/Library.h index 517fa6fad..6118fb7ce 100644 --- a/CesiumGltf/include/CesiumGltf/Library.h +++ b/CesiumGltf/include/CesiumGltf/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for working with [glTF](https://www.khronos.org/gltf/) models. + * + * @mermaid{dependencies/CesiumGltf} */ namespace CesiumGltf {} diff --git a/CesiumGltfContent/include/CesiumGltfContent/Library.h b/CesiumGltfContent/include/CesiumGltfContent/Library.h index 7b8ad7942..dc9211542 100644 --- a/CesiumGltfContent/include/CesiumGltfContent/Library.h +++ b/CesiumGltfContent/include/CesiumGltfContent/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes that support manipulating the content of a glTF. + * + * @mermaid{dependencies/CesiumGltfContent} */ namespace CesiumGltfContent {} diff --git a/CesiumGltfReader/include/CesiumGltfReader/Library.h b/CesiumGltfReader/include/CesiumGltfReader/Library.h index d4f85b2ae..1d5af8a24 100644 --- a/CesiumGltfReader/include/CesiumGltfReader/Library.h +++ b/CesiumGltfReader/include/CesiumGltfReader/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for reading [glTF](https://www.khronos.org/gltf/) models. + * + * @mermaid{dependencies/CesiumGltfReader} */ namespace CesiumGltfReader {} diff --git a/CesiumGltfWriter/include/CesiumGltfWriter/Library.h b/CesiumGltfWriter/include/CesiumGltfWriter/Library.h index 65c640127..52a98e5c6 100644 --- a/CesiumGltfWriter/include/CesiumGltfWriter/Library.h +++ b/CesiumGltfWriter/include/CesiumGltfWriter/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for writing [glTF](https://www.khronos.org/gltf/) models. + * + * @mermaid{dependencies/CesiumGltfWriter} */ namespace CesiumGltfWriter {} diff --git a/CesiumIonClient/include/CesiumIonClient/Library.h b/CesiumIonClient/include/CesiumIonClient/Library.h index a95a0f5ef..bb830b6ec 100644 --- a/CesiumIonClient/include/CesiumIonClient/Library.h +++ b/CesiumIonClient/include/CesiumIonClient/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for working with Cesium ion clients + * + * @mermaid{dependencies/CesiumIonClient} */ namespace CesiumIonClient {} diff --git a/CesiumJsonReader/include/CesiumJsonReader/Library.h b/CesiumJsonReader/include/CesiumJsonReader/Library.h index 1a44da88e..e2e7095f5 100644 --- a/CesiumJsonReader/include/CesiumJsonReader/Library.h +++ b/CesiumJsonReader/include/CesiumJsonReader/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for reading JSON. + * + * @mermaid{dependencies/CesiumJsonReader} */ namespace CesiumJsonReader {} diff --git a/CesiumJsonWriter/include/CesiumJsonWriter/Library.h b/CesiumJsonWriter/include/CesiumJsonWriter/Library.h index e7b1ba5f8..e4ce87e76 100644 --- a/CesiumJsonWriter/include/CesiumJsonWriter/Library.h +++ b/CesiumJsonWriter/include/CesiumJsonWriter/Library.h @@ -2,6 +2,8 @@ /** * @brief Classes for writing JSON. + * + * @mermaid{dependencies/CesiumJsonWriter} */ namespace CesiumJsonWriter {} diff --git a/CesiumQuantizedMeshTerrain/include/CesiumQuantizedMeshTerrain/Library.h b/CesiumQuantizedMeshTerrain/include/CesiumQuantizedMeshTerrain/Library.h index 16e10c1cb..b993f7f20 100644 --- a/CesiumQuantizedMeshTerrain/include/CesiumQuantizedMeshTerrain/Library.h +++ b/CesiumQuantizedMeshTerrain/include/CesiumQuantizedMeshTerrain/Library.h @@ -3,6 +3,8 @@ /** * @brief Classes for accessing terrain based on layer.json and * quantized-mesh-1.0. + * + * @mermaid{dependencies/CesiumQuantizedMeshTerrain} */ namespace CesiumQuantizedMeshTerrain {} diff --git a/CesiumRasterOverlays/include/CesiumRasterOverlays/Library.h b/CesiumRasterOverlays/include/CesiumRasterOverlays/Library.h index 873c2df2a..c000e0df4 100644 --- a/CesiumRasterOverlays/include/CesiumRasterOverlays/Library.h +++ b/CesiumRasterOverlays/include/CesiumRasterOverlays/Library.h @@ -3,6 +3,8 @@ /** * @brief Classes for raster overlays, which allow draping massive 2D textures * over a model. + * + * @mermaid{dependencies/CesiumRasterOverlays} */ namespace CesiumRasterOverlays {} diff --git a/CesiumUtility/include/CesiumUtility/Library.h b/CesiumUtility/include/CesiumUtility/Library.h index ed1ded7c0..08c49d874 100644 --- a/CesiumUtility/include/CesiumUtility/Library.h +++ b/CesiumUtility/include/CesiumUtility/Library.h @@ -2,6 +2,8 @@ /** * @brief Utility classes for Cesium + * + * @mermaid{dependencies/CesiumUtility} */ namespace CesiumUtility {} diff --git a/README.md b/README.md index 5a8f45da1..21a8e4cda 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,38 @@ + # Cesium Native +[![License](https://img.shields.io/:license-Apache_2.0-blue.svg)](https://github.com/CesiumGS/cesium-native/blob/main/LICENSE) +[![Build Status](https://github.com/CesiumGS/cesium-native/actions/workflows/build.yml/badge.svg)](https://github.com/CesiumGS/cesium-native/actions/workflows/build.yml) +[![Release](https://img.shields.io/github/v/tag/CesiumGS/cesium-native?label=release)](https://github.com/CesiumGS/cesium-native/tags) + + +## Table of Contents + +- [📖About](#about) + - [🗃️Libraries Overview](#️libraries-overview) + - [📗License](#license) + - [🔧Projects Using Cesium Native](#projects-using-cesium-native) + - [📦Dependencies](#dependencies) +- [💻Developers](#developers) + - [⭐Prerequisites](#prerequisites) + - [🚀Getting Started](#getting-started) + - [Clone the repo](#clone-the-repo) + - [Compile from command line](#compile-from-command-line) + - [Compile from Visual Studio Code](#compile-from-visual-studio-code) + - [Compile with any Visual Studio version using CMake generated projects](#compile-with-any-visual-studio-version-using-cmake-generated-projects) + - [Generate Documentation](#generate-documentation) + - [Regenerate glTF and 3D Tiles classes](#regenerate-gltf-and-3d-tiles-classes) + - [Regenerate Dependency Graphs](#regenerate-dependency-graphs) + + +## 📖About + Cesium Native is a set of C++ libraries for 3D geospatial, including: * [3D Tiles](https://github.com/CesiumGS/3d-tiles) runtime streaming -* lightweight glTF serialization and deserialization, and +* lightweight glTF serialization and deserialization * high-precision 3D geospatial math types and functions, including support for global-scale WGS84 ellipsoids. - -[![License](https://img.shields.io/:license-Apache_2.0-blue.svg)](https://github.com/CesiumGS/cesium-native/blob/main/LICENSE) -[![Build Status](https://github.com/CesiumGS/cesium-native/actions/workflows/build.yml/badge.svg)](https://github.com/CesiumGS/cesium-native/actions/workflows/build.yml) +* support for draping raster overlays from WMS, TMS, WMTS, and other sources over 3D tilesets Cesium Native powers Cesium's runtime integrations for [Cesium for Unreal](https://github.com/CesiumGS/cesium-unreal), [Cesium for Unity](https://github.com/CesiumGS/cesium-unity), [Cesium for Omniverse](https://github.com/CesiumGS/cesium-omniverse), and [Cesium for O3DE](https://github.com/CesiumGS/cesium-o3de). Cesium Native is the foundational layer for any 3D geospatial software, especially those that want to stream 3D Tiles. @@ -16,32 +41,51 @@ Cesium Native powers Cesium's runtime integrations for [Cesium for Unreal](https ### 🗃️Libraries Overview -| Library | Description | -| -- | -- | -| **Cesium3DTiles** | Lightweight 3D Tiles classes. | -| **Cesium3DTilesContent** | Classes that support loading and converting 3D Tiles tile content. | -| **Cesium3DTilesReader** | 3D Tiles deserialization, including 3D Tiles extension support. | -| **Cesium3DTilesWriter** | 3D Tiles serialization, including 3D Tiles extension support. | -| **Cesium3DTilesSelection** | Runtime streaming, level of detail selection, culling, cache management, and decoding of 3D Tiles. | -| **CesiumAsync** | Classes for multi-threaded asynchronous tasks. | -| **CesiumGeometry** | Common 3D geometry classes; and bounds testing, intersection testing, and spatial indexing algorithms. | -| **CesiumGeospatial** | 3D geospatial math types and functions for ellipsoids, transforms, projections. | -| **CesiumGltf** | Lightweight glTF processing and optimization functions. | -| **CesiumGltfContent** | Classes that support manipulating the content of a glTF. | -| **CesiumGltfReader** | glTF deserialization / decoding, including glTF extension support (`KHR_draco_mesh_compression` etc). | -| **CesiumGltfWriter** | glTF serialization / encoding, including glTF extension support. | -| **CesiumIonClient** | Functions to access [Cesium ion](https://cesium.com/cesium-ion/) accounts and 3D tilesets using ion's REST API. | -| **CesiumJsonReader** | Reads JSON from a buffer into statically-typed classes. | -| **CesiumJsonWriter** | Writes JSON from statically-typed classes into a buffer. | -| **CesiumQuantizedMesh** | Classes for accessing terrain in the [quantized-mesh-1.0](https://github.com/CesiumGS/quantized-mesh) format. | -| **CesiumRasterOverlays** | Classes for raster overlays, which allow draping massive 2D textures over a model. | -| **CesiumUtility** | Utility functions for JSON parsing, URI processing, credits, etc. | +| Library | Description | +| ------------------------------ | --------------------------------------------------------------------------------------------------------------- | +| **Cesium3DTiles** | Lightweight 3D Tiles classes. | +| **Cesium3DTilesContent** | Classes that support loading and converting 3D Tiles tile content. | +| **Cesium3DTilesReader** | 3D Tiles deserialization, including 3D Tiles extension support. | +| **Cesium3DTilesWriter** | 3D Tiles serialization, including 3D Tiles extension support. | +| **Cesium3DTilesSelection** | Runtime streaming, level of detail selection, culling, cache management, and decoding of 3D Tiles. | +| **CesiumAsync** | Classes for multi-threaded asynchronous tasks. | +| **CesiumGeometry** | Common 3D geometry classes; and bounds testing, intersection testing, and spatial indexing algorithms. | +| **CesiumGeospatial** | 3D geospatial math types and functions for ellipsoids, transforms, projections. | +| **CesiumGltf** | Lightweight glTF processing and optimization functions. | +| **CesiumGltfContent** | Classes that support manipulating the content of a glTF. | +| **CesiumGltfReader** | glTF deserialization / decoding, including glTF extension support (`KHR_draco_mesh_compression` etc). | +| **CesiumGltfWriter** | glTF serialization / encoding, including glTF extension support. | +| **CesiumIonClient** | Functions to access [Cesium ion](https://cesium.com/cesium-ion/) accounts and 3D tilesets using ion's REST API. | +| **CesiumJsonReader** | Reads JSON from a buffer into statically-typed classes. | +| **CesiumJsonWriter** | Writes JSON from statically-typed classes into a buffer. | +| **CesiumQuantizedMeshTerrain** | Classes for accessing terrain in the [quantized-mesh-1.0](https://github.com/CesiumGS/quantized-mesh) format. | +| **CesiumRasterOverlays** | Classes for raster overlays, which allow draping massive 2D textures over a model. | +| **CesiumUtility** | Utility functions for JSON parsing, URI processing, credits, etc. | ### 📗License [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). Cesium Native is free for both commercial and non-commercial use. +### 🔧Projects Using Cesium Native + +The following official Cesium integrations are built on top of Cesium Native: + +- [Cesium for Unreal](https://github.com/CesiumGS/cesium-unreal) +- [Cesium for Unity](https://github.com/CesiumGS/cesium-unity) +- [Cesium for Omniverse](https://github.com/CesiumGS/cesium-omniverse) +- [Cesium for O3DE](https://github.com/CesiumGS/cesium-o3de) + +In addition, Cesium Native has been used by the community to build projects including: +- [vsgCs](https://github.com/timoore/vsgCs) integrates Cesium Native with VulkanSceneGraph. +- [osgEarth](https://github.com/gwaldron/osgearth) uses Cesium Native to load 3D Tiles in OpenSceneGraph. + +### 📦Dependencies + +Cesium Native relies on various third-party packages to accomplish tasks like image decoding, URI parsing, and math operations. These dependencies are automatically obtained and built using [vcpkg](https://vcpkg.io/en/) when building through CMake. Below is a graph of all the Cesium Native libraries and their dependencies on third party packages and each other. [Click to view the full graph.](doc/img/dependency-graph.svg) + +![](doc/img/dependency-graph.svg) + ## 💻Developers ### ⭐Prerequisites @@ -128,3 +172,15 @@ cd ../.. * `npm run generate-3d-tiles` * `npm run generate-quantized-mesh-terrain` * On Windows, the line endings of the generated files will be different than those checked into the repo. Just `git add` them and git will fix the line endings (no need to commit). + +#### Regenerate Dependency Graphs + +The dependency graphs used in the Cesium Native documentation are generated using a script that parses CMake's GraphViz output and generates a set of Mermaid diagrams. To regenerate the graphs: + +* Make sure you have a relatively recent version of Node.js installed. +* Install dependencies by running: +``` +cd tools/dep-graph-gen +npm install +``` +* From the `tools/dep-graph-gen` directory, run `npm run generate-dep-graph` to regenerate the graphs. \ No newline at end of file diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1af199be3..5a80c00a9 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -5,6 +5,7 @@ if(DOXYGEN_FOUND) LIB_DIRS ../Cesium3DTiles/include ../Cesium3DTiles/generated/include + ../Cesium3DTilesContent/include ../Cesium3DTilesReader/include ../Cesium3DTilesReader/generated/include ../Cesium3DTilesWriter/include @@ -31,6 +32,7 @@ if(DOXYGEN_FOUND) set( DOXYGEN_EXAMPLE_PATH ../Cesium3DTiles/test + ../Cesium3DTilesContent/test ../Cesium3DTilesReader/test ../Cesium3DTilesWriter/test ../Cesium3DTilesSelection/test @@ -86,6 +88,9 @@ if(DOXYGEN_FOUND) set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "../README.md") set(DOXYGEN_EXCLUDE_PATTERNS "*/node_modules/*") set(DOXYGEN_IMAGE_PATH "./") + set(DOXYGEN_MARKDOWN_ID_STYLE GITHUB) + set(DOXYGEN_DOT_IMAGE_FORMAT svg) + set(DOXYGEN_INTERACTIVE_SVG YES) # Add support for Mermaid charts using the @mermaid command. set(DOXYGEN_HTML_EXTRA_FILES "${CMAKE_CURRENT_LIST_DIR}/assets/mermaid.min.js ${CMAKE_CURRENT_LIST_DIR}/assets/mingcute.json.js") diff --git a/doc/diagrams/dependencies/Cesium3DTiles.mmd b/doc/diagrams/dependencies/Cesium3DTiles.mmd new file mode 100644 index 000000000..3ae22fbee --- /dev/null +++ b/doc/diagrams/dependencies/Cesium3DTiles.mmd @@ -0,0 +1,11 @@ +--- +config: + layout: elk +title: Cesium3DTiles Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + Cesium3DTiles[Cesium3DTiles] --> CesiumUtility[CesiumUtility] + class CesiumUtility,Cesium3DTiles libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px diff --git a/doc/diagrams/dependencies/Cesium3DTilesContent.mmd b/doc/diagrams/dependencies/Cesium3DTilesContent.mmd new file mode 100644 index 000000000..119890f25 --- /dev/null +++ b/doc/diagrams/dependencies/Cesium3DTilesContent.mmd @@ -0,0 +1,30 @@ +--- +config: + layout: elk +title: Cesium3DTilesContent Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + Cesium3DTilesContent[Cesium3DTilesContent] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesContent[Cesium3DTilesContent] --> Cesium3DTilesReader[Cesium3DTilesReader] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumAsync[CesiumAsync] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGeometry[CesiumGeometry] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGeospatial[CesiumGeospatial] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltf[CesiumGltf] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltfContent[CesiumGltfContent] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltfReader[CesiumGltfReader] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumUtility[CesiumUtility] + Cesium3DTilesContent[Cesium3DTilesContent] --> libmorton_libmorton{{libmorton::libmorton}} + class libmorton_libmorton dependencyNode + class Cesium3DTiles,Cesium3DTilesReader,CesiumAsync,CesiumGeometry,CesiumGeospatial,CesiumGltf,CesiumGltfContent,CesiumGltfReader,CesiumUtility,Cesium3DTilesContent libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px + linkStyle 6 stroke:#af8d00,stroke-width:4px + linkStyle 7 stroke:#7f80cd,stroke-width:4px + linkStyle 8 stroke:#b3e900,stroke-width:4px + linkStyle 9 stroke:#c42e60,stroke-width:4px diff --git a/doc/diagrams/dependencies/Cesium3DTilesReader.mmd b/doc/diagrams/dependencies/Cesium3DTilesReader.mmd new file mode 100644 index 000000000..75fded025 --- /dev/null +++ b/doc/diagrams/dependencies/Cesium3DTilesReader.mmd @@ -0,0 +1,15 @@ +--- +config: + layout: elk +title: Cesium3DTilesReader Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + Cesium3DTilesReader[Cesium3DTilesReader] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesReader[Cesium3DTilesReader] --> CesiumAsync[CesiumAsync] + Cesium3DTilesReader[Cesium3DTilesReader] --> CesiumJsonReader[CesiumJsonReader] + class Cesium3DTiles,CesiumAsync,CesiumJsonReader,Cesium3DTilesReader libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px diff --git a/doc/diagrams/dependencies/Cesium3DTilesSelection.mmd b/doc/diagrams/dependencies/Cesium3DTilesSelection.mmd new file mode 100644 index 000000000..bd73ac741 --- /dev/null +++ b/doc/diagrams/dependencies/Cesium3DTilesSelection.mmd @@ -0,0 +1,46 @@ +--- +config: + layout: elk +title: Cesium3DTilesSelection Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTilesContent[Cesium3DTilesContent] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTilesReader[Cesium3DTilesReader] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumAsync[CesiumAsync] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGeometry[CesiumGeometry] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGeospatial[CesiumGeospatial] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGltf[CesiumGltf] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGltfReader[CesiumGltfReader] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumRasterOverlays[CesiumRasterOverlays] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumUtility[CesiumUtility] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> draco_draco{{draco::draco}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> libmorton_libmorton{{libmorton::libmorton}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> nonstd_expected-lite{{nonstd::expected-lite}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> spdlog_spdlog{{spdlog::spdlog}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> spdlog_spdlog_header_only{{spdlog::spdlog_header_only}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> tinyxml2_tinyxml2{{tinyxml2::tinyxml2}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> uriparser_uriparser{{uriparser::uriparser}} + class draco_draco,libmorton_libmorton,nonstd_expected-lite,spdlog_spdlog,spdlog_spdlog_header_only,tinyxml2_tinyxml2,uriparser_uriparser dependencyNode + class Cesium3DTiles,Cesium3DTilesContent,Cesium3DTilesReader,CesiumAsync,CesiumGeometry,CesiumGeospatial,CesiumGltf,CesiumGltfReader,CesiumQuantizedMeshTerrain,CesiumRasterOverlays,CesiumUtility,Cesium3DTilesSelection libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px + linkStyle 6 stroke:#af8d00,stroke-width:4px + linkStyle 7 stroke:#7f80cd,stroke-width:4px + linkStyle 8 stroke:#b3e900,stroke-width:4px + linkStyle 9 stroke:#c42e60,stroke-width:4px + linkStyle 10 stroke:#a65628,stroke-width:4px + linkStyle 11 stroke:#f781bf,stroke-width:4px + linkStyle 12 stroke:#8dd3c7,stroke-width:4px + linkStyle 13 stroke:#bebada,stroke-width:4px + linkStyle 14 stroke:#fb8072,stroke-width:4px + linkStyle 15 stroke:#80b1d3,stroke-width:4px + linkStyle 16 stroke:#fdb462,stroke-width:4px + linkStyle 17 stroke:#fccde5,stroke-width:4px diff --git a/doc/diagrams/dependencies/Cesium3DTilesWriter.mmd b/doc/diagrams/dependencies/Cesium3DTilesWriter.mmd new file mode 100644 index 000000000..27429f496 --- /dev/null +++ b/doc/diagrams/dependencies/Cesium3DTilesWriter.mmd @@ -0,0 +1,13 @@ +--- +config: + layout: elk +title: Cesium3DTilesWriter Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + Cesium3DTilesWriter[Cesium3DTilesWriter] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesWriter[Cesium3DTilesWriter] --> CesiumJsonWriter[CesiumJsonWriter] + class Cesium3DTiles,CesiumJsonWriter,Cesium3DTilesWriter libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumAsync.mmd b/doc/diagrams/dependencies/CesiumAsync.mmd new file mode 100644 index 000000000..10147cdce --- /dev/null +++ b/doc/diagrams/dependencies/CesiumAsync.mmd @@ -0,0 +1,20 @@ +--- +config: + layout: elk +title: CesiumAsync Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumAsync[CesiumAsync] --> Async_{{Async++}} + CesiumAsync[CesiumAsync] --> CesiumUtility[CesiumUtility] + CesiumAsync[CesiumAsync] --> spdlog_spdlog{{spdlog::spdlog}} + CesiumAsync[CesiumAsync] --> spdlog_spdlog_header_only{{spdlog::spdlog_header_only}} + CesiumAsync[CesiumAsync] --> unofficial_sqlite3_sqlite3{{unofficial::sqlite3::sqlite3}} + class Async_,spdlog_spdlog,spdlog_spdlog_header_only,unofficial_sqlite3_sqlite3 dependencyNode + class CesiumUtility,CesiumAsync libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGeometry.mmd b/doc/diagrams/dependencies/CesiumGeometry.mmd new file mode 100644 index 000000000..0419e3972 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGeometry.mmd @@ -0,0 +1,11 @@ +--- +config: + layout: elk +title: CesiumGeometry Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGeometry[CesiumGeometry] --> CesiumUtility[CesiumUtility] + class CesiumUtility,CesiumGeometry libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGeospatial.mmd b/doc/diagrams/dependencies/CesiumGeospatial.mmd new file mode 100644 index 000000000..02361bbc3 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGeospatial.mmd @@ -0,0 +1,20 @@ +--- +config: + layout: elk +title: CesiumGeospatial Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGeospatial[CesiumGeospatial] --> CesiumGeometry[CesiumGeometry] + CesiumGeospatial[CesiumGeospatial] --> CesiumUtility[CesiumUtility] + CesiumGeospatial[CesiumGeospatial] --> absl_string_view{{absl::string_view}} + CesiumGeospatial[CesiumGeospatial] --> earcut{{earcut}} + CesiumGeospatial[CesiumGeospatial] --> s2_s2{{s2::s2}} + class absl_string_view,earcut,s2_s2 dependencyNode + class CesiumGeometry,CesiumUtility,CesiumGeospatial libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGltf.mmd b/doc/diagrams/dependencies/CesiumGltf.mmd new file mode 100644 index 000000000..f693da2bc --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGltf.mmd @@ -0,0 +1,11 @@ +--- +config: + layout: elk +title: CesiumGltf Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGltf[CesiumGltf] --> CesiumUtility[CesiumUtility] + class CesiumUtility,CesiumGltf libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGltfContent.mmd b/doc/diagrams/dependencies/CesiumGltfContent.mmd new file mode 100644 index 000000000..0f27d77ae --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGltfContent.mmd @@ -0,0 +1,21 @@ +--- +config: + layout: elk +title: CesiumGltfContent Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGltfContent[CesiumGltfContent] --> CesiumAsync[CesiumAsync] + CesiumGltfContent[CesiumGltfContent] --> CesiumGeometry[CesiumGeometry] + CesiumGltfContent[CesiumGltfContent] --> CesiumGeospatial[CesiumGeospatial] + CesiumGltfContent[CesiumGltfContent] --> CesiumGltf[CesiumGltf] + CesiumGltfContent[CesiumGltfContent] --> CesiumGltfReader[CesiumGltfReader] + CesiumGltfContent[CesiumGltfContent] --> CesiumUtility[CesiumUtility] + class CesiumAsync,CesiumGeometry,CesiumGeospatial,CesiumGltf,CesiumGltfReader,CesiumUtility,CesiumGltfContent libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGltfReader.mmd b/doc/diagrams/dependencies/CesiumGltfReader.mmd new file mode 100644 index 000000000..0025592ea --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGltfReader.mmd @@ -0,0 +1,30 @@ +--- +config: + layout: elk +title: CesiumGltfReader Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGltfReader[CesiumGltfReader] --> CesiumAsync[CesiumAsync] + CesiumGltfReader[CesiumGltfReader] --> CesiumGltf[CesiumGltf] + CesiumGltfReader[CesiumGltfReader] --> CesiumJsonReader[CesiumJsonReader] + CesiumGltfReader[CesiumGltfReader] --> KTX_ktx{{KTX::ktx}} + CesiumGltfReader[CesiumGltfReader] --> WebP_webp{{WebP::webp}} + CesiumGltfReader[CesiumGltfReader] --> WebP_webpdecoder{{WebP::webpdecoder}} + CesiumGltfReader[CesiumGltfReader] --> draco_draco{{draco::draco}} + CesiumGltfReader[CesiumGltfReader] --> libjpeg-turbo_turbojpeg-static{{libjpeg-turbo::turbojpeg-static}} + CesiumGltfReader[CesiumGltfReader] --> meshoptimizer_meshoptimizer{{meshoptimizer::meshoptimizer}} + CesiumGltfReader[CesiumGltfReader] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + class KTX_ktx,WebP_webp,WebP_webpdecoder,draco_draco,libjpeg-turbo_turbojpeg-static,meshoptimizer_meshoptimizer,modp_b64_modp_b64 dependencyNode + class CesiumAsync,CesiumGltf,CesiumJsonReader,CesiumGltfReader libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px + linkStyle 6 stroke:#af8d00,stroke-width:4px + linkStyle 7 stroke:#7f80cd,stroke-width:4px + linkStyle 8 stroke:#b3e900,stroke-width:4px + linkStyle 9 stroke:#c42e60,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumGltfWriter.mmd b/doc/diagrams/dependencies/CesiumGltfWriter.mmd new file mode 100644 index 000000000..b72eaed52 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumGltfWriter.mmd @@ -0,0 +1,16 @@ +--- +config: + layout: elk +title: CesiumGltfWriter Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumGltfWriter[CesiumGltfWriter] --> CesiumGltf[CesiumGltf] + CesiumGltfWriter[CesiumGltfWriter] --> CesiumJsonWriter[CesiumJsonWriter] + CesiumGltfWriter[CesiumGltfWriter] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + class modp_b64_modp_b64 dependencyNode + class CesiumGltf,CesiumJsonWriter,CesiumGltfWriter libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumIonClient.mmd b/doc/diagrams/dependencies/CesiumIonClient.mmd new file mode 100644 index 000000000..f5b090e93 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumIonClient.mmd @@ -0,0 +1,22 @@ +--- +config: + layout: elk +title: CesiumIonClient Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumIonClient[CesiumIonClient] --> CesiumAsync[CesiumAsync] + CesiumIonClient[CesiumIonClient] --> CesiumUtility[CesiumUtility] + CesiumIonClient[CesiumIonClient] --> OpenSSL_Crypto{{OpenSSL::Crypto}} + CesiumIonClient[CesiumIonClient] --> httplib_httplib{{httplib::httplib}} + CesiumIonClient[CesiumIonClient] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + CesiumIonClient[CesiumIonClient] --> picosha2_picosha2{{picosha2::picosha2}} + class OpenSSL_Crypto,httplib_httplib,modp_b64_modp_b64,picosha2_picosha2 dependencyNode + class CesiumAsync,CesiumUtility,CesiumIonClient libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumJsonReader.mmd b/doc/diagrams/dependencies/CesiumJsonReader.mmd new file mode 100644 index 000000000..aff88ebf1 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumJsonReader.mmd @@ -0,0 +1,11 @@ +--- +config: + layout: elk +title: CesiumJsonReader Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumJsonReader[CesiumJsonReader] --> CesiumUtility[CesiumUtility] + class CesiumUtility,CesiumJsonReader libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumJsonWriter.mmd b/doc/diagrams/dependencies/CesiumJsonWriter.mmd new file mode 100644 index 000000000..fc3e6eeec --- /dev/null +++ b/doc/diagrams/dependencies/CesiumJsonWriter.mmd @@ -0,0 +1,11 @@ +--- +config: + layout: elk +title: CesiumJsonWriter Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumJsonWriter[CesiumJsonWriter] --> CesiumUtility[CesiumUtility] + class CesiumUtility,CesiumJsonWriter libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumQuantizedMeshTerrain.mmd b/doc/diagrams/dependencies/CesiumQuantizedMeshTerrain.mmd new file mode 100644 index 000000000..2a1274f71 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumQuantizedMeshTerrain.mmd @@ -0,0 +1,23 @@ +--- +config: + layout: elk +title: CesiumQuantizedMeshTerrain Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumAsync[CesiumAsync] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGeospatial[CesiumGeospatial] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGltf[CesiumGltf] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGltfContent[CesiumGltfContent] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumJsonReader[CesiumJsonReader] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumJsonWriter[CesiumJsonWriter] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumUtility[CesiumUtility] + class CesiumAsync,CesiumGeospatial,CesiumGltf,CesiumGltfContent,CesiumJsonReader,CesiumJsonWriter,CesiumUtility,CesiumQuantizedMeshTerrain libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px + linkStyle 6 stroke:#af8d00,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumRasterOverlays.mmd b/doc/diagrams/dependencies/CesiumRasterOverlays.mmd new file mode 100644 index 000000000..b6fef3d46 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumRasterOverlays.mmd @@ -0,0 +1,28 @@ +--- +config: + layout: elk +title: CesiumRasterOverlays Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumAsync[CesiumAsync] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGeometry[CesiumGeometry] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGeospatial[CesiumGeospatial] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltf[CesiumGltf] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltfContent[CesiumGltfContent] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltfReader[CesiumGltfReader] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumUtility[CesiumUtility] + CesiumRasterOverlays[CesiumRasterOverlays] --> nonstd_expected-lite{{nonstd::expected-lite}} + CesiumRasterOverlays[CesiumRasterOverlays] --> tinyxml2_tinyxml2{{tinyxml2::tinyxml2}} + class nonstd_expected-lite,tinyxml2_tinyxml2 dependencyNode + class CesiumAsync,CesiumGeometry,CesiumGeospatial,CesiumGltf,CesiumGltfContent,CesiumGltfReader,CesiumUtility,CesiumRasterOverlays libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4 stroke:#00d2d5,stroke-width:4px + linkStyle 5 stroke:#ff7f00,stroke-width:4px + linkStyle 6 stroke:#af8d00,stroke-width:4px + linkStyle 7 stroke:#7f80cd,stroke-width:4px + linkStyle 8 stroke:#b3e900,stroke-width:4px diff --git a/doc/diagrams/dependencies/CesiumUtility.mmd b/doc/diagrams/dependencies/CesiumUtility.mmd new file mode 100644 index 000000000..7304d67c6 --- /dev/null +++ b/doc/diagrams/dependencies/CesiumUtility.mmd @@ -0,0 +1,18 @@ +--- +config: + layout: elk +title: CesiumUtility Dependency Graph +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumUtility[CesiumUtility] --> glm_glm{{glm::glm}} + CesiumUtility[CesiumUtility] --> spdlog_spdlog{{spdlog::spdlog}} + CesiumUtility[CesiumUtility] --> uriparser_uriparser{{uriparser::uriparser}} + CesiumUtility[CesiumUtility] --> zlib-ng_zlib-ng{{zlib-ng::zlib-ng}} + class glm_glm,spdlog_spdlog,uriparser_uriparser,zlib-ng_zlib-ng dependencyNode + class CesiumUtility libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1 stroke:#377eb8,stroke-width:4px + linkStyle 2 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px diff --git a/doc/diagrams/dependencies/all.mmd b/doc/diagrams/dependencies/all.mmd new file mode 100644 index 000000000..dd83f5680 --- /dev/null +++ b/doc/diagrams/dependencies/all.mmd @@ -0,0 +1,140 @@ +--- +config: + layout: elk + +--- +graph TD + classDef dependencyNode fill:#fff,stroke:#ccc,color:#666 + classDef libraryNode fill:#9f9 + CesiumUtility[CesiumUtility] --> glm_glm{{glm::glm}} + CesiumUtility[CesiumUtility] --> spdlog_spdlog{{spdlog::spdlog}} + CesiumUtility[CesiumUtility] --> uriparser_uriparser{{uriparser::uriparser}} + CesiumUtility[CesiumUtility] --> zlib-ng_zlib-ng{{zlib-ng::zlib-ng}} + Cesium3DTiles[Cesium3DTiles] --> CesiumUtility[CesiumUtility] + Cesium3DTilesContent[Cesium3DTilesContent] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesContent[Cesium3DTilesContent] --> Cesium3DTilesReader[Cesium3DTilesReader] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumAsync[CesiumAsync] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGeometry[CesiumGeometry] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGeospatial[CesiumGeospatial] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltf[CesiumGltf] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltfContent[CesiumGltfContent] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumGltfReader[CesiumGltfReader] + Cesium3DTilesContent[Cesium3DTilesContent] --> CesiumUtility[CesiumUtility] + Cesium3DTilesContent[Cesium3DTilesContent] --> libmorton_libmorton{{libmorton::libmorton}} + Cesium3DTilesReader[Cesium3DTilesReader] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesReader[Cesium3DTilesReader] --> CesiumAsync[CesiumAsync] + Cesium3DTilesReader[Cesium3DTilesReader] --> CesiumJsonReader[CesiumJsonReader] + CesiumAsync[CesiumAsync] --> Async_{{Async++}} + CesiumAsync[CesiumAsync] --> CesiumUtility[CesiumUtility] + CesiumAsync[CesiumAsync] --> spdlog_spdlog{{spdlog::spdlog}} + CesiumAsync[CesiumAsync] --> spdlog_spdlog_header_only{{spdlog::spdlog_header_only}} + CesiumAsync[CesiumAsync] --> unofficial_sqlite3_sqlite3{{unofficial::sqlite3::sqlite3}} + CesiumJsonReader[CesiumJsonReader] --> CesiumUtility[CesiumUtility] + CesiumGeometry[CesiumGeometry] --> CesiumUtility[CesiumUtility] + CesiumGeospatial[CesiumGeospatial] --> CesiumGeometry[CesiumGeometry] + CesiumGeospatial[CesiumGeospatial] --> CesiumUtility[CesiumUtility] + CesiumGeospatial[CesiumGeospatial] --> absl_string_view{{absl::string_view}} + CesiumGeospatial[CesiumGeospatial] --> earcut{{earcut}} + CesiumGeospatial[CesiumGeospatial] --> s2_s2{{s2::s2}} + CesiumGltf[CesiumGltf] --> CesiumUtility[CesiumUtility] + CesiumGltfContent[CesiumGltfContent] --> CesiumAsync[CesiumAsync] + CesiumGltfContent[CesiumGltfContent] --> CesiumGeometry[CesiumGeometry] + CesiumGltfContent[CesiumGltfContent] --> CesiumGeospatial[CesiumGeospatial] + CesiumGltfContent[CesiumGltfContent] --> CesiumGltf[CesiumGltf] + CesiumGltfContent[CesiumGltfContent] --> CesiumGltfReader[CesiumGltfReader] + CesiumGltfContent[CesiumGltfContent] --> CesiumUtility[CesiumUtility] + CesiumGltfReader[CesiumGltfReader] --> CesiumAsync[CesiumAsync] + CesiumGltfReader[CesiumGltfReader] --> CesiumGltf[CesiumGltf] + CesiumGltfReader[CesiumGltfReader] --> CesiumJsonReader[CesiumJsonReader] + CesiumGltfReader[CesiumGltfReader] --> KTX_ktx{{KTX::ktx}} + CesiumGltfReader[CesiumGltfReader] --> WebP_webp{{WebP::webp}} + CesiumGltfReader[CesiumGltfReader] --> WebP_webpdecoder{{WebP::webpdecoder}} + CesiumGltfReader[CesiumGltfReader] --> draco_draco{{draco::draco}} + CesiumGltfReader[CesiumGltfReader] --> libjpeg-turbo_turbojpeg-static{{libjpeg-turbo::turbojpeg-static}} + CesiumGltfReader[CesiumGltfReader] --> meshoptimizer_meshoptimizer{{meshoptimizer::meshoptimizer}} + CesiumGltfReader[CesiumGltfReader] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTilesContent[Cesium3DTilesContent] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> Cesium3DTilesReader[Cesium3DTilesReader] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumAsync[CesiumAsync] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGeometry[CesiumGeometry] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGeospatial[CesiumGeospatial] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGltf[CesiumGltf] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumGltfReader[CesiumGltfReader] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumRasterOverlays[CesiumRasterOverlays] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> CesiumUtility[CesiumUtility] + Cesium3DTilesSelection[Cesium3DTilesSelection] --> draco_draco{{draco::draco}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> libmorton_libmorton{{libmorton::libmorton}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> nonstd_expected-lite{{nonstd::expected-lite}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> spdlog_spdlog{{spdlog::spdlog}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> spdlog_spdlog_header_only{{spdlog::spdlog_header_only}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> tinyxml2_tinyxml2{{tinyxml2::tinyxml2}} + Cesium3DTilesSelection[Cesium3DTilesSelection] --> uriparser_uriparser{{uriparser::uriparser}} + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumAsync[CesiumAsync] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGeospatial[CesiumGeospatial] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGltf[CesiumGltf] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumGltfContent[CesiumGltfContent] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumJsonReader[CesiumJsonReader] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumJsonWriter[CesiumJsonWriter] + CesiumQuantizedMeshTerrain[CesiumQuantizedMeshTerrain] --> CesiumUtility[CesiumUtility] + CesiumJsonWriter[CesiumJsonWriter] --> CesiumUtility[CesiumUtility] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumAsync[CesiumAsync] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGeometry[CesiumGeometry] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGeospatial[CesiumGeospatial] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltf[CesiumGltf] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltfContent[CesiumGltfContent] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumGltfReader[CesiumGltfReader] + CesiumRasterOverlays[CesiumRasterOverlays] --> CesiumUtility[CesiumUtility] + CesiumRasterOverlays[CesiumRasterOverlays] --> nonstd_expected-lite{{nonstd::expected-lite}} + CesiumRasterOverlays[CesiumRasterOverlays] --> tinyxml2_tinyxml2{{tinyxml2::tinyxml2}} + Cesium3DTilesWriter[Cesium3DTilesWriter] --> Cesium3DTiles[Cesium3DTiles] + Cesium3DTilesWriter[Cesium3DTilesWriter] --> CesiumJsonWriter[CesiumJsonWriter] + CesiumGltfWriter[CesiumGltfWriter] --> CesiumGltf[CesiumGltf] + CesiumGltfWriter[CesiumGltfWriter] --> CesiumJsonWriter[CesiumJsonWriter] + CesiumGltfWriter[CesiumGltfWriter] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + CesiumIonClient[CesiumIonClient] --> CesiumAsync[CesiumAsync] + CesiumIonClient[CesiumIonClient] --> CesiumUtility[CesiumUtility] + CesiumIonClient[CesiumIonClient] --> OpenSSL_Crypto{{OpenSSL::Crypto}} + CesiumIonClient[CesiumIonClient] --> httplib_httplib{{httplib::httplib}} + CesiumIonClient[CesiumIonClient] --> modp_b64_modp_b64{{modp_b64::modp_b64}} + CesiumIonClient[CesiumIonClient] --> picosha2_picosha2{{picosha2::picosha2}} + class glm_glm,spdlog_spdlog,uriparser_uriparser,zlib-ng_zlib-ng,libmorton_libmorton,Async_,spdlog_spdlog_header_only,unofficial_sqlite3_sqlite3,absl_string_view,earcut,s2_s2,KTX_ktx,WebP_webp,WebP_webpdecoder,draco_draco,libjpeg-turbo_turbojpeg-static,meshoptimizer_meshoptimizer,modp_b64_modp_b64,nonstd_expected-lite,tinyxml2_tinyxml2,OpenSSL_Crypto,httplib_httplib,picosha2_picosha2 dependencyNode + class CesiumUtility,Cesium3DTiles,Cesium3DTilesReader,CesiumAsync,CesiumGeometry,CesiumGeospatial,CesiumGltf,CesiumGltfContent,CesiumGltfReader,Cesium3DTilesContent,CesiumJsonReader,CesiumQuantizedMeshTerrain,CesiumRasterOverlays,Cesium3DTilesSelection,CesiumJsonWriter,Cesium3DTilesWriter,CesiumGltfWriter,CesiumIonClient libraryNode + linkStyle 0 stroke:#ff0029,stroke-width:4px + linkStyle 1,20,61 stroke:#377eb8,stroke-width:4px + linkStyle 2,64 stroke:#66a61e,stroke-width:4px + linkStyle 3 stroke:#984ea3,stroke-width:4px + linkStyle 4,13,19,23,24,26,30,36,57,71,72,79,88 stroke:#00d2d5,stroke-width:4px + linkStyle 5,15,47,82 stroke:#ff7f00,stroke-width:4px + linkStyle 6,49 stroke:#af8d00,stroke-width:4px + linkStyle 7,16,31,37,50,65,73,87 stroke:#7f80cd,stroke-width:4px + linkStyle 8,25,32,51,74 stroke:#b3e900,stroke-width:4px + linkStyle 9,33,52,66,75 stroke:#c42e60,stroke-width:4px + linkStyle 10,34,38,53,67,76,84 stroke:#a65628,stroke-width:4px + linkStyle 11,68,77 stroke:#f781bf,stroke-width:4px + linkStyle 12,35,54,78 stroke:#8dd3c7,stroke-width:4px + linkStyle 14,59 stroke:#bebada,stroke-width:4px + linkStyle 17,39,69 stroke:#fb8072,stroke-width:4px + linkStyle 18 stroke:#80b1d3,stroke-width:4px + linkStyle 21,62 stroke:#fdb462,stroke-width:4px + linkStyle 22 stroke:#fccde5,stroke-width:4px + linkStyle 27 stroke:#bc80bd,stroke-width:4px + linkStyle 28 stroke:#ffed6f,stroke-width:4px + linkStyle 29 stroke:#c4eaff,stroke-width:4px + linkStyle 40 stroke:#cf8c00,stroke-width:4px + linkStyle 41 stroke:#1b9e77,stroke-width:4px + linkStyle 42 stroke:#d95f02,stroke-width:4px + linkStyle 43,58 stroke:#e7298a,stroke-width:4px + linkStyle 44 stroke:#e6ab02,stroke-width:4px + linkStyle 45 stroke:#a6761d,stroke-width:4px + linkStyle 46,86,91 stroke:#0097ff,stroke-width:4px + linkStyle 48 stroke:#00d067,stroke-width:4px + linkStyle 55 stroke:#000000,stroke-width:4px + linkStyle 56 stroke:#252525,stroke-width:4px + linkStyle 60,80 stroke:#525252,stroke-width:4px + linkStyle 63,81 stroke:#737373,stroke-width:4px + linkStyle 70,83,85 stroke:#969696,stroke-width:4px + linkStyle 89 stroke:#bdbdbd,stroke-width:4px + linkStyle 90 stroke:#f43600,stroke-width:4px + linkStyle 92 stroke:#4ba93b,stroke-width:4px diff --git a/doc/footer.html b/doc/footer.html index 8b75ff702..98485b68c 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -2,7 +2,10 @@ + + - + + - + + \ No newline at end of file diff --git a/doc/topics/dependencies.md b/doc/topics/dependencies.md new file mode 100644 index 000000000..1c4e7ea78 --- /dev/null +++ b/doc/topics/dependencies.md @@ -0,0 +1,33 @@ +# Dependencies + +Cesium Native relies on a number of third-party dependencies. These dependencies are automatically resolved and built using [vcpkg](https://vcpkg.io/) at compile time. + +| Dependency | Usage | +| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| [Async++](https://github.com/Amanieu/asyncplusplus) | Used by CesiumAsync for cross-platform concurrency. | +| [Catch2](https://github.com/catchorg/Catch2) | Test framework used by CesiumNativeTests. | +| [draco](https://github.com/google/draco) | Required to decode meshes and point clouds compressed with Draco. | +| [earcut](https://github.com/mapbox/earcut.hpp) | Polygon triangulation library for used by CartographicPolygon. | +| [expected-lite](https://github.com/martinmoene/expected-lite) | Implementation of the `std::expected` proposal for returning either an expected value or an error value. | +| [glm](https://github.com/g-truc/glm) | C++ mathematics library powering the high-precision math needed for geospatial software. | +| [meshoptimizer](https://github.com/zeux/meshoptimizer) | Required to decode meshes compressed with meshoptimizer. | +| [httplib](https://github.com/yhirose/cpp-httplib) | Used by CesiumIonClient to interact with the Cesium ion REST API. | +| [Ktx](https://github.com/CesiumGS/KTX-Software) | Required to load KTX GPU compressed textures. | +| [libmorton](https://github.com/Forceflow/libmorton) | Implementation of Morton codes used for implicit tiling. | +| [libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) | Decodes JPEG images. | +| [libwebp](https://github.com/webmproject/libwebp) | Decodes WebP images. | +| [modp_b64](https://github.com/chromium/chromium/tree/15996b5d2322b634f4197447b10289bddc2b0b32/third_party/modp_b64) | Decodes and encodes base64. | +| [OpenSSL](https://github.com/openssl/openssl) | Used to generate unique authorization tokens for authenticating with Cesium ion. | +| [PicoSHA2](https://okdshin/PicoSHA2) | Generates SHA256 hashes for use with the Cesium ion REST API. | +| [RapidJSON](https://github.com/Tencent/rapidjson) | For JSON reading and writing. | +| [s2geometry](https://github.com/google/s2geometry) | Spatial indexing library designed for geospatial use and required by some tilesets. | +| [spdlog](https://github.com/gabime/spdlog) | Debug logging. | +| [sqlite3](https://www.sqlite.org/index.html) | Used to cache HTTP responses. | +| [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h) | A simple image loader. | +| [tinyxml2](https://github.com/leethomason/tinyxml2) | XML parser for interacting with XML APIs such as those implementing the Web Map Service standard. | +| [uriparser](https://github.com/uriparser/uriparser) | Used to parse and manipulate URIs. | +| [zlib-ng](https://github.com/zlib-ng/zlib-ng) | An optimized zlib implementation for working with Gzipped data. | + +The following chart illustrates the connections between the Cesium Native libraries and third-party dependencies: + +\image html dependency-graph.svg \ No newline at end of file diff --git a/tools/dep-graph-gen/index.js b/tools/dep-graph-gen/index.js index 687e15d1f..c3ef80d87 100644 --- a/tools/dep-graph-gen/index.js +++ b/tools/dep-graph-gen/index.js @@ -59,11 +59,11 @@ function formatLibraryNameAsId(libraryName) { const includedRegex = new RegExp(argv.targets); -function generateChart(includedSet, colorLinks, title) { +function generateChart(includedSet, colorLinks, useElk, title) { let output = `--- comment: This file was generated by dep-graph-gen. DO NOT EDIT THIS FILE! -config: - layout: elk +${useElk ? `config: + layout: elk` : ``} ${title ? `title: ${title}` : ``} --- graph TD @@ -127,11 +127,11 @@ Object.keys(dependencyLinks).filter(d => includedRegex.test(d)).forEach(d => { includedNodes[d] = true; }); -fs.writeFileSync(path.join(argv.output, "all.mmd"), generateChart(includedNodes, true)); +fs.writeFileSync(path.join(argv.output, "all.mmd"), generateChart(includedNodes, true, true)); // Per-target graphs Object.keys(includedNodes).forEach(n => { const filename = formatLibraryNameAsId(n) + ".mmd"; - fs.writeFileSync(path.join(argv.output, filename), generateChart({ [n]: true }, false, `${n} Dependency Graph`)); + fs.writeFileSync(path.join(argv.output, filename), generateChart({ [n]: true }, false, false, `${n} Dependency Graph`)); }); console.log(`Wrote generated Mermaid graphs to ${argv.output}`); \ No newline at end of file From 76a9fa1ba141f4cfdb7c82ac3c8593ec44fa77a3 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Fri, 6 Dec 2024 18:25:47 -0500 Subject: [PATCH 21/33] Add license to panzoom.js --- doc/assets/panzoom.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/assets/panzoom.js b/doc/assets/panzoom.js index 017def2ed..4e41cd718 100644 --- a/doc/assets/panzoom.js +++ b/doc/assets/panzoom.js @@ -1 +1,24 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 - 2024 Andrei Kashcha + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.panzoom=f()}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0){transform.x+=diff;adjusted=true}diff=boundingBox.right-clientRect.left;if(diff<0){transform.x+=diff;adjusted=true}diff=boundingBox.top-clientRect.bottom;if(diff>0){transform.y+=diff;adjusted=true}diff=boundingBox.bottom-clientRect.top;if(diff<0){transform.y+=diff;adjusted=true}return adjusted}function getBoundingBox(){if(!bounds)return;if(typeof bounds==="boolean"){var ownerRect=owner.getBoundingClientRect();var sceneWidth=ownerRect.width;var sceneHeight=ownerRect.height;return{left:sceneWidth*boundsPadding,top:sceneHeight*boundsPadding,right:sceneWidth*(1-boundsPadding),bottom:sceneHeight*(1-boundsPadding)}}return bounds}function getClientRect(){var bbox=panController.getBBox();var leftTop=client(bbox.left,bbox.top);return{left:leftTop.x,top:leftTop.y,right:bbox.width*transform.scale+leftTop.x,bottom:bbox.height*transform.scale+leftTop.y}}function client(x,y){return{x:x*transform.scale+transform.x,y:y*transform.scale+transform.y}}function makeDirty(){isDirty=true;frameAnimation=window.requestAnimationFrame(frame)}function zoomByRatio(clientX,clientY,ratio){if(isNaN(clientX)||isNaN(clientY)||isNaN(ratio)){throw new Error("zoom requires valid numbers")}var newScale=transform.scale*ratio;if(newScalemaxZoom){if(transform.scale===maxZoom)return;ratio=maxZoom/transform.scale}var size=transformToScreen(clientX,clientY);transform.x=size.x-ratio*(size.x-transform.x);transform.y=size.y-ratio*(size.y-transform.y);if(bounds&&boundsPadding===1&&minZoom===1){transform.scale*=ratio;keepTransformInsideBounds()}else{var transformAdjusted=keepTransformInsideBounds();if(!transformAdjusted)transform.scale*=ratio}triggerEvent("zoom");makeDirty()}function zoomAbs(clientX,clientY,zoomLevel){var ratio=zoomLevel/transform.scale;zoomByRatio(clientX,clientY,ratio)}function centerOn(ui){var parent=ui.ownerSVGElement;if(!parent)throw new Error("ui element is required to be within the scene");var clientRect=ui.getBoundingClientRect();var cx=clientRect.left+clientRect.width/2;var cy=clientRect.top+clientRect.height/2;var container=parent.getBoundingClientRect();var dx=container.width/2-cx;var dy=container.height/2-cy;internalMoveBy(dx,dy,true)}function smoothMoveTo(x,y){internalMoveBy(x-transform.x,y-transform.y,true)}function internalMoveBy(dx,dy,smooth){if(!smooth){return moveBy(dx,dy)}if(moveByAnimation)moveByAnimation.cancel();var from={x:0,y:0};var to={x:dx,y:dy};var lastX=0;var lastY=0;moveByAnimation=animate(from,to,{step:function(v){moveBy(v.x-lastX,v.y-lastY);lastX=v.x;lastY=v.y}})}function scroll(x,y){cancelZoomAnimation();moveTo(x,y)}function dispose(){releaseEvents()}function listenForEvents(){owner.addEventListener("mousedown",onMouseDown,{passive:false});owner.addEventListener("dblclick",onDoubleClick,{passive:false});owner.addEventListener("touchstart",onTouch,{passive:false});owner.addEventListener("keydown",onKeyDown,{passive:false});wheel.addWheelListener(owner,onMouseWheel,{passive:false});makeDirty()}function releaseEvents(){wheel.removeWheelListener(owner,onMouseWheel);owner.removeEventListener("mousedown",onMouseDown);owner.removeEventListener("keydown",onKeyDown);owner.removeEventListener("dblclick",onDoubleClick);owner.removeEventListener("touchstart",onTouch);if(frameAnimation){window.cancelAnimationFrame(frameAnimation);frameAnimation=0}smoothScroll.cancel();releaseDocumentMouse();releaseTouches();textSelection.release();triggerPanEnd()}function frame(){if(isDirty)applyTransform()}function applyTransform(){isDirty=false;panController.applyTransform(transform);triggerEvent("transform");frameAnimation=0}function onKeyDown(e){var x=0,y=0,z=0;if(e.keyCode===38){y=1}else if(e.keyCode===40){y=-1}else if(e.keyCode===37){x=1}else if(e.keyCode===39){x=-1}else if(e.keyCode===189||e.keyCode===109){z=1}else if(e.keyCode===187||e.keyCode===107){z=-1}if(filterKey(e,x,y,z)){return}if(x||y){e.preventDefault();e.stopPropagation();var clientRect=owner.getBoundingClientRect();var offset=Math.min(clientRect.width,clientRect.height);var moveSpeedRatio=.05;var dx=offset*moveSpeedRatio*x;var dy=offset*moveSpeedRatio*y;internalMoveBy(dx,dy)}if(z){var scaleMultiplier=getScaleMultiplier(z*100);var offset=transformOrigin?getTransformOriginOffset():midPoint();publicZoomTo(offset.x,offset.y,scaleMultiplier)}}function midPoint(){var ownerRect=owner.getBoundingClientRect();return{x:ownerRect.width/2,y:ownerRect.height/2}}function onTouch(e){beforeTouch(e);if(e.touches.length===1){return handleSingleFingerTouch(e,e.touches[0])}else if(e.touches.length===2){pinchZoomLength=getPinchZoomLength(e.touches[0],e.touches[1]);multiTouch=true;startTouchListenerIfNeeded()}}function beforeTouch(e){if(options.onTouch&&!options.onTouch(e)){return}e.stopPropagation();e.preventDefault()}function beforeDoubleClick(e){if(options.onDoubleClick&&!options.onDoubleClick(e)){return}e.preventDefault();e.stopPropagation()}function handleSingleFingerTouch(e){var touch=e.touches[0];var offset=getOffsetXY(touch);lastSingleFingerOffset=offset;var point=transformToScreen(offset.x,offset.y);mouseX=point.x;mouseY=point.y;smoothScroll.cancel();startTouchListenerIfNeeded()}function startTouchListenerIfNeeded(){if(touchInProgress){return}touchInProgress=true;document.addEventListener("touchmove",handleTouchMove);document.addEventListener("touchend",handleTouchEnd);document.addEventListener("touchcancel",handleTouchEnd)}function handleTouchMove(e){if(e.touches.length===1){e.stopPropagation();var touch=e.touches[0];var offset=getOffsetXY(touch);var point=transformToScreen(offset.x,offset.y);var dx=point.x-mouseX;var dy=point.y-mouseY;if(dx!==0&&dy!==0){triggerPanStart()}mouseX=point.x;mouseY=point.y;internalMoveBy(dx,dy)}else if(e.touches.length===2){multiTouch=true;var t1=e.touches[0];var t2=e.touches[1];var currentPinchLength=getPinchZoomLength(t1,t2);var scaleMultiplier=1+(currentPinchLength/pinchZoomLength-1)*pinchSpeed;var firstTouchPoint=getOffsetXY(t1);var secondTouchPoint=getOffsetXY(t2);mouseX=(firstTouchPoint.x+secondTouchPoint.x)/2;mouseY=(firstTouchPoint.y+secondTouchPoint.y)/2;if(transformOrigin){var offset=getTransformOriginOffset();mouseX=offset.x;mouseY=offset.y}publicZoomTo(mouseX,mouseY,scaleMultiplier);pinchZoomLength=currentPinchLength;e.stopPropagation();e.preventDefault()}}function handleTouchEnd(e){if(e.touches.length>0){var offset=getOffsetXY(e.touches[0]);var point=transformToScreen(offset.x,offset.y);mouseX=point.x;mouseY=point.y}else{var now=new Date;if(now-lastTouchEndTime0)delta*=100;var scaleMultiplier=getScaleMultiplier(delta);if(scaleMultiplier!==1){var offset=transformOrigin?getTransformOriginOffset():getOffsetXY(e);publicZoomTo(offset.x,offset.y,scaleMultiplier);e.preventDefault()}}function getOffsetXY(e){var offsetX,offsetY;var ownerRect=owner.getBoundingClientRect();offsetX=e.clientX-ownerRect.left;offsetY=e.clientY-ownerRect.top;return{x:offsetX,y:offsetY}}function smoothZoom(clientX,clientY,scaleMultiplier){var fromValue=transform.scale;var from={scale:fromValue};var to={scale:scaleMultiplier*fromValue};smoothScroll.cancel();cancelZoomAnimation();zoomToAnimation=animate(from,to,{step:function(v){zoomAbs(clientX,clientY,v.scale)},done:triggerZoomEnd})}function smoothZoomAbs(clientX,clientY,toScaleValue){var fromValue=transform.scale;var from={scale:fromValue};var to={scale:toScaleValue};smoothScroll.cancel();cancelZoomAnimation();zoomToAnimation=animate(from,to,{step:function(v){zoomAbs(clientX,clientY,v.scale)}})}function getTransformOriginOffset(){var ownerRect=owner.getBoundingClientRect();return{x:ownerRect.width*transformOrigin.x,y:ownerRect.height*transformOrigin.y}}function publicZoomTo(clientX,clientY,scaleMultiplier){smoothScroll.cancel();cancelZoomAnimation();return zoomByRatio(clientX,clientY,scaleMultiplier)}function cancelZoomAnimation(){if(zoomToAnimation){zoomToAnimation.cancel();zoomToAnimation=null}}function getScaleMultiplier(delta){var sign=Math.sign(delta);var deltaAdjustedSpeed=Math.min(.25,Math.abs(speed*delta/128));return 1-sign*deltaAdjustedSpeed}function triggerPanStart(){if(!panstartFired){triggerEvent("panstart");panstartFired=true;smoothScroll.start()}}function triggerPanEnd(){if(panstartFired){if(!multiTouch)smoothScroll.stop();triggerEvent("panend")}}function triggerZoomEnd(){triggerEvent("zoomend")}function triggerEvent(name){api.fire(name,api)}}function parseTransformOrigin(options){if(!options)return;if(typeof options==="object"){if(!isNumber(options.x)||!isNumber(options.y))failTransformOrigin(options);return options}failTransformOrigin()}function failTransformOrigin(options){console.error(options);throw new Error(["Cannot parse transform origin.","Some good examples:",' "center center" can be achieved with {x: 0.5, y: 0.5}',' "top center" can be achieved with {x: 0.5, y: 0}',' "bottom right" can be achieved with {x: 1, y: 1}'].join("\n"))}function noop(){}function validateBounds(bounds){var boundsType=typeof bounds;if(boundsType==="undefined"||boundsType==="boolean")return;var validBounds=isNumber(bounds.left)&&isNumber(bounds.top)&&isNumber(bounds.bottom)&&isNumber(bounds.right);if(!validBounds)throw new Error("Bounds object is not valid. It can be: "+"undefined, boolean (true|false) or an object {left, top, right, bottom}")}function isNumber(x){return Number.isFinite(x)}function isNaN(value){if(Number.isNaN){return Number.isNaN(value)}return value!==value}function rigidScroll(){return{start:noop,stop:noop,cancel:noop}}function autoRun(){if(typeof document==="undefined")return;var scripts=document.getElementsByTagName("script");if(!scripts)return;var panzoomScript;for(var i=0;iminVelocity){ax=amplitude*vx;targetX+=ax}if(vy<-minVelocity||vy>minVelocity){ay=amplitude*vy;targetY+=ay}raf=requestAnimationFrame(autoScroll)}function autoScroll(){var elapsed=Date.now()-timestamp;var moving=false;var dx=0;var dy=0;if(ax){dx=-ax*Math.exp(-elapsed/timeConstant);if(dx>.5||dx<-.5)moving=true;else dx=ax=0}if(ay){dy=-ay*Math.exp(-elapsed/timeConstant);if(dy>.5||dy<-.5)moving=true;else dy=ay=0}if(moving){scroll(targetX+dx,targetY+dy);raf=requestAnimationFrame(autoScroll)}}}function getCancelAnimationFrame(){if(typeof cancelAnimationFrame==="function")return cancelAnimationFrame;return clearTimeout}function getRequestAnimationFrame(){if(typeof requestAnimationFrame==="function")return requestAnimationFrame;return function(handler){return setTimeout(handler,16)}}},{}],5:[function(require,module,exports){module.exports=makeSvgController;module.exports.canAttach=isSVGElement;function makeSvgController(svgElement,options){if(!isSVGElement(svgElement)){throw new Error("svg element is required for svg.panzoom to work")}var owner=svgElement.ownerSVGElement;if(!owner){throw new Error("Do not apply panzoom to the root element. "+"Use its child instead (e.g. ). "+"As of March 2016 only FireFox supported transform on the root element")}if(!options.disableKeyboardInteraction){owner.setAttribute("tabindex",0)}var api={getBBox:getBBox,getScreenCTM:getScreenCTM,getOwner:getOwner,applyTransform:applyTransform,initTransform:initTransform};return api;function getOwner(){return owner}function getBBox(){var bbox=svgElement.getBBox();return{left:bbox.x,top:bbox.y,width:bbox.width,height:bbox.height}}function getScreenCTM(){var ctm=owner.getCTM();if(!ctm){return owner.getScreenCTM()}return ctm}function initTransform(transform){var screenCTM=svgElement.getCTM();if(screenCTM===null){screenCTM=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix()}transform.x=screenCTM.e;transform.y=screenCTM.f;transform.scale=screenCTM.a;owner.removeAttributeNS(null,"viewBox")}function applyTransform(transform){svgElement.setAttribute("transform","matrix("+transform.scale+" 0 0 "+transform.scale+" "+transform.x+" "+transform.y+")")}}function isSVGElement(element){return element&&element.ownerSVGElement&&element.getCTM}},{}],6:[function(require,module,exports){module.exports=Transform;function Transform(){this.x=0;this.y=0;this.scale=1}},{}],7:[function(require,module,exports){var BezierEasing=require("bezier-easing");var animations={ease:BezierEasing(.25,.1,.25,1),easeIn:BezierEasing(.42,0,1,1),easeOut:BezierEasing(0,0,.58,1),easeInOut:BezierEasing(.42,0,.58,1),linear:BezierEasing(0,0,1,1)};module.exports=animate;module.exports.makeAggregateRaf=makeAggregateRaf;module.exports.sharedScheduler=makeAggregateRaf();function animate(source,target,options){var start=Object.create(null);var diff=Object.create(null);options=options||{};var easing=typeof options.easing==="function"?options.easing:animations[options.easing];if(!easing){if(options.easing){console.warn("Unknown easing function in amator: "+options.easing)}easing=animations.ease}var step=typeof options.step==="function"?options.step:noop;var done=typeof options.done==="function"?options.done:noop;var scheduler=getScheduler(options.scheduler);var keys=Object.keys(target);keys.forEach(function(key){start[key]=source[key];diff[key]=target[key]-source[key]});var durationInMs=typeof options.duration==="number"?options.duration:400;var durationInFrames=Math.max(1,durationInMs*.06);var previousAnimationId;var frame=0;previousAnimationId=scheduler.next(loop);return{cancel:cancel};function cancel(){scheduler.cancel(previousAnimationId);previousAnimationId=0}function loop(){var t=easing(frame/durationInFrames);frame+=1;setValues(t);if(frame<=durationInFrames){previousAnimationId=scheduler.next(loop);step(source)}else{previousAnimationId=0;setTimeout(function(){done(source)},0)}}function setValues(t){keys.forEach(function(key){source[key]=diff[key]*t+start[key]})}}function noop(){}function getScheduler(scheduler){if(!scheduler){var canRaf=typeof window!=="undefined"&&window.requestAnimationFrame;return canRaf?rafScheduler():timeoutScheduler()}if(typeof scheduler.next!=="function")throw new Error("Scheduler is supposed to have next(cb) function");if(typeof scheduler.cancel!=="function")throw new Error("Scheduler is supposed to have cancel(handle) function");return scheduler}function rafScheduler(){return{next:window.requestAnimationFrame.bind(window),cancel:window.cancelAnimationFrame.bind(window)}}function timeoutScheduler(){return{next:function(cb){return setTimeout(cb,1e3/60)},cancel:function(id){return clearTimeout(id)}}}function makeAggregateRaf(){var frontBuffer=new Set;var backBuffer=new Set;var frameToken=0;return{next:next,cancel:next,clearAll:clearAll};function clearAll(){frontBuffer.clear();backBuffer.clear();cancelAnimationFrame(frameToken);frameToken=0}function next(callback){backBuffer.add(callback);renderNextFrame()}function renderNextFrame(){if(!frameToken)frameToken=requestAnimationFrame(renderFrame)}function renderFrame(){frameToken=0;var t=backBuffer;backBuffer=frontBuffer;frontBuffer=t;frontBuffer.forEach(function(callback){callback()});frontBuffer.clear()}function cancel(callback){backBuffer.delete(callback)}}},{"bezier-easing":8}],8:[function(require,module,exports){var NEWTON_ITERATIONS=4;var NEWTON_MIN_SLOPE=.001;var SUBDIVISION_PRECISION=1e-7;var SUBDIVISION_MAX_ITERATIONS=10;var kSplineTableSize=11;var kSampleStepSize=1/(kSplineTableSize-1);var float32ArraySupported=typeof Float32Array==="function";function A(aA1,aA2){return 1-3*aA2+3*aA1}function B(aA1,aA2){return 3*aA2-6*aA1}function C(aA1){return 3*aA1}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT}function getSlope(aT,aA1,aA2){return 3*A(aA1,aA2)*aT*aT+2*B(aA1,aA2)*aT+C(aA1)}function binarySubdivide(aX,aA,aB,mX1,mX2){var currentX,currentT,i=0;do{currentT=aA+(aB-aA)/2;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0){aB=currentT}else{aA=currentT}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT,mX1,mX2)}else if(initialSlope===0){return guessForT}else{return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize,mX1,mX2)}}return function BezierEasing(x){if(x===0){return 0}if(x===1){return 1}return calcBezier(getTForX(x),mY1,mY2)}}},{}],9:[function(require,module,exports){module.exports=function eventify(subject){validateSubject(subject);var eventsStorage=createEventsStorage(subject);subject.on=eventsStorage.on;subject.off=eventsStorage.off;subject.fire=eventsStorage.fire;return subject};function createEventsStorage(subject){var registeredEvents=Object.create(null);return{on:function(eventName,callback,ctx){if(typeof callback!=="function"){throw new Error("callback is expected to be a function")}var handlers=registeredEvents[eventName];if(!handlers){handlers=registeredEvents[eventName]=[]}handlers.push({callback:callback,ctx:ctx});return subject},off:function(eventName,callback){var wantToRemoveAll=typeof eventName==="undefined";if(wantToRemoveAll){registeredEvents=Object.create(null);return subject}if(registeredEvents[eventName]){var deleteAllCallbacksForEvent=typeof callback!=="function";if(deleteAllCallbacksForEvent){delete registeredEvents[eventName]}else{var callbacks=registeredEvents[eventName];for(var i=0;i1){fireArguments=Array.prototype.splice.call(arguments,1)}for(var i=0;i Date: Tue, 10 Dec 2024 00:13:45 +0100 Subject: [PATCH 22/33] Be more precise about use of AsyncSystem objects --- doc/topics/async-system.md | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index 391c21880..3fb0bf0de 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -23,7 +23,20 @@ Unfortunately, there is inevitably at least a little bit of tile loading work th ## The AsyncSystem Class -An `AsyncSystem` object manages the other objects we use to schedule work and wait for its completion. During initialization, the host system [constructs an `AsyncSystem` object](#creating-an-asyncsystem) and passes it to Cesium Native, which in turn uses it in all operations that might complete asynchronously. `AsyncSystem` instances can be safely and efficiently stored and copied by value; this makes it easy to make them available wherever they're needed, including in lambda captures. On the other hand, using a reference to an `AsyncSystem` object is very bug-prone in asynchronous code, because the lifetime of the reference holder is often quite different from the code that uses it. +An `AsyncSystem` object manages the other objects we use to schedule work and wait for its completion. During initialization, an application [constructs an AsyncSystem object](#creating-an-asyncsystem) and passes it to Cesium Native, which in turn uses it in all operations that might complete asynchronously. `AsyncSystem` instances can be safely and efficiently stored and copied by value; this makes it easy to make them available wherever they're needed, including in lambda captures. On the other hand, holding a reference to an `AsyncSystem` object is very bug-prone in asynchronous code; the lifetime of the reference holder can be quite different from the code that uses it and hard to reason about. It is idiomatic to pass a `const` reference to an `AsyncSystem` object as a parameter to a function, but that reference must be copied to a value if it will be used outside of the lifetime of the function. For example, in the following code, the `asyncSystem` function parameter is copied to a constant value member in the inner lambda: + + Future> SubtreeFileReader::load( + const AsyncSystem& asyncSystem, + const std::shared_ptr& pAssetAccessor, + const std::string& url, + const std::vector& headers) const noexcept { + return pAssetAccessor->get(asyncSystem, url, headers) + .thenInWorkerThread([asyncSystem, pAssetAccessor, this]( + std::shared_ptr&& pRequest) { + return this->load(asyncSystem, pAssetAccessor, pRequest); + }); + } + ## Future {#future} @@ -198,22 +211,24 @@ It may initially be surprising to learn that calling `then...` or `catch...` on ### Creating an AsyncSystem {#creating-an-asyncsystem} -[AsyncSystem](@ref CesiumAsync::AsyncSystem) is not an abstract interface class, but it is implemented using an object that is a subclass of the [ITaskProcessor](@ref CesiumAsync::ITaskProcessor) interface class. -Most applications construct a single `AsyncSystem` object that is copied and is used throughout. `ITaskProcessor` specifies a simple interface used to perform some work in a background thread. The simplest possible implementation looks like this: +[AsyncSystem](@ref CesiumAsync::AsyncSystem) is implemented using a subclass of the [ITaskProcessor](@ref CesiumAsync::ITaskProcessor) interface class via [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection). +`ITaskProcessor` specifies a simple interface used to perform some work in a background thread. The simplest possible implementation looks like this: \snippet{trimleft} ExamplesAsyncSystem.cpp simplest-task-processor -This implementation will work, but it isn't very efficient because a brand new thread is created for each task. Most applications will implement this interface using a thread pool, task graph, or similar functionality that their application already contains. +This implementation will work, but it isn't very efficient because a brand new thread is created for each task. Most applications will implement this interface using a thread pool, task graph, or similar functionality that their application already contains. -The `AsyncSystem` can be created as follows: +The `AsyncSystem` could be created as follows: \snippet{trimleft} ExamplesAsyncSystem.cpp create-async-system -`AsyncSystem` instances have copy semantics, so it is easy to make them available wherever they're needed, including in lambda captures. In this example, `asyncSystem` is captured by value for use in the lambda. +However, Cesium Native does not contain any calls like this, other than in test code. Except under unusual circumstances, applications should construct a single `AsyncSystem` object that is copied and is used throughout. Two `AsyncSystem` objects that are created with this constructor, even if they share the same `ITaskProcessor`, will have different work queues and different notions of the main thread and, if they are used together, disaster can result. + +On the other hand, `AsyncSystem` instances have copy semantics, so it is easy to make them available wherever they're needed, including in lambda captures. In this example, `asyncSystem` is captured by value for use in the lambda. \snippet{trimleft} ExamplesAsyncSystem.cpp capture-by-value -You can think of an instance of `AsyncSystem` as a reference (perhaps a "smart reference") to an underlying implementation. When we create an `AsyncSystem` using its constructor, we're creating a brand new underlying implementation. If we then copy that `AsyncSystem` (using its copy constructor or assignment operator), we're not really copying that underlying implementation, we're just creating another reference to the same one with its `ITaskProcessor` object. Only when the last `AsyncSystem` instance referencing a particular underlying implementation is destroyed is that _underlying implementation_ destroyed. +You can think of an instance of `AsyncSystem` as a reference (perhaps a "smart reference") to an underlying implementation which includes an `ITaskProcessor` and all the supporting data structures for implementing futures, promises, and other `AsyncSystem` abstractions. When we create an `AsyncSystem` using its constructor, we're creating a brand new underlying implementation. If we then copy that `AsyncSystem` (using its copy constructor or assignment operator), we're not really copying that underlying implementation, we're just creating another reference to the same one with its `ITaskProcessor` object. Only when the last `AsyncSystem` instance referencing a particular underlying implementation is destroyed is that _underlying implementation_ destroyed. You can copy and destroy `AsyncSystem` instances at will, but you must take care that the _last_ instance referencing a given underlying implementation is destroyed only after all of that underlying implementation's `Futures` are complete. So a common pattern is to create and store an `AsyncSystem` as a static local in an accessor function: From f1ae8bd16c9c18bd5228a76e4c2ed761e61ff79e Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Mon, 9 Dec 2024 18:29:20 -0500 Subject: [PATCH 23/33] Update generated classes for EXT_structural_metadata --- CHANGES.md | 4 + .../ExtensionExtStructuralMetadata.h | 64 +++++++++ .../ExtensionExtStructuralMetadataReader.h | 76 +++++++++++ ...xtensionExtStructuralMetadataJsonHandler.h | 53 ++++++++ .../generated/src/GeneratedJsonHandlers.cpp | 121 ++++++++++++++++++ .../src/registerReaderExtensions.cpp | 7 + .../generated/src/ModelJsonWriter.cpp | 34 +++++ .../generated/src/ModelJsonWriter.h | 12 ++ .../src/registerWriterExtensions.cpp | 7 + tools/generate-classes/glTF.json | 11 ++ 10 files changed, 389 insertions(+) create mode 100644 CesiumGltf/generated/include/CesiumGltf/ExtensionExtStructuralMetadata.h create mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtStructuralMetadataReader.h create mode 100644 CesiumGltfReader/generated/src/ExtensionExtStructuralMetadataJsonHandler.h diff --git a/CHANGES.md b/CHANGES.md index 26d28e96c..2a255d443 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ### ? - ? +##### Additions :tada: + +- Updates generated classes for `EXT_structural_metadata`. See https://github.com/CesiumGS/glTF/pull/71. + ##### Fixes :wrench: - Fixed a bug in `thenPassThrough` that caused a compiler error when given a value by r-value refrence. diff --git a/CesiumGltf/generated/include/CesiumGltf/ExtensionExtStructuralMetadata.h b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtStructuralMetadata.h new file mode 100644 index 000000000..3dd5cfe11 --- /dev/null +++ b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtStructuralMetadata.h @@ -0,0 +1,64 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include +#include +#include + +#include +#include +#include + +namespace CesiumGltf { +/** + * @brief Structural metadata about a glTF element. + */ +struct CESIUMGLTF_API ExtensionExtStructuralMetadata final + : public CesiumUtility::ExtensibleObject { + static constexpr const char* TypeName = "ExtensionExtStructuralMetadata"; + static constexpr const char* ExtensionName = "EXT_structural_metadata"; + + /** + * @brief The class that property values conform to. The value shall be a + * class ID declared in the `classes` dictionary of the metadata schema. + */ + std::optional classProperty; + + /** + * @brief A dictionary, where each key corresponds to a property ID in the + * class' `properties` dictionary and each value contains the property values. + * The type of the value shall match the property definition: For `BOOLEAN` + * use `true` or `false`. For `STRING` use a JSON string. For numeric types + * use a JSON number. For `ENUM` use a valid enum `name`, not an integer + * value. For `ARRAY`, `VECN`, and `MATN` types use a JSON array containing + * values matching the `componentType`. Required properties shall be included + * in this dictionary. + */ + std::unordered_map properties; + + /** + * @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(ExtensionExtStructuralMetadata)); + accum += CesiumUtility::ExtensibleObject::getSizeBytes() - + int64_t(sizeof(CesiumUtility::ExtensibleObject)); + if (this->classProperty) { + accum += int64_t(this->classProperty->capacity() * sizeof(char)); + } + accum += int64_t( + this->properties.bucket_count() * + (sizeof(std::string) + sizeof(CesiumUtility::JsonValue))); + for (const auto& [k, v] : this->properties) { + accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string)); + accum += int64_t(sizeof(CesiumUtility::JsonValue)); + } + return accum; + } +}; +} // namespace CesiumGltf diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtStructuralMetadataReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtStructuralMetadataReader.h new file mode 100644 index 000000000..091cc9bb8 --- /dev/null +++ b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtStructuralMetadataReader.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 ExtensionExtStructuralMetadata; +} // namespace CesiumGltf + +namespace CesiumGltfReader { + +/** + * @brief Reads {@link ExtensionExtStructuralMetadata} instances from JSON. + */ +class CESIUMGLTFREADER_API ExtensionExtStructuralMetadataReader { +public: + /** + * @brief Constructs a new instance. + */ + ExtensionExtStructuralMetadataReader(); + + /** + * @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 ExtensionExtStructuralMetadata 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 ExtensionExtStructuralMetadata from a + * rapidJson::Value. + * + * @param data The buffer 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 ExtensionExtStructuralMetadata from a + * rapidJson::Value. + * + * @param data The buffer 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/ExtensionExtStructuralMetadataJsonHandler.h b/CesiumGltfReader/generated/src/ExtensionExtStructuralMetadataJsonHandler.h new file mode 100644 index 000000000..c939de2b5 --- /dev/null +++ b/CesiumGltfReader/generated/src/ExtensionExtStructuralMetadataJsonHandler.h @@ -0,0 +1,53 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include +#include +#include +#include +#include + +namespace CesiumJsonReader { +class JsonReaderOptions; +} // namespace CesiumJsonReader + +namespace CesiumGltfReader { +class ExtensionExtStructuralMetadataJsonHandler + : public CesiumJsonReader::ExtensibleObjectJsonHandler, + public CesiumJsonReader::IExtensionJsonHandler { +public: + using ValueType = CesiumGltf::ExtensionExtStructuralMetadata; + + static constexpr const char* ExtensionName = "EXT_structural_metadata"; + + explicit ExtensionExtStructuralMetadataJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept; + void reset( + IJsonHandler* pParentHandler, + CesiumGltf::ExtensionExtStructuralMetadata* 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* readObjectKeyExtensionExtStructuralMetadata( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionExtStructuralMetadata& o); + +private: + CesiumGltf::ExtensionExtStructuralMetadata* _pObject = nullptr; + CesiumJsonReader::StringJsonHandler _classProperty; + CesiumJsonReader::DictionaryJsonHandler< + CesiumUtility::JsonValue, + CesiumJsonReader::JsonObjectJsonHandler> + _properties; +}; +} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp index e3e26fa95..5532d65ac 100644 --- a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp +++ b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp @@ -853,6 +853,127 @@ ExtensionBufferViewExtMeshoptCompressionReader::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 "ExtensionExtStructuralMetadataJsonHandler.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 { + +ExtensionExtStructuralMetadataJsonHandler:: + ExtensionExtStructuralMetadataJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept + : CesiumJsonReader::ExtensibleObjectJsonHandler(options), + _classProperty(), + _properties() {} + +void ExtensionExtStructuralMetadataJsonHandler::reset( + CesiumJsonReader::IJsonHandler* pParentHandler, + CesiumGltf::ExtensionExtStructuralMetadata* pObject) { + CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); + this->_pObject = pObject; +} + +CesiumJsonReader::IJsonHandler* +ExtensionExtStructuralMetadataJsonHandler::readObjectKey( + const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyExtensionExtStructuralMetadata( + CesiumGltf::ExtensionExtStructuralMetadata::TypeName, + str, + *this->_pObject); +} + +void ExtensionExtStructuralMetadataJsonHandler::reset( + CesiumJsonReader::IJsonHandler* pParentHandler, + CesiumUtility::ExtensibleObject& o, + const std::string_view& extensionName) { + std::any& value = + o.extensions + .emplace(extensionName, CesiumGltf::ExtensionExtStructuralMetadata()) + .first->second; + this->reset( + pParentHandler, + &std::any_cast(value)); +} + +CesiumJsonReader::IJsonHandler* ExtensionExtStructuralMetadataJsonHandler:: + readObjectKeyExtensionExtStructuralMetadata( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionExtStructuralMetadata& o) { + using namespace std::string_literals; + + if ("class"s == str) { + return property("class", this->_classProperty, o.classProperty); + } + if ("properties"s == str) { + return property("properties", this->_properties, o.properties); + } + + return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); +} + +ExtensionExtStructuralMetadataReader::ExtensionExtStructuralMetadataReader() { + registerReaderExtensions(this->_options); +} + +CesiumJsonReader::JsonReaderOptions& +ExtensionExtStructuralMetadataReader::getOptions() { + return this->_options; +} + +const CesiumJsonReader::JsonReaderOptions& +ExtensionExtStructuralMetadataReader::getOptions() const { + return this->_options; +} + +CesiumJsonReader::ReadJsonResult +ExtensionExtStructuralMetadataReader::readFromJson( + const std::span& data) const { + ExtensionExtStructuralMetadataJsonHandler handler(this->_options); + return CesiumJsonReader::JsonReader::readJson(data, handler); +} + +CesiumJsonReader::ReadJsonResult +ExtensionExtStructuralMetadataReader::readFromJson( + const rapidjson::Value& value) const { + ExtensionExtStructuralMetadataJsonHandler handler(this->_options); + return CesiumJsonReader::JsonReader::readJson(value, handler); +} + +CesiumJsonReader::ReadJsonResult< + std::vector> +ExtensionExtStructuralMetadataReader::readArrayFromJson( + const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler< + CesiumGltf::ExtensionExtStructuralMetadata, + ExtensionExtStructuralMetadataJsonHandler> + 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 a7fd0aa62..34d2b855c 100644 --- a/CesiumGltfReader/generated/src/registerReaderExtensions.cpp +++ b/CesiumGltfReader/generated/src/registerReaderExtensions.cpp @@ -11,6 +11,7 @@ #include "ExtensionExtInstanceFeaturesJsonHandler.h" #include "ExtensionExtMeshFeaturesJsonHandler.h" #include "ExtensionExtMeshGpuInstancingJsonHandler.h" +#include "ExtensionExtStructuralMetadataJsonHandler.h" #include "ExtensionKhrDracoMeshCompressionJsonHandler.h" #include "ExtensionKhrMaterialsUnlitJsonHandler.h" #include "ExtensionKhrTextureBasisuJsonHandler.h" @@ -75,6 +76,9 @@ void registerReaderExtensions(CesiumJsonReader::JsonReaderOptions& options) { options.registerExtension< CesiumGltf::Node, ExtensionExtMeshGpuInstancingJsonHandler>(); + options.registerExtension< + CesiumGltf::Node, + ExtensionExtStructuralMetadataJsonHandler>(); options.registerExtension< CesiumGltf::Node, ExtensionNodeMaxarMeshVariantsJsonHandler>(); @@ -84,6 +88,9 @@ void registerReaderExtensions(CesiumJsonReader::JsonReaderOptions& options) { options.registerExtension< CesiumGltf::BufferView, ExtensionBufferViewExtMeshoptCompressionJsonHandler>(); + options.registerExtension< + CesiumGltf::Material, + ExtensionExtStructuralMetadataJsonHandler>(); options.registerExtension< CesiumGltf::Material, ExtensionKhrMaterialsUnlitJsonHandler>(); diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp index eb90d3792..731c7e282 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -122,6 +123,11 @@ void writeJson( CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); +void writeJson( + const CesiumGltf::ExtensionExtStructuralMetadata& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context); + void writeJson( const CesiumGltf::ExtensionModelExtStructuralMetadata& obj, CesiumJsonWriter::JsonWriter& jsonWriter, @@ -728,6 +734,27 @@ void writeJson( jsonWriter.EndObject(); } +void writeJson( + const CesiumGltf::ExtensionExtStructuralMetadata& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context) { + jsonWriter.StartObject(); + + if (obj.classProperty) { + jsonWriter.Key("class"); + writeJson(obj.classProperty, jsonWriter, context); + } + + if (!obj.properties.empty()) { + jsonWriter.Key("properties"); + writeJson(obj.properties, jsonWriter, context); + } + + writeExtensibleObject(obj, jsonWriter, context); + + jsonWriter.EndObject(); +} + void writeJson( const CesiumGltf::ExtensionModelExtStructuralMetadata& obj, CesiumJsonWriter::JsonWriter& jsonWriter, @@ -2419,6 +2446,13 @@ void ExtensionBufferViewExtMeshoptCompressionJsonWriter::write( writeJson(obj, jsonWriter, context); } +void ExtensionExtStructuralMetadataJsonWriter::write( + const CesiumGltf::ExtensionExtStructuralMetadata& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context) { + writeJson(obj, jsonWriter, context); +} + void ExtensionModelExtStructuralMetadataJsonWriter::write( const CesiumGltf::ExtensionModelExtStructuralMetadata& obj, CesiumJsonWriter::JsonWriter& jsonWriter, diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.h b/CesiumGltfWriter/generated/src/ModelJsonWriter.h index 8dccf43b9..0262f519e 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.h +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.h @@ -17,6 +17,7 @@ struct ExtensionExtMeshFeatures; struct ExtensionExtMeshGpuInstancing; struct ExtensionBufferExtMeshoptCompression; struct ExtensionBufferViewExtMeshoptCompression; +struct ExtensionExtStructuralMetadata; struct ExtensionModelExtStructuralMetadata; struct ExtensionMeshPrimitiveExtStructuralMetadata; struct ExtensionKhrDracoMeshCompression; @@ -156,6 +157,17 @@ struct ExtensionBufferViewExtMeshoptCompressionJsonWriter { const CesiumJsonWriter::ExtensionWriterContext& context); }; +struct ExtensionExtStructuralMetadataJsonWriter { + using ValueType = CesiumGltf::ExtensionExtStructuralMetadata; + + static constexpr const char* ExtensionName = "EXT_structural_metadata"; + + static void write( + const CesiumGltf::ExtensionExtStructuralMetadata& obj, + CesiumJsonWriter::JsonWriter& jsonWriter, + const CesiumJsonWriter::ExtensionWriterContext& context); +}; + struct ExtensionModelExtStructuralMetadataJsonWriter { using ValueType = CesiumGltf::ExtensionModelExtStructuralMetadata; diff --git a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp index 49a388aca..d0b0ab627 100644 --- a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp +++ b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -80,6 +81,9 @@ void registerWriterExtensions( context.registerExtension< CesiumGltf::Node, ExtensionExtMeshGpuInstancingJsonWriter>(); + context.registerExtension< + CesiumGltf::Node, + ExtensionExtStructuralMetadataJsonWriter>(); context.registerExtension< CesiumGltf::Node, ExtensionNodeMaxarMeshVariantsJsonWriter>(); @@ -89,6 +93,9 @@ void registerWriterExtensions( context.registerExtension< CesiumGltf::BufferView, ExtensionBufferViewExtMeshoptCompressionJsonWriter>(); + context.registerExtension< + CesiumGltf::Material, + ExtensionExtStructuralMetadataJsonWriter>(); context.registerExtension< CesiumGltf::Material, ExtensionKhrMaterialsUnlitJsonWriter>(); diff --git a/tools/generate-classes/glTF.json b/tools/generate-classes/glTF.json index 5a5f8fb28..10e6609ca 100644 --- a/tools/generate-classes/glTF.json +++ b/tools/generate-classes/glTF.json @@ -61,6 +61,9 @@ "overrideName": "ExtensionBufferViewExtMeshoptCompression" }, "EXT_structural_metadata glTF extension": { + "overrideName": "ExtensionExtStructuralMetadata" + }, + "EXT_structural_metadata glTF Document extension": { "overrideName": "ExtensionModelExtStructuralMetadata" }, "EXT_structural_metadata glTF Mesh Primitive extension": { @@ -169,6 +172,14 @@ "extensionName": "EXT_meshopt_compression", "schema": "Vendor/EXT_meshopt_compression/schema/bufferView.EXT_meshopt_compression.schema.json" }, + { + "extensionName": "EXT_structural_metadata", + "schema": "Vendor/EXT_structural_metadata/schema/EXT_structural_metadata.schema.json", + "attachTo": [ + "node", + "material" + ] + }, { "extensionName": "EXT_structural_metadata", "schema": "Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json" From 1b4318a38cdb8ff14c45660ab28d60a4983b5bba Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 5 Dec 2024 11:37:43 +1100 Subject: [PATCH 24/33] Better explanation of AsyncSystem copying, waitInMainThread->wait --- CesiumAsync/test/ExamplesAsyncSystem.cpp | 8 ++++---- doc/topics/async-system.md | 16 ++++++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CesiumAsync/test/ExamplesAsyncSystem.cpp b/CesiumAsync/test/ExamplesAsyncSystem.cpp index a9b3cf4c4..c0356df59 100644 --- a/CesiumAsync/test/ExamplesAsyncSystem.cpp +++ b/CesiumAsync/test/ExamplesAsyncSystem.cpp @@ -157,7 +157,7 @@ TEST_CASE("AsyncSystem Examples") { }; //! [capture-by-value] - SECTION("waitInMainThread") { + SECTION("wait") { //! [create-request-future] std::shared_ptr pAssetAccessor = getAssetAccessor(); @@ -166,10 +166,10 @@ TEST_CASE("AsyncSystem Examples") { pAssetAccessor->get(asyncSystem, "https://example.com"); //! [create-request-future] - //! [wait-in-main-thread] + //! [wait] std::shared_ptr pCompletedRequest = - std::move(future).waitInMainThread(); - //! [wait-in-main-thread] + std::move(future).wait(); + //! [wait] } SECTION("thenInMainThread") { diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index bc5207364..516d7f12a 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -33,11 +33,13 @@ The `AsyncSystem` can then be created as follows: \snippet{trimleft} ExamplesAsyncSystem.cpp create-async-system -`AsyncSystem` instances can be safely and efficiently stored and copied by value. This makes it easy to make them available wherever they're needed, including in lambda captures. You can think of an `AsyncSystem` instance as acting a bit like a smart pointer. +`AsyncSystem` instances can be safely and efficiently stored and copied by value. This makes it easy to make them available wherever they're needed, including in lambda captures. \snippet{trimleft} ExamplesAsyncSystem.cpp capture-by-value -However, it is essential that the last `AsyncSystem` instance be destroyed only after everything is done using it. So a common pattern is to create and store it as a static local in an accessor function: +You can think of an instance of `AsyncSystem` as a reference (perhaps a "smart reference") to an underlying implementation. When we create an `AsyncSystem` using its constructor taking an `ITaskProcessor`, we're creating a brand new underlying implementation. If we then copy that `AsyncSystem` (using its copy constructor or assignment operator), we're not really copying that underlying implementation, we're just creating another reference to the same one. Only when the last `AsyncSystem` instance referencing a particular underlying implementation is destroyed is that _underlying implementation_ destroyed. + +You can copy and destroy `AsyncSystem` instances at will, but you must take care that the _last_ instance referencing a given underlying implementation is destroyed only after all of that underlying implementation's `Futures` are complete. So a common pattern is to create and store an `AsyncSystem` as a static local in an accessor function: \snippet{trimleft} ExamplesAsyncSystem.cpp async-system-singleton @@ -52,16 +54,18 @@ This [get](@ref CesiumAsync::IAssetAccessor::get) function will start the HTTP r * _Resolved_: The operation has completed successfully and the result value is available. * _Rejected_: The operation failed, and an exception describing the error is available. -If we want to block the current thread and wait for the request to complete, we can call [waitInMainThread](@ref CesiumAsync::Future::waitInMainThread): +If we want to block the current thread and wait for the request to complete, we can call [wait](@ref CesiumAsync::Future::wait): -\snippet{trimleft} ExamplesAsyncSystem.cpp wait-in-main-thread +\snippet{trimleft} ExamplesAsyncSystem.cpp wait -`waitInMainThread` blocks until the `Future` completes. If it is resolved, `waitInMainThread` returns its value. If it is rejected, `waitInMainThread` throws an exception representing the error. +`wait` blocks until the `Future` completes. If it is resolved, `wait` returns its value. If it is rejected, `wait` throws an exception representing the error. > [!note] > The `std::move` is needed because `Future` is meant to be consumed just once. This allows for best efficiency because the value resulting from the asynchronous operation can be provided to the caller without ever making a copy of it. -In practice, though, we almost never call `waitInMainThread`. After all, what good is it to start an asynchronous operation if we're just going to block the calling thread waiting for it? Instead, we register a _continuation function_ with the `Future`. +`wait` should never be called in the "main thread" (defined in the next section), because doing so can cause a deadlock. To block the main thread waiting for a `Future`, call [waitInMainThread](@ref CesiumAsync::Future::waitInMainThread) instead. + +In practice, though, we almost never call `wait` or `waitInMainThread`. After all, what good is it to start an asynchronous operation if we're just going to block the calling thread waiting for it? Instead, we register a _continuation function_ with the `Future`. ## Continuation Functions {#continuation-functions} From aeb996582e9f06fde4932535345d3931d5bf15a0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 5 Dec 2024 11:43:05 +1100 Subject: [PATCH 25/33] Add more explanation of `thenInThreadPool`. --- doc/topics/async-system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index 516d7f12a..dbee5c311 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -73,7 +73,7 @@ A continuation function is a callback - usually a lambda - that is invoked when * [thenInMainThread](@ref CesiumAsync::Future::thenInMainThread): The continuation function is invoked in the "main" thread. Many applications have a clear idea of which thread they consider the main one, but in Cesium Native, "main thread" very specifically means the thread that called `waitInMainThread` or [dispatchMainThreadTasks](@ref CesiumAsync::AsyncSystem::dispatchMainThreadTasks) on the `AsyncSystem`. This need not be the same as the thread your application considers to be the main one. * [thenInWorkerThread](@ref CesiumAsync::Future::thenInWorkerThread): The continuation function is invoked in a background worker thread by calling [startTask](@ref CesiumAsync::ITaskProcessor::startTask) on the `ITaskProcessor` instance with which the `AsyncSystem` was constructed. -* [thenInThreadPool](@ref CesiumAsync::Future::thenInThreadPool): The continuation function is invoked in a specified [ThreadPool](@ref CesiumAsync::ThreadPool). +* [thenInThreadPool](@ref CesiumAsync::Future::thenInThreadPool): The continuation function is invoked in a specified [ThreadPool](@ref CesiumAsync::ThreadPool). This is most commonly used with a `ThreadPool` containing just a single thread, in order to delegate certain tasks (such as database access) to a dedicated thread. In other cases, `thenInWorkerThread` is probably a better choice. * [thenImmediately](@ref CesiumAsync::Future::thenImmediately): The continuation function is invoked immediately in whatever thread happened to resolve the `Future`. This is only appropriate for work that completes very quickly and is safe to run in any thread. Continuing with our web request example above, we can register a continuation that receives the completed request and does something with the downloaded data in the main thread: From b30c1b99152920a76ffcbf746817fc4dd683e325 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 5 Dec 2024 12:26:17 +1100 Subject: [PATCH 26/33] Add note about createFuture invoking its function in the current thread. --- doc/topics/async-system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index dbee5c311..553b72d5f 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -188,7 +188,7 @@ We could change `myComputeSomethingSlowlyWrapper` to catch the possible exceptio \snippet{trimleft} ExamplesAsyncSystem.cpp compute-something-slowly-wrapper-handle-exception -The `createFuture` method takes a function as its only parameter, and it _immediately_ invokes that function (that's why it's safe to capture everything by reference `&` in this case). The function receives a parameter of type `Promise`, which is identical to the one that would be created by `createPromise`. Just like before, we call the library function that we're wrapping and resolve the `Promise` when its callback is invoked. +The `createFuture` method takes a function as its only parameter, and it _immediately_ invokes that function in the current thread (that's why it's safe to capture everything by reference `&` in this case). The function receives a parameter of type `Promise`, which is identical to the one that would be created by `createPromise`. Just like before, we call the library function that we're wrapping and resolve the `Promise` when its callback is invoked. The important difference, however, is that if `computeSomethingSlowly` throws an exception, `createFuture` will automatically catch that exception and turn it into a rejection of the `Future`. From ada01eb089b8ec64027ccc08611d706c870dbeb1 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 5 Dec 2024 12:27:52 +1100 Subject: [PATCH 27/33] Multiple continuations can be attached to a single SharedFuture. --- doc/topics/async-system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index 553b72d5f..52b7b8b5a 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -196,7 +196,7 @@ The important difference, however, is that if `computeSomethingSlowly` throws an A `Future` may have at most one continuation. It's not possible to arrange for two continuation functions to be called when a given `Future` resolves. This policy makes `Future` more efficient by minimizing bookkeeping. In the majority of cases, this is sufficient. But not always. -In those cases where we do want to be able to attach multiple continuations, we can convert a `Future` into a [SharedFuture](@ref CesiumAsync::SharedFuture) by calling the [share](@ref CesiumAsync::Future::share) method on it. The returned `SharedFuture` instance works a bit like a smart pointer. It's safe to copy, and all copies are logically identical to the original. Just like `Future`, we can call `then...` and `catch...` methods to attach continuations. The difference is that we can do this multiple times, and all attached continuations will be invoked when the future completes. +In those cases where we do want to be able to attach multiple continuations, we can convert a `Future` into a [SharedFuture](@ref CesiumAsync::SharedFuture) by calling the [share](@ref CesiumAsync::Future::share) method on it. The returned `SharedFuture` instance works a bit like a smart pointer. It's safe to copy, and all copies are logically identical to the original. Just like `Future`, we can call `then...` and `catch...` methods to attach continuations. The difference is that we can do this multiple times, even on a single `SharedFuture` instance, and all attached continuations will be invoked when the future completes. It may initially be surprising to learn that calling `then...` or `catch...` on a `SharedFuture` returns a `Future`, not another `SharedFuture`. This is again for efficiency. Just because multiple continuations are needed for one point in a continuation chain does not necessarily mean later parts of the chain will also need multiple continuations. If they do, however, it's just a matter of calling `share` again. From decf9d1f1f3003d4237ca3e0f2e7a388276d28b0 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Thu, 12 Dec 2024 13:25:13 +1100 Subject: [PATCH 28/33] Fix typo. --- doc/topics/rendering-3d-tiles.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/rendering-3d-tiles.md b/doc/topics/rendering-3d-tiles.md index c844d4e07..6764f570a 100644 --- a/doc/topics/rendering-3d-tiles.md +++ b/doc/topics/rendering-3d-tiles.md @@ -47,7 +47,7 @@ With Tile A selected and its loading complete, the `Tileset` will return it from @mermaid{tileset-sequence-diagram-frame4} -In Frame 4, the `prepareInLoadThread` initiated for Tile B in Frame 3 resolves. When `Tileset` runs the selection algorith, it learns that, because a view has moved, only Tile B is selected now. It calls `prepareInMainThread` on Tile B to prepare it for rendering. +In Frame 4, the `prepareInLoadThread` initiated for Tile B in Frame 3 resolves. When `Tileset` runs the selection algorithm, it learns that, because a view has moved, only Tile B is selected now. It calls `prepareInMainThread` on Tile B to prepare it for rendering. `Tileset` also calls [free](@ref Cesium3DTilesSelection::IPrepareRendererResources::free) to release the renderer resources that were created for Tile A in `prepareInLoadThread` and `prepareInMainThread`. Once the renderer resources are freed, the `Tileset` will release the glTF tile content as well. In practice, this `free` may or may not actually happen this frame. Cesium Native keeps some tiles around, up to a [maximumCachedBytes](@ref Cesium3DTilesSelection::TilesetOptions::maximumCachedBytes) specified in [TilesetOptions](@ref Cesium3DTilesSelection::TilesetOptions), in case they are needed again soon. Cesium Native will ensure that the tiles it calls `free` on are not currently visible in the scene. From 44c5892779bbc59216b707e3a24df3cab17eb6b9 Mon Sep 17 00:00:00 2001 From: Janine Liu <32226860+j9liu@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:50:46 -0500 Subject: [PATCH 29/33] Apply suggestions from code review --- CHANGES.md | 2 +- Cesium3DTilesSelection/src/Tileset.cpp | 2 +- CesiumAsync/include/CesiumAsync/SqliteHelper.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3b29364d9..e54e166cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,7 +10,7 @@ - Added `InstanceAttributeSemantics` to `CesiumGltf`. - Added `VertexAttributeSemantics::FEATURE_ID_n`. - Added a `const` version of `Tileset::forEachLoadedTile`. -- Added `DebugTileStateDatabase` class. +- Added `DebugTileStateDatabase`, which provides tools for debugging the tile selection algorithm using SQLite. - Added `CesiumAsync::SqliteHelper`, containing functions for working with SQLite. ##### Fixes :wrench: diff --git a/Cesium3DTilesSelection/src/Tileset.cpp b/Cesium3DTilesSelection/src/Tileset.cpp index 28a8b92bb..00ce4a018 100644 --- a/Cesium3DTilesSelection/src/Tileset.cpp +++ b/Cesium3DTilesSelection/src/Tileset.cpp @@ -1663,7 +1663,7 @@ Tileset::TraversalDetails Tileset::createTraversalDetailsForSingleTile( if (!wasRenderedLastFrame && lastFrameResult == TileSelectionState::Result::Refined) { if (tile.getRefine() == TileRefine::Add) { - // An additive-refined tile that was refine was also rendered. + // An additive-refined tile that was refined was also rendered. wasRenderedLastFrame = true; } else { // With replace-refinement, if any of this refined tile's children were diff --git a/CesiumAsync/include/CesiumAsync/SqliteHelper.h b/CesiumAsync/include/CesiumAsync/SqliteHelper.h index b210e76b1..9633e8011 100644 --- a/CesiumAsync/include/CesiumAsync/SqliteHelper.h +++ b/CesiumAsync/include/CesiumAsync/SqliteHelper.h @@ -19,7 +19,7 @@ struct DeleteSqliteConnection { }; /** - * @brief A deleter that can be used with `std::unique_ptr` to property destroy + * @brief A deleter that can be used with `std::unique_ptr` to properly destroy * a SQLite prepared statement when it is no longer needed. */ struct DeleteSqliteStatement { From 53bb0eddac44ca95b55f17dedcd4dd2488f51292 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Fri, 13 Dec 2024 17:26:55 +0100 Subject: [PATCH 30/33] Take asyncSystem lambda example from live code --- Cesium3DTilesReader/src/SubtreeFileReader.cpp | 2 ++ doc/CMakeLists.txt | 1 + doc/topics/async-system.md | 15 ++------------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Cesium3DTilesReader/src/SubtreeFileReader.cpp b/Cesium3DTilesReader/src/SubtreeFileReader.cpp index 4ec1c59c6..f023a956a 100644 --- a/Cesium3DTilesReader/src/SubtreeFileReader.cpp +++ b/Cesium3DTilesReader/src/SubtreeFileReader.cpp @@ -19,6 +19,7 @@ SubtreeFileReader::getOptions() const { return this->_reader.getOptions(); } +//! [async-system-store-in-lambda] Future> SubtreeFileReader::load( const AsyncSystem& asyncSystem, const std::shared_ptr& pAssetAccessor, @@ -30,6 +31,7 @@ Future> SubtreeFileReader::load( return this->load(asyncSystem, pAssetAccessor, pRequest); }); } +//! [async-system-store-in-lambda] Future> SubtreeFileReader::load( const AsyncSystem& asyncSystem, diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1af199be3..0ed46b91c 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -47,6 +47,7 @@ if(DOXYGEN_FOUND) ../CesiumQuantizedMeshTerrain/test ../CesiumRasterOverlays/test ../CesiumUtility/test + ../ # For examples drawn from the actual code ) # These macro definitions confuse doxygen, causing it diff --git a/doc/topics/async-system.md b/doc/topics/async-system.md index ec986770e..848fbac84 100644 --- a/doc/topics/async-system.md +++ b/doc/topics/async-system.md @@ -21,22 +21,11 @@ Unfortunately, there is inevitably at least a little bit of tile loading work th `AsyncSystem` gives us an elegant way to express this kind of sequential process involving a series of asynchronous steps. -## The AsyncSystem Class +## The AsyncSystem Class {#asyncsystem-class} An `AsyncSystem` object manages the other objects we use to schedule work and wait for its completion. During initialization, an application [constructs an AsyncSystem object](#creating-an-asyncsystem) and passes it to Cesium Native, which in turn uses it in all operations that might complete asynchronously. `AsyncSystem` instances can be safely and efficiently stored and copied by value; this makes it easy to make them available wherever they're needed, including in lambda captures. On the other hand, holding a reference to an `AsyncSystem` object is very bug-prone in asynchronous code; the lifetime of the reference holder can be quite different from the code that uses it and hard to reason about. It is idiomatic to pass a `const` reference to an `AsyncSystem` object as a parameter to a function, but that reference must be copied to a value if it will be used outside of the lifetime of the function. For example, in the following code, the `asyncSystem` function parameter is copied to a constant value member in the inner lambda: - Future> SubtreeFileReader::load( - const AsyncSystem& asyncSystem, - const std::shared_ptr& pAssetAccessor, - const std::string& url, - const std::vector& headers) const noexcept { - return pAssetAccessor->get(asyncSystem, url, headers) - .thenInWorkerThread([asyncSystem, pAssetAccessor, this]( - std::shared_ptr&& pRequest) { - return this->load(asyncSystem, pAssetAccessor, pRequest); - }); - } - +\snippet{trimleft} Cesium3DTilesReader/src/SubtreeFileReader.cpp async-system-store-in-lambda ## Future {#future} From b3abb9f930129872e94792fd030f6fee091de69e Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Fri, 13 Dec 2024 15:40:11 -0500 Subject: [PATCH 31/33] Update based on review --- CONTRIBUTING.md | 2 +- README.md | 1 - doc/CMakeLists.txt | 1 + doc/diagrams/dependency-graph.svg | 1 - doc/footer.html | 5 +-- doc/topics/dependencies.md | 52 +++++++++++++++---------------- 6 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 doc/diagrams/dependency-graph.svg diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d28ef8bd2..b0c37370b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Our code is our lifeblood so maintaining Cesium Native's high code quality is im - Pull request tips - If your pull request fixes an existing issue, include a link to the issue in the description (like this: "Fixes [#1](https://github.com/CesiumGS/cesium-native/issues/1)"). Likewise, if your pull request fixes an issue reported on the Cesium forum, include a link to the thread. - If your pull request needs additional work, include a [task list](https://github.com/blog/1375%0A-task-lists-in-gfm-issues-pulls-comments). - - Once you are done making new commits to address feedback, add a comment to the pull request such as `"this is ready"` since GitHub doesn't notify us about commits. + - Once you are done making new commits to address feedback, add a comment to the pull request such as `"this is ready"`. - Code and tests - Review the [C++ Style Guide](doc/topics/style-guide.md). These guidelines help us write consistent, performant, less buggy code and improve our productivity by standardizing the decisions we make across the codebase. - Verify that all tests pass, and write new tests with excellent code coverage for new code. Tests can be built and run using the `cesium-native-tests` target. diff --git a/README.md b/README.md index c384c7177..6ce657f87 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![Release](https://img.shields.io/github/v/tag/CesiumGS/cesium-native?label=release)](https://github.com/CesiumGS/cesium-native/tags) 📚Documentation - 📒Change Log - 💬Community Forums - ## 📖About diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 310658b3e..4cea1b28a 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -97,6 +97,7 @@ if(DOXYGEN_FOUND) set(DOXYGEN_HTML_EXTRA_FILES "${CMAKE_CURRENT_LIST_DIR}/assets/mermaid.min.js ${CMAKE_CURRENT_LIST_DIR}/assets/mingcute.json.js ${CMAKE_CURRENT_LIST_DIR}/assets/panzoom.js") list(APPEND DOXYGEN_ALIASES mermaid{1}="\\htmlonly
^^ \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly ^^
\\endhtmlonly") list(APPEND DOXYGEN_ALIASES mermaid-interactive{1}="\\htmlonly
^^ \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly ^^
\\endhtmlonly") + list(APPEND DOXYGEN_ALIASES svg-interactive{2}="\\htmlonly
^^ \\endhtmlonly \\image html \\\"\\1.svg\\\" \\htmlonly ^^
\\endhtmlonly") set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES DOXYGEN_HTML_EXTRA_FILES) list(APPEND DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_LIST_DIR}/diagrams") diff --git a/doc/diagrams/dependency-graph.svg b/doc/diagrams/dependency-graph.svg deleted file mode 100644 index b34ba7aa5..000000000 --- a/doc/diagrams/dependency-graph.svg +++ /dev/null @@ -1 +0,0 @@ -

CesiumUtility

glm::glm

spdlog::spdlog

uriparser::uriparser

zlib-ng::zlib-ng

Cesium3DTiles

Cesium3DTilesContent

Cesium3DTilesReader

CesiumAsync

CesiumGeometry

CesiumGeospatial

CesiumGltf

CesiumGltfContent

CesiumGltfReader

libmorton::libmorton

CesiumJsonReader

Async++

spdlog::spdlog_header_only

unofficial::sqlite3::sqlite3

earcut

s2::s2

KTX::ktx

WebP::webp

WebP::webpdecoder

draco::draco

libjpeg-turbo::turbojpeg-static

meshoptimizer::meshoptimizer

modp_b64::modp_b64

Cesium3DTilesSelection

CesiumQuantizedMeshTerrain

CesiumRasterOverlays

nonstd::expected-lite

tinyxml2::tinyxml2

CesiumJsonWriter

Cesium3DTilesWriter

CesiumGltfWriter

CesiumIonClient

OpenSSL::Crypto

httplib::httplib

picosha2::picosha2

\ No newline at end of file diff --git a/doc/footer.html b/doc/footer.html index 03ac196fe..280ffec1b 100644 --- a/doc/footer.html +++ b/doc/footer.html @@ -15,15 +15,16 @@ } ]); window.addEventListener("load", (ev) => { - document.querySelectorAll(".interactive svg").forEach(svg => { + document.querySelectorAll(".mermaid.interactive svg").forEach(svg => { svg.parentElement.style.overflow = "hidden"; svg.parentElement.classList.add("pan-zoom-viewport"); panzoom(svg); }); - document.querySelectorAll("object[type='image/svg+xml']").forEach(svg => { + document.querySelectorAll(".svg.interactive object[type='image/svg+xml']").forEach(svg => { // Make parent element the viewport svg.parentElement.style.overflow = "hidden"; svg.parentElement.classList.add("pan-zoom-viewport"); + svg.parentElement.style.minHeight = svg.parentElement.parentElement.style.minHeight; panzoom(svg); }); }); diff --git a/doc/topics/dependencies.md b/doc/topics/dependencies.md index 1c4e7ea78..b3b418f23 100644 --- a/doc/topics/dependencies.md +++ b/doc/topics/dependencies.md @@ -2,32 +2,32 @@ Cesium Native relies on a number of third-party dependencies. These dependencies are automatically resolved and built using [vcpkg](https://vcpkg.io/) at compile time. -| Dependency | Usage | -| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| [Async++](https://github.com/Amanieu/asyncplusplus) | Used by CesiumAsync for cross-platform concurrency. | -| [Catch2](https://github.com/catchorg/Catch2) | Test framework used by CesiumNativeTests. | -| [draco](https://github.com/google/draco) | Required to decode meshes and point clouds compressed with Draco. | -| [earcut](https://github.com/mapbox/earcut.hpp) | Polygon triangulation library for used by CartographicPolygon. | -| [expected-lite](https://github.com/martinmoene/expected-lite) | Implementation of the `std::expected` proposal for returning either an expected value or an error value. | -| [glm](https://github.com/g-truc/glm) | C++ mathematics library powering the high-precision math needed for geospatial software. | -| [meshoptimizer](https://github.com/zeux/meshoptimizer) | Required to decode meshes compressed with meshoptimizer. | -| [httplib](https://github.com/yhirose/cpp-httplib) | Used by CesiumIonClient to interact with the Cesium ion REST API. | -| [Ktx](https://github.com/CesiumGS/KTX-Software) | Required to load KTX GPU compressed textures. | -| [libmorton](https://github.com/Forceflow/libmorton) | Implementation of Morton codes used for implicit tiling. | -| [libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) | Decodes JPEG images. | -| [libwebp](https://github.com/webmproject/libwebp) | Decodes WebP images. | -| [modp_b64](https://github.com/chromium/chromium/tree/15996b5d2322b634f4197447b10289bddc2b0b32/third_party/modp_b64) | Decodes and encodes base64. | -| [OpenSSL](https://github.com/openssl/openssl) | Used to generate unique authorization tokens for authenticating with Cesium ion. | -| [PicoSHA2](https://okdshin/PicoSHA2) | Generates SHA256 hashes for use with the Cesium ion REST API. | -| [RapidJSON](https://github.com/Tencent/rapidjson) | For JSON reading and writing. | -| [s2geometry](https://github.com/google/s2geometry) | Spatial indexing library designed for geospatial use and required by some tilesets. | -| [spdlog](https://github.com/gabime/spdlog) | Debug logging. | -| [sqlite3](https://www.sqlite.org/index.html) | Used to cache HTTP responses. | -| [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h) | A simple image loader. | -| [tinyxml2](https://github.com/leethomason/tinyxml2) | XML parser for interacting with XML APIs such as those implementing the Web Map Service standard. | -| [uriparser](https://github.com/uriparser/uriparser) | Used to parse and manipulate URIs. | -| [zlib-ng](https://github.com/zlib-ng/zlib-ng) | An optimized zlib implementation for working with Gzipped data. | +| Dependency | Usage | +| ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| [Async++](https://github.com/Amanieu/asyncplusplus) | Used by CesiumAsync for cross-platform concurrency. | +| [Catch2](https://github.com/catchorg/Catch2) | Test framework used by CesiumNativeTests. | +| [draco](https://github.com/google/draco) | Required to decode meshes and point clouds compressed with Draco. | +| [earcut](https://github.com/mapbox/earcut.hpp) | Polygon triangulation library for used by CartographicPolygon. | +| [expected-lite](https://github.com/martinmoene/expected-lite) | Implementation of the `std::expected` proposal for returning either an expected value or an error value. | +| [glm](https://github.com/g-truc/glm) | C++ mathematics library powering the high-precision math needed for geospatial software. | +| [meshoptimizer](https://github.com/zeux/meshoptimizer) | Required to decode meshes compressed with meshoptimizer. | +| [httplib](https://github.com/yhirose/cpp-httplib) | Used by CesiumIonClient to interact with the Cesium ion REST API. | +| [Ktx](https://github.com/CesiumGS/KTX-Software) | Required to load KTX GPU compressed textures. | +| [libmorton](https://github.com/Forceflow/libmorton) | Implementation of Morton codes used for implicit tiling. | +| [libjpeg-turbo](https://github.com/libjpeg-turbo/libjpeg-turbo) | Decodes JPEG images. | +| [libwebp](https://github.com/webmproject/libwebp) | Decodes WebP images. | +| [modp_b64](https://github.com/chromium/chromium/tree/15996b5d2322b634f4197447b10289bddc2b0b32/third_party/modp_b64) | Decodes and encodes base64. | +| [OpenSSL](https://github.com/openssl/openssl) | Required by s2geometry, and also used to generate unique authorization tokens for authenticating with Cesium ion. | +| [PicoSHA2](https://okdshin/PicoSHA2) | Generates SHA256 hashes for use with the Cesium ion REST API. | +| [RapidJSON](https://github.com/Tencent/rapidjson) | For JSON reading and writing. | +| [s2geometry](https://github.com/google/s2geometry) | Spatial indexing library designed for geospatial use and required by some tilesets. | +| [spdlog](https://github.com/gabime/spdlog) | Logging. | +| [sqlite3](https://www.sqlite.org/index.html) | Used to cache HTTP responses. | +| [stb_image](https://github.com/nothings/stb/blob/master/stb_image.h) | A simple image loader. | +| [tinyxml2](https://github.com/leethomason/tinyxml2) | XML parser for interacting with XML APIs such as those implementing the Web Map Service standard. | +| [uriparser](https://github.com/uriparser/uriparser) | Used to parse and manipulate URIs. | +| [zlib-ng](https://github.com/zlib-ng/zlib-ng) | An optimized zlib implementation for working with Gzipped data. | The following chart illustrates the connections between the Cesium Native libraries and third-party dependencies: -\image html dependency-graph.svg \ No newline at end of file +\svg-interactive{dependency-graph, 600px} \ No newline at end of file From fc4e9dda7e3c61dd2a11c6fa4166028ae11c5400 Mon Sep 17 00:00:00 2001 From: Ashley Rogers Date: Fri, 13 Dec 2024 15:45:34 -0500 Subject: [PATCH 32/33] Update Visual Studio CMake line --- doc/topics/developer-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/topics/developer-setup.md b/doc/topics/developer-setup.md index f12f85dfe..c9b86e682 100644 --- a/doc/topics/developer-setup.md +++ b/doc/topics/developer-setup.md @@ -44,7 +44,7 @@ git submodule update --init --recursive ```bash ## Windows compilation using Visual Studio -cmake -B build -S . -G "Visual Studio 15 2017 Win64" +cmake -B build -S . -G "Visual Studio 17 2022" -A x64 cmake --build build --config Debug cmake --build build --config Release From f8956edf9c154ddec343ac801ef63e6f187838f2 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 17 Dec 2024 10:28:55 +1100 Subject: [PATCH 33/33] Fix misplaced doc comment. --- .../Cesium3DTilesSelection/TileOcclusionRendererProxy.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TileOcclusionRendererProxy.h b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TileOcclusionRendererProxy.h index 18d6c8cc4..b3f47b5fb 100644 --- a/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TileOcclusionRendererProxy.h +++ b/Cesium3DTilesSelection/include/Cesium3DTilesSelection/TileOcclusionRendererProxy.h @@ -7,10 +7,11 @@ #include #include +namespace Cesium3DTilesSelection { + /** * @brief The occlusion state of a tile as reported by the renderer proxy. */ -namespace Cesium3DTilesSelection { enum class CESIUM3DTILESSELECTION_API TileOcclusionState { /** * @brief The renderer does not yet know if the tile's bounding volume is