cesium-native 0.48.0
Loading...
Searching...
No Matches
SubtreeWriter.h
1#pragma once
2
3#include <Cesium3DTilesWriter/Library.h>
4#include <CesiumJsonWriter/ExtensionWriterContext.h>
5
6#include <span>
7
8// forward declarations
9namespace Cesium3DTiles {
10struct Subtree;
11}
12
13namespace Cesium3DTilesWriter {
14
19struct CESIUM3DTILESWRITER_API SubtreeWriterResult {
24 std::vector<std::byte> subtreeBytes;
25
29 std::vector<std::string> errors;
30
34 std::vector<std::string> warnings;
35};
36
40struct CESIUM3DTILESWRITER_API SubtreeWriterOptions {
45 bool prettyPrint = false;
46};
47
51class CESIUM3DTILESWRITER_API SubtreeWriter {
52public:
57
62
67
80 const Cesium3DTiles::Subtree& subtree,
81 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
82
96 const Cesium3DTiles::Subtree& subtree,
97 const std::span<const std::byte>& bufferData,
98 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
99
100private:
102};
103
104} // namespace Cesium3DTilesWriter
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 Cesium3DTiles::Subtree &subtree, const std::span< const std::byte > &bufferData, const SubtreeWriterOptions &options=SubtreeWriterOptions()) const
Serializes the provided subtree into a subtree binary byte vector.
SubtreeWriterResult writeSubtreeJson(const Cesium3DTiles::Subtree &subtree, const SubtreeWriterOptions &options=SubtreeWriterOptions()) const
Serializes the provided subtree into a subtree JSON byte vector.
A context for writing extensions where known extensions and their handlers can be registered.
Classes for writing 3D Tiles.
Definition Library.h:8
Classes for using 3D Tiles.
Definition Buffer.h:7
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