cesium-native 0.43.0
Loading...
Searching...
No Matches
MeshPrimitive.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 <CesiumUtility/ExtensibleObject.h>
7
8#include <cstdint>
9#include <string>
10#include <unordered_map>
11#include <vector>
12
13namespace CesiumGltf {
17struct CESIUMGLTF_API MeshPrimitive final
22 static constexpr const char* TypeName = "MeshPrimitive";
23
27 struct Mode {
29 static constexpr int32_t POINTS = 0;
30
32 static constexpr int32_t LINES = 1;
33
35 static constexpr int32_t LINE_LOOP = 2;
36
38 static constexpr int32_t LINE_STRIP = 3;
39
41 static constexpr int32_t TRIANGLES = 4;
42
44 static constexpr int32_t TRIANGLE_STRIP = 5;
45
47 static constexpr int32_t TRIANGLE_FAN = 6;
48 };
49
55 std::unordered_map<std::string, int32_t> attributes;
56
64 int32_t indices = -1;
65
69 int32_t material = -1;
70
77 int32_t mode = Mode::TRIANGLES;
78
82 std::vector<std::unordered_map<std::string, int32_t>> targets;
83
90 int64_t getSizeBytes() const {
91 int64_t accum = 0;
92 accum += int64_t(sizeof(MeshPrimitive));
94 int64_t(sizeof(CesiumUtility::ExtensibleObject));
95 accum += int64_t(
96 this->attributes.bucket_count() *
97 (sizeof(std::string) + sizeof(int32_t)));
98 for (const auto& [k, v] : this->attributes) {
99 accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
100 accum += int64_t(sizeof(int32_t));
101 }
102 accum += int64_t(
103 sizeof(std::unordered_map<std::string, int32_t>) *
104 this->targets.capacity());
105 return accum;
106 }
107};
108} // namespace CesiumGltf
Classes for working with glTF models.
Known values for The topology type of primitives to render.
Geometry to be rendered with the given material.
std::vector< std::unordered_map< std::string, int32_t > > targets
An array of morph targets.
std::unordered_map< std::string, int32_t > attributes
A plain JSON object, where each key corresponds to a mesh attribute semantic and each value is the in...
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
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 ...