cesium-native 0.43.0
Loading...
Searching...
No Matches
ModelSpec.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Accessor.h>
6#include <CesiumGltf/Animation.h>
7#include <CesiumGltf/Asset.h>
8#include <CesiumGltf/Buffer.h>
9#include <CesiumGltf/BufferView.h>
10#include <CesiumGltf/Camera.h>
11#include <CesiumGltf/Image.h>
12#include <CesiumGltf/Library.h>
13#include <CesiumGltf/Material.h>
14#include <CesiumGltf/Mesh.h>
15#include <CesiumGltf/Node.h>
16#include <CesiumGltf/Sampler.h>
17#include <CesiumGltf/Scene.h>
18#include <CesiumGltf/Skin.h>
19#include <CesiumGltf/Texture.h>
20#include <CesiumUtility/ExtensibleObject.h>
21
22#include <cstdint>
23#include <string>
24#include <vector>
25
26namespace CesiumGltf {
30struct CESIUMGLTF_API ModelSpec : public CesiumUtility::ExtensibleObject {
34 static constexpr const char* TypeName = "Model";
35
39 std::vector<std::string> extensionsUsed;
40
44 std::vector<std::string> extensionsRequired;
45
51 std::vector<CesiumGltf::Accessor> accessors;
52
56 std::vector<CesiumGltf::Animation> animations;
57
62
68 std::vector<CesiumGltf::Buffer> buffers;
69
76 std::vector<CesiumGltf::BufferView> bufferViews;
77
83 std::vector<CesiumGltf::Camera> cameras;
84
90 std::vector<CesiumGltf::Image> images;
91
97 std::vector<CesiumGltf::Material> materials;
98
104 std::vector<CesiumGltf::Mesh> meshes;
105
109 std::vector<CesiumGltf::Node> nodes;
110
116 std::vector<CesiumGltf::Sampler> samplers;
117
123 int32_t scene = -1;
124
128 std::vector<CesiumGltf::Scene> scenes;
129
135 std::vector<CesiumGltf::Skin> skins;
136
140 std::vector<CesiumGltf::Texture> textures;
141
148 int64_t getSizeBytes() const {
149 int64_t accum = 0;
150 accum += int64_t(sizeof(ModelSpec));
152 int64_t(sizeof(CesiumUtility::ExtensibleObject));
153 accum += int64_t(sizeof(std::string) * this->extensionsUsed.capacity());
154 accum += int64_t(sizeof(std::string) * this->extensionsRequired.capacity());
155 accum += int64_t(sizeof(CesiumGltf::Accessor) * this->accessors.capacity());
156 for (const CesiumGltf::Accessor& value : this->accessors) {
157 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Accessor));
158 }
159 accum +=
160 int64_t(sizeof(CesiumGltf::Animation) * this->animations.capacity());
161 for (const CesiumGltf::Animation& value : this->animations) {
162 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Animation));
163 }
164 accum += this->asset.getSizeBytes() - int64_t(sizeof(CesiumGltf::Asset));
165 accum += int64_t(sizeof(CesiumGltf::Buffer) * this->buffers.capacity());
166 for (const CesiumGltf::Buffer& value : this->buffers) {
167 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Buffer));
168 }
169 accum +=
170 int64_t(sizeof(CesiumGltf::BufferView) * this->bufferViews.capacity());
171 for (const CesiumGltf::BufferView& value : this->bufferViews) {
172 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::BufferView));
173 }
174 accum += int64_t(sizeof(CesiumGltf::Camera) * this->cameras.capacity());
175 for (const CesiumGltf::Camera& value : this->cameras) {
176 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Camera));
177 }
178 accum += int64_t(sizeof(CesiumGltf::Image) * this->images.capacity());
179 for (const CesiumGltf::Image& value : this->images) {
180 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Image));
181 }
182 accum += int64_t(sizeof(CesiumGltf::Material) * this->materials.capacity());
183 for (const CesiumGltf::Material& value : this->materials) {
184 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Material));
185 }
186 accum += int64_t(sizeof(CesiumGltf::Mesh) * this->meshes.capacity());
187 for (const CesiumGltf::Mesh& value : this->meshes) {
188 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Mesh));
189 }
190 accum += int64_t(sizeof(CesiumGltf::Node) * this->nodes.capacity());
191 for (const CesiumGltf::Node& value : this->nodes) {
192 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Node));
193 }
194 accum += int64_t(sizeof(CesiumGltf::Sampler) * this->samplers.capacity());
195 for (const CesiumGltf::Sampler& value : this->samplers) {
196 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Sampler));
197 }
198 accum += int64_t(sizeof(CesiumGltf::Scene) * this->scenes.capacity());
199 for (const CesiumGltf::Scene& value : this->scenes) {
200 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Scene));
201 }
202 accum += int64_t(sizeof(CesiumGltf::Skin) * this->skins.capacity());
203 for (const CesiumGltf::Skin& value : this->skins) {
204 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Skin));
205 }
206 accum += int64_t(sizeof(CesiumGltf::Texture) * this->textures.capacity());
207 for (const CesiumGltf::Texture& value : this->textures) {
208 accum += value.getSizeBytes() - int64_t(sizeof(CesiumGltf::Texture));
209 }
210 return accum;
211 }
212
213protected:
217 ModelSpec() = default;
218 friend struct Model;
219};
220} // namespace CesiumGltf
Classes for working with glTF models.
This class is not meant to be instantiated directly. Use Accessor instead.
Definition Accessor.h:12
A keyframe animation.
Definition Animation.h:16
Metadata about the glTF asset.
Definition Asset.h:15
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Asset.h:51
A view into a buffer generally representing a subset of the buffer.
Definition BufferView.h:15
This class is not meant to be instantiated directly. Use Buffer instead.
Definition Buffer.h:9
A camera's projection. A node MAY reference a camera to apply a transform to place the camera in the ...
Definition Camera.h:18
This class is not meant to be instantiated directly. Use Image instead.
Definition Image.h:10
The material appearance of a primitive.
Definition Material.h:20
A set of primitives to be rendered. Its global transform is defined by a node that references it.
Definition Mesh.h:16
The root object for a glTF asset.
Definition ModelSpec.h:30
std::vector< CesiumGltf::Camera > cameras
An array of cameras.
Definition ModelSpec.h:83
std::vector< CesiumGltf::Scene > scenes
An array of scenes.
Definition ModelSpec.h:128
ModelSpec()=default
This class is not meant to be instantiated directly. Use Model instead.
std::vector< CesiumGltf::Skin > skins
An array of skins.
Definition ModelSpec.h:135
std::vector< CesiumGltf::BufferView > bufferViews
An array of bufferViews.
Definition ModelSpec.h:76
std::vector< CesiumGltf::Animation > animations
An array of keyframe animations.
Definition ModelSpec.h:56
std::vector< CesiumGltf::Sampler > samplers
An array of samplers.
Definition ModelSpec.h:116
std::vector< CesiumGltf::Material > materials
An array of materials.
Definition ModelSpec.h:97
CesiumGltf::Asset asset
Metadata about the glTF asset.
Definition ModelSpec.h:61
std::vector< std::string > extensionsRequired
Names of glTF extensions required to properly load this asset.
Definition ModelSpec.h:44
std::vector< CesiumGltf::Mesh > meshes
An array of meshes.
Definition ModelSpec.h:104
std::vector< CesiumGltf::Node > nodes
An array of nodes.
Definition ModelSpec.h:109
std::vector< CesiumGltf::Image > images
An array of images.
Definition ModelSpec.h:90
std::vector< CesiumGltf::Accessor > accessors
An array of accessors.
Definition ModelSpec.h:51
std::vector< CesiumGltf::Texture > textures
An array of textures.
Definition ModelSpec.h:140
std::vector< std::string > extensionsUsed
Names of glTF extensions used in this asset.
Definition ModelSpec.h:39
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition ModelSpec.h:148
std::vector< CesiumGltf::Buffer > buffers
An array of buffers.
Definition ModelSpec.h:68
This class is not meant to be instantiated directly. Use Model instead.
Definition Model.h:14
A node in the node hierarchy. When the node contains skin, all mesh.primitives MUST contain JOINTS_0 ...
Definition Node.h:23
Texture sampler properties for filtering and wrapping modes.
Definition Sampler.h:14
The root nodes of a scene.
Definition Scene.h:15
Joints and matrices defining a skin.
Definition Skin.h:15
A texture and its sampler.
Definition Texture.h:14
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 ...