cesium-native 0.64.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
20struct CESIUM3DTILESWRITER_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 CESIUM3DTILESWRITER_API SubtreeWriterOptions {
46 bool prettyPrint = false;
47};
48
52class CESIUM3DTILESWRITER_API SubtreeWriter {
53public:
58
63
68
81 const Cesium3DTiles::Subtree& subtree,
82 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
83
97 const Cesium3DTiles::Subtree& subtree,
98 const std::span<const std::byte>& bufferData,
99 const SubtreeWriterOptions& options = SubtreeWriterOptions()) const;
100
101private:
103};
104
105} // 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.
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