-
Notifications
You must be signed in to change notification settings - Fork 275
Add support for 3DTILES_content_conditional in serializer / deserializer
#1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a49bc41
Generate classes for 3DTILES_content_conditional
lilleyse 1c8c925
Merge branch 'main' into 3d-tiles-content-conditional
lilleyse e5179cb
Update paths
lilleyse 4b14c49
Fix path
lilleyse 2d76d70
Add test
lilleyse c7cc282
Update CHANGES.md
lilleyse 03e6851
Regenerate code
lilleyse b3fb61d
Merge branch 'main' into 3d-tiles-content-conditional
j9liu d83fc06
Merge branch 'main' into 3d-tiles-content-conditional
lilleyse e7548c9
PR feedback
lilleyse af089b7
Regenerate with new descriptions
lilleyse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
Cesium3DTiles/generated/include/Cesium3DTiles/ConditionalContent.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/ConditionalContentItem.h> | ||
| #include <Cesium3DTiles/Library.h> | ||
| #include <CesiumUtility/ExtensibleObject.h> | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| /** | ||
| * @brief Defines the structure of 3D Tiles content for the | ||
| * 3DTILES_content_conditional extension | ||
| */ | ||
| struct CESIUM3DTILES_API ConditionalContent final | ||
| : public CesiumUtility::ExtensibleObject { | ||
| /** | ||
| * @brief The original name of this type. | ||
| */ | ||
| static constexpr const char* TypeName = "ConditionalContent"; | ||
|
|
||
| /** | ||
| * @brief The array of content objects that have additional conditions | ||
| * associated with them, based on which they are activated. | ||
| */ | ||
| std::vector<Cesium3DTiles::ConditionalContentItem> conditionalContents; | ||
|
|
||
| /** | ||
| * @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(ConditionalContent)); | ||
| accum += CesiumUtility::ExtensibleObject::getSizeBytes() - | ||
| int64_t(sizeof(CesiumUtility::ExtensibleObject)); | ||
| accum += int64_t( | ||
| sizeof(Cesium3DTiles::ConditionalContentItem) * | ||
| this->conditionalContents.capacity()); | ||
| for (const Cesium3DTiles::ConditionalContentItem& value : | ||
| this->conditionalContents) { | ||
| accum += value.getSizeBytes() - | ||
| int64_t(sizeof(Cesium3DTiles::ConditionalContentItem)); | ||
| } | ||
| return accum; | ||
| } | ||
| }; | ||
| } // namespace Cesium3DTiles |
50 changes: 50 additions & 0 deletions
50
Cesium3DTiles/generated/include/Cesium3DTiles/ConditionalContentItem.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/Content.h> | ||
| #include <Cesium3DTiles/Library.h> | ||
| #include <CesiumUtility/JsonValue.h> | ||
|
|
||
| #include <string> | ||
| #include <unordered_map> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| /** | ||
| * @brief Defines the structure of a single content item in | ||
| * 3DTILES_content_conditional | ||
| */ | ||
| struct CESIUM3DTILES_API ConditionalContentItem final : public Content { | ||
| /** | ||
| * @brief The original name of this type. | ||
| */ | ||
| static constexpr const char* TypeName = "ConditionalContentItem"; | ||
|
|
||
| /** | ||
| * @brief Properties that define the conditions based on which the item can | ||
| * become active. The names of these properties correspond to the 'dimensions' | ||
| * that are defined in the top-level extension object. | ||
| */ | ||
| std::unordered_map<std::string, CesiumUtility::JsonValue> keys; | ||
|
|
||
| /** | ||
| * @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(ConditionalContentItem)); | ||
| accum += Content::getSizeBytes() - int64_t(sizeof(Content)); | ||
| accum += int64_t( | ||
| this->keys.bucket_count() * | ||
| (sizeof(std::string) + sizeof(CesiumUtility::JsonValue))); | ||
| for (const auto& [k, v] : this->keys) { | ||
| accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string)); | ||
| accum += int64_t(sizeof(CesiumUtility::JsonValue)); | ||
| } | ||
| return accum; | ||
| } | ||
| }; | ||
| } // namespace Cesium3DTiles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Cesium3DTiles/generated/include/Cesium3DTiles/Extension3dTilesContentConditional.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/Extension3dTilesContentConditionalDimensionsValue.h> | ||
| #include <Cesium3DTiles/Library.h> | ||
| #include <CesiumUtility/ExtensibleObject.h> | ||
|
|
||
| #include <vector> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| /** | ||
| * @brief Defines the structure of the extension object that is stored as the | ||
| * 3DTILES_content_conditional extension in a tileset JSON, and that summarizes | ||
| * the conditions that appear in the contents. | ||
| */ | ||
| struct CESIUM3DTILES_API Extension3dTilesContentConditional final | ||
| : public CesiumUtility::ExtensibleObject { | ||
| /** | ||
| * @brief The original name of this type. | ||
| */ | ||
| static constexpr const char* TypeName = "Extension3dTilesContentConditional"; | ||
| /** @brief The official name of the extension. This should be the same as its | ||
| * key in the `extensions` object. */ | ||
| static constexpr const char* ExtensionName = "3DTILES_content_conditional"; | ||
|
|
||
| /** | ||
| * @brief The dimensions of the conditions, each consisting of the name and | ||
| * domain of the respective property. | ||
| */ | ||
| std::vector<Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue> | ||
| dimensions; | ||
|
|
||
| /** | ||
| * @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(Extension3dTilesContentConditional)); | ||
| accum += CesiumUtility::ExtensibleObject::getSizeBytes() - | ||
| int64_t(sizeof(CesiumUtility::ExtensibleObject)); | ||
| accum += int64_t( | ||
| sizeof( | ||
| Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue) * | ||
| this->dimensions.capacity()); | ||
| for (const Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue& | ||
| value : this->dimensions) { | ||
| accum += value.getSizeBytes() - | ||
| int64_t(sizeof( | ||
| Cesium3DTiles:: | ||
| Extension3dTilesContentConditionalDimensionsValue)); | ||
| } | ||
| return accum; | ||
| } | ||
| }; | ||
| } // namespace Cesium3DTiles |
52 changes: 52 additions & 0 deletions
52
...Tiles/generated/include/Cesium3DTiles/Extension3dTilesContentConditionalDimensionsValue.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/Library.h> | ||
| #include <CesiumUtility/ExtensibleObject.h> | ||
| #include <CesiumUtility/JsonValue.h> | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| /** | ||
| * @brief Extension3dTilesContentConditional Dimensions Value | ||
| */ | ||
| struct CESIUM3DTILES_API Extension3dTilesContentConditionalDimensionsValue final | ||
| : public CesiumUtility::ExtensibleObject { | ||
| /** | ||
| * @brief The original name of this type. | ||
| */ | ||
| static constexpr const char* TypeName = | ||
| "Extension3dTilesContentConditionalDimensionsValue"; | ||
|
|
||
| /** | ||
| * @brief The name of the property that is used for defining the condition, to | ||
| * be used as one of the keys in the conditional content array items. | ||
| */ | ||
| std::string name; | ||
|
|
||
| /** | ||
| * @brief The set of all values that appear in any condition. | ||
| */ | ||
| std::vector<CesiumUtility::JsonValue> keySet; | ||
|
|
||
| /** | ||
| * @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(Extension3dTilesContentConditionalDimensionsValue)); | ||
| accum += CesiumUtility::ExtensibleObject::getSizeBytes() - | ||
| int64_t(sizeof(CesiumUtility::ExtensibleObject)); | ||
| accum += int64_t(this->name.capacity() * sizeof(char)); | ||
| accum += | ||
| int64_t(sizeof(CesiumUtility::JsonValue) * this->keySet.capacity()); | ||
| return accum; | ||
| } | ||
| }; | ||
| } // namespace Cesium3DTiles | ||
75 changes: 75 additions & 0 deletions
75
Cesium3DTilesReader/generated/include/Cesium3DTilesReader/ConditionalContentItemReader.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/ConditionalContentItem.h> | ||
| #include <Cesium3DTilesReader/Library.h> | ||
| #include <CesiumJsonReader/JsonReader.h> | ||
| #include <CesiumJsonReader/JsonReaderOptions.h> | ||
|
|
||
| #include <rapidjson/fwd.h> | ||
|
|
||
| #include <span> | ||
| #include <vector> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| struct ConditionalContentItem; | ||
| } // namespace Cesium3DTiles | ||
|
|
||
| namespace Cesium3DTilesReader { | ||
|
|
||
| /** | ||
| * @brief Reads \ref Cesium3DTiles::ConditionalContentItem | ||
| * "ConditionalContentItem" instances from JSON. | ||
| */ | ||
| class CESIUM3DTILESREADER_API ConditionalContentItemReader { | ||
| public: | ||
| /** | ||
| * @brief Constructs a new instance. | ||
| */ | ||
| ConditionalContentItemReader(); | ||
|
|
||
| /** | ||
| * @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 ConditionalContentItem from a byte buffer. | ||
| * | ||
| * @param data The buffer from which to read the instance. | ||
| * @return The result of reading the instance. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContentItem> | ||
| readFromJson(const std::span<const std::byte>& data) const; | ||
|
|
||
| /** | ||
| * @brief Reads an instance of ConditionalContentItem from a rapidJson::Value. | ||
| * | ||
| * @param value The value from which to read the instance. | ||
| * @return The result of reading the instance. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContentItem> | ||
| readFromJson(const rapidjson::Value& value) const; | ||
|
|
||
| /** | ||
| * @brief Reads an array of instances of ConditionalContentItem from a | ||
| * rapidJson::Value. | ||
| * | ||
| * @param value The value from which to read the array of instances. | ||
| * @return The result of reading the array of instances. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult< | ||
| std::vector<Cesium3DTiles::ConditionalContentItem>> | ||
| readArrayFromJson(const rapidjson::Value& value) const; | ||
|
|
||
| private: | ||
| CesiumJsonReader::JsonReaderOptions _options; | ||
| }; | ||
|
|
||
| } // namespace Cesium3DTilesReader |
75 changes: 75 additions & 0 deletions
75
Cesium3DTilesReader/generated/include/Cesium3DTilesReader/ConditionalContentReader.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| // This file was generated by generate-classes. | ||
| // DO NOT EDIT THIS FILE! | ||
| #pragma once | ||
|
|
||
| #include <Cesium3DTiles/ConditionalContent.h> | ||
| #include <Cesium3DTilesReader/Library.h> | ||
| #include <CesiumJsonReader/JsonReader.h> | ||
| #include <CesiumJsonReader/JsonReaderOptions.h> | ||
|
|
||
| #include <rapidjson/fwd.h> | ||
|
|
||
| #include <span> | ||
| #include <vector> | ||
|
|
||
| namespace Cesium3DTiles { | ||
| struct ConditionalContent; | ||
| } // namespace Cesium3DTiles | ||
|
|
||
| namespace Cesium3DTilesReader { | ||
|
|
||
| /** | ||
| * @brief Reads \ref Cesium3DTiles::ConditionalContent "ConditionalContent" | ||
| * instances from JSON. | ||
| */ | ||
| class CESIUM3DTILESREADER_API ConditionalContentReader { | ||
| public: | ||
| /** | ||
| * @brief Constructs a new instance. | ||
| */ | ||
| ConditionalContentReader(); | ||
|
|
||
| /** | ||
| * @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 ConditionalContent from a byte buffer. | ||
| * | ||
| * @param data The buffer from which to read the instance. | ||
| * @return The result of reading the instance. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContent> | ||
| readFromJson(const std::span<const std::byte>& data) const; | ||
|
|
||
| /** | ||
| * @brief Reads an instance of ConditionalContent from a rapidJson::Value. | ||
| * | ||
| * @param value The value from which to read the instance. | ||
| * @return The result of reading the instance. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContent> | ||
| readFromJson(const rapidjson::Value& value) const; | ||
|
|
||
| /** | ||
| * @brief Reads an array of instances of ConditionalContent from a | ||
| * rapidJson::Value. | ||
| * | ||
| * @param value The value from which to read the array of instances. | ||
| * @return The result of reading the array of instances. | ||
| */ | ||
| CesiumJsonReader::ReadJsonResult< | ||
| std::vector<Cesium3DTiles::ConditionalContent>> | ||
| readArrayFromJson(const rapidjson::Value& value) const; | ||
|
|
||
| private: | ||
| CesiumJsonReader::JsonReaderOptions _options; | ||
| }; | ||
|
|
||
| } // namespace Cesium3DTilesReader |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.