cesium-native 0.45.0
Loading...
Searching...
No Matches
ExtensionExtPrimitiveVoxels.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 ExtensionExtPrimitiveVoxels final
25 static constexpr const char* TypeName = "ExtensionExtPrimitiveVoxels";
28 static constexpr const char* ExtensionName = "EXT_primitive_voxels";
29
34 int32_t shape = -1;
35
40 std::vector<int64_t> dimensions;
41
45 std::optional<CesiumGltf::Padding> padding;
46
53 std::unordered_map<std::string, std::vector<double>> noData;
54
61 int64_t getSizeBytes() const {
62 int64_t accum = 0;
63 accum += int64_t(sizeof(ExtensionExtPrimitiveVoxels));
65 int64_t(sizeof(CesiumUtility::ExtensibleObject));
66 accum += int64_t(sizeof(int64_t) * this->dimensions.capacity());
67 if (this->padding) {
68 accum +=
69 this->padding->getSizeBytes() - int64_t(sizeof(CesiumGltf::Padding));
70 }
71 accum += int64_t(
72 this->noData.bucket_count() *
73 (sizeof(std::string) + sizeof(std::vector<double>)));
74 for (const auto& [k, v] : this->noData) {
75 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
76 accum += int64_t(sizeof(double) * v.capacity());
77 }
78 return accum;
79 }
80};
81} // namespace CesiumGltf
Classes for working with glTF models.
EXT_primitive_voxels extension for a primitive in a glTF model to indicate voxel-based volumetric dat...
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
std::optional< CesiumGltf::Padding > padding
The optional padding of the voxels.
std::vector< int64_t > dimensions
Dimensions of the voxel grid. The values are interpreted with respect to the shape indicated by KHR_i...
std::unordered_map< std::string, std::vector< double > > noData
A plain JSON object, where each key corresponds to an existing semantic in the primitive's attributes...
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 ...