cesium-native 0.48.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
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.
static constexpr int32_t DOUBLE
DOUBLE (5130)
static constexpr int32_t INT
INT (5124)
static constexpr int32_t UNSIGNED_SHORT
UNSIGNED_SHORT (5123)
static constexpr int32_t UNSIGNED_INT
UNSIGNED_INT (5125)
static constexpr int32_t UNSIGNED_BYTE
UNSIGNED_BYTE (5121)
static constexpr int32_t SHORT
SHORT (5122)
static constexpr int32_t UNSIGNED_INT64
UNSIGNED_INT64 (5135)
static constexpr int32_t INT64
INT64 (5134)
static constexpr int32_t BYTE
BYTE (5120)
static constexpr int32_t FLOAT
FLOAT (5126)
Known values for Specifies if the accessor's elements are scalars, vectors, or matrices.
static const std::string SCALAR
SCALAR
static const std::string VEC4
VEC4
static const std::string MAT4
MAT4
static const std::string VEC3
VEC3
static const std::string MAT3
MAT3
static const std::string VEC2
VEC2
static const std::string MAT2
MAT2
int64_t byteOffset
The offset relative to the start of the buffer view in bytes.
std::optional< CesiumGltf::AccessorSparse > sparse
Sparse storage of elements that deviate from their initialization value.
bool normalized
Specifies whether integer data values are normalized before usage.
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::string type
Specifies if the accessor's elements are scalars, vectors, or matrices.
std::vector< double > min
Minimum value of each component in this accessor.
int64_t count
The number of elements referenced by this accessor.
int32_t componentType
The datatype of the accessor's components.
static constexpr const char * TypeName
The original name of this type.
std::vector< double > max
Maximum value of each component in this accessor.
int32_t bufferView
The index of the bufferView.
The base class for objects in a glTF that have a name.
Definition NamedObject.h:14
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition NamedObject.h:28