Skip to content

Commit

Permalink
Add *Reader classes to CesiumGltfReader and Cesium3DTilesReader.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Aug 23, 2023
1 parent 25944b7 commit b1f2650
Show file tree
Hide file tree
Showing 120 changed files with 12,271 additions and 429 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Unknown properties in objects read with a `JsonReader` are now stored in the `unknownProperties` property on `ExtensibleObject` by default. To ignore them, as was done in previous versions, call `setCaptureUnknownProperties` on `JsonReaderOptions`.
- Added `ValueType` type alias to `ArrayJsonHandler`, for consistency with other JSON handlers.
- Added an overload of `JsonReader::readJson` that takes a `rapidjson::Value` instead of a byte buffer. This allows a subtree of a `rapidjson::Document` to be easily and efficiently converted into statically-typed classes via `IJsonHandler`.
- Added `*Reader` classes to `CesiumGltfReader` and `Cesium3DTilesReader` to allow each of the classes to be individually read from JSON.

### v0.27.0 - 2023-09-01

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <Cesium3DTiles/Asset.h>
#include <Cesium3DTilesReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <gsl/span>
#include <rapidjson/fwd.h>

#include <vector>

namespace Cesium3DTiles {
struct Asset;
}

namespace Cesium3DTilesReader {

/**
* @brief Reads {@link Asset} instances from JSON.
*/
class CESIUM3DTILESREADER_API AssetReader {
public:
/**
* @brief Constructs a new instance.
*/
AssetReader();

/**
* @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 Asset from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Asset>
readFromJson(const gsl::span<const std::byte>& data) const;

/**
* @brief Reads an instance of Asset from a rapidJson::Value.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Asset>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of Asset 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<Cesium3DTiles::Asset>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace Cesium3DTilesReader
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <Cesium3DTiles/Availability.h>
#include <Cesium3DTilesReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <gsl/span>
#include <rapidjson/fwd.h>

#include <vector>

namespace Cesium3DTiles {
struct Availability;
}

namespace Cesium3DTilesReader {

/**
* @brief Reads {@link Availability} instances from JSON.
*/
class CESIUM3DTILESREADER_API AvailabilityReader {
public:
/**
* @brief Constructs a new instance.
*/
AvailabilityReader();

/**
* @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 Availability from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Availability>
readFromJson(const gsl::span<const std::byte>& data) const;

/**
* @brief Reads an instance of Availability from a rapidJson::Value.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Availability>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of Availability 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<Cesium3DTiles::Availability>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace Cesium3DTilesReader
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <Cesium3DTiles/BoundingVolume.h>
#include <Cesium3DTilesReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <gsl/span>
#include <rapidjson/fwd.h>

#include <vector>

namespace Cesium3DTiles {
struct BoundingVolume;
}

namespace Cesium3DTilesReader {

/**
* @brief Reads {@link BoundingVolume} instances from JSON.
*/
class CESIUM3DTILESREADER_API BoundingVolumeReader {
public:
/**
* @brief Constructs a new instance.
*/
BoundingVolumeReader();

/**
* @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 BoundingVolume from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::BoundingVolume>
readFromJson(const gsl::span<const std::byte>& data) const;

/**
* @brief Reads an instance of BoundingVolume from a rapidJson::Value.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::BoundingVolume>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of BoundingVolume 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<Cesium3DTiles::BoundingVolume>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace Cesium3DTilesReader
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <Cesium3DTiles/Buffer.h>
#include <Cesium3DTilesReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <gsl/span>
#include <rapidjson/fwd.h>

#include <vector>

namespace Cesium3DTiles {
struct Buffer;
}

namespace Cesium3DTilesReader {

/**
* @brief Reads {@link Buffer} instances from JSON.
*/
class CESIUM3DTILESREADER_API BufferReader {
public:
/**
* @brief Constructs a new instance.
*/
BufferReader();

/**
* @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 Buffer from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Buffer>
readFromJson(const gsl::span<const std::byte>& data) const;

/**
* @brief Reads an instance of Buffer from a rapidJson::Value.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Buffer>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of Buffer 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<Cesium3DTiles::Buffer>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace Cesium3DTilesReader
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// This file was generated by generate-classes.
// DO NOT EDIT THIS FILE!
#pragma once

#include <Cesium3DTiles/BufferView.h>
#include <Cesium3DTilesReader/Library.h>
#include <CesiumJsonReader/JsonReader.h>
#include <CesiumJsonReader/JsonReaderOptions.h>

#include <gsl/span>
#include <rapidjson/fwd.h>

#include <vector>

namespace Cesium3DTiles {
struct BufferView;
}

namespace Cesium3DTilesReader {

/**
* @brief Reads {@link BufferView} instances from JSON.
*/
class CESIUM3DTILESREADER_API BufferViewReader {
public:
/**
* @brief Constructs a new instance.
*/
BufferViewReader();

/**
* @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 BufferView from a byte buffer.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::BufferView>
readFromJson(const gsl::span<const std::byte>& data) const;

/**
* @brief Reads an instance of BufferView from a rapidJson::Value.
*
* @param data The buffer from which to read the instance.
* @return The result of reading the instance.
*/
CesiumJsonReader::ReadJsonResult<Cesium3DTiles::BufferView>
readFromJson(const rapidjson::Value& value) const;

/**
* @brief Reads an array of instances of BufferView 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<Cesium3DTiles::BufferView>>
readArrayFromJson(const rapidjson::Value& value) const;

private:
CesiumJsonReader::JsonReaderOptions _options;
};

} // namespace Cesium3DTilesReader
Loading

0 comments on commit b1f2650

Please sign in to comment.