cesium-native 0.66.0
Loading...
Searching...
No Matches
ExtensionExtVoxels.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Library.h>
6#include <CesiumGltf/Padding.h>
7#include <CesiumUtility/ExtensibleObject.h>
8
9#include <cstdint>
10#include <optional>
11#include <string>
12#include <unordered_map>
13#include <vector>
14
15namespace CesiumGltf {
20struct CESIUMGLTF_API ExtensionExtVoxels final
25 static constexpr const char* TypeName = "ExtensionExtVoxels";
28 static constexpr const char* ExtensionName = "EXT_voxels";
29
34 std::vector<int64_t> dimensions;
35
39 std::optional<CesiumGltf::Padding> padding;
40
46 std::unordered_map<std::string, int32_t> attributes;
47
54 std::unordered_map<std::string, std::vector<double>> noData;
55
62 int64_t getSizeBytes() const {
63 int64_t accum = 0;
64 accum += int64_t(sizeof(ExtensionExtVoxels));
66 int64_t(sizeof(CesiumUtility::ExtensibleObject));
67 accum += int64_t(sizeof(int64_t) * this->dimensions.capacity());
68 if (this->padding) {
69 accum +=
70 this->padding->getSizeBytes() - int64_t(sizeof(CesiumGltf::Padding));
71 }
72 accum += int64_t(
73 this->attributes.bucket_count() *
74 (sizeof(std::string) + sizeof(int32_t)));
75 for (const auto& [k, v] : this->attributes) {
76 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
77 accum += int64_t(sizeof(int32_t));
78 }
79 accum += int64_t(
80 this->noData.bucket_count() *
81 (sizeof(std::string) + sizeof(std::vector<double>)));
82 for (const auto& [k, v] : this->noData) {
83 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
84 accum += int64_t(sizeof(double) * v.capacity());
85 }
86 return accum;
87 }
88};
89} // namespace CesiumGltf
Classes for working with glTF models.
EXT_voxels extension for a node in a glTF model to indicate voxel-based volumetric data
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
std::unordered_map< std::string, int32_t > attributes
A plain JSON object, where each key corresponds to an attribute semantic and each value is the index ...
static constexpr const char * TypeName
The original name of this type.
std::unordered_map< std::string, std::vector< double > > noData
A plain JSON object, where each key corresponds to an existing semantic in attributes,...
static constexpr const char * ExtensionName
The official name of the extension. This should be the same as its key in the extensions object.
std::vector< int64_t > dimensions
Dimensions of the voxel grid. The values are interpreted with respect to the shape indicated by shape...
std::optional< CesiumGltf::Padding > padding
The optional padding of the voxels.
The padding around a voxel grid. Specifies how many rows of attribute data come from neighboring grid...
Definition Padding.h:16
The base class for objects that have extensions and extras.
int64_t getSizeBytes() const
Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including ...