cesium-native 0.45.0
Loading...
Searching...
No Matches
Shape.h
1// This file was generated by generate-classes.
2// DO NOT EDIT THIS FILE!
3#pragma once
4
5#include <CesiumGltf/Box.h>
6#include <CesiumGltf/Capsule.h>
7#include <CesiumGltf/Cylinder.h>
8#include <CesiumGltf/Library.h>
9#include <CesiumGltf/NamedObject.h>
10#include <CesiumGltf/Sphere.h>
11
12#include <optional>
13#include <string>
14
15namespace CesiumGltf {
19struct CESIUMGLTF_API Shape final : public CesiumGltf::NamedObject {
23 static constexpr const char* TypeName = "Shape";
24
28 struct Type {
31 inline static const std::string sphere = "sphere";
32
35 inline static const std::string box = "box";
36
40 inline static const std::string capsule = "capsule";
41
45 inline static const std::string cylinder = "cylinder";
46 };
47
54 std::string type = Type::sphere;
55
59 std::optional<CesiumGltf::Sphere> sphere;
60
64 std::optional<CesiumGltf::Box> box;
65
69 std::optional<CesiumGltf::Capsule> capsule;
70
74 std::optional<CesiumGltf::Cylinder> cylinder;
75
82 int64_t getSizeBytes() const {
83 int64_t accum = 0;
84 accum += int64_t(sizeof(Shape));
86 int64_t(sizeof(CesiumGltf::NamedObject));
87 if (this->sphere) {
88 accum +=
89 this->sphere->getSizeBytes() - int64_t(sizeof(CesiumGltf::Sphere));
90 }
91 if (this->box) {
92 accum += this->box->getSizeBytes() - int64_t(sizeof(CesiumGltf::Box));
93 }
94 if (this->capsule) {
95 accum +=
96 this->capsule->getSizeBytes() - int64_t(sizeof(CesiumGltf::Capsule));
97 }
98 if (this->cylinder) {
99 accum += this->cylinder->getSizeBytes() -
100 int64_t(sizeof(CesiumGltf::Cylinder));
101 }
102 return accum;
103 }
104};
105} // namespace CesiumGltf
Classes for working with glTF models.
Parameters describing a box shape.
Definition Box.h:14
Parameters describing a capsule shape.
Definition Capsule.h:12
Parameters describing a cylinder shape.
Definition Cylinder.h:12
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
Known values for Specifies the shape type.
Definition Shape.h:28
Parameters describing an implicit shape.
Definition Shape.h:19
std::optional< CesiumGltf::Cylinder > cylinder
A set of parameter values that are used to define a cylinder shape.
Definition Shape.h:74
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Shape.h:82
std::optional< CesiumGltf::Sphere > sphere
A set of parameter values that are used to define a sphere shape.
Definition Shape.h:59
std::optional< CesiumGltf::Box > box
A set of parameter values that are used to define a box shape.
Definition Shape.h:64
std::optional< CesiumGltf::Capsule > capsule
A set of parameter values that are used to define a capsule shape.
Definition Shape.h:69
Parameters describing a sphere shape.
Definition Sphere.h:12