Generate classes for 3DTILES_bounding_volume_cylinder
This commit is contained in:
parent
1164b6d2f4
commit
3a48361c85
|
|
@ -0,0 +1,52 @@
|
|||
// This file was generated by generate-classes.
|
||||
// DO NOT EDIT THIS FILE!
|
||||
#pragma once
|
||||
|
||||
#include <Cesium3DTiles/Library.h>
|
||||
#include <CesiumUtility/ExtensibleObject.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
/**
|
||||
* @brief 3D Tiles extension for cylinder bounding volumes.
|
||||
*/
|
||||
struct CESIUM3DTILES_API Extension3dTilesBoundingVolumeCylinder final
|
||||
: public CesiumUtility::ExtensibleObject {
|
||||
/**
|
||||
* @brief The original name of this type.
|
||||
*/
|
||||
static constexpr const char* TypeName =
|
||||
"Extension3dTilesBoundingVolumeCylinder";
|
||||
/** @brief The official name of the extension. This should be the same as its
|
||||
* key in the `extensions` object. */
|
||||
static constexpr const char* ExtensionName =
|
||||
"3DTILES_bounding_volume_cylinder";
|
||||
|
||||
/**
|
||||
* @brief An array of 12 numbers that define a cylinder. The first three
|
||||
* elements define the x, y, and z values for the center of the cylinder. The
|
||||
* next three elements (with indices 3, 4, and 5) define the x axis direction
|
||||
* and half-length. The next three elements (indices 6, 7, and 8) define the y
|
||||
* axis direction and half-length. The last three elements (indices 9, 10, and
|
||||
* 11) define the z axis direction and half-length. The axes must be
|
||||
* orthogonal to each other.
|
||||
*/
|
||||
std::vector<double> cylinder;
|
||||
|
||||
/**
|
||||
* @brief Calculates the size in bytes of this object, including the contents
|
||||
* of all collections, pointers, and strings. This will NOT include the size
|
||||
* of any extensions attached to the object. Calling this method may be slow
|
||||
* as it requires traversing the object's entire structure.
|
||||
*/
|
||||
int64_t getSizeBytes() const {
|
||||
int64_t accum = 0;
|
||||
accum += int64_t(sizeof(Extension3dTilesBoundingVolumeCylinder));
|
||||
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
|
||||
int64_t(sizeof(CesiumUtility::ExtensibleObject));
|
||||
accum += int64_t(sizeof(double) * this->cylinder.capacity());
|
||||
return accum;
|
||||
}
|
||||
};
|
||||
} // namespace Cesium3DTiles
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
// This file was generated by generate-classes.
|
||||
// DO NOT EDIT THIS FILE!
|
||||
#pragma once
|
||||
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeCylinder.h>
|
||||
#include <Cesium3DTilesReader/Library.h>
|
||||
#include <CesiumJsonReader/JsonReader.h>
|
||||
#include <CesiumJsonReader/JsonReaderOptions.h>
|
||||
|
||||
#include <rapidjson/fwd.h>
|
||||
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
struct Extension3dTilesBoundingVolumeCylinder;
|
||||
} // namespace Cesium3DTiles
|
||||
|
||||
namespace Cesium3DTilesReader {
|
||||
|
||||
/**
|
||||
* @brief Reads \ref Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder
|
||||
* "Extension3dTilesBoundingVolumeCylinder" instances from JSON.
|
||||
*/
|
||||
class CESIUM3DTILESREADER_API Extension3dTilesBoundingVolumeCylinderReader {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs a new instance.
|
||||
*/
|
||||
Extension3dTilesBoundingVolumeCylinderReader();
|
||||
|
||||
/**
|
||||
* @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 Extension3dTilesBoundingVolumeCylinder from a
|
||||
* byte buffer.
|
||||
*
|
||||
* @param data The buffer from which to read the instance.
|
||||
* @return The result of reading the instance.
|
||||
*/
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>
|
||||
readFromJson(const std::span<const std::byte>& data) const;
|
||||
|
||||
/**
|
||||
* @brief Reads an instance of Extension3dTilesBoundingVolumeCylinder from a
|
||||
* rapidJson::Value.
|
||||
*
|
||||
* @param value The value from which to read the instance.
|
||||
* @return The result of reading the instance.
|
||||
*/
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>
|
||||
readFromJson(const rapidjson::Value& value) const;
|
||||
|
||||
/**
|
||||
* @brief Reads an array of instances of
|
||||
* Extension3dTilesBoundingVolumeCylinder from a rapidJson::Value.
|
||||
*
|
||||
* @param value The value from which to read the array of instances.
|
||||
* @return The result of reading the array of instances.
|
||||
*/
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
std::vector<Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>>
|
||||
readArrayFromJson(const rapidjson::Value& value) const;
|
||||
|
||||
private:
|
||||
CesiumJsonReader::JsonReaderOptions _options;
|
||||
};
|
||||
|
||||
} // namespace Cesium3DTilesReader
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
// This file was generated by generate-classes.
|
||||
// DO NOT EDIT THIS FILE!
|
||||
#pragma once
|
||||
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeCylinder.h>
|
||||
#include <CesiumJsonReader/ArrayJsonHandler.h>
|
||||
#include <CesiumJsonReader/DoubleJsonHandler.h>
|
||||
#include <CesiumJsonReader/ExtensibleObjectJsonHandler.h>
|
||||
|
||||
namespace CesiumJsonReader {
|
||||
class JsonReaderOptions;
|
||||
} // namespace CesiumJsonReader
|
||||
|
||||
namespace Cesium3DTilesReader {
|
||||
class Extension3dTilesBoundingVolumeCylinderJsonHandler
|
||||
: public CesiumJsonReader::ExtensibleObjectJsonHandler,
|
||||
public CesiumJsonReader::IExtensionJsonHandler {
|
||||
public:
|
||||
using ValueType = Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder;
|
||||
|
||||
static constexpr const char* ExtensionName =
|
||||
"3DTILES_bounding_volume_cylinder";
|
||||
|
||||
explicit Extension3dTilesBoundingVolumeCylinderJsonHandler(
|
||||
const CesiumJsonReader::JsonReaderOptions& options) noexcept;
|
||||
void reset(
|
||||
IJsonHandler* pParentHandler,
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder* pObject);
|
||||
|
||||
IJsonHandler* readObjectKey(const std::string_view& str) override;
|
||||
|
||||
void reset(
|
||||
IJsonHandler* pParentHandler,
|
||||
CesiumUtility::ExtensibleObject& o,
|
||||
const std::string_view& extensionName) override;
|
||||
|
||||
IJsonHandler& getHandler() override { return *this; }
|
||||
|
||||
protected:
|
||||
IJsonHandler* readObjectKeyExtension3dTilesBoundingVolumeCylinder(
|
||||
const std::string& objectType,
|
||||
const std::string_view& str,
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& o);
|
||||
|
||||
private:
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder* _pObject = nullptr;
|
||||
CesiumJsonReader::
|
||||
ArrayJsonHandler<double, CesiumJsonReader::DoubleJsonHandler>
|
||||
_cylinder;
|
||||
};
|
||||
} // namespace Cesium3DTilesReader
|
||||
|
|
@ -246,6 +246,129 @@ Extension3dTilesEllipsoidReader::readArrayFromJson(
|
|||
return CesiumJsonReader::JsonReader::readJson(value, handler);
|
||||
}
|
||||
|
||||
} // namespace Cesium3DTilesReader
|
||||
// This file was generated by generate-classes.
|
||||
// DO NOT EDIT THIS FILE!
|
||||
// NOLINTBEGIN(readability-duplicate-include)
|
||||
#include "Extension3dTilesBoundingVolumeCylinderJsonHandler.h"
|
||||
#include "registerReaderExtensions.h"
|
||||
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeCylinder.h>
|
||||
#include <Cesium3DTilesReader/Extension3dTilesBoundingVolumeCylinderReader.h>
|
||||
#include <CesiumJsonReader/ArrayJsonHandler.h>
|
||||
#include <CesiumJsonReader/ExtensibleObjectJsonHandler.h>
|
||||
#include <CesiumJsonReader/IJsonHandler.h>
|
||||
#include <CesiumJsonReader/JsonReader.h>
|
||||
#include <CesiumUtility/Assert.h>
|
||||
#include <CesiumUtility/ExtensibleObject.h>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
#include <any>
|
||||
#include <cstddef>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
// NOLINTEND(readability-duplicate-include)
|
||||
|
||||
namespace Cesium3DTilesReader {
|
||||
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler::
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler(
|
||||
const CesiumJsonReader::JsonReaderOptions& options) noexcept
|
||||
: CesiumJsonReader::ExtensibleObjectJsonHandler(options), _cylinder() {}
|
||||
|
||||
void Extension3dTilesBoundingVolumeCylinderJsonHandler::reset(
|
||||
CesiumJsonReader::IJsonHandler* pParentHandler,
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder* pObject) {
|
||||
CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject);
|
||||
this->_pObject = pObject;
|
||||
}
|
||||
|
||||
CesiumJsonReader::IJsonHandler*
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler::readObjectKey(
|
||||
const std::string_view& str) {
|
||||
CESIUM_ASSERT(this->_pObject);
|
||||
return this->readObjectKeyExtension3dTilesBoundingVolumeCylinder(
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder::TypeName,
|
||||
str,
|
||||
*this->_pObject);
|
||||
}
|
||||
|
||||
void Extension3dTilesBoundingVolumeCylinderJsonHandler::reset(
|
||||
CesiumJsonReader::IJsonHandler* pParentHandler,
|
||||
CesiumUtility::ExtensibleObject& o,
|
||||
const std::string_view& extensionName) {
|
||||
std::any& value =
|
||||
o.extensions
|
||||
.emplace(
|
||||
extensionName,
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder())
|
||||
.first->second;
|
||||
this->reset(
|
||||
pParentHandler,
|
||||
&std::any_cast<Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder&>(
|
||||
value));
|
||||
}
|
||||
|
||||
CesiumJsonReader::IJsonHandler*
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler::
|
||||
readObjectKeyExtension3dTilesBoundingVolumeCylinder(
|
||||
const std::string& objectType,
|
||||
const std::string_view& str,
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& o) {
|
||||
using namespace std::string_literals;
|
||||
|
||||
if ("cylinder"s == str) {
|
||||
return property("cylinder", this->_cylinder, o.cylinder);
|
||||
}
|
||||
|
||||
return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject);
|
||||
}
|
||||
|
||||
Extension3dTilesBoundingVolumeCylinderReader::
|
||||
Extension3dTilesBoundingVolumeCylinderReader() {
|
||||
registerReaderExtensions(this->_options);
|
||||
}
|
||||
|
||||
CesiumJsonReader::JsonReaderOptions&
|
||||
Extension3dTilesBoundingVolumeCylinderReader::getOptions() {
|
||||
return this->_options;
|
||||
}
|
||||
|
||||
const CesiumJsonReader::JsonReaderOptions&
|
||||
Extension3dTilesBoundingVolumeCylinderReader::getOptions() const {
|
||||
return this->_options;
|
||||
}
|
||||
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>
|
||||
Extension3dTilesBoundingVolumeCylinderReader::readFromJson(
|
||||
const std::span<const std::byte>& data) const {
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler handler(this->_options);
|
||||
return CesiumJsonReader::JsonReader::readJson(data, handler);
|
||||
}
|
||||
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>
|
||||
Extension3dTilesBoundingVolumeCylinderReader::readFromJson(
|
||||
const rapidjson::Value& value) const {
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler handler(this->_options);
|
||||
return CesiumJsonReader::JsonReader::readJson(value, handler);
|
||||
}
|
||||
|
||||
CesiumJsonReader::ReadJsonResult<
|
||||
std::vector<Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder>>
|
||||
Extension3dTilesBoundingVolumeCylinderReader::readArrayFromJson(
|
||||
const rapidjson::Value& value) const {
|
||||
CesiumJsonReader::ArrayJsonHandler<
|
||||
Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder,
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler>
|
||||
handler(this->_options);
|
||||
return CesiumJsonReader::JsonReader::readJson(value, handler);
|
||||
}
|
||||
|
||||
} // namespace Cesium3DTilesReader
|
||||
// This file was generated by generate-classes.
|
||||
// DO NOT EDIT THIS FILE!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "registerReaderExtensions.h"
|
||||
|
||||
#include "Extension3dTilesBoundingVolumeCylinderJsonHandler.h"
|
||||
#include "Extension3dTilesBoundingVolumeS2JsonHandler.h"
|
||||
#include "Extension3dTilesEllipsoidJsonHandler.h"
|
||||
#include "ExtensionContent3dTilesContentVoxelsJsonHandler.h"
|
||||
|
|
@ -19,6 +20,9 @@ void registerReaderExtensions(CesiumJsonReader::JsonReaderOptions& options) {
|
|||
options.registerExtension<
|
||||
Cesium3DTiles::BoundingVolume,
|
||||
Extension3dTilesBoundingVolumeS2JsonHandler>();
|
||||
options.registerExtension<
|
||||
Cesium3DTiles::BoundingVolume,
|
||||
Extension3dTilesBoundingVolumeCylinderJsonHandler>();
|
||||
options.registerExtension<
|
||||
Cesium3DTiles::Tileset,
|
||||
Extension3dTilesEllipsoidJsonHandler>();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <Cesium3DTiles/Content.h>
|
||||
#include <Cesium3DTiles/Enum.h>
|
||||
#include <Cesium3DTiles/EnumValue.h>
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeCylinder.h>
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeS2.h>
|
||||
#include <Cesium3DTiles/Extension3dTilesEllipsoid.h>
|
||||
#include <Cesium3DTiles/ExtensionContent3dTilesContentVoxels.h>
|
||||
|
|
@ -60,6 +61,11 @@ void writeJson(
|
|||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
const CesiumJsonWriter::ExtensionWriterContext& context);
|
||||
|
||||
void writeJson(
|
||||
const Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
const CesiumJsonWriter::ExtensionWriterContext& context);
|
||||
|
||||
void writeJson(
|
||||
const Cesium3DTiles::ExtensionContent3dTilesContentVoxels& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
|
|
@ -394,6 +400,22 @@ void writeJson(
|
|||
jsonWriter.EndObject();
|
||||
}
|
||||
|
||||
void writeJson(
|
||||
const Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
const CesiumJsonWriter::ExtensionWriterContext& context) {
|
||||
jsonWriter.StartObject();
|
||||
|
||||
if (!obj.cylinder.empty()) {
|
||||
jsonWriter.Key("cylinder");
|
||||
writeJson(obj.cylinder, jsonWriter, context);
|
||||
}
|
||||
|
||||
writeExtensibleObject(obj, jsonWriter, context);
|
||||
|
||||
jsonWriter.EndObject();
|
||||
}
|
||||
|
||||
void writeJson(
|
||||
const Cesium3DTiles::ExtensionContent3dTilesContentVoxels& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
|
|
@ -1234,6 +1256,13 @@ void Extension3dTilesEllipsoidJsonWriter::write(
|
|||
writeJson(obj, jsonWriter, context);
|
||||
}
|
||||
|
||||
void Extension3dTilesBoundingVolumeCylinderJsonWriter::write(
|
||||
const Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
const CesiumJsonWriter::ExtensionWriterContext& context) {
|
||||
writeJson(obj, jsonWriter, context);
|
||||
}
|
||||
|
||||
void ExtensionContent3dTilesContentVoxelsJsonWriter::write(
|
||||
const Cesium3DTiles::ExtensionContent3dTilesContentVoxels& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class ExtensionWriterContext;
|
|||
namespace Cesium3DTiles {
|
||||
struct Extension3dTilesBoundingVolumeS2;
|
||||
struct Extension3dTilesEllipsoid;
|
||||
struct Extension3dTilesBoundingVolumeCylinder;
|
||||
struct ExtensionContent3dTilesContentVoxels;
|
||||
struct Padding;
|
||||
struct Statistics;
|
||||
|
|
@ -68,6 +69,20 @@ struct Extension3dTilesEllipsoidJsonWriter {
|
|||
const CesiumJsonWriter::ExtensionWriterContext& context);
|
||||
};
|
||||
|
||||
struct Extension3dTilesBoundingVolumeCylinderJsonWriter {
|
||||
using ValueType = Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder;
|
||||
|
||||
/** @brief The official name of the extension. This should be the same as its
|
||||
* key in the `extensions` object. */
|
||||
static constexpr const char* ExtensionName =
|
||||
"3DTILES_bounding_volume_cylinder";
|
||||
|
||||
static void write(
|
||||
const Cesium3DTiles::Extension3dTilesBoundingVolumeCylinder& obj,
|
||||
CesiumJsonWriter::JsonWriter& jsonWriter,
|
||||
const CesiumJsonWriter::ExtensionWriterContext& context);
|
||||
};
|
||||
|
||||
struct ExtensionContent3dTilesContentVoxelsJsonWriter {
|
||||
using ValueType = Cesium3DTiles::ExtensionContent3dTilesContentVoxels;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include <CesiumJsonWriter/ExtensionWriterContext.h>
|
||||
|
||||
// NOLINTBEGIN(misc-include-cleaner)
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeCylinder.h>
|
||||
#include <Cesium3DTiles/Extension3dTilesBoundingVolumeS2.h>
|
||||
#include <Cesium3DTiles/Extension3dTilesEllipsoid.h>
|
||||
#include <Cesium3DTiles/ExtensionContent3dTilesContentVoxels.h>
|
||||
|
|
@ -24,6 +25,9 @@ void registerWriterExtensions(
|
|||
context.registerExtension<
|
||||
Cesium3DTiles::BoundingVolume,
|
||||
Extension3dTilesBoundingVolumeS2JsonWriter>();
|
||||
context.registerExtension<
|
||||
Cesium3DTiles::BoundingVolume,
|
||||
Extension3dTilesBoundingVolumeCylinderJsonWriter>();
|
||||
context.registerExtension<
|
||||
Cesium3DTiles::Tileset,
|
||||
Extension3dTilesEllipsoidJsonWriter>();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
"3DTILES_bounding_volume_S2 extension": {
|
||||
"overrideName": "Extension3dTilesBoundingVolumeS2"
|
||||
},
|
||||
"3DTILES_bounding_volume_cylinder extension": {
|
||||
"overrideName": "Extension3dTilesBoundingVolumeCylinder"
|
||||
},
|
||||
"3DTILES_content_voxels content extension": {
|
||||
"overrideName": "ExtensionContent3dTilesContentVoxels"
|
||||
},
|
||||
"3DTILES_ellipsoid extension": {
|
||||
"overrideName": "Extension3dTilesEllipsoid"
|
||||
},
|
||||
|
|
@ -27,9 +33,6 @@
|
|||
},
|
||||
"Buffer": {
|
||||
"toBeInherited": true
|
||||
},
|
||||
"3DTILES_content_voxels content extension": {
|
||||
"overrideName": "ExtensionContent3dTilesContentVoxels"
|
||||
}
|
||||
},
|
||||
"extensions": [
|
||||
|
|
@ -44,6 +47,10 @@
|
|||
"tileset"
|
||||
]
|
||||
},
|
||||
{
|
||||
"extensionName": "3DTILES_bounding_volume_cylinder",
|
||||
"schema": "3DTILES_bounding_volume_cylinder/schema/boundingVolume.3DTILES_bounding_volume_cylinder.schema.json"
|
||||
},
|
||||
{
|
||||
"extensionName": "3DTILES_content_voxels",
|
||||
"schema": "3DTILES_content_voxels/schema/content.3DTILES_content_voxels.schema.json"
|
||||
|
|
|
|||
Loading…
Reference in New Issue