|
cesium-native 0.67.0
|
Utility for identifying file formats and content types supported in 3D Tiles. More...
#include <Cesium3DTiles/FileFormat.h>
Public Types | |
| enum class | Type { Unknown , GltfJson , GltfBinary , Batched3dModel , Composite , Instanced3DModel , PointCloud , SubtreeJson , SubtreeBinary , TilesetJson , LayerJson , GeoJson } |
| Enumerates the supported file formats for 3D Tiles. More... | |
Static Public Member Functions | |
| static std::string | getMagic (const std::span< const std::byte > &data, size_t length=4) |
| Retrieves the specified number of bytes at the start of the given buffer, and interprets them as a string magic identifier for the data. | |
| static std::string | getMagicForType (Type type) |
| Gets the magic identifier associated with the given file format. Returns an empty string if no magic exists. | |
| static Type | getTypeFromMagic (const std::string &magic) |
| Gets the file format type associated with the given magic identifier. Returns Type::Unknown if no type has the specified magic. | |
| static Type | getBestFittingFormat (const rapidjson::Document &document) |
| Infers the file format that best fits the given JSON document based on its available members. | |
| static Type | getBestFittingFormat (const std::span< const std::byte > &data) |
| Infers the file format that best fits the given data buffer based on its four-letter magic. | |
Utility for identifying file formats and content types supported in 3D Tiles.
Definition at line 18 of file FileFormat.h.
|
strong |
Enumerates the supported file formats for 3D Tiles.
| Enumerator | |
|---|---|
| Unknown | Indicates an unknown file format. |
| GltfJson | Indicates a glTF model in JSON format. |
| GltfBinary | Indicates a glTF model in binary (glb) format. |
| Batched3dModel | Indicates a Batched 3D Model (b3dm) from 3D Tiles 1.0. |
| Composite | Indicates a Composite (cmpt) from 3D Tiles 1.0. |
| Instanced3DModel | Indicates an Instanced 3D Model (i3dm) from 3D Tiles 1.0. |
| PointCloud | Indicates a Point Cloud (pnts) from 3D Tiles 1.0. |
| SubtreeJson | Indicates a subtree in JSON format from 3D Tiles 1.1. |
| SubtreeBinary | Indicates a subtree in binary (subt) format from 3D Tiles 1.1. |
| TilesetJson | A tileset.json. |
| LayerJson | A quantized-mesh layer.json. Alhough quantized-mesh is distinct from the 3D Tiles spec, cesium-native supports quantized-mesh by converting it to 3D Tiles at runtime. |
| GeoJson | A GeoJSON file, supported in 3D Tiles through CesiumTilesetJson::ExtensionTilesetMaxarContentGeoJson. |
Definition at line 23 of file FileFormat.h.
|
static |
Infers the file format that best fits the given JSON document based on its available members.
| document | The parsed JSON document. |
|
static |
Infers the file format that best fits the given data buffer based on its four-letter magic.
| data | The binary data. |
|
static |
Retrieves the specified number of bytes at the start of the given buffer, and interprets them as a string magic identifier for the data.
| data | The data buffer. |
| length | The target length for the magic. |
|
static |
Gets the magic identifier associated with the given file format. Returns an empty string if no magic exists.
| type | The file format type. |
|
static |
Gets the file format type associated with the given magic identifier. Returns Type::Unknown if no type has the specified magic.
| magic | The magic identifier. |