cesium-native 0.43.0
Loading...
Searching...
No Matches
AccessorSpec.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/AccessorSparse.h>
6#include <CesiumGltf/Library.h>
7#include <CesiumGltf/NamedObject.h>
8
9#include <cstdint>
10#include <optional>
11#include <string>
12#include <vector>
13
14namespace CesiumGltf {
18struct CESIUMGLTF_API AccessorSpec : public CesiumGltf::NamedObject {
22 static constexpr const char* TypeName = "Accessor";
23
29 static constexpr int32_t BYTE = 5120;
30
32 static constexpr int32_t UNSIGNED_BYTE = 5121;
33
35 static constexpr int32_t SHORT = 5122;
36
38 static constexpr int32_t UNSIGNED_SHORT = 5123;
39
41 static constexpr int32_t INT = 5124;
42
44 static constexpr int32_t UNSIGNED_INT = 5125;
45
47 static constexpr int32_t INT64 = 5134;
48
50 static constexpr int32_t UNSIGNED_INT64 = 5135;
51
53 static constexpr int32_t FLOAT = 5126;
54
56 static constexpr int32_t DOUBLE = 5130;
57 };
58
63 struct Type {
65 inline static const std::string SCALAR = "SCALAR";
66
68 inline static const std::string VEC2 = "VEC2";
69
71 inline static const std::string VEC3 = "VEC3";
72
74 inline static const std::string VEC4 = "VEC4";
75
77 inline static const std::string MAT2 = "MAT2";
78
80 inline static const std::string MAT3 = "MAT3";
81
83 inline static const std::string MAT4 = "MAT4";
84 };
85
93 int32_t bufferView = -1;
94
101 int64_t byteOffset = 0;
102
112 int32_t componentType = ComponentType::BYTE;
113
122 bool normalized = false;
123
130 int64_t count = int64_t();
131
139 std::string type = Type::SCALAR;
140
154 std::vector<double> max;
155
169 std::vector<double> min;
170
175 std::optional<CesiumGltf::AccessorSparse> sparse;
176
183 int64_t getSizeBytes() const {
184 int64_t accum = 0;
185 accum += int64_t(sizeof(AccessorSpec));
187 int64_t(sizeof(CesiumGltf::NamedObject));
188 accum += int64_t(sizeof(double) * this->max.capacity());
189 accum += int64_t(sizeof(double) * this->min.capacity());
190 if (this->sparse) {
191 accum += this->sparse->getSizeBytes() -
192 int64_t(sizeof(CesiumGltf::AccessorSparse));
193 }
194 return accum;
195 }
196
197protected:
201 AccessorSpec() = default;
202 friend struct Accessor;
203};
204} // namespace CesiumGltf
Classes for working with glTF models.
Sparse storage of accessor values that deviate from their initialization value.
Known values for The datatype of the accessor's components.
Known values for Specifies if the accessor's elements are scalars, vectors, or matrices.
A typed view into a buffer view that contains raw binary data.
std::optional< CesiumGltf::AccessorSparse > sparse
Sparse storage of elements that deviate from their initialization value.
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
AccessorSpec()=default
This class is not meant to be instantiated directly. Use Accessor instead.
std::vector< double > min
Minimum value of each component in this accessor.
std::vector< double > max
Maximum value of each component in this accessor.
This class is not meant to be instantiated directly. Use Accessor instead.
Definition Accessor.h:12
The base class for objects in a glTF that have a name.
Definition NamedObject.h:15
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition NamedObject.h:29