From d799da276a1dbd3655e50718bfb1965dbb853773 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Mon, 28 Oct 2024 17:53:28 -0400 Subject: [PATCH] Regenerate for KHR_implicit_shapes --- CesiumGltf/generated/include/CesiumGltf/Box.h | 6 +- .../generated/include/CesiumGltf/Capsule.h | 34 + .../generated/include/CesiumGltf/Cylinder.h | 18 +- .../include/CesiumGltf/CylinderSlice.h | 50 -- .../generated/include/CesiumGltf/Ellipsoid.h | 30 - .../include/CesiumGltf/EllipsoidSlice.h | 48 - .../CesiumGltf/ExtensionExtPrimitiveVoxels.h | 6 +- .../CesiumGltf/ExtensionKhrImplicitShapes.h | 26 + .../generated/include/CesiumGltf/Geometry.h | 48 - .../generated/include/CesiumGltf/Region.h | 43 - .../include/CesiumGltf/RegionSlice.h | 48 - .../generated/include/CesiumGltf/Shape.h | 63 ++ .../generated/include/CesiumGltf/Sphere.h | 14 +- .../include/CesiumGltf/SphereSlice.h | 47 - .../{GeometryReader.h => CapsuleReader.h} | 22 +- .../CesiumGltfReader/CylinderSliceReader.h | 73 -- .../CesiumGltfReader/EllipsoidReader.h | 72 -- .../CesiumGltfReader/EllipsoidSliceReader.h | 73 -- ...r.h => ExtensionKhrImplicitShapesReader.h} | 23 +- .../GeometryInEXT_implicit_geometryReader.h | 76 -- .../CesiumGltfReader/RegionSliceReader.h | 72 -- .../{RegionReader.h => ShapeReader.h} | 22 +- .../CesiumGltfReader/SphereSliceReader.h | 72 -- ...soidJsonHandler.h => CapsuleJsonHandler.h} | 26 +- .../generated/src/CylinderJsonHandler.h | 6 +- .../generated/src/CylinderSliceJsonHandler.h | 40 - .../generated/src/EllipsoidSliceJsonHandler.h | 43 - .../ExtensionKhrImplicitShapesJsonHandler.h | 50 ++ .../generated/src/GeneratedJsonHandlers.cpp | 833 ++++-------------- .../generated/src/GeometryJsonHandler.h | 44 - .../generated/src/RegionJsonHandler.h | 39 - .../generated/src/RegionSliceJsonHandler.h | 43 - .../generated/src/ShapeJsonHandler.h | 42 + .../generated/src/SphereJsonHandler.h | 3 - .../generated/src/SphereSliceJsonHandler.h | 43 - .../src/registerReaderExtensions.cpp | 4 +- .../generated/src/ModelJsonWriter.cpp | 365 ++------ .../generated/src/ModelJsonWriter.h | 90 +- .../src/registerWriterExtensions.cpp | 4 +- package-lock.json | 4 +- tools/generate-classes/glTF.json | 28 +- tools/generate-classes/package.json | 2 +- 42 files changed, 569 insertions(+), 2126 deletions(-) create mode 100644 CesiumGltf/generated/include/CesiumGltf/Capsule.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/CylinderSlice.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/Ellipsoid.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/EllipsoidSlice.h create mode 100644 CesiumGltf/generated/include/CesiumGltf/ExtensionKhrImplicitShapes.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/Geometry.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/Region.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/RegionSlice.h create mode 100644 CesiumGltf/generated/include/CesiumGltf/Shape.h delete mode 100644 CesiumGltf/generated/include/CesiumGltf/SphereSlice.h rename CesiumGltfReader/generated/include/CesiumGltfReader/{GeometryReader.h => CapsuleReader.h} (70%) delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/CylinderSliceReader.h delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidReader.h delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidSliceReader.h rename CesiumGltfReader/generated/include/CesiumGltfReader/{ExtensionExtImplicitGeometryReader.h => ExtensionKhrImplicitShapesReader.h} (66%) delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/GeometryInEXT_implicit_geometryReader.h delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/RegionSliceReader.h rename CesiumGltfReader/generated/include/CesiumGltfReader/{RegionReader.h => ShapeReader.h} (71%) delete mode 100644 CesiumGltfReader/generated/include/CesiumGltfReader/SphereSliceReader.h rename CesiumGltfReader/generated/src/{EllipsoidJsonHandler.h => CapsuleJsonHandler.h} (53%) delete mode 100644 CesiumGltfReader/generated/src/CylinderSliceJsonHandler.h delete mode 100644 CesiumGltfReader/generated/src/EllipsoidSliceJsonHandler.h create mode 100644 CesiumGltfReader/generated/src/ExtensionKhrImplicitShapesJsonHandler.h delete mode 100644 CesiumGltfReader/generated/src/GeometryJsonHandler.h delete mode 100644 CesiumGltfReader/generated/src/RegionJsonHandler.h delete mode 100644 CesiumGltfReader/generated/src/RegionSliceJsonHandler.h create mode 100644 CesiumGltfReader/generated/src/ShapeJsonHandler.h delete mode 100644 CesiumGltfReader/generated/src/SphereSliceJsonHandler.h diff --git a/CesiumGltf/generated/include/CesiumGltf/Box.h b/CesiumGltf/generated/include/CesiumGltf/Box.h index ccf42b5e4..a122861ab 100644 --- a/CesiumGltf/generated/include/CesiumGltf/Box.h +++ b/CesiumGltf/generated/include/CesiumGltf/Box.h @@ -10,14 +10,14 @@ namespace CesiumGltf { /** - * @brief An implicit box centered at the local space origin. + * @brief Parameters describing a box shape. */ struct CESIUMGLTF_API Box final : public CesiumUtility::ExtensibleObject { static inline constexpr const char* TypeName = "Box"; /** - * @brief The size of the box in meters. + * @brief The extents of the box in each axis in local space. */ - std::vector size; + std::vector size = {1, 1, 1}; }; } // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Capsule.h b/CesiumGltf/generated/include/CesiumGltf/Capsule.h new file mode 100644 index 000000000..39e4bf8f0 --- /dev/null +++ b/CesiumGltf/generated/include/CesiumGltf/Capsule.h @@ -0,0 +1,34 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include "CesiumGltf/Library.h" + +#include + +namespace CesiumGltf { +/** + * @brief Parameters describing a capsule shape. + */ +struct CESIUMGLTF_API Capsule final : public CesiumUtility::ExtensibleObject { + static inline constexpr const char* TypeName = "Capsule"; + + /** + * @brief The distance between the centers of the two capping spheres of + * capsule. + */ + double height = 0.5; + + /** + * @brief The radius of the sphere located at the bottom of the capsule (i.e. + * the sphere at the half-height along -Y) + */ + double radiusBottom = 0.25; + + /** + * @brief The radius of the sphere located at the top of the capsule (i.e. the + * sphere at the half-height along +Y) + */ + double radiusTop = 0.25; +}; +} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Cylinder.h b/CesiumGltf/generated/include/CesiumGltf/Cylinder.h index b0314d649..210d70e39 100644 --- a/CesiumGltf/generated/include/CesiumGltf/Cylinder.h +++ b/CesiumGltf/generated/include/CesiumGltf/Cylinder.h @@ -2,33 +2,31 @@ // DO NOT EDIT THIS FILE! #pragma once -#include "CesiumGltf/CylinderSlice.h" #include "CesiumGltf/Library.h" #include -#include - namespace CesiumGltf { /** - * @brief An implicit cylinder centered at the local space origin. + * @brief Parameters describing a cylinder shape. */ struct CESIUMGLTF_API Cylinder final : public CesiumUtility::ExtensibleObject { static inline constexpr const char* TypeName = "Cylinder"; /** - * @brief The radius of the cylinder in meters. + * @brief The height of the cylinder, centered along the Y axis. */ - double radius = double(); + double height = 0.5; /** - * @brief The height of the cylinder in meters. + * @brief The radius of the bottom of the cylinder (the disk located along + * -Y.) */ - double height = double(); + double radiusBottom = 0.25; /** - * @brief The optionally-defined slice of the cylinder. + * @brief The radius of the top of the cylinder (the disk located along +Y.) */ - std::optional slice; + double radiusTop = 0.25; }; } // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/CylinderSlice.h b/CesiumGltf/generated/include/CesiumGltf/CylinderSlice.h deleted file mode 100644 index 68957a348..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/CylinderSlice.h +++ /dev/null @@ -1,50 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Library.h" - -#include - -namespace CesiumGltf { -/** - * @brief A slice of an implicit cylinder. Defines the subsection of the - * cylinder that the implicit volume actually occupies. - */ -struct CESIUMGLTF_API CylinderSlice final - : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "CylinderSlice"; - - /** - * @brief The start of the slice along the radius of the cylinder. - */ - double minRadius = 0; - - /** - * @brief The end of the slice along the radius of the cylinder. - */ - double maxRadius = 1; - - /** - * @brief The start of the slice along the height of the cylinder. - */ - double minHeight = 0; - - /** - * @brief The end of the slice along the height of the cylinder. - */ - double maxHeight = 1; - - /** - * @brief The start of the slice along the angle of the cylinder. Values must - * be in the range [-pi, pi]. - */ - double minAngle = -3.14159265359; - - /** - * @brief The end of the slice along the angle of the cylinder. Values must be - * in the range [-pi, pi]. - */ - double maxAngle = 3.14159265359; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Ellipsoid.h b/CesiumGltf/generated/include/CesiumGltf/Ellipsoid.h deleted file mode 100644 index db1c5af20..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/Ellipsoid.h +++ /dev/null @@ -1,30 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/EllipsoidSlice.h" -#include "CesiumGltf/Library.h" - -#include - -#include -#include - -namespace CesiumGltf { -/** - * @brief An implicit ellipsoid centered at the local space origin. - */ -struct CESIUMGLTF_API Ellipsoid final : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "Ellipsoid"; - - /** - * @brief The radii of the ellipsoid along the X, Y, and Z axes in meters. - */ - std::vector radii; - - /** - * @brief The optionally-defined slice of the ellipsoid. - */ - std::optional slice; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/EllipsoidSlice.h b/CesiumGltf/generated/include/CesiumGltf/EllipsoidSlice.h deleted file mode 100644 index c735513b8..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/EllipsoidSlice.h +++ /dev/null @@ -1,48 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Library.h" - -#include - -#include - -namespace CesiumGltf { -/** - * @brief A slice of an implicit ellipsoid. Defines the subsection of the - * ellipsoid that the implicit volume actually occupies. - */ -struct CESIUMGLTF_API EllipsoidSlice final - : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "EllipsoidSlice"; - - /** - * @brief The start of the slice along the radius of the ellipsoid. - */ - double minRadius = 0; - - /** - * @brief The end of the slice along the radius of the ellipsoid. - */ - double maxRadius = 1; - - /** - * @brief The start of the slice across the angles of the sphere, given in - * radians. The first element corresponds to the azimuthal angle (a.k.a - * longitude) and must be in the range [-pi, pi]. The second element - * corresponds to the polar angle (a.k.a. latitude) and must be in the range - * [-pi/2, pi/2]. - */ - std::vector minAngle = {-3.14159265359, -1.57079632679}; - - /** - * @brief The end of the slice across the angles of the sphere, given in - * radians. The first element corresponds to the azimuthal angle (a.k.a - * longitude) and must be in the range [-pi, pi]. The second element - * corresponds to the polar angle (a.k.a. latitude) and must be in the range - * [-pi/2, pi/2]. - */ - std::vector maxAngle = {3.14159265359, 1.57079632679}; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/ExtensionExtPrimitiveVoxels.h b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtPrimitiveVoxels.h index a52d7a384..30699c110 100644 --- a/CesiumGltf/generated/include/CesiumGltf/ExtensionExtPrimitiveVoxels.h +++ b/CesiumGltf/generated/include/CesiumGltf/ExtensionExtPrimitiveVoxels.h @@ -22,14 +22,14 @@ struct CESIUMGLTF_API ExtensionExtPrimitiveVoxels final static inline constexpr const char* ExtensionName = "EXT_primitive_voxels"; /** - * @brief The index of the shape in `EXT_implicit_geometry` that the voxel - * grid adheres to. + * @brief The index of the shape in `KHR_implicit_shapes` that the voxel grid + * adheres to. */ int32_t shape = -1; /** * @brief Dimensions of the voxel grid. The values are interpreted with - * respect to the shape indicated by `EXT_implicit_geometry`. + * respect to the shape indicated by `KHR_implicit_shapes`. */ std::vector dimensions; diff --git a/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrImplicitShapes.h b/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrImplicitShapes.h new file mode 100644 index 000000000..d27d61967 --- /dev/null +++ b/CesiumGltf/generated/include/CesiumGltf/ExtensionKhrImplicitShapes.h @@ -0,0 +1,26 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include "CesiumGltf/Library.h" +#include "CesiumGltf/Shape.h" + +#include + +#include + +namespace CesiumGltf { +/** + * @brief Top level collision primitives. + */ +struct CESIUMGLTF_API ExtensionKhrImplicitShapes final + : public CesiumUtility::ExtensibleObject { + static inline constexpr const char* TypeName = "ExtensionKhrImplicitShapes"; + static inline constexpr const char* ExtensionName = "KHR_implicit_shapes"; + + /** + * @brief An array of shape descriptions. + */ + std::vector shapes; +}; +} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Geometry.h b/CesiumGltf/generated/include/CesiumGltf/Geometry.h deleted file mode 100644 index 9cd99be16..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/Geometry.h +++ /dev/null @@ -1,48 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Box.h" -#include "CesiumGltf/Cylinder.h" -#include "CesiumGltf/Ellipsoid.h" -#include "CesiumGltf/Library.h" -#include "CesiumGltf/Region.h" -#include "CesiumGltf/Sphere.h" - -#include - -#include - -namespace CesiumGltf { -/** - * @brief A definition of implicit 3D geometry. - */ -struct CESIUMGLTF_API Geometry final : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "Geometry"; - - /** - * @brief box - */ - std::optional box; - - /** - * @brief cylinder - */ - std::optional cylinder; - - /** - * @brief sphere - */ - std::optional sphere; - - /** - * @brief ellipsoid - */ - std::optional ellipsoid; - - /** - * @brief region - */ - std::optional region; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Region.h b/CesiumGltf/generated/include/CesiumGltf/Region.h deleted file mode 100644 index 0b9941d1d..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/Region.h +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Library.h" -#include "CesiumGltf/RegionSlice.h" - -#include - -#include - -namespace CesiumGltf { -/** - * @brief An implicit region defined relative to an ellipsoid that is centered - * at the local space origin. - */ -struct CESIUMGLTF_API Region final : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "Region"; - - /** - * @brief The radius along the semi-major axis of the reference ellipsoid in - * meters. - */ - double semiMajorAxisRadius = double(); - - /** - * @brief The radius along the semi-minor axis of the reference ellipsoid in - * meters. - */ - double semiMinorAxisRadius = double(); - - /** - * @brief The height of this region from the surface of the reference - * ellipsoid in meters. - */ - double heightFromSurface = double(); - - /** - * @brief The optionally-defined slice of the region. - */ - std::optional slice; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/RegionSlice.h b/CesiumGltf/generated/include/CesiumGltf/RegionSlice.h deleted file mode 100644 index 43304099a..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/RegionSlice.h +++ /dev/null @@ -1,48 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Library.h" - -#include - -#include - -namespace CesiumGltf { -/** - * @brief A slice of an implicit region relative to an ellipsoid. Defines the - * subsection of the region that the implicit volume actually occupies. - */ -struct CESIUMGLTF_API RegionSlice final - : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "RegionSlice"; - - /** - * @brief The start of the slice along the region's height. - */ - double minHeight = 0; - - /** - * @brief The end of the slice along the region's height. - */ - double maxHeight = 1; - - /** - * @brief The start of the slice along the angles of the reference ellipsoid, - * in radians. The first element corresponds to the azimuthal angle (a.k.a - * longitude) and must be in the range [-pi, pi]. The second element - * corresponds to the polar angle (a.k.a. latitude) and must be in the range - * [-pi/2, pi/2]. - */ - std::vector minAngle = {-3.14159265359, -1.57079632679}; - - /** - * @brief The end of the slice along the angles of the reference ellipsoid, in - * radians. The first element corresponds to the azimuthal angle (a.k.a - * longitude) and must be in the range [-pi, pi]. The second element - * corresponds to the polar angle (a.k.a. latitude) and must be in the range - * [-pi/2, pi/2]. - */ - std::vector maxAngle = {3.14159265359, 1.57079632679}; -}; -} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Shape.h b/CesiumGltf/generated/include/CesiumGltf/Shape.h new file mode 100644 index 000000000..cf25f8a8b --- /dev/null +++ b/CesiumGltf/generated/include/CesiumGltf/Shape.h @@ -0,0 +1,63 @@ +// 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 +#include + +namespace CesiumGltf { +/** + * @brief Parameters describing a node's physics collision geometry. + */ +struct CESIUMGLTF_API Shape final : public CesiumGltf::NamedObject { + static inline constexpr const char* TypeName = "Shape"; + + /** + * @brief Known values for Specifies the shape type. + */ + struct Type { + inline static const std::string sphere = "sphere"; + + inline static const std::string box = "box"; + + inline static const std::string capsule = "capsule"; + + 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 sphere; + + /** + * @brief A set of parameter values that are used to define a box shape. + */ + std::optional box; + + /** + * @brief A set of parameter values that are used to define a capsule shape. + */ + std::optional capsule; + + /** + * @brief A set of parameter values that are used to define a cylinder shape. + */ + std::optional cylinder; +}; +} // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/Sphere.h b/CesiumGltf/generated/include/CesiumGltf/Sphere.h index 66a4381b6..1eeaa4810 100644 --- a/CesiumGltf/generated/include/CesiumGltf/Sphere.h +++ b/CesiumGltf/generated/include/CesiumGltf/Sphere.h @@ -3,27 +3,19 @@ #pragma once #include "CesiumGltf/Library.h" -#include "CesiumGltf/SphereSlice.h" #include -#include - namespace CesiumGltf { /** - * @brief An implicit sphere centered at the local space origin. + * @brief Parameters describing a sphere shape. */ struct CESIUMGLTF_API Sphere final : public CesiumUtility::ExtensibleObject { static inline constexpr const char* TypeName = "Sphere"; /** - * @brief The radius of the sphere in local space. - */ - double radius = double(); - - /** - * @brief The optionally-defined slice of the sphere. + * @brief The radius of the sphere. */ - std::optional slice; + double radius = 0.5; }; } // namespace CesiumGltf diff --git a/CesiumGltf/generated/include/CesiumGltf/SphereSlice.h b/CesiumGltf/generated/include/CesiumGltf/SphereSlice.h deleted file mode 100644 index ea3f74304..000000000 --- a/CesiumGltf/generated/include/CesiumGltf/SphereSlice.h +++ /dev/null @@ -1,47 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "CesiumGltf/Library.h" - -#include - -#include - -namespace CesiumGltf { -/** - * @brief A slice of an implicit sphere. Defines the subsection of the sphere - * that the implicit volume actually occupies. - */ -struct CESIUMGLTF_API SphereSlice final - : public CesiumUtility::ExtensibleObject { - static inline constexpr const char* TypeName = "SphereSlice"; - - /** - * @brief The start of the slice along the radius of the sphere. - */ - double minRadius = 0; - - /** - * @brief The end of the slice along the radius of the sphere. - */ - double maxRadius = 1; - - /** - * @brief The start of the slice across the angles of the sphere, given in - * radians. The first element corresponds to the azimuthal angle (a.k.a - * longitude) and must be in the range [-pi, pi]. The second element - * corresponds to the polar angle (a.k.a. latitude) and must be in the range - * [-pi/2, pi/2]. - */ - std::vector minAngle = {-3.14159265359, -1.57079632679}; - - /** - * @brief The end of the slice across the angles of the sphere, in radians. - * The first element corresponds to the azimuthal angle (a.k.a longitude) and - * must be in the range [-pi, pi]. The second element corresponds to the polar - * angle (a.k.a. latitude) and must be in the range [-pi/2, pi/2]. - */ - std::vector maxAngle = {3.14159265359, 1.57079632679}; -}; -} // namespace CesiumGltf diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/GeometryReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/CapsuleReader.h similarity index 70% rename from CesiumGltfReader/generated/include/CesiumGltfReader/GeometryReader.h rename to CesiumGltfReader/generated/include/CesiumGltfReader/CapsuleReader.h index 6b97054bf..4272e103f 100644 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/GeometryReader.h +++ b/CesiumGltfReader/generated/include/CesiumGltfReader/CapsuleReader.h @@ -2,7 +2,7 @@ // DO NOT EDIT THIS FILE! #pragma once -#include +#include #include #include #include @@ -13,20 +13,20 @@ #include namespace CesiumGltf { -struct Geometry; +struct Capsule; } namespace CesiumGltfReader { /** - * @brief Reads {@link Geometry} instances from JSON. + * @brief Reads {@link Capsule} instances from JSON. */ -class CESIUMGLTFREADER_API GeometryReader { +class CESIUMGLTFREADER_API CapsuleReader { public: /** * @brief Constructs a new instance. */ - GeometryReader(); + CapsuleReader(); /** * @brief Gets the options controlling how the JSON is read. @@ -39,30 +39,30 @@ class CESIUMGLTFREADER_API GeometryReader { const CesiumJsonReader::JsonReaderOptions& getOptions() const; /** - * @brief Reads an instance of Geometry from a byte buffer. + * @brief Reads an instance of Capsule from a byte buffer. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const gsl::span& data) const; /** - * @brief Reads an instance of Geometry from a rapidJson::Value. + * @brief Reads an instance of Capsule from a rapidJson::Value. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const rapidjson::Value& value) const; /** - * @brief Reads an array of instances of Geometry from a rapidJson::Value. + * @brief Reads an array of instances of Capsule from a rapidJson::Value. * * @param data The buffer from which to read the array of instances. * @return The result of reading the array of instances. */ - CesiumJsonReader::ReadJsonResult> + CesiumJsonReader::ReadJsonResult> readArrayFromJson(const rapidjson::Value& value) const; private: diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/CylinderSliceReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/CylinderSliceReader.h deleted file mode 100644 index a65432144..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/CylinderSliceReader.h +++ /dev/null @@ -1,73 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct CylinderSlice; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link CylinderSlice} instances from JSON. - */ -class CESIUMGLTFREADER_API CylinderSliceReader { -public: - /** - * @brief Constructs a new instance. - */ - CylinderSliceReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of CylinderSlice from a byte buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of CylinderSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of CylinderSlice from a - * rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidReader.h deleted file mode 100644 index 57bd9d1f0..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidReader.h +++ /dev/null @@ -1,72 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct Ellipsoid; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link Ellipsoid} instances from JSON. - */ -class CESIUMGLTFREADER_API EllipsoidReader { -public: - /** - * @brief Constructs a new instance. - */ - EllipsoidReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of Ellipsoid from a byte buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of Ellipsoid from a rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of Ellipsoid from a rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidSliceReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidSliceReader.h deleted file mode 100644 index 4403546ca..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/EllipsoidSliceReader.h +++ /dev/null @@ -1,73 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct EllipsoidSlice; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link EllipsoidSlice} instances from JSON. - */ -class CESIUMGLTFREADER_API EllipsoidSliceReader { -public: - /** - * @brief Constructs a new instance. - */ - EllipsoidSliceReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of EllipsoidSlice from a byte buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of EllipsoidSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of EllipsoidSlice from a - * rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtImplicitGeometryReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionKhrImplicitShapesReader.h similarity index 66% rename from CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtImplicitGeometryReader.h rename to CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionKhrImplicitShapesReader.h index 70b2393f0..a4095ffdf 100644 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionExtImplicitGeometryReader.h +++ b/CesiumGltfReader/generated/include/CesiumGltfReader/ExtensionKhrImplicitShapesReader.h @@ -2,7 +2,7 @@ // DO NOT EDIT THIS FILE! #pragma once -#include +#include #include #include #include @@ -13,20 +13,20 @@ #include namespace CesiumGltf { -struct ExtensionExtImplicitGeometry; +struct ExtensionKhrImplicitShapes; } namespace CesiumGltfReader { /** - * @brief Reads {@link ExtensionExtImplicitGeometry} instances from JSON. + * @brief Reads {@link ExtensionKhrImplicitShapes} instances from JSON. */ -class CESIUMGLTFREADER_API ExtensionExtImplicitGeometryReader { +class CESIUMGLTFREADER_API ExtensionKhrImplicitShapesReader { public: /** * @brief Constructs a new instance. */ - ExtensionExtImplicitGeometryReader(); + ExtensionKhrImplicitShapesReader(); /** * @brief Gets the options controlling how the JSON is read. @@ -39,34 +39,33 @@ class CESIUMGLTFREADER_API ExtensionExtImplicitGeometryReader { const CesiumJsonReader::JsonReaderOptions& getOptions() const; /** - * @brief Reads an instance of ExtensionExtImplicitGeometry from a byte - * buffer. + * @brief Reads an instance of ExtensionKhrImplicitShapes from a byte buffer. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const gsl::span& data) const; /** - * @brief Reads an instance of ExtensionExtImplicitGeometry from a + * @brief Reads an instance of ExtensionKhrImplicitShapes from a * rapidJson::Value. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const rapidjson::Value& value) const; /** - * @brief Reads an array of instances of ExtensionExtImplicitGeometry from a + * @brief Reads an array of instances of ExtensionKhrImplicitShapes from a * rapidJson::Value. * * @param data The buffer from which to read the array of instances. * @return The result of reading the array of instances. */ CesiumJsonReader::ReadJsonResult< - std::vector> + std::vector> readArrayFromJson(const rapidjson::Value& value) const; private: diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/GeometryInEXT_implicit_geometryReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/GeometryInEXT_implicit_geometryReader.h deleted file mode 100644 index 542f951af..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/GeometryInEXT_implicit_geometryReader.h +++ /dev/null @@ -1,76 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct GeometryInEXT_implicit_geometry; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link GeometryInEXT_implicit_geometry} instances from JSON. - */ -class CESIUMGLTFREADER_API GeometryInEXT_implicit_geometryReader { -public: - /** - * @brief Constructs a new instance. - */ - GeometryInEXT_implicit_geometryReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of GeometryInEXT_implicit_geometry from a byte - * buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of GeometryInEXT_implicit_geometry from a - * rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of GeometryInEXT_implicit_geometry from - * a rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult< - std::vector> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/RegionSliceReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/RegionSliceReader.h deleted file mode 100644 index 59aa03c9a..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/RegionSliceReader.h +++ /dev/null @@ -1,72 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct RegionSlice; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link RegionSlice} instances from JSON. - */ -class CESIUMGLTFREADER_API RegionSliceReader { -public: - /** - * @brief Constructs a new instance. - */ - RegionSliceReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of RegionSlice from a byte buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of RegionSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of RegionSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/RegionReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/ShapeReader.h similarity index 71% rename from CesiumGltfReader/generated/include/CesiumGltfReader/RegionReader.h rename to CesiumGltfReader/generated/include/CesiumGltfReader/ShapeReader.h index 668b498e3..8fdaeda3e 100644 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/RegionReader.h +++ b/CesiumGltfReader/generated/include/CesiumGltfReader/ShapeReader.h @@ -2,7 +2,7 @@ // DO NOT EDIT THIS FILE! #pragma once -#include +#include #include #include #include @@ -13,20 +13,20 @@ #include namespace CesiumGltf { -struct Region; +struct Shape; } namespace CesiumGltfReader { /** - * @brief Reads {@link Region} instances from JSON. + * @brief Reads {@link Shape} instances from JSON. */ -class CESIUMGLTFREADER_API RegionReader { +class CESIUMGLTFREADER_API ShapeReader { public: /** * @brief Constructs a new instance. */ - RegionReader(); + ShapeReader(); /** * @brief Gets the options controlling how the JSON is read. @@ -39,30 +39,30 @@ class CESIUMGLTFREADER_API RegionReader { const CesiumJsonReader::JsonReaderOptions& getOptions() const; /** - * @brief Reads an instance of Region from a byte buffer. + * @brief Reads an instance of Shape from a byte buffer. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const gsl::span& data) const; /** - * @brief Reads an instance of Region from a rapidJson::Value. + * @brief Reads an instance of Shape from a rapidJson::Value. * * @param data The buffer from which to read the instance. * @return The result of reading the instance. */ - CesiumJsonReader::ReadJsonResult + CesiumJsonReader::ReadJsonResult readFromJson(const rapidjson::Value& value) const; /** - * @brief Reads an array of instances of Region from a rapidJson::Value. + * @brief Reads an array of instances of Shape from a rapidJson::Value. * * @param data The buffer from which to read the array of instances. * @return The result of reading the array of instances. */ - CesiumJsonReader::ReadJsonResult> + CesiumJsonReader::ReadJsonResult> readArrayFromJson(const rapidjson::Value& value) const; private: diff --git a/CesiumGltfReader/generated/include/CesiumGltfReader/SphereSliceReader.h b/CesiumGltfReader/generated/include/CesiumGltfReader/SphereSliceReader.h deleted file mode 100644 index 7d10f6309..000000000 --- a/CesiumGltfReader/generated/include/CesiumGltfReader/SphereSliceReader.h +++ /dev/null @@ -1,72 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include - -namespace CesiumGltf { -struct SphereSlice; -} - -namespace CesiumGltfReader { - -/** - * @brief Reads {@link SphereSlice} instances from JSON. - */ -class CESIUMGLTFREADER_API SphereSliceReader { -public: - /** - * @brief Constructs a new instance. - */ - SphereSliceReader(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - CesiumJsonReader::JsonReaderOptions& getOptions(); - - /** - * @brief Gets the options controlling how the JSON is read. - */ - const CesiumJsonReader::JsonReaderOptions& getOptions() const; - - /** - * @brief Reads an instance of SphereSlice from a byte buffer. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const gsl::span& data) const; - - /** - * @brief Reads an instance of SphereSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the instance. - * @return The result of reading the instance. - */ - CesiumJsonReader::ReadJsonResult - readFromJson(const rapidjson::Value& value) const; - - /** - * @brief Reads an array of instances of SphereSlice from a rapidJson::Value. - * - * @param data The buffer from which to read the array of instances. - * @return The result of reading the array of instances. - */ - CesiumJsonReader::ReadJsonResult> - readArrayFromJson(const rapidjson::Value& value) const; - -private: - CesiumJsonReader::JsonReaderOptions _options; -}; - -} // namespace CesiumGltfReader \ No newline at end of file diff --git a/CesiumGltfReader/generated/src/EllipsoidJsonHandler.h b/CesiumGltfReader/generated/src/CapsuleJsonHandler.h similarity index 53% rename from CesiumGltfReader/generated/src/EllipsoidJsonHandler.h rename to CesiumGltfReader/generated/src/CapsuleJsonHandler.h index 71a59ec8f..1f9faa8ef 100644 --- a/CesiumGltfReader/generated/src/EllipsoidJsonHandler.h +++ b/CesiumGltfReader/generated/src/CapsuleJsonHandler.h @@ -2,10 +2,7 @@ // DO NOT EDIT THIS FILE! #pragma once -#include "EllipsoidSliceJsonHandler.h" - -#include -#include +#include #include #include @@ -14,28 +11,27 @@ class JsonReaderOptions; } namespace CesiumGltfReader { -class EllipsoidJsonHandler +class CapsuleJsonHandler : public CesiumJsonReader::ExtensibleObjectJsonHandler { public: - using ValueType = CesiumGltf::Ellipsoid; + using ValueType = CesiumGltf::Capsule; - EllipsoidJsonHandler( + CapsuleJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::Ellipsoid* pObject); + void reset(IJsonHandler* pParentHandler, CesiumGltf::Capsule* pObject); virtual IJsonHandler* readObjectKey(const std::string_view& str) override; protected: - IJsonHandler* readObjectKeyEllipsoid( + IJsonHandler* readObjectKeyCapsule( const std::string& objectType, const std::string_view& str, - CesiumGltf::Ellipsoid& o); + CesiumGltf::Capsule& o); private: - CesiumGltf::Ellipsoid* _pObject = nullptr; - CesiumJsonReader:: - ArrayJsonHandler - _radii; - EllipsoidSliceJsonHandler _slice; + CesiumGltf::Capsule* _pObject = nullptr; + CesiumJsonReader::DoubleJsonHandler _height; + CesiumJsonReader::DoubleJsonHandler _radiusBottom; + CesiumJsonReader::DoubleJsonHandler _radiusTop; }; } // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/CylinderJsonHandler.h b/CesiumGltfReader/generated/src/CylinderJsonHandler.h index b632157f0..378409bc3 100644 --- a/CesiumGltfReader/generated/src/CylinderJsonHandler.h +++ b/CesiumGltfReader/generated/src/CylinderJsonHandler.h @@ -2,8 +2,6 @@ // DO NOT EDIT THIS FILE! #pragma once -#include "CylinderSliceJsonHandler.h" - #include #include #include @@ -32,8 +30,8 @@ class CylinderJsonHandler private: CesiumGltf::Cylinder* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _radius; CesiumJsonReader::DoubleJsonHandler _height; - CylinderSliceJsonHandler _slice; + CesiumJsonReader::DoubleJsonHandler _radiusBottom; + CesiumJsonReader::DoubleJsonHandler _radiusTop; }; } // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/CylinderSliceJsonHandler.h b/CesiumGltfReader/generated/src/CylinderSliceJsonHandler.h deleted file mode 100644 index 25e39fdfd..000000000 --- a/CesiumGltfReader/generated/src/CylinderSliceJsonHandler.h +++ /dev/null @@ -1,40 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class CylinderSliceJsonHandler - : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::CylinderSlice; - - CylinderSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::CylinderSlice* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeyCylinderSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::CylinderSlice& o); - -private: - CesiumGltf::CylinderSlice* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _minRadius; - CesiumJsonReader::DoubleJsonHandler _maxRadius; - CesiumJsonReader::DoubleJsonHandler _minHeight; - CesiumJsonReader::DoubleJsonHandler _maxHeight; - CesiumJsonReader::DoubleJsonHandler _minAngle; - CesiumJsonReader::DoubleJsonHandler _maxAngle; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/EllipsoidSliceJsonHandler.h b/CesiumGltfReader/generated/src/EllipsoidSliceJsonHandler.h deleted file mode 100644 index 4c83ede09..000000000 --- a/CesiumGltfReader/generated/src/EllipsoidSliceJsonHandler.h +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class EllipsoidSliceJsonHandler - : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::EllipsoidSlice; - - EllipsoidSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::EllipsoidSlice* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeyEllipsoidSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::EllipsoidSlice& o); - -private: - CesiumGltf::EllipsoidSlice* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _minRadius; - CesiumJsonReader::DoubleJsonHandler _maxRadius; - CesiumJsonReader:: - ArrayJsonHandler - _minAngle; - CesiumJsonReader:: - ArrayJsonHandler - _maxAngle; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/ExtensionKhrImplicitShapesJsonHandler.h b/CesiumGltfReader/generated/src/ExtensionKhrImplicitShapesJsonHandler.h new file mode 100644 index 000000000..9d385dfc1 --- /dev/null +++ b/CesiumGltfReader/generated/src/ExtensionKhrImplicitShapesJsonHandler.h @@ -0,0 +1,50 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include "ShapeJsonHandler.h" + +#include +#include +#include + +namespace CesiumJsonReader { +class JsonReaderOptions; +} + +namespace CesiumGltfReader { +class ExtensionKhrImplicitShapesJsonHandler + : public CesiumJsonReader::ExtensibleObjectJsonHandler, + public CesiumJsonReader::IExtensionJsonHandler { +public: + using ValueType = CesiumGltf::ExtensionKhrImplicitShapes; + + static inline constexpr const char* ExtensionName = "KHR_implicit_shapes"; + + ExtensionKhrImplicitShapesJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept; + void reset( + IJsonHandler* pParentHandler, + CesiumGltf::ExtensionKhrImplicitShapes* pObject); + + virtual IJsonHandler* readObjectKey(const std::string_view& str) override; + + virtual void reset( + IJsonHandler* pParentHandler, + CesiumUtility::ExtensibleObject& o, + const std::string_view& extensionName) override; + + virtual IJsonHandler& getHandler() override { return *this; } + +protected: + IJsonHandler* readObjectKeyExtensionKhrImplicitShapes( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionKhrImplicitShapes& o); + +private: + CesiumGltf::ExtensionKhrImplicitShapes* _pObject = nullptr; + CesiumJsonReader::ArrayJsonHandler + _shapes; +}; +} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp index af398f6ba..1bd8113c0 100644 --- a/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp +++ b/CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp @@ -2057,103 +2057,102 @@ ExtensionCesiumPrimitiveOutlineReader::readArrayFromJson( } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! -#include "ExtensionExtImplicitGeometryJsonHandler.h" +#include "ExtensionKhrImplicitShapesJsonHandler.h" #include "registerReaderExtensions.h" -#include -#include +#include +#include #include #include +#include -#include #include namespace CesiumGltfReader { -ExtensionExtImplicitGeometryJsonHandler:: - ExtensionExtImplicitGeometryJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept +ExtensionKhrImplicitShapesJsonHandler::ExtensionKhrImplicitShapesJsonHandler( + const CesiumJsonReader::JsonReaderOptions& options) noexcept : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _geometries(options) {} + _shapes(options) {} -void ExtensionExtImplicitGeometryJsonHandler::reset( +void ExtensionKhrImplicitShapesJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::ExtensionExtImplicitGeometry* pObject) { + CesiumGltf::ExtensionKhrImplicitShapes* pObject) { CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); this->_pObject = pObject; } CesiumJsonReader::IJsonHandler* -ExtensionExtImplicitGeometryJsonHandler::readObjectKey( +ExtensionKhrImplicitShapesJsonHandler::readObjectKey( const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyExtensionExtImplicitGeometry( - CesiumGltf::ExtensionExtImplicitGeometry::TypeName, + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyExtensionKhrImplicitShapes( + CesiumGltf::ExtensionKhrImplicitShapes::TypeName, str, *this->_pObject); } -void ExtensionExtImplicitGeometryJsonHandler::reset( +void ExtensionKhrImplicitShapesJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, CesiumUtility::ExtensibleObject& o, const std::string_view& extensionName) { std::any& value = o.extensions - .emplace(extensionName, CesiumGltf::ExtensionExtImplicitGeometry()) + .emplace(extensionName, CesiumGltf::ExtensionKhrImplicitShapes()) .first->second; this->reset( pParentHandler, - &std::any_cast(value)); + &std::any_cast(value)); } -CesiumJsonReader::IJsonHandler* ExtensionExtImplicitGeometryJsonHandler:: - readObjectKeyExtensionExtImplicitGeometry( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::ExtensionExtImplicitGeometry& o) { +CesiumJsonReader::IJsonHandler* +ExtensionKhrImplicitShapesJsonHandler::readObjectKeyExtensionKhrImplicitShapes( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::ExtensionKhrImplicitShapes& o) { using namespace std::string_literals; - if ("geometries"s == str) - return property("geometries", this->_geometries, o.geometries); + if ("shapes"s == str) + return property("shapes", this->_shapes, o.shapes); return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); } -ExtensionExtImplicitGeometryReader::ExtensionExtImplicitGeometryReader() { +ExtensionKhrImplicitShapesReader::ExtensionKhrImplicitShapesReader() { registerReaderExtensions(this->_options); } CesiumJsonReader::JsonReaderOptions& -ExtensionExtImplicitGeometryReader::getOptions() { +ExtensionKhrImplicitShapesReader::getOptions() { return this->_options; } const CesiumJsonReader::JsonReaderOptions& -ExtensionExtImplicitGeometryReader::getOptions() const { +ExtensionKhrImplicitShapesReader::getOptions() const { return this->_options; } -CesiumJsonReader::ReadJsonResult -ExtensionExtImplicitGeometryReader::readFromJson( +CesiumJsonReader::ReadJsonResult +ExtensionKhrImplicitShapesReader::readFromJson( const gsl::span& data) const { - ExtensionExtImplicitGeometryJsonHandler handler(this->_options); + ExtensionKhrImplicitShapesJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(data, handler); } -CesiumJsonReader::ReadJsonResult -ExtensionExtImplicitGeometryReader::readFromJson( +CesiumJsonReader::ReadJsonResult +ExtensionKhrImplicitShapesReader::readFromJson( const rapidjson::Value& value) const { - ExtensionExtImplicitGeometryJsonHandler handler(this->_options); + ExtensionKhrImplicitShapesJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } CesiumJsonReader::ReadJsonResult< - std::vector> -ExtensionExtImplicitGeometryReader::readArrayFromJson( + std::vector> +ExtensionKhrImplicitShapesReader::readArrayFromJson( const rapidjson::Value& value) const { CesiumJsonReader::ArrayJsonHandler< - CesiumGltf::ExtensionExtImplicitGeometry, - ExtensionExtImplicitGeometryJsonHandler> + CesiumGltf::ExtensionKhrImplicitShapes, + ExtensionKhrImplicitShapesJsonHandler> handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } @@ -2168,8 +2167,8 @@ ExtensionExtImplicitGeometryReader::readArrayFromJson( #include #include #include +#include -#include #include namespace CesiumGltfReader { @@ -2191,7 +2190,7 @@ void ExtensionExtPrimitiveVoxelsJsonHandler::reset( CesiumJsonReader::IJsonHandler* ExtensionExtPrimitiveVoxelsJsonHandler::readObjectKey( const std::string_view& str) { - assert(this->_pObject); + CESIUM_ASSERT(this->_pObject); return this->readObjectKeyExtensionExtPrimitiveVoxels( CesiumGltf::ExtensionExtPrimitiveVoxels::TypeName, str, @@ -2277,8 +2276,8 @@ ExtensionExtPrimitiveVoxelsReader::readArrayFromJson( #include #include #include +#include -#include #include namespace CesiumGltfReader { @@ -2298,7 +2297,7 @@ void PaddingJsonHandler::reset( CesiumJsonReader::IJsonHandler* PaddingJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); + CESIUM_ASSERT(this->_pObject); return this->readObjectKeyPadding( CesiumGltf::Padding::TypeName, str, @@ -2351,89 +2350,89 @@ PaddingReader::readArrayFromJson(const rapidjson::Value& value) const { } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! -#include "GeometryJsonHandler.h" +#include "ShapeJsonHandler.h" #include "registerReaderExtensions.h" -#include -#include +#include +#include #include #include +#include -#include #include namespace CesiumGltfReader { -GeometryJsonHandler::GeometryJsonHandler( +ShapeJsonHandler::ShapeJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _box(options), - _cylinder(options), + : CesiumGltfReader::NamedObjectJsonHandler(options), + _type(), _sphere(options), - _ellipsoid(options), - _region(options) {} + _box(options), + _capsule(options), + _cylinder(options) {} -void GeometryJsonHandler::reset( +void ShapeJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::Geometry* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); + CesiumGltf::Shape* pObject) { + CesiumGltfReader::NamedObjectJsonHandler::reset(pParentHandler, pObject); this->_pObject = pObject; } CesiumJsonReader::IJsonHandler* -GeometryJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyGeometry( - CesiumGltf::Geometry::TypeName, +ShapeJsonHandler::readObjectKey(const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyShape( + CesiumGltf::Shape::TypeName, str, *this->_pObject); } -CesiumJsonReader::IJsonHandler* GeometryJsonHandler::readObjectKeyGeometry( +CesiumJsonReader::IJsonHandler* ShapeJsonHandler::readObjectKeyShape( const std::string& objectType, const std::string_view& str, - CesiumGltf::Geometry& o) { + CesiumGltf::Shape& o) { using namespace std::string_literals; + if ("type"s == str) + return property("type", this->_type, o.type); + if ("sphere"s == str) + return property("sphere", this->_sphere, o.sphere); if ("box"s == str) return property("box", this->_box, o.box); + if ("capsule"s == str) + return property("capsule", this->_capsule, o.capsule); if ("cylinder"s == str) return property("cylinder", this->_cylinder, o.cylinder); - if ("sphere"s == str) - return property("sphere", this->_sphere, o.sphere); - if ("ellipsoid"s == str) - return property("ellipsoid", this->_ellipsoid, o.ellipsoid); - if ("region"s == str) - return property("region", this->_region, o.region); - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); + return this->readObjectKeyNamedObject(objectType, str, *this->_pObject); } -GeometryReader::GeometryReader() { registerReaderExtensions(this->_options); } +ShapeReader::ShapeReader() { registerReaderExtensions(this->_options); } -CesiumJsonReader::JsonReaderOptions& GeometryReader::getOptions() { +CesiumJsonReader::JsonReaderOptions& ShapeReader::getOptions() { return this->_options; } -const CesiumJsonReader::JsonReaderOptions& GeometryReader::getOptions() const { +const CesiumJsonReader::JsonReaderOptions& ShapeReader::getOptions() const { return this->_options; } -CesiumJsonReader::ReadJsonResult -GeometryReader::readFromJson(const gsl::span& data) const { - GeometryJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +ShapeReader::readFromJson(const gsl::span& data) const { + ShapeJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(data, handler); } -CesiumJsonReader::ReadJsonResult -GeometryReader::readFromJson(const rapidjson::Value& value) const { - GeometryJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +ShapeReader::readFromJson(const rapidjson::Value& value) const { + ShapeJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } -CesiumJsonReader::ReadJsonResult> -GeometryReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader::ArrayJsonHandler +CesiumJsonReader::ReadJsonResult> +ShapeReader::readArrayFromJson(const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } @@ -2441,95 +2440,83 @@ GeometryReader::readArrayFromJson(const rapidjson::Value& value) const { } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! -#include "RegionJsonHandler.h" +#include "CylinderJsonHandler.h" #include "registerReaderExtensions.h" -#include -#include +#include +#include #include #include +#include -#include #include namespace CesiumGltfReader { -RegionJsonHandler::RegionJsonHandler( +CylinderJsonHandler::CylinderJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _semiMajorAxisRadius(), - _semiMinorAxisRadius(), - _heightFromSurface(), - _slice(options) {} + _height(), + _radiusBottom(), + _radiusTop() {} -void RegionJsonHandler::reset( +void CylinderJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::Region* pObject) { + CesiumGltf::Cylinder* pObject) { CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); this->_pObject = pObject; } CesiumJsonReader::IJsonHandler* -RegionJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyRegion( - CesiumGltf::Region::TypeName, +CylinderJsonHandler::readObjectKey(const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyCylinder( + CesiumGltf::Cylinder::TypeName, str, *this->_pObject); } -CesiumJsonReader::IJsonHandler* RegionJsonHandler::readObjectKeyRegion( +CesiumJsonReader::IJsonHandler* CylinderJsonHandler::readObjectKeyCylinder( const std::string& objectType, const std::string_view& str, - CesiumGltf::Region& o) { + CesiumGltf::Cylinder& o) { using namespace std::string_literals; - if ("semiMajorAxisRadius"s == str) - return property( - "semiMajorAxisRadius", - this->_semiMajorAxisRadius, - o.semiMajorAxisRadius); - if ("semiMinorAxisRadius"s == str) - return property( - "semiMinorAxisRadius", - this->_semiMinorAxisRadius, - o.semiMinorAxisRadius); - if ("heightFromSurface"s == str) - return property( - "heightFromSurface", - this->_heightFromSurface, - o.heightFromSurface); - if ("slice"s == str) - return property("slice", this->_slice, o.slice); + if ("height"s == str) + return property("height", this->_height, o.height); + if ("radiusBottom"s == str) + return property("radiusBottom", this->_radiusBottom, o.radiusBottom); + if ("radiusTop"s == str) + return property("radiusTop", this->_radiusTop, o.radiusTop); return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); } -RegionReader::RegionReader() { registerReaderExtensions(this->_options); } +CylinderReader::CylinderReader() { registerReaderExtensions(this->_options); } -CesiumJsonReader::JsonReaderOptions& RegionReader::getOptions() { +CesiumJsonReader::JsonReaderOptions& CylinderReader::getOptions() { return this->_options; } -const CesiumJsonReader::JsonReaderOptions& RegionReader::getOptions() const { +const CesiumJsonReader::JsonReaderOptions& CylinderReader::getOptions() const { return this->_options; } -CesiumJsonReader::ReadJsonResult -RegionReader::readFromJson(const gsl::span& data) const { - RegionJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +CylinderReader::readFromJson(const gsl::span& data) const { + CylinderJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(data, handler); } -CesiumJsonReader::ReadJsonResult -RegionReader::readFromJson(const rapidjson::Value& value) const { - RegionJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +CylinderReader::readFromJson(const rapidjson::Value& value) const { + CylinderJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } -CesiumJsonReader::ReadJsonResult> -RegionReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader::ArrayJsonHandler +CesiumJsonReader::ReadJsonResult> +CylinderReader::readArrayFromJson(const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } @@ -2537,267 +2524,161 @@ RegionReader::readArrayFromJson(const rapidjson::Value& value) const { } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! -#include "RegionSliceJsonHandler.h" -#include "registerReaderExtensions.h" - -#include -#include -#include -#include - -#include -#include - -namespace CesiumGltfReader { - -RegionSliceJsonHandler::RegionSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _minHeight(), - _maxHeight(), - _minAngle(), - _maxAngle() {} - -void RegionSliceJsonHandler::reset( - CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::RegionSlice* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); - this->_pObject = pObject; -} - -CesiumJsonReader::IJsonHandler* -RegionSliceJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyRegionSlice( - CesiumGltf::RegionSlice::TypeName, - str, - *this->_pObject); -} - -CesiumJsonReader::IJsonHandler* -RegionSliceJsonHandler::readObjectKeyRegionSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::RegionSlice& o) { - using namespace std::string_literals; - - if ("minHeight"s == str) - return property("minHeight", this->_minHeight, o.minHeight); - if ("maxHeight"s == str) - return property("maxHeight", this->_maxHeight, o.maxHeight); - if ("minAngle"s == str) - return property("minAngle", this->_minAngle, o.minAngle); - if ("maxAngle"s == str) - return property("maxAngle", this->_maxAngle, o.maxAngle); - - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); -} - -RegionSliceReader::RegionSliceReader() { - registerReaderExtensions(this->_options); -} - -CesiumJsonReader::JsonReaderOptions& RegionSliceReader::getOptions() { - return this->_options; -} - -const CesiumJsonReader::JsonReaderOptions& -RegionSliceReader::getOptions() const { - return this->_options; -} - -CesiumJsonReader::ReadJsonResult -RegionSliceReader::readFromJson(const gsl::span& data) const { - RegionSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(data, handler); -} - -CesiumJsonReader::ReadJsonResult -RegionSliceReader::readFromJson(const rapidjson::Value& value) const { - RegionSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -CesiumJsonReader::ReadJsonResult> -RegionSliceReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader:: - ArrayJsonHandler - handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -} // namespace CesiumGltfReader -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#include "EllipsoidJsonHandler.h" +#include "CapsuleJsonHandler.h" #include "registerReaderExtensions.h" -#include -#include +#include +#include #include #include +#include -#include #include namespace CesiumGltfReader { -EllipsoidJsonHandler::EllipsoidJsonHandler( +CapsuleJsonHandler::CapsuleJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _radii(), - _slice(options) {} + _height(), + _radiusBottom(), + _radiusTop() {} -void EllipsoidJsonHandler::reset( +void CapsuleJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::Ellipsoid* pObject) { + CesiumGltf::Capsule* pObject) { CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); this->_pObject = pObject; } CesiumJsonReader::IJsonHandler* -EllipsoidJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyEllipsoid( - CesiumGltf::Ellipsoid::TypeName, +CapsuleJsonHandler::readObjectKey(const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyCapsule( + CesiumGltf::Capsule::TypeName, str, *this->_pObject); } -CesiumJsonReader::IJsonHandler* EllipsoidJsonHandler::readObjectKeyEllipsoid( +CesiumJsonReader::IJsonHandler* CapsuleJsonHandler::readObjectKeyCapsule( const std::string& objectType, const std::string_view& str, - CesiumGltf::Ellipsoid& o) { + CesiumGltf::Capsule& o) { using namespace std::string_literals; - if ("radii"s == str) - return property("radii", this->_radii, o.radii); - if ("slice"s == str) - return property("slice", this->_slice, o.slice); + if ("height"s == str) + return property("height", this->_height, o.height); + if ("radiusBottom"s == str) + return property("radiusBottom", this->_radiusBottom, o.radiusBottom); + if ("radiusTop"s == str) + return property("radiusTop", this->_radiusTop, o.radiusTop); return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); } -EllipsoidReader::EllipsoidReader() { registerReaderExtensions(this->_options); } +CapsuleReader::CapsuleReader() { registerReaderExtensions(this->_options); } -CesiumJsonReader::JsonReaderOptions& EllipsoidReader::getOptions() { +CesiumJsonReader::JsonReaderOptions& CapsuleReader::getOptions() { return this->_options; } -const CesiumJsonReader::JsonReaderOptions& EllipsoidReader::getOptions() const { +const CesiumJsonReader::JsonReaderOptions& CapsuleReader::getOptions() const { return this->_options; } -CesiumJsonReader::ReadJsonResult -EllipsoidReader::readFromJson(const gsl::span& data) const { - EllipsoidJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +CapsuleReader::readFromJson(const gsl::span& data) const { + CapsuleJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(data, handler); } -CesiumJsonReader::ReadJsonResult -EllipsoidReader::readFromJson(const rapidjson::Value& value) const { - EllipsoidJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +CapsuleReader::readFromJson(const rapidjson::Value& value) const { + CapsuleJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } -CesiumJsonReader::ReadJsonResult> -EllipsoidReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader:: - ArrayJsonHandler - handler(this->_options); +CesiumJsonReader::ReadJsonResult> +CapsuleReader::readArrayFromJson(const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler + handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! -#include "EllipsoidSliceJsonHandler.h" +#include "BoxJsonHandler.h" #include "registerReaderExtensions.h" -#include -#include +#include +#include #include #include +#include -#include #include namespace CesiumGltfReader { -EllipsoidSliceJsonHandler::EllipsoidSliceJsonHandler( +BoxJsonHandler::BoxJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _minRadius(), - _maxRadius(), - _minAngle(), - _maxAngle() {} + : CesiumJsonReader::ExtensibleObjectJsonHandler(options), _size() {} -void EllipsoidSliceJsonHandler::reset( +void BoxJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::EllipsoidSlice* pObject) { + CesiumGltf::Box* pObject) { CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); this->_pObject = pObject; } CesiumJsonReader::IJsonHandler* -EllipsoidSliceJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyEllipsoidSlice( - CesiumGltf::EllipsoidSlice::TypeName, +BoxJsonHandler::readObjectKey(const std::string_view& str) { + CESIUM_ASSERT(this->_pObject); + return this->readObjectKeyBox( + CesiumGltf::Box::TypeName, str, *this->_pObject); } -CesiumJsonReader::IJsonHandler* -EllipsoidSliceJsonHandler::readObjectKeyEllipsoidSlice( +CesiumJsonReader::IJsonHandler* BoxJsonHandler::readObjectKeyBox( const std::string& objectType, const std::string_view& str, - CesiumGltf::EllipsoidSlice& o) { + CesiumGltf::Box& o) { using namespace std::string_literals; - if ("minRadius"s == str) - return property("minRadius", this->_minRadius, o.minRadius); - if ("maxRadius"s == str) - return property("maxRadius", this->_maxRadius, o.maxRadius); - if ("minAngle"s == str) - return property("minAngle", this->_minAngle, o.minAngle); - if ("maxAngle"s == str) - return property("maxAngle", this->_maxAngle, o.maxAngle); + if ("size"s == str) + return property("size", this->_size, o.size); return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); } -EllipsoidSliceReader::EllipsoidSliceReader() { - registerReaderExtensions(this->_options); -} +BoxReader::BoxReader() { registerReaderExtensions(this->_options); } -CesiumJsonReader::JsonReaderOptions& EllipsoidSliceReader::getOptions() { +CesiumJsonReader::JsonReaderOptions& BoxReader::getOptions() { return this->_options; } -const CesiumJsonReader::JsonReaderOptions& -EllipsoidSliceReader::getOptions() const { +const CesiumJsonReader::JsonReaderOptions& BoxReader::getOptions() const { return this->_options; } -CesiumJsonReader::ReadJsonResult -EllipsoidSliceReader::readFromJson( - const gsl::span& data) const { - EllipsoidSliceJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +BoxReader::readFromJson(const gsl::span& data) const { + BoxJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(data, handler); } -CesiumJsonReader::ReadJsonResult -EllipsoidSliceReader::readFromJson(const rapidjson::Value& value) const { - EllipsoidSliceJsonHandler handler(this->_options); +CesiumJsonReader::ReadJsonResult +BoxReader::readFromJson(const rapidjson::Value& value) const { + BoxJsonHandler handler(this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } -CesiumJsonReader::ReadJsonResult> -EllipsoidSliceReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader:: - ArrayJsonHandler - handler(this->_options); +CesiumJsonReader::ReadJsonResult> +BoxReader::readArrayFromJson(const rapidjson::Value& value) const { + CesiumJsonReader::ArrayJsonHandler handler( + this->_options); return CesiumJsonReader::JsonReader::readJson(value, handler); } @@ -2811,17 +2692,15 @@ EllipsoidSliceReader::readArrayFromJson(const rapidjson::Value& value) const { #include #include #include +#include -#include #include namespace CesiumGltfReader { SphereJsonHandler::SphereJsonHandler( const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _radius(), - _slice(options) {} + : CesiumJsonReader::ExtensibleObjectJsonHandler(options), _radius() {} void SphereJsonHandler::reset( CesiumJsonReader::IJsonHandler* pParentHandler, @@ -2832,7 +2711,7 @@ void SphereJsonHandler::reset( CesiumJsonReader::IJsonHandler* SphereJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); + CESIUM_ASSERT(this->_pObject); return this->readObjectKeySphere( CesiumGltf::Sphere::TypeName, str, @@ -2847,8 +2726,6 @@ CesiumJsonReader::IJsonHandler* SphereJsonHandler::readObjectKeySphere( if ("radius"s == str) return property("radius", this->_radius, o.radius); - if ("slice"s == str) - return property("slice", this->_slice, o.slice); return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); } @@ -2882,358 +2759,6 @@ SphereReader::readArrayFromJson(const rapidjson::Value& value) const { return CesiumJsonReader::JsonReader::readJson(value, handler); } -} // namespace CesiumGltfReader -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#include "SphereSliceJsonHandler.h" -#include "registerReaderExtensions.h" - -#include -#include -#include -#include - -#include -#include - -namespace CesiumGltfReader { - -SphereSliceJsonHandler::SphereSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _minRadius(), - _maxRadius(), - _minAngle(), - _maxAngle() {} - -void SphereSliceJsonHandler::reset( - CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::SphereSlice* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); - this->_pObject = pObject; -} - -CesiumJsonReader::IJsonHandler* -SphereSliceJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeySphereSlice( - CesiumGltf::SphereSlice::TypeName, - str, - *this->_pObject); -} - -CesiumJsonReader::IJsonHandler* -SphereSliceJsonHandler::readObjectKeySphereSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::SphereSlice& o) { - using namespace std::string_literals; - - if ("minRadius"s == str) - return property("minRadius", this->_minRadius, o.minRadius); - if ("maxRadius"s == str) - return property("maxRadius", this->_maxRadius, o.maxRadius); - if ("minAngle"s == str) - return property("minAngle", this->_minAngle, o.minAngle); - if ("maxAngle"s == str) - return property("maxAngle", this->_maxAngle, o.maxAngle); - - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); -} - -SphereSliceReader::SphereSliceReader() { - registerReaderExtensions(this->_options); -} - -CesiumJsonReader::JsonReaderOptions& SphereSliceReader::getOptions() { - return this->_options; -} - -const CesiumJsonReader::JsonReaderOptions& -SphereSliceReader::getOptions() const { - return this->_options; -} - -CesiumJsonReader::ReadJsonResult -SphereSliceReader::readFromJson(const gsl::span& data) const { - SphereSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(data, handler); -} - -CesiumJsonReader::ReadJsonResult -SphereSliceReader::readFromJson(const rapidjson::Value& value) const { - SphereSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -CesiumJsonReader::ReadJsonResult> -SphereSliceReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader:: - ArrayJsonHandler - handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -} // namespace CesiumGltfReader -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#include "CylinderJsonHandler.h" -#include "registerReaderExtensions.h" - -#include -#include -#include -#include - -#include -#include - -namespace CesiumGltfReader { - -CylinderJsonHandler::CylinderJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _radius(), - _height(), - _slice(options) {} - -void CylinderJsonHandler::reset( - CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::Cylinder* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); - this->_pObject = pObject; -} - -CesiumJsonReader::IJsonHandler* -CylinderJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyCylinder( - CesiumGltf::Cylinder::TypeName, - str, - *this->_pObject); -} - -CesiumJsonReader::IJsonHandler* CylinderJsonHandler::readObjectKeyCylinder( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::Cylinder& o) { - using namespace std::string_literals; - - if ("radius"s == str) - return property("radius", this->_radius, o.radius); - if ("height"s == str) - return property("height", this->_height, o.height); - if ("slice"s == str) - return property("slice", this->_slice, o.slice); - - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); -} - -CylinderReader::CylinderReader() { registerReaderExtensions(this->_options); } - -CesiumJsonReader::JsonReaderOptions& CylinderReader::getOptions() { - return this->_options; -} - -const CesiumJsonReader::JsonReaderOptions& CylinderReader::getOptions() const { - return this->_options; -} - -CesiumJsonReader::ReadJsonResult -CylinderReader::readFromJson(const gsl::span& data) const { - CylinderJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(data, handler); -} - -CesiumJsonReader::ReadJsonResult -CylinderReader::readFromJson(const rapidjson::Value& value) const { - CylinderJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -CesiumJsonReader::ReadJsonResult> -CylinderReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader::ArrayJsonHandler - handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -} // namespace CesiumGltfReader -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#include "CylinderSliceJsonHandler.h" -#include "registerReaderExtensions.h" - -#include -#include -#include -#include - -#include -#include - -namespace CesiumGltfReader { - -CylinderSliceJsonHandler::CylinderSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), - _minRadius(), - _maxRadius(), - _minHeight(), - _maxHeight(), - _minAngle(), - _maxAngle() {} - -void CylinderSliceJsonHandler::reset( - CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::CylinderSlice* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); - this->_pObject = pObject; -} - -CesiumJsonReader::IJsonHandler* -CylinderSliceJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyCylinderSlice( - CesiumGltf::CylinderSlice::TypeName, - str, - *this->_pObject); -} - -CesiumJsonReader::IJsonHandler* -CylinderSliceJsonHandler::readObjectKeyCylinderSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::CylinderSlice& o) { - using namespace std::string_literals; - - if ("minRadius"s == str) - return property("minRadius", this->_minRadius, o.minRadius); - if ("maxRadius"s == str) - return property("maxRadius", this->_maxRadius, o.maxRadius); - if ("minHeight"s == str) - return property("minHeight", this->_minHeight, o.minHeight); - if ("maxHeight"s == str) - return property("maxHeight", this->_maxHeight, o.maxHeight); - if ("minAngle"s == str) - return property("minAngle", this->_minAngle, o.minAngle); - if ("maxAngle"s == str) - return property("maxAngle", this->_maxAngle, o.maxAngle); - - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); -} - -CylinderSliceReader::CylinderSliceReader() { - registerReaderExtensions(this->_options); -} - -CesiumJsonReader::JsonReaderOptions& CylinderSliceReader::getOptions() { - return this->_options; -} - -const CesiumJsonReader::JsonReaderOptions& -CylinderSliceReader::getOptions() const { - return this->_options; -} - -CesiumJsonReader::ReadJsonResult -CylinderSliceReader::readFromJson( - const gsl::span& data) const { - CylinderSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(data, handler); -} - -CesiumJsonReader::ReadJsonResult -CylinderSliceReader::readFromJson(const rapidjson::Value& value) const { - CylinderSliceJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -CesiumJsonReader::ReadJsonResult> -CylinderSliceReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader:: - ArrayJsonHandler - handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -} // namespace CesiumGltfReader -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#include "BoxJsonHandler.h" -#include "registerReaderExtensions.h" - -#include -#include -#include -#include - -#include -#include - -namespace CesiumGltfReader { - -BoxJsonHandler::BoxJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept - : CesiumJsonReader::ExtensibleObjectJsonHandler(options), _size() {} - -void BoxJsonHandler::reset( - CesiumJsonReader::IJsonHandler* pParentHandler, - CesiumGltf::Box* pObject) { - CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject); - this->_pObject = pObject; -} - -CesiumJsonReader::IJsonHandler* -BoxJsonHandler::readObjectKey(const std::string_view& str) { - assert(this->_pObject); - return this->readObjectKeyBox( - CesiumGltf::Box::TypeName, - str, - *this->_pObject); -} - -CesiumJsonReader::IJsonHandler* BoxJsonHandler::readObjectKeyBox( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::Box& o) { - using namespace std::string_literals; - - if ("size"s == str) - return property("size", this->_size, o.size); - - return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject); -} - -BoxReader::BoxReader() { registerReaderExtensions(this->_options); } - -CesiumJsonReader::JsonReaderOptions& BoxReader::getOptions() { - return this->_options; -} - -const CesiumJsonReader::JsonReaderOptions& BoxReader::getOptions() const { - return this->_options; -} - -CesiumJsonReader::ReadJsonResult -BoxReader::readFromJson(const gsl::span& data) const { - BoxJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(data, handler); -} - -CesiumJsonReader::ReadJsonResult -BoxReader::readFromJson(const rapidjson::Value& value) const { - BoxJsonHandler handler(this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - -CesiumJsonReader::ReadJsonResult> -BoxReader::readArrayFromJson(const rapidjson::Value& value) const { - CesiumJsonReader::ArrayJsonHandler handler( - this->_options); - return CesiumJsonReader::JsonReader::readJson(value, handler); -} - } // namespace CesiumGltfReader // This file was generated by generate-classes. // DO NOT EDIT THIS FILE! diff --git a/CesiumGltfReader/generated/src/GeometryJsonHandler.h b/CesiumGltfReader/generated/src/GeometryJsonHandler.h deleted file mode 100644 index 25a36538f..000000000 --- a/CesiumGltfReader/generated/src/GeometryJsonHandler.h +++ /dev/null @@ -1,44 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "BoxJsonHandler.h" -#include "CylinderJsonHandler.h" -#include "EllipsoidJsonHandler.h" -#include "RegionJsonHandler.h" -#include "SphereJsonHandler.h" - -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class GeometryJsonHandler - : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::Geometry; - - GeometryJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::Geometry* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeyGeometry( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::Geometry& o); - -private: - CesiumGltf::Geometry* _pObject = nullptr; - BoxJsonHandler _box; - CylinderJsonHandler _cylinder; - SphereJsonHandler _sphere; - EllipsoidJsonHandler _ellipsoid; - RegionJsonHandler _region; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/RegionJsonHandler.h b/CesiumGltfReader/generated/src/RegionJsonHandler.h deleted file mode 100644 index c01ad0069..000000000 --- a/CesiumGltfReader/generated/src/RegionJsonHandler.h +++ /dev/null @@ -1,39 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include "RegionSliceJsonHandler.h" - -#include -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class RegionJsonHandler : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::Region; - - RegionJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::Region* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeyRegion( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::Region& o); - -private: - CesiumGltf::Region* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _semiMajorAxisRadius; - CesiumJsonReader::DoubleJsonHandler _semiMinorAxisRadius; - CesiumJsonReader::DoubleJsonHandler _heightFromSurface; - RegionSliceJsonHandler _slice; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/RegionSliceJsonHandler.h b/CesiumGltfReader/generated/src/RegionSliceJsonHandler.h deleted file mode 100644 index c208f18e6..000000000 --- a/CesiumGltfReader/generated/src/RegionSliceJsonHandler.h +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class RegionSliceJsonHandler - : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::RegionSlice; - - RegionSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::RegionSlice* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeyRegionSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::RegionSlice& o); - -private: - CesiumGltf::RegionSlice* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _minHeight; - CesiumJsonReader::DoubleJsonHandler _maxHeight; - CesiumJsonReader:: - ArrayJsonHandler - _minAngle; - CesiumJsonReader:: - ArrayJsonHandler - _maxAngle; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/ShapeJsonHandler.h b/CesiumGltfReader/generated/src/ShapeJsonHandler.h new file mode 100644 index 000000000..1707af34d --- /dev/null +++ b/CesiumGltfReader/generated/src/ShapeJsonHandler.h @@ -0,0 +1,42 @@ +// This file was generated by generate-classes. +// DO NOT EDIT THIS FILE! +#pragma once + +#include "BoxJsonHandler.h" +#include "CapsuleJsonHandler.h" +#include "CylinderJsonHandler.h" +#include "NamedObjectJsonHandler.h" +#include "SphereJsonHandler.h" + +#include +#include + +namespace CesiumJsonReader { +class JsonReaderOptions; +} + +namespace CesiumGltfReader { +class ShapeJsonHandler : public CesiumGltfReader::NamedObjectJsonHandler { +public: + using ValueType = CesiumGltf::Shape; + + ShapeJsonHandler(const CesiumJsonReader::JsonReaderOptions& options) noexcept; + void reset(IJsonHandler* pParentHandler, CesiumGltf::Shape* pObject); + + virtual IJsonHandler* readObjectKey(const std::string_view& str) override; + +protected: + IJsonHandler* readObjectKeyShape( + const std::string& objectType, + const std::string_view& str, + CesiumGltf::Shape& o); + +private: + CesiumGltf::Shape* _pObject = nullptr; + CesiumJsonReader::StringJsonHandler _type; + SphereJsonHandler _sphere; + BoxJsonHandler _box; + CapsuleJsonHandler _capsule; + CylinderJsonHandler _cylinder; +}; +} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/SphereJsonHandler.h b/CesiumGltfReader/generated/src/SphereJsonHandler.h index 8380fc9fc..1bdd56551 100644 --- a/CesiumGltfReader/generated/src/SphereJsonHandler.h +++ b/CesiumGltfReader/generated/src/SphereJsonHandler.h @@ -2,8 +2,6 @@ // DO NOT EDIT THIS FILE! #pragma once -#include "SphereSliceJsonHandler.h" - #include #include #include @@ -32,6 +30,5 @@ class SphereJsonHandler : public CesiumJsonReader::ExtensibleObjectJsonHandler { private: CesiumGltf::Sphere* _pObject = nullptr; CesiumJsonReader::DoubleJsonHandler _radius; - SphereSliceJsonHandler _slice; }; } // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/SphereSliceJsonHandler.h b/CesiumGltfReader/generated/src/SphereSliceJsonHandler.h deleted file mode 100644 index b6b095654..000000000 --- a/CesiumGltfReader/generated/src/SphereSliceJsonHandler.h +++ /dev/null @@ -1,43 +0,0 @@ -// This file was generated by generate-classes. -// DO NOT EDIT THIS FILE! -#pragma once - -#include -#include -#include -#include - -namespace CesiumJsonReader { -class JsonReaderOptions; -} - -namespace CesiumGltfReader { -class SphereSliceJsonHandler - : public CesiumJsonReader::ExtensibleObjectJsonHandler { -public: - using ValueType = CesiumGltf::SphereSlice; - - SphereSliceJsonHandler( - const CesiumJsonReader::JsonReaderOptions& options) noexcept; - void reset(IJsonHandler* pParentHandler, CesiumGltf::SphereSlice* pObject); - - virtual IJsonHandler* readObjectKey(const std::string_view& str) override; - -protected: - IJsonHandler* readObjectKeySphereSlice( - const std::string& objectType, - const std::string_view& str, - CesiumGltf::SphereSlice& o); - -private: - CesiumGltf::SphereSlice* _pObject = nullptr; - CesiumJsonReader::DoubleJsonHandler _minRadius; - CesiumJsonReader::DoubleJsonHandler _maxRadius; - CesiumJsonReader:: - ArrayJsonHandler - _minAngle; - CesiumJsonReader:: - ArrayJsonHandler - _maxAngle; -}; -} // namespace CesiumGltfReader diff --git a/CesiumGltfReader/generated/src/registerReaderExtensions.cpp b/CesiumGltfReader/generated/src/registerReaderExtensions.cpp index e51f744c9..c404aa18d 100644 --- a/CesiumGltfReader/generated/src/registerReaderExtensions.cpp +++ b/CesiumGltfReader/generated/src/registerReaderExtensions.cpp @@ -8,12 +8,12 @@ #include "ExtensionCesiumPrimitiveOutlineJsonHandler.h" #include "ExtensionCesiumRTCJsonHandler.h" #include "ExtensionCesiumTileEdgesJsonHandler.h" -#include "ExtensionExtImplicitGeometryJsonHandler.h" #include "ExtensionExtInstanceFeaturesJsonHandler.h" #include "ExtensionExtMeshFeaturesJsonHandler.h" #include "ExtensionExtMeshGpuInstancingJsonHandler.h" #include "ExtensionExtPrimitiveVoxelsJsonHandler.h" #include "ExtensionKhrDracoMeshCompressionJsonHandler.h" +#include "ExtensionKhrImplicitShapesJsonHandler.h" #include "ExtensionKhrMaterialsUnlitJsonHandler.h" #include "ExtensionKhrTextureBasisuJsonHandler.h" #include "ExtensionKhrTextureTransformJsonHandler.h" @@ -55,7 +55,7 @@ void registerReaderExtensions(CesiumJsonReader::JsonReaderOptions& options) { ExtensionModelMaxarMeshVariantsJsonHandler>(); options.registerExtension< CesiumGltf::Model, - ExtensionExtImplicitGeometryJsonHandler>(); + ExtensionKhrImplicitShapesJsonHandler>(); options.registerExtension< CesiumGltf::MeshPrimitive, ExtensionCesiumTileEdgesJsonHandler>(); diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp index d835b0ed2..4fc827a89 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.cpp @@ -18,12 +18,10 @@ #include #include #include +#include #include #include #include -#include -#include -#include #include #include #include @@ -31,13 +29,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include @@ -54,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -71,14 +68,12 @@ #include #include #include -#include -#include #include #include #include +#include #include #include -#include #include #include #include @@ -187,7 +182,7 @@ void writeJson( const CesiumJsonWriter::ExtensionWriterContext& context); void writeJson( - const CesiumGltf::ExtensionExtImplicitGeometry& obj, + const CesiumGltf::ExtensionKhrImplicitShapes& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); @@ -202,27 +197,22 @@ void writeJson( const CesiumJsonWriter::ExtensionWriterContext& context); void writeJson( - const CesiumGltf::Geometry& obj, + const CesiumGltf::Shape& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); void writeJson( - const CesiumGltf::Region& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); - -void writeJson( - const CesiumGltf::RegionSlice& obj, + const CesiumGltf::Cylinder& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); void writeJson( - const CesiumGltf::Ellipsoid& obj, + const CesiumGltf::Capsule& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); void writeJson( - const CesiumGltf::EllipsoidSlice& obj, + const CesiumGltf::Box& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); @@ -231,26 +221,6 @@ void writeJson( CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); -void writeJson( - const CesiumGltf::SphereSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); - -void writeJson( - const CesiumGltf::Cylinder& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); - -void writeJson( - const CesiumGltf::CylinderSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); - -void writeJson( - const CesiumGltf::Box& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); - void writeJson( const CesiumGltf::ExtensionNodeMaxarMeshVariantsMappingsValue& obj, CesiumJsonWriter::JsonWriter& jsonWriter, @@ -1021,14 +991,14 @@ void writeJson( } void writeJson( - const CesiumGltf::ExtensionExtImplicitGeometry& obj, + const CesiumGltf::ExtensionKhrImplicitShapes& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (!obj.geometries.empty()) { - jsonWriter.Key("geometries"); - writeJson(obj.geometries, jsonWriter, context); + if (!obj.shapes.empty()) { + jsonWriter.Key("shapes"); + writeJson(obj.shapes, jsonWriter, context); } writeExtensibleObject(obj, jsonWriter, context); @@ -1084,173 +1054,58 @@ void writeJson( } void writeJson( - const CesiumGltf::Geometry& obj, + const CesiumGltf::Shape& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (obj.box.has_value()) { - jsonWriter.Key("box"); - writeJson(obj.box, jsonWriter, context); - } - - if (obj.cylinder.has_value()) { - jsonWriter.Key("cylinder"); - writeJson(obj.cylinder, jsonWriter, context); - } + jsonWriter.Key("type"); + writeJson(obj.type, jsonWriter, context); if (obj.sphere.has_value()) { jsonWriter.Key("sphere"); writeJson(obj.sphere, jsonWriter, context); } - if (obj.ellipsoid.has_value()) { - jsonWriter.Key("ellipsoid"); - writeJson(obj.ellipsoid, jsonWriter, context); - } - - if (obj.region.has_value()) { - jsonWriter.Key("region"); - writeJson(obj.region, jsonWriter, context); - } - - writeExtensibleObject(obj, jsonWriter, context); - - jsonWriter.EndObject(); -} - -void writeJson( - const CesiumGltf::Region& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - jsonWriter.StartObject(); - - jsonWriter.Key("semiMajorAxisRadius"); - writeJson(obj.semiMajorAxisRadius, jsonWriter, context); - - jsonWriter.Key("semiMinorAxisRadius"); - writeJson(obj.semiMinorAxisRadius, jsonWriter, context); - - jsonWriter.Key("heightFromSurface"); - writeJson(obj.heightFromSurface, jsonWriter, context); - - if (obj.slice.has_value()) { - jsonWriter.Key("slice"); - writeJson(obj.slice, jsonWriter, context); - } - - writeExtensibleObject(obj, jsonWriter, context); - - jsonWriter.EndObject(); -} - -void writeJson( - const CesiumGltf::RegionSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - jsonWriter.StartObject(); - - if (obj.minHeight != 0) { - jsonWriter.Key("minHeight"); - writeJson(obj.minHeight, jsonWriter, context); - } - - if (obj.maxHeight != 1) { - jsonWriter.Key("maxHeight"); - writeJson(obj.maxHeight, jsonWriter, context); - } - - static const std::vector minAngleDefault = { - -3.14159265359, - -1.57079632679}; - if (obj.minAngle != minAngleDefault) { - jsonWriter.Key("minAngle"); - writeJson(obj.minAngle, jsonWriter, context); + if (obj.box.has_value()) { + jsonWriter.Key("box"); + writeJson(obj.box, jsonWriter, context); } - static const std::vector maxAngleDefault = { - 3.14159265359, - 1.57079632679}; - if (obj.maxAngle != maxAngleDefault) { - jsonWriter.Key("maxAngle"); - writeJson(obj.maxAngle, jsonWriter, context); + if (obj.capsule.has_value()) { + jsonWriter.Key("capsule"); + writeJson(obj.capsule, jsonWriter, context); } - writeExtensibleObject(obj, jsonWriter, context); - - jsonWriter.EndObject(); -} - -void writeJson( - const CesiumGltf::Ellipsoid& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - jsonWriter.StartObject(); - - if (!obj.radii.empty()) { - jsonWriter.Key("radii"); - writeJson(obj.radii, jsonWriter, context); - } - - if (obj.slice.has_value()) { - jsonWriter.Key("slice"); - writeJson(obj.slice, jsonWriter, context); + if (obj.cylinder.has_value()) { + jsonWriter.Key("cylinder"); + writeJson(obj.cylinder, jsonWriter, context); } - writeExtensibleObject(obj, jsonWriter, context); + writeNamedObject(obj, jsonWriter, context); jsonWriter.EndObject(); } void writeJson( - const CesiumGltf::EllipsoidSlice& obj, + const CesiumGltf::Cylinder& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (obj.minRadius != 0) { - jsonWriter.Key("minRadius"); - writeJson(obj.minRadius, jsonWriter, context); + if (obj.height != 0.5) { + jsonWriter.Key("height"); + writeJson(obj.height, jsonWriter, context); } - if (obj.maxRadius != 1) { - jsonWriter.Key("maxRadius"); - writeJson(obj.maxRadius, jsonWriter, context); + if (obj.radiusBottom != 0.25) { + jsonWriter.Key("radiusBottom"); + writeJson(obj.radiusBottom, jsonWriter, context); } - static const std::vector minAngleDefault = { - -3.14159265359, - -1.57079632679}; - if (obj.minAngle != minAngleDefault) { - jsonWriter.Key("minAngle"); - writeJson(obj.minAngle, jsonWriter, context); - } - - static const std::vector maxAngleDefault = { - 3.14159265359, - 1.57079632679}; - if (obj.maxAngle != maxAngleDefault) { - jsonWriter.Key("maxAngle"); - writeJson(obj.maxAngle, jsonWriter, context); - } - - writeExtensibleObject(obj, jsonWriter, context); - - jsonWriter.EndObject(); -} - -void writeJson( - const CesiumGltf::Sphere& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - jsonWriter.StartObject(); - - jsonWriter.Key("radius"); - writeJson(obj.radius, jsonWriter, context); - - if (obj.slice.has_value()) { - jsonWriter.Key("slice"); - writeJson(obj.slice, jsonWriter, context); + if (obj.radiusTop != 0.25) { + jsonWriter.Key("radiusTop"); + writeJson(obj.radiusTop, jsonWriter, context); } writeExtensibleObject(obj, jsonWriter, context); @@ -1259,35 +1114,24 @@ void writeJson( } void writeJson( - const CesiumGltf::SphereSlice& obj, + const CesiumGltf::Capsule& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (obj.minRadius != 0) { - jsonWriter.Key("minRadius"); - writeJson(obj.minRadius, jsonWriter, context); + if (obj.height != 0.5) { + jsonWriter.Key("height"); + writeJson(obj.height, jsonWriter, context); } - if (obj.maxRadius != 1) { - jsonWriter.Key("maxRadius"); - writeJson(obj.maxRadius, jsonWriter, context); + if (obj.radiusBottom != 0.25) { + jsonWriter.Key("radiusBottom"); + writeJson(obj.radiusBottom, jsonWriter, context); } - static const std::vector minAngleDefault = { - -3.14159265359, - -1.57079632679}; - if (obj.minAngle != minAngleDefault) { - jsonWriter.Key("minAngle"); - writeJson(obj.minAngle, jsonWriter, context); - } - - static const std::vector maxAngleDefault = { - 3.14159265359, - 1.57079632679}; - if (obj.maxAngle != maxAngleDefault) { - jsonWriter.Key("maxAngle"); - writeJson(obj.maxAngle, jsonWriter, context); + if (obj.radiusTop != 0.25) { + jsonWriter.Key("radiusTop"); + writeJson(obj.radiusTop, jsonWriter, context); } writeExtensibleObject(obj, jsonWriter, context); @@ -1296,61 +1140,15 @@ void writeJson( } void writeJson( - const CesiumGltf::Cylinder& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - jsonWriter.StartObject(); - - jsonWriter.Key("radius"); - writeJson(obj.radius, jsonWriter, context); - - jsonWriter.Key("height"); - writeJson(obj.height, jsonWriter, context); - - if (obj.slice.has_value()) { - jsonWriter.Key("slice"); - writeJson(obj.slice, jsonWriter, context); - } - - writeExtensibleObject(obj, jsonWriter, context); - - jsonWriter.EndObject(); -} - -void writeJson( - const CesiumGltf::CylinderSlice& obj, + const CesiumGltf::Box& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (obj.minRadius != 0) { - jsonWriter.Key("minRadius"); - writeJson(obj.minRadius, jsonWriter, context); - } - - if (obj.maxRadius != 1) { - jsonWriter.Key("maxRadius"); - writeJson(obj.maxRadius, jsonWriter, context); - } - - if (obj.minHeight != 0) { - jsonWriter.Key("minHeight"); - writeJson(obj.minHeight, jsonWriter, context); - } - - if (obj.maxHeight != 1) { - jsonWriter.Key("maxHeight"); - writeJson(obj.maxHeight, jsonWriter, context); - } - - if (obj.minAngle != -3.14159265359) { - jsonWriter.Key("minAngle"); - writeJson(obj.minAngle, jsonWriter, context); - } - - if (obj.maxAngle != 3.14159265359) { - jsonWriter.Key("maxAngle"); - writeJson(obj.maxAngle, jsonWriter, context); + static const std::vector sizeDefault = {1, 1, 1}; + if (obj.size != sizeDefault) { + jsonWriter.Key("size"); + writeJson(obj.size, jsonWriter, context); } writeExtensibleObject(obj, jsonWriter, context); @@ -1359,14 +1157,14 @@ void writeJson( } void writeJson( - const CesiumGltf::Box& obj, + const CesiumGltf::Sphere& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { jsonWriter.StartObject(); - if (!obj.size.empty()) { - jsonWriter.Key("size"); - writeJson(obj.size, jsonWriter, context); + if (obj.radius != 0.5) { + jsonWriter.Key("radius"); + writeJson(obj.radius, jsonWriter, context); } writeExtensibleObject(obj, jsonWriter, context); @@ -2912,8 +2710,8 @@ void ExtensionCesiumPrimitiveOutlineJsonWriter::write( writeJson(obj, jsonWriter, context); } -void ExtensionExtImplicitGeometryJsonWriter::write( - const CesiumGltf::ExtensionExtImplicitGeometry& obj, +void ExtensionKhrImplicitShapesJsonWriter::write( + const CesiumGltf::ExtensionKhrImplicitShapes& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { writeJson(obj, jsonWriter, context); @@ -2933,36 +2731,29 @@ void PaddingJsonWriter::write( writeJson(obj, jsonWriter, context); } -void GeometryJsonWriter::write( - const CesiumGltf::Geometry& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - writeJson(obj, jsonWriter, context); -} - -void RegionJsonWriter::write( - const CesiumGltf::Region& obj, +void ShapeJsonWriter::write( + const CesiumGltf::Shape& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { writeJson(obj, jsonWriter, context); } -void RegionSliceJsonWriter::write( - const CesiumGltf::RegionSlice& obj, +void CylinderJsonWriter::write( + const CesiumGltf::Cylinder& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { writeJson(obj, jsonWriter, context); } -void EllipsoidJsonWriter::write( - const CesiumGltf::Ellipsoid& obj, +void CapsuleJsonWriter::write( + const CesiumGltf::Capsule& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { writeJson(obj, jsonWriter, context); } -void EllipsoidSliceJsonWriter::write( - const CesiumGltf::EllipsoidSlice& obj, +void BoxJsonWriter::write( + const CesiumGltf::Box& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context) { writeJson(obj, jsonWriter, context); @@ -2975,34 +2766,6 @@ void SphereJsonWriter::write( writeJson(obj, jsonWriter, context); } -void SphereSliceJsonWriter::write( - const CesiumGltf::SphereSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - writeJson(obj, jsonWriter, context); -} - -void CylinderJsonWriter::write( - const CesiumGltf::Cylinder& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - writeJson(obj, jsonWriter, context); -} - -void CylinderSliceJsonWriter::write( - const CesiumGltf::CylinderSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - writeJson(obj, jsonWriter, context); -} - -void BoxJsonWriter::write( - const CesiumGltf::Box& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context) { - writeJson(obj, jsonWriter, context); -} - void ExtensionNodeMaxarMeshVariantsMappingsValueJsonWriter::write( const CesiumGltf::ExtensionNodeMaxarMeshVariantsMappingsValue& obj, CesiumJsonWriter::JsonWriter& jsonWriter, diff --git a/CesiumGltfWriter/generated/src/ModelJsonWriter.h b/CesiumGltfWriter/generated/src/ModelJsonWriter.h index 575520fcd..1a16b3a9d 100644 --- a/CesiumGltfWriter/generated/src/ModelJsonWriter.h +++ b/CesiumGltfWriter/generated/src/ModelJsonWriter.h @@ -29,19 +29,14 @@ struct ExtensionNodeMaxarMeshVariants; struct ExtensionKhrTextureTransform; struct ExtensionTextureWebp; struct ExtensionCesiumPrimitiveOutline; -struct ExtensionExtImplicitGeometry; +struct ExtensionKhrImplicitShapes; struct ExtensionExtPrimitiveVoxels; struct Padding; -struct Geometry; -struct Region; -struct RegionSlice; -struct Ellipsoid; -struct EllipsoidSlice; -struct Sphere; -struct SphereSlice; +struct Shape; struct Cylinder; -struct CylinderSlice; +struct Capsule; struct Box; +struct Sphere; struct ExtensionNodeMaxarMeshVariantsMappingsValue; struct ExtensionModelMaxarMeshVariantsValue; struct ExtensionMeshPrimitiveKhrMaterialsVariantsMappingsValue; @@ -303,13 +298,13 @@ struct ExtensionCesiumPrimitiveOutlineJsonWriter { const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct ExtensionExtImplicitGeometryJsonWriter { - using ValueType = CesiumGltf::ExtensionExtImplicitGeometry; +struct ExtensionKhrImplicitShapesJsonWriter { + using ValueType = CesiumGltf::ExtensionKhrImplicitShapes; - static inline constexpr const char* ExtensionName = "EXT_implicit_geometry"; + static inline constexpr const char* ExtensionName = "KHR_implicit_shapes"; static void write( - const CesiumGltf::ExtensionExtImplicitGeometry& obj, + const CesiumGltf::ExtensionKhrImplicitShapes& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); }; @@ -334,47 +329,38 @@ struct PaddingJsonWriter { const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct GeometryJsonWriter { - using ValueType = CesiumGltf::Geometry; +struct ShapeJsonWriter { + using ValueType = CesiumGltf::Shape; static void write( - const CesiumGltf::Geometry& obj, + const CesiumGltf::Shape& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct RegionJsonWriter { - using ValueType = CesiumGltf::Region; - - static void write( - const CesiumGltf::Region& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); -}; - -struct RegionSliceJsonWriter { - using ValueType = CesiumGltf::RegionSlice; +struct CylinderJsonWriter { + using ValueType = CesiumGltf::Cylinder; static void write( - const CesiumGltf::RegionSlice& obj, + const CesiumGltf::Cylinder& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct EllipsoidJsonWriter { - using ValueType = CesiumGltf::Ellipsoid; +struct CapsuleJsonWriter { + using ValueType = CesiumGltf::Capsule; static void write( - const CesiumGltf::Ellipsoid& obj, + const CesiumGltf::Capsule& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct EllipsoidSliceJsonWriter { - using ValueType = CesiumGltf::EllipsoidSlice; +struct BoxJsonWriter { + using ValueType = CesiumGltf::Box; static void write( - const CesiumGltf::EllipsoidSlice& obj, + const CesiumGltf::Box& obj, CesiumJsonWriter::JsonWriter& jsonWriter, const CesiumJsonWriter::ExtensionWriterContext& context); }; @@ -388,42 +374,6 @@ struct SphereJsonWriter { const CesiumJsonWriter::ExtensionWriterContext& context); }; -struct SphereSliceJsonWriter { - using ValueType = CesiumGltf::SphereSlice; - - static void write( - const CesiumGltf::SphereSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); -}; - -struct CylinderJsonWriter { - using ValueType = CesiumGltf::Cylinder; - - static void write( - const CesiumGltf::Cylinder& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); -}; - -struct CylinderSliceJsonWriter { - using ValueType = CesiumGltf::CylinderSlice; - - static void write( - const CesiumGltf::CylinderSlice& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); -}; - -struct BoxJsonWriter { - using ValueType = CesiumGltf::Box; - - static void write( - const CesiumGltf::Box& obj, - CesiumJsonWriter::JsonWriter& jsonWriter, - const CesiumJsonWriter::ExtensionWriterContext& context); -}; - struct ExtensionNodeMaxarMeshVariantsMappingsValueJsonWriter { using ValueType = CesiumGltf::ExtensionNodeMaxarMeshVariantsMappingsValue; diff --git a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp index 88eaa355a..33752a983 100644 --- a/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp +++ b/CesiumGltfWriter/generated/src/registerWriterExtensions.cpp @@ -12,12 +12,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -57,7 +57,7 @@ void registerWriterExtensions( ExtensionModelMaxarMeshVariantsJsonWriter>(); context.registerExtension< CesiumGltf::Model, - ExtensionExtImplicitGeometryJsonWriter>(); + ExtensionKhrImplicitShapesJsonWriter>(); context.registerExtension< CesiumGltf::MeshPrimitive, ExtensionCesiumTileEdgesJsonWriter>(); diff --git a/package-lock.json b/package-lock.json index 6a307bc7e..c5dc09302 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cesium-native", - "version": "0.36.0", + "version": "0.40.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cesium-native", - "version": "0.36.0", + "version": "0.40.1", "license": "Apache-2.0", "devDependencies": { "clang-format": "^1.5.0" diff --git a/tools/generate-classes/glTF.json b/tools/generate-classes/glTF.json index d57897321..efd02a042 100644 --- a/tools/generate-classes/glTF.json +++ b/tools/generate-classes/glTF.json @@ -132,11 +132,23 @@ "CESIUM_primitive_outline glTF primitive extension": { "overrideName": "ExtensionCesiumPrimitiveOutline" }, - "EXT_implicit_geometry glTF extension": { - "overrideName": "ExtensionExtImplicitGeometry" + "KHR_implicit_shapes glTF Document Extension": { + "overrideName": "ExtensionKhrImplicitShapes" }, - "Geometry in EXT_implicit_geometry": { - "overrideName": "Geometry" + "KHR_implicit_shapes Shape Resource": { + "overrideName": "Shape" + }, + "KHR_implicit_shapes Box Shape": { + "overrideName": "Box" + }, + "KHR_implicit_shapes Capsule Shape": { + "overrideName": "Capsule" + }, + "KHR_implicit_shapes Cylinder Shape": { + "overrideName": "Cylinder" + }, + "KHR_implicit_shapes Sphere Shape": { + "overrideName": "Sphere" }, "EXT_primitive_voxels glTF Mesh Primitive extension": { "overrideName": "ExtensionExtPrimitiveVoxels" @@ -239,13 +251,15 @@ ] }, { - "extensionName": "EXT_implicit_geometry", - "schema": "Vendor/EXT_implicit_geometry/schema/glTF.EXT_implicit_geometry.schema.json" + "extensionName": "KHR_implicit_shapes", + "schema": "Khronos/KHR_implicit_shapes/schema/glTF.KHR_implicit_shapes.schema.json", + "attachTo": [ + "glTF" + ] }, { "extensionName": "EXT_primitive_voxels", "schema": "Vendor/EXT_primitive_voxels/schema/mesh.primitive.EXT_primitive_voxels.schema.json" - } ] } diff --git a/tools/generate-classes/package.json b/tools/generate-classes/package.json index 54d6e8933..5db81d2a8 100644 --- a/tools/generate-classes/package.json +++ b/tools/generate-classes/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "generate-3d-tiles": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/tileset.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/common/rootProperty.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/PropertyTable/propertyTable.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/Subtree/subtree.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/Schema/schema.schema.json https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/specification/schema/Statistics/statistics.schema.json --output ../../Cesium3DTiles --readerOutput ../../Cesium3DTilesReader --writerOutput ../../Cesium3DTilesWriter --extensions https://raw.githubusercontent.com/CesiumGS/3d-tiles/main/extensions/ --namespace Cesium3DTiles --readerNamespace Cesium3DTilesReader --writerNamespace Cesium3DTilesWriter --config 3dTiles.json", - "generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/3d-tiles-next/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/3d-tiles-next/extensions/2.0/ https://raw.githubusercontent.com/CesiumGS/glTF/ext-primitive-voxels-revisions/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json", + "generate-gltf": "node index.js --schemas https://raw.githubusercontent.com/CesiumGS/glTF/3d-tiles-next/specification/2.0/schema/glTF.schema.json --output ../../CesiumGltf --readerOutput ../../CesiumGltfReader --writerOutput ../../CesiumGltfWriter --extensions https://raw.githubusercontent.com/CesiumGS/glTF/3d-tiles-next/extensions/2.0/ https://raw.githubusercontent.com/CesiumGS/glTF/ext-primitive-voxels-revisions/extensions/2.0/ https://raw.githubusercontent.com/eoineoineoin/glTF/collisionShapeMerge/extensions/2.0/ --namespace CesiumGltf --readerNamespace CesiumGltfReader --writerNamespace CesiumGltfWriter --config glTF.json", "generate-quantized-mesh-terrain": "node index.js --schemas ../../CesiumQuantizedMeshTerrain/schema/layer.schema.json --output ../../CesiumQuantizedMeshTerrain --readerOutput ../../CesiumQuantizedMeshTerrain --writerOutput ../../CesiumQuantizedMeshTerrain --extensions ../../CesiumQuantizedMeshTerrain/schema/extensions --namespace CesiumQuantizedMeshTerrain --readerNamespace CesiumQuantizedMeshTerrain --writerNamespace CesiumQuantizedMeshTerrain --config QuantizedMeshTerrain.json" }, "author": "CesiumGS, Inc.",