cesium-native 0.43.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. | |
PropertyAttributeViewStatus | status () const noexcept |
Gets the status of this property attribute view. | |
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. | |
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> | |
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 . | |
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 that views the data of the property with the specified id. | |
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 to view the data stored in the PropertyAttributeProperty . | |
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 72 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
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.
primitive | The id of the property to retrieve data from |
callback | A callback function that accepts property id and PropertyAttributePropertyView |
Callback | The type of the callback function. |
Definition at line 328 of file PropertyAttributeView.h.
|
inlinenoexcept |
Gets the Class
that this property attribute conforms to.
Class
. Returns nullptr if the PropertyAttribute did not specify a valid class. Definition at line 107 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. |
ClassProperty
. Return nullptr if the PropertyAttributeView is invalid or if no class property was found.
|
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 |
PropertyAttributePropertyView
of the property. If no valid property is found, the property view will be invalid. Definition at line 144 of file PropertyAttributeView.h.
|
inline |
Gets a PropertyAttributePropertyView
through a callback that accepts a property id and a PropertyAttributePropertyView
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 |
Callback | The type of the callback function. |
Definition at line 192 of file PropertyAttributeView.h.
|
inlinenoexcept |
Gets the name of the property attribute being viewed. Returns std::nullopt if no name was specified.
Definition at line 97 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 91 of file PropertyAttributeView.h.