Merge branch 'axis-aligned-from-points' into 3dtiles-bounding-volume-cylinder
This commit is contained in:
commit
e1cc0c3e5b
|
|
@ -69,9 +69,9 @@ jobs:
|
|||
- name: Install Doxygen
|
||||
run: |
|
||||
cd ~
|
||||
wget https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.linux.bin.tar.gz
|
||||
tar xzf doxygen-1.12.0.linux.bin.tar.gz
|
||||
export PATH=$PWD/doxygen-1.12.0/bin:$PATH
|
||||
wget https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.linux.bin.tar.gz
|
||||
tar xzf doxygen-1.13.2.linux.bin.tar.gz
|
||||
export PATH=$PWD/doxygen-1.13.2/bin:$PATH
|
||||
echo "PATH=$PATH" >> "$GITHUB_ENV"
|
||||
doxygen --version
|
||||
- name: Check out repository code
|
||||
|
|
|
|||
|
|
@ -9,13 +9,22 @@
|
|||
##### Additions :tada:
|
||||
|
||||
- Added `convertPropertyComponentTypeToAccessorComponentType` to `PropertyType`.
|
||||
- `LayerJsonTerrainLoader` now includes the query parameters from the base URL in the requests for each `.terrain` file loaded.
|
||||
- Added support for `3DTILES_ellipsoid` in `Cesium3DTiles`, `Cesium3DTilesReader`, and `Cesium3DTilesWriter`.
|
||||
- Added support for `3DTILES_content_voxels` in `Cesium3DTiles`, `Cesium3DTilesReader`, and `Cesium3DTilesWriter`.
|
||||
- Added generated classes for `EXT_primitive_voxels` and its dependencies in `CesiumGltf`, `CesiumGltfReader`, and `CesiumGltfWriter`.
|
||||
- Added `AxisAlignedBox::fromPositions`, which creates an `AxisAlignedBox` from an input vector of positions.
|
||||
|
||||
##### Fixes :wrench:
|
||||
|
||||
- Fixed parsing URIs that have a scheme followed by `:` instead of `://`.
|
||||
- Fixed decoding of KHR_mesh_quantization normalized values.
|
||||
|
||||
### v0.44.3 - 2025-02-12
|
||||
|
||||
##### Fixes :wrench:
|
||||
|
||||
- Fixed another bug in `GltfUtilities::parseGltfCopyright` that could cause it to crash or produce incorrect results.
|
||||
|
||||
### v0.44.2 - 2025-02-10
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ endif()
|
|||
include("cmake/defaults.cmake")
|
||||
|
||||
project(cesium-native
|
||||
VERSION 0.44.2
|
||||
VERSION 0.44.3
|
||||
LANGUAGES CXX C
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -690,7 +690,8 @@ std::string resolveTileUrl(
|
|||
}
|
||||
|
||||
return placeholder;
|
||||
}));
|
||||
}),
|
||||
true);
|
||||
|
||||
if (!layer.extensionsToRequest.empty()) {
|
||||
UriQuery params(uri);
|
||||
|
|
|
|||
|
|
@ -496,6 +496,42 @@ TEST_CASE("Test load layer json tile content") {
|
|||
CHECK(!layer.contentAvailability.isTileAvailable(QuadtreeTileID(9, 0, 0)));
|
||||
}
|
||||
|
||||
SUBCASE("Load tile with query parameters from base URL") {
|
||||
// create loader
|
||||
std::vector<LayerJsonTerrainLoader::Layer> layers;
|
||||
layers.emplace_back(
|
||||
"layer.json?param=some_parameter_here",
|
||||
"1.0.0",
|
||||
std::vector<std::string>{"{level}.{x}.{y}/{version}.terrain"},
|
||||
"one-two",
|
||||
std::move(contentAvailability),
|
||||
maxZoom,
|
||||
10);
|
||||
|
||||
LayerJsonTerrainLoader loader{tilingScheme, projection, std::move(layers)};
|
||||
|
||||
// mock tile content request
|
||||
pMockedAssetAccessor->mockCompletedRequests.insert(
|
||||
{"0.0.0/1.0.0.terrain?param=some_parameter_here&extensions=one-two",
|
||||
createMockAssetRequest(
|
||||
testDataPath / "CesiumTerrainTileJson" /
|
||||
"tile.metadataavailability.terrain")});
|
||||
|
||||
// check the load result
|
||||
auto tileLoadResultFuture = loadTile(
|
||||
QuadtreeTileID(0, 0, 0),
|
||||
loader,
|
||||
asyncSystem,
|
||||
pMockedAssetAccessor);
|
||||
auto tileLoadResult = tileLoadResultFuture.wait();
|
||||
CHECK(
|
||||
std::holds_alternative<CesiumGltf::Model>(tileLoadResult.contentKind));
|
||||
CHECK(tileLoadResult.updatedBoundingVolume);
|
||||
CHECK(!tileLoadResult.updatedContentBoundingVolume);
|
||||
CHECK(!tileLoadResult.tileInitializer);
|
||||
CHECK(tileLoadResult.state == TileLoadResultState::Success);
|
||||
}
|
||||
|
||||
SUBCASE("Load tile when layer have no availabilityLevels field") {
|
||||
// create loader
|
||||
std::vector<LayerJsonTerrainLoader::Layer> layers;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include "CesiumGeometry/Library.h"
|
||||
#include "Library.h"
|
||||
|
||||
#include <glm/common.hpp>
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace CesiumGeometry {
|
||||
|
||||
/**
|
||||
|
|
@ -120,6 +123,30 @@ struct CESIUMGEOMETRY_API AxisAlignedBox final {
|
|||
position.y >= this->minimumY && position.y <= this->maximumY &&
|
||||
position.z >= this->minimumZ && position.z <= this->maximumZ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a tight-fitting, axis-aligned bounding box that contains all
|
||||
* of the input positions.
|
||||
*
|
||||
* @param positions The positions.
|
||||
* @returns An axis-aligned bounding box derived from the input positions.
|
||||
*/
|
||||
static AxisAlignedBox
|
||||
fromPositions(const std::vector<glm::dvec3>& positions) {
|
||||
if (positions.size() == 0) {
|
||||
return AxisAlignedBox();
|
||||
}
|
||||
|
||||
glm::dvec3 min = positions[0];
|
||||
glm::dvec3 max = positions[0];
|
||||
|
||||
for (size_t i = 1; i < positions.size(); i++) {
|
||||
min = glm::min(min, positions[i]);
|
||||
max = glm::max(max, positions[i]);
|
||||
}
|
||||
|
||||
return AxisAlignedBox(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace CesiumGeometry
|
||||
|
|
|
|||
|
|
@ -19,3 +19,44 @@ TEST_CASE("AxisAlignedBox constructor") {
|
|||
CHECK(aabb.lengthY == 5.0 - 2.0);
|
||||
CHECK(aabb.lengthZ == 6.0 - 3.0);
|
||||
}
|
||||
|
||||
TEST_CASE("AxisAlignedBox fromPositions") {
|
||||
SUBCASE("returns default box for empty vector") {
|
||||
AxisAlignedBox aabb = AxisAlignedBox::fromPositions({});
|
||||
|
||||
CHECK(aabb.minimumX == 0.0);
|
||||
CHECK(aabb.minimumY == 0.0);
|
||||
CHECK(aabb.minimumZ == 0.0);
|
||||
CHECK(aabb.maximumX == 0.0);
|
||||
CHECK(aabb.maximumY == 0.0);
|
||||
CHECK(aabb.maximumZ == 0.0);
|
||||
}
|
||||
|
||||
SUBCASE("works for single position") {
|
||||
glm::dvec3 position(1.0, 2.0, 3.0);
|
||||
AxisAlignedBox aabb = AxisAlignedBox::fromPositions({position});
|
||||
|
||||
CHECK(aabb.minimumX == position.x);
|
||||
CHECK(aabb.minimumY == position.y);
|
||||
CHECK(aabb.minimumZ == position.z);
|
||||
CHECK(aabb.maximumX == position.x);
|
||||
CHECK(aabb.maximumY == position.y);
|
||||
CHECK(aabb.maximumZ == position.z);
|
||||
}
|
||||
|
||||
SUBCASE("works for multiple positions") {
|
||||
std::vector<glm::dvec3> positions{
|
||||
glm::dvec3(1.0, 2.0, 3.0),
|
||||
glm::dvec3(-2.0, 0.4, -10.0),
|
||||
glm::dvec3(0.1, 4.3, 11.0),
|
||||
glm::dvec3(0.5, 0.5, 2.7)};
|
||||
|
||||
AxisAlignedBox aabb = AxisAlignedBox::fromPositions(positions);
|
||||
CHECK(aabb.minimumX == -2.0);
|
||||
CHECK(aabb.minimumY == 0.4);
|
||||
CHECK(aabb.minimumZ == -10.0);
|
||||
CHECK(aabb.maximumX == 1.0);
|
||||
CHECK(aabb.maximumY == 4.3);
|
||||
CHECK(aabb.maximumZ == 11.0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,8 +295,13 @@ std::string_view trimWhitespace(const std::string_view& s) {
|
|||
size_t end = s.find_last_not_of(" \t");
|
||||
if (end == std::string::npos)
|
||||
return {};
|
||||
size_t start = s.find_first_not_of(" \t", 0, end + 1);
|
||||
return s.substr(start, end - start + 1);
|
||||
|
||||
std::string_view trimmedRight = s.substr(0, end + 1);
|
||||
size_t start = trimmedRight.find_first_not_of(" \t");
|
||||
if (start == std::string::npos)
|
||||
return {};
|
||||
|
||||
return trimmedRight.substr(start);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ template <> float intToFloat(std::int8_t c) {
|
|||
return std::max(c / 127.0f, -1.0f);
|
||||
}
|
||||
|
||||
template <> float intToFloat(std::uint8_t c) { return c / 127.0f; }
|
||||
template <> float intToFloat(std::uint8_t c) { return c / 255.0f; }
|
||||
|
||||
template <> float intToFloat(std::int16_t c) {
|
||||
return std::max(c / 65535.0f, -1.0f);
|
||||
return std::max(c / 32767.0f, -1.0f);
|
||||
}
|
||||
|
||||
template <> float intToFloat(std::uint16_t c) { return c / 65535.0f; }
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ public:
|
|||
return this->_objectHandler->readObjectStart();
|
||||
}
|
||||
|
||||
virtual IJsonHandler*
|
||||
readObjectKey(const std::string_view& /*str*/) noexcept override {
|
||||
virtual IJsonHandler* readObjectKey(
|
||||
[[maybe_unused]] const std::string_view& str) noexcept override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,34 +29,21 @@ if(DOXYGEN_FOUND)
|
|||
)
|
||||
|
||||
set(DOXYGEN_STRIP_FROM_INC_PATH ${LIB_DIRS})
|
||||
set(
|
||||
DOXYGEN_EXAMPLE_PATH
|
||||
../Cesium3DTiles/test
|
||||
../Cesium3DTilesContent/test
|
||||
../Cesium3DTilesReader/test
|
||||
../Cesium3DTilesWriter/test
|
||||
../Cesium3DTilesSelection/test
|
||||
../CesiumAsync/test
|
||||
../CesiumGeometry/test
|
||||
../CesiumGeospatial/test
|
||||
../CesiumGltf/test
|
||||
../CesiumGltfContent/test
|
||||
../CesiumGltfReader/test
|
||||
../CesiumGltfWriter/test
|
||||
../CesiumIonClient/test
|
||||
../CesiumJsonWriter/test
|
||||
../CesiumQuantizedMeshTerrain/test
|
||||
../CesiumRasterOverlays/test
|
||||
../CesiumUtility/test
|
||||
../ # For examples drawn from the actual code
|
||||
)
|
||||
|
||||
# Instead of specifying the full source tree in the example path, specify only the Cesium* lib directories to reduce parsing time
|
||||
file(GLOB example_dirs LIST_DIRECTORIES true RELATIVE ${CMAKE_CURRENT_LIST_DIR} "../Cesium*")
|
||||
foreach(child ${example_dirs})
|
||||
if(IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/${child})
|
||||
list(APPEND DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_LIST_DIR}/${child})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# These macro definitions confuse doxygen, causing it
|
||||
# to omit the respective elements in the documentation,
|
||||
# so ignore these macros during doxygen preprocessing:
|
||||
set(DOXYGEN_ENABLE_PREPROCESSING YES)
|
||||
set(DOXYGEN_MACRO_EXPANSION YES)
|
||||
set(DOXYGEN_EXPAND_ONLY_PREDEF YES)
|
||||
set(DOXYGEN_EXPAND_ONLY_PREDEF NO)
|
||||
set(DOXYGEN_PREDEFINED
|
||||
"CESIUM3DTILES_API"
|
||||
"CESIUM3DTILESCONTENT_API"
|
||||
|
|
@ -76,7 +63,7 @@ if(DOXYGEN_FOUND)
|
|||
"CESIUMQUANTIZEDMESHTERRAIN_API"
|
||||
"CESIUMRASTEROVERLAYS_API"
|
||||
"CESIUMUTILITY_API"
|
||||
"CESIUM_DEFAULT_ELLIPSOID=\=CesiumGeospatial::Ellipsoid::WGS84")
|
||||
"CESIUM_DEFAULT_ELLIPSOID==CesiumGeospatial::Ellipsoid::WGS84")
|
||||
set(DOXYGEN_HTML_EXTRA_STYLESHEET "${CMAKE_CURRENT_LIST_DIR}/../node_modules/doxygen-awesome-css/doxygen-awesome.css")
|
||||
set(DOXYGEN_HTML_FOOTER "${CMAKE_CURRENT_LIST_DIR}/footer.html")
|
||||
set(DOXYGEN_GENERATE_TREEVIEW YES)
|
||||
|
|
@ -86,8 +73,6 @@ if(DOXYGEN_FOUND)
|
|||
set(DOXYGEN_SOURCE_BROWSER YES)
|
||||
set(DOXYGEN_BUILTIN_STL_SUPPORT YES)
|
||||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "../README.md")
|
||||
list(APPEND DOXYGEN_EXCLUDE_PATTERNS "*/node_modules/*")
|
||||
list(APPEND DOXYGEN_EXCLUDE_PATTERNS "*/build/*")
|
||||
|
||||
set(DOXYGEN_DOT_GRAPH_MAX_NODES 100)
|
||||
set(DOXYGEN_WARN_AS_ERROR FAIL_ON_WARNINGS_PRINT)
|
||||
|
|
@ -109,9 +94,9 @@ if(DOXYGEN_FOUND)
|
|||
|
||||
# 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 ${CMAKE_CURRENT_LIST_DIR}/assets/panzoom.js")
|
||||
list(APPEND DOXYGEN_ALIASES mermaid{1}="\\htmlonly <div class=\\\"mermaid\\\"> ^^ \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly ^^ </div> \\endhtmlonly")
|
||||
list(APPEND DOXYGEN_ALIASES mermaid-interactive{1}="\\htmlonly <div class=\\\"mermaid interactive\\\"> ^^ \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly ^^ </div> \\endhtmlonly")
|
||||
list(APPEND DOXYGEN_ALIASES svg-interactive{2}="\\htmlonly <div class=\\\"svg interactive\\\" style=\\\"min-height: \\2\\\"> ^^ \\endhtmlonly \\image html \\\"\\1.svg\\\" \\htmlonly ^^ </div> \\endhtmlonly")
|
||||
list(APPEND DOXYGEN_ALIASES mermaid{1}="\\htmlonly <div class=\\\"mermaid\\\"> \\ilinebr \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly \\ilinebr </div> \\endhtmlonly")
|
||||
list(APPEND DOXYGEN_ALIASES mermaid-interactive{1}="\\htmlonly <div class=\\\"mermaid interactive\\\"> \\ilinebr \\endhtmlonly \\htmlinclude \\\"\\1.mmd\\\" \\htmlonly \\ilinebr </div> \\endhtmlonly")
|
||||
list(APPEND DOXYGEN_ALIASES svg-interactive{2}="\\htmlonly <div class=\\\"svg interactive\\\" style=\\\"min-height: \\2\\\"> \\ilinebr \\endhtmlonly \\image html \\\"\\1.svg\\\" \\htmlonly \\ilinebr </div> \\endhtmlonly")
|
||||
set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES DOXYGEN_HTML_EXTRA_FILES)
|
||||
list(APPEND DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_LIST_DIR}/diagrams")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cesium-native",
|
||||
"version": "0.44.2",
|
||||
"version": "0.44.3",
|
||||
"description": "Cesium 3D Geospatial for C++",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"main": "index.js",
|
||||
"scripts": {
|
||||
"generate-3d-tiles": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/tileset.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/common/rootProperty.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/PropertyTable/propertyTable.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Subtree/subtree.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Schema/schema.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/specification/schema/Statistics/statistics.schema.json --output ../../Cesium3DTiles --readerOutput ../../Cesium3DTilesReader --writerOutput ../../Cesium3DTilesWriter --extensions https://raw.githubusercontent.com/CesiumGS/3d-tiles/cesium-native/extensions/ --namespace Cesium3DTiles --readerNamespace Cesium3DTilesReader --writerNamespace Cesium3DTilesWriter --config 3dTiles.json",
|
||||
"generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/extensions/2.0/ https://raw.githubusercontent.com/eoineoineoin/glTF/collisionShapeMerge/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json",
|
||||
"generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/cesium-native/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json",
|
||||
"generate-quantized-mesh-terrain": "node index.js --schemas ../../CesiumQuantizedMeshTerrain/schema/layer.schema.json --output ../../CesiumQuantizedMeshTerrain --readerOutput ../../CesiumQuantizedMeshTerrain --writerOutput ../../CesiumQuantizedMeshTerrain --extensions ../../CesiumQuantizedMeshTerrain/schema/extensions --namespace CesiumQuantizedMeshTerrain --readerNamespace CesiumQuantizedMeshTerrain --writerNamespace CesiumQuantizedMeshTerrain --config QuantizedMeshTerrain.json"
|
||||
},
|
||||
"author": "CesiumGS, Inc. and Contributors",
|
||||
|
|
|
|||
Loading…
Reference in New Issue