cesium-native 0.67.0
Loading...
Searching...
No Matches
SubtreeWriter.h
1#pragma once
2
3#include <CesiumJsonWriter/ExtensionWriterContext.h>
4#include <CesiumTilesetJsonWriter/Library.h>
5
6#include <span>
7
8// forward declarations
9namespace CesiumTilesetJson {
10struct Subtree;
11}
12
14
20struct CESIUMTILESETJSONWRITER_API SubtreeWriterResult {
25 std::vector<std::byte> subtreeBytes;
26
30 std::vector<std::string> errors;
31
35 std::vector<std::string> warnings;
36};
37
41struct CESIUMTILESETJSONWRITER_API SubtreeWriterOptions {
46 bool prettyPrint = false;
47};
48
52class CESIUMTILESETJSONWRITER_API SubtreeWriter {
53public:
58
63
68
81 const CesiumTilesetJson::Subtree& subtree,
82 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
83
97 const CesiumTilesetJson::Subtree& subtree,
98 const std::span<const std::byte>& bufferData,
99 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
100
101private:
103};
104
105} // namespace CesiumTilesetJsonWriter
A context for writing extensions where known extensions and their handlers can be registered.
SubtreeWriterResult writeSubtreeJson(const CesiumTilesetJson::Subtree &subtree, const SubtreeWriterOptions &options=SubtreeWriterOptions()) const
Serializes the provided subtree into a subtree JSON byte vector.
CesiumJsonWriter::ExtensionWriterContext & getExtensions()
Gets the context used to control how subtree extensions are written.
SubtreeWriter()
Constructs a new instance.
const CesiumJsonWriter::ExtensionWriterContext & getExtensions() const
Gets the context used to control how subtree extensions are written.
SubtreeWriterResult writeSubtreeBinary(const CesiumTilesetJson::Subtree &subtree, const std::span< const std::byte > &bufferData, const SubtreeWriterOptions &options=SubtreeWriterOptions()) const
Serializes the provided subtree into a subtree binary byte vector.
Classes for writing a tileset.json from 3D Tiles 1.1.
Classes to represent a tileset.json from 3D Tiles 1.1.
Options for how to write a subtree.
bool prettyPrint
If the subtree JSON should be pretty printed. Usable with subtree JSON or subtree binary (not advised...
The result of writing a subtree with SubtreeWriter::writeSubtreeJson or SubtreeWriter::writeSubtreeBi...
std::vector< std::byte > subtreeBytes
The final generated std::vector<std::byte> of the subtree JSON or subtree binary.
std::vector< std::string > warnings
Warnings, if any, that occurred during the write process.
std::vector< std::string > errors
Errors, if any, that occurred during the write process.
An object describing the availability of tiles and content in a subtree, as well as availability of c...
Definition Subtree.h:24