cesium-native 0.66.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/Plane.h>
11#include <CesiumGltf/Sphere.h>
12
13#include <optional>
14#include <string>
15
16namespace CesiumGltf {
21struct CESIUMGLTF_API Shape final : public CesiumGltf::NamedObject {
25 static constexpr const char* TypeName = "Shape";
26
32 struct Type {
34 inline static const std::string box = "box";
35
37 inline static const std::string capsule = "capsule";
38
40 inline static const std::string cylinder = "cylinder";
41
43 inline static const std::string plane = "plane";
44
46 inline static const std::string sphere = "sphere";
47 };
48
57 std::string type = Type::box;
58
62 std::optional<CesiumGltf::Box> box;
63
67 std::optional<CesiumGltf::Capsule> capsule;
68
72 std::optional<CesiumGltf::Cylinder> cylinder;
73
77 std::optional<CesiumGltf::Plane> plane;
78
82 std::optional<CesiumGltf::Sphere> sphere;
83
90 int64_t getSizeBytes() const {
91 int64_t accum = 0;
92 accum += int64_t(sizeof(Shape));
94 int64_t(sizeof(CesiumGltf::NamedObject));
95 if (this->box) {
96 accum += this->box->getSizeBytes() - int64_t(sizeof(CesiumGltf::Box));
97 }
98 if (this->capsule) {
99 accum +=
100 this->capsule->getSizeBytes() - int64_t(sizeof(CesiumGltf::Capsule));
101 }
102 if (this->cylinder) {
103 accum += this->cylinder->getSizeBytes() -
104 int64_t(sizeof(CesiumGltf::Cylinder));
105 }
106 if (this->plane) {
107 accum += this->plane->getSizeBytes() - int64_t(sizeof(CesiumGltf::Plane));
108 }
109 if (this->sphere) {
110 accum +=
111 this->sphere->getSizeBytes() - int64_t(sizeof(CesiumGltf::Sphere));
112 }
113 return accum;
114 }
115};
116} // namespace CesiumGltf
Classes for working with glTF models.
An axis-aligned box with a size per-axis, centered at the origin in local space, with normals facing ...
Definition Box.h:15
A capsule, centered at the origin in local space with potentially different radii at each end,...
Definition Capsule.h:15
A cylinder, centered at the origin in local space with potentially different radii at each end,...
Definition Cylinder.h:16
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
A plane centered at the origin in local space, optionally with finite extents, with normal along the ...
Definition Plane.h:16
Known values for The type of shape this shape object represents. If any properties are explicitly spe...
Definition Shape.h:32
static const std::string capsule
capsule
Definition Shape.h:37
static const std::string cylinder
cylinder
Definition Shape.h:40
static const std::string sphere
sphere
Definition Shape.h:46
static const std::string box
box
Definition Shape.h:34
static const std::string plane
plane
Definition Shape.h:43
A generic, re-usable shape definition with no inherent meaning attached to it.
Definition Shape.h:21
std::optional< CesiumGltf::Cylinder > cylinder
Parameter values defining a cylinder shape.
Definition Shape.h:72
int64_t getSizeBytes() const
Calculates the size in bytes of this object, including the contents of all collections,...
Definition Shape.h:90
std::optional< CesiumGltf::Sphere > sphere
Parameter values defining a sphere shape.
Definition Shape.h:82
std::string type
The type of shape this shape object represents. If any properties are explicitly specified for the sh...
Definition Shape.h:57
static constexpr const char * TypeName
The original name of this type.
Definition Shape.h:25
std::optional< CesiumGltf::Box > box
Parameter values defining a box shape.
Definition Shape.h:62
std::optional< CesiumGltf::Capsule > capsule
Parameter values defining a capsule shape.
Definition Shape.h:67
std::optional< CesiumGltf::Plane > plane
Parameter values defining a plane shape.
Definition Shape.h:77
A sphere, centered at the origin in local space with a radius equal in all directions,...
Definition Sphere.h:13