|
cesium-native 0.52.0
|
Utility to retrieve the data of PropertyTable.
More...
#include <CesiumGltf/PropertyTableView.h>
Public Member Functions | |
| PropertyTableView (const Model &model, const PropertyTable &propertyTable) | |
| Creates an instance of PropertyTableView. | |
| PropertyTableViewStatus | status () const noexcept |
| Gets the status of this property table view. | |
| const std::optional< std::string > & | name () const noexcept |
| Gets the name of the property table being viewed. Returns std::nullopt if no name was specified. | |
| int64_t | size () const noexcept |
Get the number of elements in this PropertyTableView. If the view is valid, this returns PropertyTable::count. Otherwise, this returns 0. | |
| const Class * | getClass () const noexcept |
Gets the Class that this property table conforms to. | |
| const ClassProperty * | getClassProperty (const std::string &propertyId) const |
Finds the ClassProperty that describes the type information of the property with the specified id. | |
| template<typename T, bool Normalized = false> | |
| PropertyTablePropertyView< T, Normalized > | getPropertyView (const std::string &propertyId) const |
Gets a PropertyTablePropertyView that views the data of a property stored in the PropertyTable. | |
| template<typename Callback> | |
| void | getPropertyView (const std::string &propertyId, Callback &&callback) const |
| Gets a PropertyTablePropertyView through a callback that accepts a property id and a PropertyTablePropertyView that views the data of the property with the specified id. | |
| template<typename Callback> | |
| void | forEachProperty (Callback &&callback) const |
| Iterates over each property in the PropertyTable with a callback that accepts a property id and a PropertyTablePropertyView to view the data stored in the PropertyTableProperty. | |
Utility to retrieve the data of PropertyTable.
This should be used to get a PropertyTablePropertyView of a property in the property table. It will validate the EXT_structural_metadata format and ensure PropertyTablePropertyView does not access out of bounds.
Definition at line 55 of file PropertyTableView.h.
| CesiumGltf::PropertyTableView::PropertyTableView | ( | const Model & | model, |
| const PropertyTable & | propertyTable ) |
Creates an instance of PropertyTableView.
| model | The glTF Model that contains the property table data. |
| propertyTable | The PropertyTable from which the view will retrieve data. |
|
inline |
Iterates over each property in the PropertyTable with a callback that accepts a property id and a PropertyTablePropertyView to view the data stored in the PropertyTableProperty.
This method will validate the EXT_structural_metadata format to ensure PropertyTablePropertyView retrieves the correct data. T must be one of the following: a scalar (uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double), a glm vecN composed of one of the scalar types, a glm matN composed of one of the scalar types, bool, std::string_view, or PropertyArrayView with T as one of the aforementioned types.
If the property is invalid, an empty PropertyTablePropertyView with an error status code will be passed to the callback. Otherwise, a valid property view will be passed to the callback.
| callback | A callback function that accepts property id and PropertyTablePropertyView |
| Callback | The type of the callback function. |
Definition at line 362 of file PropertyTableView.h.
|
inlinenoexcept |
Gets the Class that this property table conforms to.
Class. Returns nullptr if the PropertyTable did not specify a valid class. Definition at line 100 of file PropertyTableView.h.
| const ClassProperty * CesiumGltf::PropertyTableView::getClassProperty | ( | const std::string & | propertyId | ) | const |
Finds the ClassProperty that describes the type information of the property with the specified id.
| propertyId | The id of the property to retrieve the class for. |
ClassProperty. Returns nullptr if the PropertyTableView is invalid or if no class property was found.
|
inline |
Gets a PropertyTablePropertyView that views the data of a property stored in the PropertyTable.
This method will validate the EXT_structural_metadata format to ensure PropertyTablePropertyView retrieves the correct data. T must be one of the following: a scalar (uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double), a glm vecN composed of one of the scalar types, a glm matN composed of one of the scalar types, bool, std::string_view, or PropertyArrayView with T as one of the aforementioned types.
If T does not match the type specified by the class property, this returns an invalid PropertyTablePropertyView. Likewise, if the value of Normalized does not match the value of ClassProperty::normalized for that class property, this returns an invalid property view. Only types with integer components may be normalized.
| T | The C++ type corresponding to the type of the data retrieved. |
| Normalized | Whether the property is normalized. Only applicable to types with integer components. |
| propertyId | The id of the property to retrieve data from |
Definition at line 139 of file PropertyTableView.h.
|
inline |
Gets a PropertyTablePropertyView through a callback that accepts a property id and a PropertyTablePropertyView that views the data of the property with the specified id.
This method will validate the EXT_structural_metadata format to ensure PropertyTablePropertyView retrieves the correct data. T must be one of the following: a scalar (uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double), a glm vecN composed of one of the scalar types, a glm matN composed of one of the scalar types, bool, std::string_view, or PropertyArrayView with T as one of the aforementioned types.
If the property is invalid, an empty PropertyTablePropertyView with an error status will be passed to the callback. Otherwise, a valid property view will be passed to the callback.
| propertyId | The id of the property to retrieve data from |
| callback | A callback function that accepts a property id and a PropertyTablePropertyView |
| Callback | The type of the callback function. |
Definition at line 178 of file PropertyTableView.h.
|
inlinenoexcept |
Gets the name of the property table being viewed. Returns std::nullopt if no name was specified.
Definition at line 79 of file PropertyTableView.h.
|
inlinenoexcept |
Get the number of elements in this PropertyTableView. If the view is valid, this returns PropertyTable::count. Otherwise, this returns 0.
Definition at line 89 of file PropertyTableView.h.
|
inlinenoexcept |
Gets the status of this property table view.
Indicates whether the view accurately reflects the property table's data, or whether an error occurred.
Definition at line 73 of file PropertyTableView.h.