Skip to content

Commit 37018d3

Browse files
committed
Merge branch 'main' of https://github.com/CesiumGS/cesium-native into ownership
2 parents abded91 + 98da25d commit 37018d3

58 files changed

Lines changed: 4391 additions & 583 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Change Log
22

3+
### ? - ?
4+
5+
##### Additions :tada:
6+
7+
- Added support for [`EXT_mesh_primitive_edge_visibility`](https://github.com/KhronosGroup/glTF/pull/2479) in `CesiumGltf`, `CesiumGltfReader`, and `CesiumGltfWriter`.
8+
- Added support for [`3DTILES_content_conditional`](https://github.com/CesiumGS/3d-tiles/pull/834) in `Cesium3DTiles`, `Cesium3DTilesReader`, and `Cesium3DTilesWriter`.
9+
310
### v0.60.0 - 2026-05-01
411

512
##### Additions :tada:
613

714
- Added `BoundingRegionBuilder::expandToIncludeBoundingRegion`.
15+
- Added support for 3D Tiles `MAXAR_tileset_geojson` extension, which allows GeoJSON files as tile content. The GeoJSON is translated to glTF.
816

917
##### Fixes :wrench:
1018

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ endif()
194194
include("cmake/defaults.cmake")
195195

196196
project(cesium-native
197-
VERSION 0.59.0
197+
VERSION 0.60.0
198198
LANGUAGES CXX C
199199
)
200200

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// This file was generated by generate-classes.
2+
// DO NOT EDIT THIS FILE!
3+
#pragma once
4+
5+
#include <Cesium3DTiles/ConditionalContentItem.h>
6+
#include <Cesium3DTiles/Library.h>
7+
#include <CesiumUtility/ExtensibleObject.h>
8+
9+
#include <vector>
10+
11+
namespace Cesium3DTiles {
12+
/**
13+
* @brief Defines the structure of 3D Tiles content for the
14+
* 3DTILES_content_conditional extension
15+
*/
16+
struct CESIUM3DTILES_API ConditionalContent final
17+
: public CesiumUtility::ExtensibleObject {
18+
/**
19+
* @brief The original name of this type.
20+
*/
21+
static constexpr const char* TypeName = "ConditionalContent";
22+
23+
/**
24+
* @brief The array of content objects that have additional conditions
25+
* associated with them, based on which they are activated.
26+
*/
27+
std::vector<Cesium3DTiles::ConditionalContentItem> conditionalContents;
28+
29+
/**
30+
* @brief Calculates the size in bytes of this object, including the contents
31+
* of all collections, pointers, and strings. This will NOT include the size
32+
* of any extensions attached to the object. Calling this method may be slow
33+
* as it requires traversing the object's entire structure.
34+
*/
35+
int64_t getSizeBytes() const {
36+
int64_t accum = 0;
37+
accum += int64_t(sizeof(ConditionalContent));
38+
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
39+
int64_t(sizeof(CesiumUtility::ExtensibleObject));
40+
accum += int64_t(
41+
sizeof(Cesium3DTiles::ConditionalContentItem) *
42+
this->conditionalContents.capacity());
43+
for (const Cesium3DTiles::ConditionalContentItem& value :
44+
this->conditionalContents) {
45+
accum += value.getSizeBytes() -
46+
int64_t(sizeof(Cesium3DTiles::ConditionalContentItem));
47+
}
48+
return accum;
49+
}
50+
};
51+
} // namespace Cesium3DTiles
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// This file was generated by generate-classes.
2+
// DO NOT EDIT THIS FILE!
3+
#pragma once
4+
5+
#include <Cesium3DTiles/Content.h>
6+
#include <Cesium3DTiles/Library.h>
7+
#include <CesiumUtility/JsonValue.h>
8+
9+
#include <string>
10+
#include <unordered_map>
11+
12+
namespace Cesium3DTiles {
13+
/**
14+
* @brief Defines the structure of a single content item in
15+
* 3DTILES_content_conditional
16+
*/
17+
struct CESIUM3DTILES_API ConditionalContentItem final : public Content {
18+
/**
19+
* @brief The original name of this type.
20+
*/
21+
static constexpr const char* TypeName = "ConditionalContentItem";
22+
23+
/**
24+
* @brief Properties that define the conditions based on which the item can
25+
* become active. The names of these properties correspond to the 'dimensions'
26+
* that are defined in the top-level extension object.
27+
*/
28+
std::unordered_map<std::string, CesiumUtility::JsonValue> keys;
29+
30+
/**
31+
* @brief Calculates the size in bytes of this object, including the contents
32+
* of all collections, pointers, and strings. This will NOT include the size
33+
* of any extensions attached to the object. Calling this method may be slow
34+
* as it requires traversing the object's entire structure.
35+
*/
36+
int64_t getSizeBytes() const {
37+
int64_t accum = 0;
38+
accum += int64_t(sizeof(ConditionalContentItem));
39+
accum += Content::getSizeBytes() - int64_t(sizeof(Content));
40+
accum += int64_t(
41+
this->keys.bucket_count() *
42+
(sizeof(std::string) + sizeof(CesiumUtility::JsonValue)));
43+
for (const auto& [k, v] : this->keys) {
44+
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
45+
accum += int64_t(sizeof(CesiumUtility::JsonValue));
46+
}
47+
return accum;
48+
}
49+
};
50+
} // namespace Cesium3DTiles

Cesium3DTiles/generated/include/Cesium3DTiles/Content.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ namespace Cesium3DTiles {
1515
/**
1616
* @brief Metadata about the tile's content and a link to the content.
1717
*/
18-
struct CESIUM3DTILES_API Content final
19-
: public CesiumUtility::ExtensibleObject {
18+
struct CESIUM3DTILES_API Content : public CesiumUtility::ExtensibleObject {
2019
/**
2120
* @brief The original name of this type.
2221
*/
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// This file was generated by generate-classes.
2+
// DO NOT EDIT THIS FILE!
3+
#pragma once
4+
5+
#include <Cesium3DTiles/Extension3dTilesContentConditionalDimensionsValue.h>
6+
#include <Cesium3DTiles/Library.h>
7+
#include <CesiumUtility/ExtensibleObject.h>
8+
9+
#include <vector>
10+
11+
namespace Cesium3DTiles {
12+
/**
13+
* @brief Defines the structure of the extension object that is stored as the
14+
* 3DTILES_content_conditional extension in a tileset JSON, and that summarizes
15+
* the conditions that appear in the contents.
16+
*/
17+
struct CESIUM3DTILES_API Extension3dTilesContentConditional final
18+
: public CesiumUtility::ExtensibleObject {
19+
/**
20+
* @brief The original name of this type.
21+
*/
22+
static constexpr const char* TypeName = "Extension3dTilesContentConditional";
23+
/** @brief The official name of the extension. This should be the same as its
24+
* key in the `extensions` object. */
25+
static constexpr const char* ExtensionName = "3DTILES_content_conditional";
26+
27+
/**
28+
* @brief The dimensions of the conditions, each consisting of the name and
29+
* domain of the respective property.
30+
*/
31+
std::vector<Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue>
32+
dimensions;
33+
34+
/**
35+
* @brief Calculates the size in bytes of this object, including the contents
36+
* of all collections, pointers, and strings. This will NOT include the size
37+
* of any extensions attached to the object. Calling this method may be slow
38+
* as it requires traversing the object's entire structure.
39+
*/
40+
int64_t getSizeBytes() const {
41+
int64_t accum = 0;
42+
accum += int64_t(sizeof(Extension3dTilesContentConditional));
43+
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
44+
int64_t(sizeof(CesiumUtility::ExtensibleObject));
45+
accum += int64_t(
46+
sizeof(
47+
Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue) *
48+
this->dimensions.capacity());
49+
for (const Cesium3DTiles::Extension3dTilesContentConditionalDimensionsValue&
50+
value : this->dimensions) {
51+
accum += value.getSizeBytes() -
52+
int64_t(sizeof(
53+
Cesium3DTiles::
54+
Extension3dTilesContentConditionalDimensionsValue));
55+
}
56+
return accum;
57+
}
58+
};
59+
} // namespace Cesium3DTiles
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// This file was generated by generate-classes.
2+
// DO NOT EDIT THIS FILE!
3+
#pragma once
4+
5+
#include <Cesium3DTiles/Library.h>
6+
#include <CesiumUtility/ExtensibleObject.h>
7+
#include <CesiumUtility/JsonValue.h>
8+
9+
#include <string>
10+
#include <vector>
11+
12+
namespace Cesium3DTiles {
13+
/**
14+
* @brief Extension3dTilesContentConditional Dimensions Value
15+
*/
16+
struct CESIUM3DTILES_API Extension3dTilesContentConditionalDimensionsValue final
17+
: public CesiumUtility::ExtensibleObject {
18+
/**
19+
* @brief The original name of this type.
20+
*/
21+
static constexpr const char* TypeName =
22+
"Extension3dTilesContentConditionalDimensionsValue";
23+
24+
/**
25+
* @brief The name of the property that is used for defining the condition, to
26+
* be used as one of the keys in the conditional content array items.
27+
*/
28+
std::string name;
29+
30+
/**
31+
* @brief The set of all values that appear in any condition.
32+
*/
33+
std::vector<CesiumUtility::JsonValue> keySet;
34+
35+
/**
36+
* @brief Calculates the size in bytes of this object, including the contents
37+
* of all collections, pointers, and strings. This will NOT include the size
38+
* of any extensions attached to the object. Calling this method may be slow
39+
* as it requires traversing the object's entire structure.
40+
*/
41+
int64_t getSizeBytes() const {
42+
int64_t accum = 0;
43+
accum += int64_t(sizeof(Extension3dTilesContentConditionalDimensionsValue));
44+
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
45+
int64_t(sizeof(CesiumUtility::ExtensibleObject));
46+
accum += int64_t(this->name.capacity() * sizeof(char));
47+
accum +=
48+
int64_t(sizeof(CesiumUtility::JsonValue) * this->keySet.capacity());
49+
return accum;
50+
}
51+
};
52+
} // namespace Cesium3DTiles
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// This file was generated by generate-classes.
2+
// DO NOT EDIT THIS FILE!
3+
#pragma once
4+
5+
#include <Cesium3DTiles/ConditionalContentItem.h>
6+
#include <Cesium3DTilesReader/Library.h>
7+
#include <CesiumJsonReader/JsonReader.h>
8+
#include <CesiumJsonReader/JsonReaderOptions.h>
9+
10+
#include <rapidjson/fwd.h>
11+
12+
#include <span>
13+
#include <vector>
14+
15+
namespace Cesium3DTiles {
16+
struct ConditionalContentItem;
17+
} // namespace Cesium3DTiles
18+
19+
namespace Cesium3DTilesReader {
20+
21+
/**
22+
* @brief Reads \ref Cesium3DTiles::ConditionalContentItem
23+
* "ConditionalContentItem" instances from JSON.
24+
*/
25+
class CESIUM3DTILESREADER_API ConditionalContentItemReader {
26+
public:
27+
/**
28+
* @brief Constructs a new instance.
29+
*/
30+
ConditionalContentItemReader();
31+
32+
/**
33+
* @brief Gets the options controlling how the JSON is read.
34+
*/
35+
CesiumJsonReader::JsonReaderOptions& getOptions();
36+
37+
/**
38+
* @brief Gets the options controlling how the JSON is read.
39+
*/
40+
const CesiumJsonReader::JsonReaderOptions& getOptions() const;
41+
42+
/**
43+
* @brief Reads an instance of ConditionalContentItem from a byte buffer.
44+
*
45+
* @param data The buffer from which to read the instance.
46+
* @return The result of reading the instance.
47+
*/
48+
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContentItem>
49+
readFromJson(const std::span<const std::byte>& data) const;
50+
51+
/**
52+
* @brief Reads an instance of ConditionalContentItem from a rapidJson::Value.
53+
*
54+
* @param value The value from which to read the instance.
55+
* @return The result of reading the instance.
56+
*/
57+
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::ConditionalContentItem>
58+
readFromJson(const rapidjson::Value& value) const;
59+
60+
/**
61+
* @brief Reads an array of instances of ConditionalContentItem from a
62+
* rapidJson::Value.
63+
*
64+
* @param value The value from which to read the array of instances.
65+
* @return The result of reading the array of instances.
66+
*/
67+
CesiumJsonReader::ReadJsonResult<
68+
std::vector<Cesium3DTiles::ConditionalContentItem>>
69+
readArrayFromJson(const rapidjson::Value& value) const;
70+
71+
private:
72+
CesiumJsonReader::JsonReaderOptions _options;
73+
};
74+
75+
} // namespace Cesium3DTilesReader

0 commit comments

Comments
 (0)