106 lines
3.3 KiB
C++
106 lines
3.3 KiB
C++
// This file was generated by generate-classes.
|
|
// DO NOT EDIT THIS FILE!
|
|
#pragma once
|
|
|
|
#include <CesiumGltf/Box.h>
|
|
#include <CesiumGltf/Capsule.h>
|
|
#include <CesiumGltf/Cylinder.h>
|
|
#include <CesiumGltf/Library.h>
|
|
#include <CesiumGltf/NamedObject.h>
|
|
#include <CesiumGltf/Sphere.h>
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace CesiumGltf {
|
|
/**
|
|
* @brief Parameters describing an implicit shape.
|
|
*/
|
|
struct CESIUMGLTF_API Shape final : public CesiumGltf::NamedObject {
|
|
/**
|
|
* @brief The original name of this type.
|
|
*/
|
|
static constexpr const char* TypeName = "Shape";
|
|
|
|
/**
|
|
* @brief Known values for Specifies the shape type.
|
|
*/
|
|
struct Type {
|
|
/** @brief A sphere with a specified radius, centered at the origin in local
|
|
* space. */
|
|
inline static const std::string sphere = "sphere";
|
|
|
|
/** @brief An axis-aligned box with a size per-axis, centered at the origin
|
|
* in local space */
|
|
inline static const std::string box = "box";
|
|
|
|
/** @brief A capsule shape, centered at the origin in local space,
|
|
* equivalent to the convex hull of two spheres located along the Y axis (in
|
|
* local space) at a specified distance. */
|
|
inline static const std::string capsule = "capsule";
|
|
|
|
/** @brief A cylinder shape, centered at the origin in local space,
|
|
* equivalent to the convex hull of two circles in the X/Z plane positioned
|
|
* along the Y axis at a specified distance. */
|
|
inline static const std::string cylinder = "cylinder";
|
|
};
|
|
|
|
/**
|
|
* @brief Specifies the shape type.
|
|
*
|
|
* Known values are defined in {@link Type}.
|
|
*
|
|
*/
|
|
std::string type = Type::sphere;
|
|
|
|
/**
|
|
* @brief A set of parameter values that are used to define a sphere shape.
|
|
*/
|
|
std::optional<CesiumGltf::Sphere> sphere;
|
|
|
|
/**
|
|
* @brief A set of parameter values that are used to define a box shape.
|
|
*/
|
|
std::optional<CesiumGltf::Box> box;
|
|
|
|
/**
|
|
* @brief A set of parameter values that are used to define a capsule shape.
|
|
*/
|
|
std::optional<CesiumGltf::Capsule> capsule;
|
|
|
|
/**
|
|
* @brief A set of parameter values that are used to define a cylinder shape.
|
|
*/
|
|
std::optional<CesiumGltf::Cylinder> cylinder;
|
|
|
|
/**
|
|
* @brief Calculates the size in bytes of this object, including the contents
|
|
* of all collections, pointers, and strings. This will NOT include the size
|
|
* of any extensions attached to the object. Calling this method may be slow
|
|
* as it requires traversing the object's entire structure.
|
|
*/
|
|
int64_t getSizeBytes() const {
|
|
int64_t accum = 0;
|
|
accum += int64_t(sizeof(Shape));
|
|
accum += CesiumGltf::NamedObject::getSizeBytes() -
|
|
int64_t(sizeof(CesiumGltf::NamedObject));
|
|
if (this->sphere) {
|
|
accum +=
|
|
this->sphere->getSizeBytes() - int64_t(sizeof(CesiumGltf::Sphere));
|
|
}
|
|
if (this->box) {
|
|
accum += this->box->getSizeBytes() - int64_t(sizeof(CesiumGltf::Box));
|
|
}
|
|
if (this->capsule) {
|
|
accum +=
|
|
this->capsule->getSizeBytes() - int64_t(sizeof(CesiumGltf::Capsule));
|
|
}
|
|
if (this->cylinder) {
|
|
accum += this->cylinder->getSizeBytes() -
|
|
int64_t(sizeof(CesiumGltf::Cylinder));
|
|
}
|
|
return accum;
|
|
}
|
|
};
|
|
} // namespace CesiumGltf
|