Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into doc-tile-selection-al…
Browse files Browse the repository at this point in the history
…gorithm
  • Loading branch information
kring committed Dec 17, 2024
2 parents 113368e + 4e6e2b8 commit 54f9d4b
Show file tree
Hide file tree
Showing 78 changed files with 5,679 additions and 155 deletions.
6 changes: 4 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
- 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.
- 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.
- Fixed a raster overlay bug that could cause unnecessary upsampling with failed or missing overlay tiles.
- Fixed a bug in `SubtreeFileReader::loadBinary` that prevented valid subtrees from loading if they did not contain binary data.
- Fixed a bug in the `Tileset` selection algorithm that could cause detail to disappear during load in some cases.

Expand Down Expand Up @@ -1121,4 +1123,4 @@ In addition to the above, this release updates the following third-party librari

### v0.1.0 - 2021-03-30

- Initial release.
- Initial release.
7 changes: 7 additions & 0 deletions CMakeGraphVizOptions.cmake
Original file line number Diff line number Diff line change
@@ -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")
75 changes: 75 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Contribution Guide {#contributing}

<!--! \cond DOXYGEN_EXCLUDE !-->

## Table of Contents

- [📬Submitting an Issue](#submitting-an-issue)
- [📝Opening a Pull Request](#opening-a-pull-request)
- [Contributor License Agreement (CLA)](#contributor-license-agreement-cla)
- [Pull Request Guidelines](#pull-request-guidelines)
- [⚖️Code of Conduct](#️code-of-conduct)

<!--! \endcond -->

Community involvement in Cesium Native has been and continues to be a key part of its development. Contributing to Cesium Native can take many forms:
<!--! [TOC] -->

- Making a pull request to add features or fix issues.
- Submitting an issue to report a bug.
- Triaging existing issues. This can include attempting to reproduce issues or sharing additional information you have.
- Being active on the [Cesium community forum](https://community.cesium.com/) by answering questions and providing input on Cesium's direction.
- Writing tutorials, creating examples, and improving the reference documentation.
- Sharing projects you've made with Cesium Native with us through the [Cesium community forum](https://community.cesium.com/) or at [email protected].

More details about writing issues and pull requests is detailed below. For any other guidance you need, don't hesitate to ask on the [Cesium community forum](https://community.cesium.com/)!

## 📬Submitting an Issue

If you have a question, please do not submit an issue; instead, search the [Cesium community forum](https://community.cesium.com/). The forum is very active and there are years of informative archives, often with answers from the core Cesium team. If you do not find an answer to your question, start a new thread and you'll likely get a quick response!

If you think you've found a bug in Cesium Native, first search the [issues](https://github.com/CesiumGS/cesium-native/issues). If an issue already exists, please add a comment expressing your interest and any additional information. This helps us prioritize issues.

If a related issue does not exist, submit a new one. Please be concise and include as much of the following information as is relevant:

- Minimum amount of sample code (and data).
- Screenshot or animated .gif if appropriate (try [LICEcap](http://www.cockos.com/licecap/)). For example, see [#803](https://github.com/CesiumGS/cesium-native/issues/803). Screenshots are particularly useful for exceptions and rendering artifacts.
- Link to the thread if this was discussed on the Cesium forum or elsewhere. For example, see [#878](https://github.com/CesiumGS/cesium-native/issues/878).
- Your operating system and version, compiler and version, and video card. If you're using Cesium Native with an engine like Unreal or Unity, please include this information as well. Are they all up-to-date? Is the issue specific to one of them?
- The version of Cesium Native. Did this work in a previous version?
- Ideas for how to fix or workaround the issue. Also mention if you are willing to help fix it. If so, the Cesium team can often provide guidance and the issue may get fixed more quickly with your help.

## 📝Opening a Pull Request

Pull requests are a huge help in the development of Cesium Native. Following the tips in this guide will help your pull request get merged quickly.

> If you plan to make a major change, please start a new thread on the [Cesium community forum](https://community.cesium.com/) first. Pull requests for small features and bug fixes can generally just be opened without discussion on the forum.
### Contributor License Agreement (CLA)

Before we can review a pull request, we require a signed Contributor License Agreement. There is a CLA for:

- [individuals](https://docs.google.com/forms/d/e/1FAIpQLScU-yvQdcdjCFHkNXwdNeEXx5Qhu45QXuWX_uF5qiLGFSEwlA/viewform) and
- [corporations](https://docs.google.com/forms/d/e/1FAIpQLSeYEaWlBl1tQEiegfHMuqnH9VxyfgXGyIw13C2sN7Fj3J3GVA/viewform).

This only needs to be completed once, and enables contributions to all of the projects under the [CesiumGS](https://github.com/CesiumGS) organization, including Cesium Native. The CLA ensures you retain copyright to your contributions, and provides us the right to use, modify, and redistribute your contributions using the [Apache 2.0 License](LICENSE.md).

If you have any questions, feel free to reach out to [email protected]!

### Pull Request Guidelines

Our code is our lifeblood so maintaining Cesium Native's high code quality is important to us.
- For an overview of our workflow see [github pull request workflows](https://cesium.com/blog/2013/10/08/github-pull-request-workflows/).
- Pull request tips
- If your pull request fixes an existing issue, include a link to the issue in the description (like this: &quot;Fixes [#1](https://github.com/CesiumGS/cesium-native/issues/1)&quot;). 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"`.
- 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.
- Update [CHANGES.md](CHANGES.md) with a brief description of your changes.
- If you plan to add a third-party library, start a [GitHub issue](https://github.com/CesiumGS/cesium/issues/new) discussing it first.

## ⚖️Code of Conduct

To ensure an inclusive community, contributors and users in the Cesium community should follow the [code of conduct](https://github.com/CesiumGS/cesium/blob/main/CODE_OF_CONDUCT.md).
2 changes: 2 additions & 0 deletions Cesium3DTiles/include/Cesium3DTiles/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes for using [3D Tiles](https://github.com/CesiumGS/3d-tiles).
*
* @mermaid-interactive{dependencies/Cesium3DTiles}
*/
namespace Cesium3DTiles {}

Expand Down
2 changes: 2 additions & 0 deletions Cesium3DTilesContent/include/Cesium3DTilesContent/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes that support loading and converting 3D Tiles tile content.
*
* @mermaid-interactive{dependencies/Cesium3DTilesContent}
*/
namespace Cesium3DTilesContent {}

Expand Down
2 changes: 2 additions & 0 deletions Cesium3DTilesReader/include/Cesium3DTilesReader/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes for reading [3D Tiles](https://github.com/CesiumGS/3d-tiles).
*
* @mermaid-interactive{dependencies/Cesium3DTilesReader}
*/
namespace Cesium3DTilesReader {}

Expand Down
2 changes: 2 additions & 0 deletions Cesium3DTilesReader/src/SubtreeFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ SubtreeFileReader::getOptions() const {
return this->_reader.getOptions();
}

//! [async-system-store-in-lambda]
Future<ReadJsonResult<Cesium3DTiles::Subtree>> SubtreeFileReader::load(
const AsyncSystem& asyncSystem,
const std::shared_ptr<IAssetAccessor>& pAssetAccessor,
Expand All @@ -30,6 +31,7 @@ Future<ReadJsonResult<Cesium3DTiles::Subtree>> SubtreeFileReader::load(
return this->load(asyncSystem, pAssetAccessor, pRequest);
});
}
//! [async-system-store-in-lambda]

Future<ReadJsonResult<Subtree>> SubtreeFileReader::load(
const AsyncSystem& asyncSystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes that implement the 3D Tiles standard
*
* @mermaid-interactive{dependencies/Cesium3DTilesSelection}
*/
namespace Cesium3DTilesSelection {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#include <unordered_map>
#include <vector>

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
Expand Down
2 changes: 1 addition & 1 deletion Cesium3DTilesSelection/src/Tileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,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
Expand Down
2 changes: 2 additions & 0 deletions Cesium3DTilesWriter/include/Cesium3DTilesWriter/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes for writing [3D Tiles](https://github.com/CesiumGS/3d-tiles).
*
* @mermaid-interactive{dependencies/Cesium3DTilesWriter}
*/
namespace Cesium3DTilesWriter {}

Expand Down
2 changes: 2 additions & 0 deletions CesiumAsync/include/CesiumAsync/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes that support asynchronous operations.
*
* @mermaid-interactive{dependencies/CesiumAsync}
*/
namespace CesiumAsync {}

Expand Down
2 changes: 1 addition & 1 deletion CesiumAsync/include/CesiumAsync/SqliteHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions CesiumGeometry/include/CesiumGeometry/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Basic geometry classes for Cesium
*
* @mermaid-interactive{dependencies/CesiumGeometry}
*/
namespace CesiumGeometry {}

Expand Down
2 changes: 2 additions & 0 deletions CesiumGeospatial/include/CesiumGeospatial/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes for geospatial computations in Cesium
*
* @mermaid-interactive{dependencies/CesiumGeospatial}
*/
namespace CesiumGeospatial {}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <CesiumGltf/Library.h>
#include <CesiumUtility/ExtensibleObject.h>
#include <CesiumUtility/JsonValue.h>

#include <optional>
#include <string>
#include <unordered_map>

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<std::string> 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<std::string, CesiumUtility::JsonValue> 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
2 changes: 2 additions & 0 deletions CesiumGltf/include/CesiumGltf/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes for working with [glTF](https://www.khronos.org/gltf/) models.
*
* @mermaid-interactive{dependencies/CesiumGltf}
*/
namespace CesiumGltf {}

Expand Down
2 changes: 2 additions & 0 deletions CesiumGltfContent/include/CesiumGltfContent/Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* @brief Classes that support manipulating the content of a glTF.
*
* @mermaid-interactive{dependencies/CesiumGltfContent}
*/
namespace CesiumGltfContent {}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <CesiumGltf/ExtensionExtStructuralMetadata.h>
#include <CesiumGltfReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <rapidjson/fwd.h>

#include <span>
#include <vector>

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<CesiumGltf::ExtensionExtStructuralMetadata>
readFromJson(const std::span<const std::byte>& 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<CesiumGltf::ExtensionExtStructuralMetadata>
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<CesiumGltf::ExtensionExtStructuralMetadata>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace CesiumGltfReader
Loading

0 comments on commit 54f9d4b

Please sign in to comment.