cesium-native
0.41.0
|
A view on a PropertyAttribute. More...
#include <CesiumGltf/PropertyAttributeView.h>
Public Member Functions | |
PropertyAttributeView (const Model &model, const PropertyAttribute &propertyAttribute) noexcept | |
Construct a PropertyAttributeView. More... | |
PropertyAttributeViewStatus | status () const noexcept |
Gets the status of this property attribute view. More... | |
const std::optional< std::string > & | name () const noexcept |
Gets the name of the property attribute being viewed. Returns std::nullopt if no name was specified. | |
const Class * | getClass () const noexcept |
Gets the Class that this property attribute conforms to. More... | |
const ClassProperty * | getClassProperty (const std::string &propertyId) const |
Finds the ClassProperty that describes the type information of the property with the specified id. More... | |
template<typename T , bool Normalized = false> | |
PropertyAttributePropertyView< T, Normalized > | getPropertyView (const MeshPrimitive &primitive, const std::string &propertyId) const |
Gets a PropertyAttributePropertyView that views the data of a property stored in the PropertyAttribute. More... | |
template<typename Callback > | |
void | getPropertyView (const MeshPrimitive &primitive, const std::string &propertyId, Callback &&callback) const |
Gets a PropertyAttributePropertyView through a callback that accepts a property id and a PropertyAttributePropertyView<T> that views the data of the property with the specified id. More... | |
template<typename Callback > | |
void | forEachProperty (const MeshPrimitive &primitive, Callback &&callback) const |
Iterates over each property in the PropertyAttribute with a callback that accepts a property id and a PropertyAttributePropertyView<T> to view the data stored in the PropertyAttributeProperty. More... | |
A view on a PropertyAttribute.
This should be used to get a PropertyAttributePropertyView of a property in the property attribute. It will validate the EXT_structural_metadata format and ensure PropertyAttributePropertyView does not access data out of bounds.
Definition at line 54 of file PropertyAttributeView.h.
|
noexcept |
Construct a PropertyAttributeView.
model | The glTF that contains the property attribute's data. |
propertyAttribute | The PropertyAttribute from which the view will retrieve data. |
|
inline |
Iterates over each property in the PropertyAttribute with a callback that accepts a property id and a PropertyAttributePropertyView<T> to view the data stored in the PropertyAttributeProperty.
This method will validate the EXT_structural_metadata format to ensure PropertyAttributePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, float), a glm vecN composed of one of the scalar types, or a PropertyArrayView containing one of the scalar types.
If the property is invalid, an empty PropertyAttributePropertyView 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 property id and PropertyAttributePropertyView<T> |
Definition at line 308 of file PropertyAttributeView.h.
|
inlinenoexcept |
Gets the Class that this property attribute conforms to.
Definition at line 89 of file PropertyAttributeView.h.
const ClassProperty* CesiumGltf::PropertyAttributeView::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. |
|
inline |
Gets a PropertyAttributePropertyView that views the data of a property stored in the PropertyAttribute.
This method will validate the EXT_structural_metadata format to ensure PropertyAttributePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, float), a glm vecN composed of one of the scalar types, or a glm matN containing one of the scalar types.
If T does not match the type specified by the class property, this returns an invalid PropertyAttributePropertyView. 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. |
primitive | The target primitive |
propertyId | The id of the property to retrieve data from |
Definition at line 126 of file PropertyAttributeView.h.
|
inline |
Gets a PropertyAttributePropertyView through a callback that accepts a property id and a PropertyAttributePropertyView<T> that views the data of the property with the specified id.
This method will validate the EXT_structural_metadata format to ensure PropertyAttributePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, float), a glm vecN composed of one of the scalar types, or a glm matN containing one of the scalar types.
If the property is somehow invalid, an empty PropertyAttributePropertyView with an error status will be passed to the callback. Otherwise, a valid property view will be passed to the callback.
primitive | The target primitive |
propertyId | The id of the property to retrieve data from |
callback | A callback function that accepts a property id and a PropertyAttributePropertyView<T> |
Definition at line 173 of file PropertyAttributeView.h.
|
inlinenoexcept |
Gets the status of this property attribute view.
Indicates whether the view accurately reflects the property attribute's data, or whether an error occurred.
Definition at line 73 of file PropertyAttributeView.h.