|
cesium-native 0.52.0
|
A view on a PropertyTexture.
More...
#include <CesiumGltf/PropertyTextureView.h>
Public Member Functions | |
| PropertyTextureView (const Model &model, const PropertyTexture &propertyTexture) noexcept | |
| Construct a PropertyTextureView. | |
| PropertyTextureViewStatus | status () const noexcept |
| Gets the status of this property texture view. | |
| const std::optional< std::string > & | name () const noexcept |
| Gets the name of the property texture being viewed. Returns std::nullopt if no name was specified. | |
| const Class * | getClass () const noexcept |
Gets the Class that this property texture 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> | |
| PropertyTexturePropertyView< T, Normalized > | getPropertyView (const std::string &propertyId, const TextureViewOptions &propertyOptions=TextureViewOptions()) const |
Gets a PropertyTexturePropertyView that views the data of a property stored in the PropertyTexture. | |
| template<typename Callback> | |
| void | getPropertyView (const std::string &propertyId, Callback &&callback, const TextureViewOptions &propertyOptions=TextureViewOptions()) const |
Gets a PropertyTexturePropertyView through a callback that accepts a property id and a PropertyTexturePropertyView that views the data of the property with the specified id. | |
| template<typename Callback> | |
| void | forEachProperty (Callback &&callback, const TextureViewOptions &propertyOptions=TextureViewOptions()) const |
Iterates over each property in the PropertyTexture with a callback that accepts a property id and a PropertyTexturePropertyView to view the data stored in the PropertyTextureProperty. | |
A view on a PropertyTexture.
This should be used to get a PropertyTexturePropertyView of a property in the property texture. It will validate the EXT_structural_metadata format and ensure PropertyTexturePropertyView does not access data out of bounds.
Definition at line 51 of file PropertyTextureView.h.
|
noexcept |
Construct a PropertyTextureView.
| model | The glTF that contains the property texture's data. |
| propertyTexture | The PropertyTexture from which the view will retrieve data. |
|
inline |
Iterates over each property in the PropertyTexture with a callback that accepts a property id and a PropertyTexturePropertyView to view the data stored in the PropertyTextureProperty.
This method will validate the EXT_structural_metadata format to ensure PropertyTexturePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_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 PropertyTexturePropertyView with an error status 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 PropertyTexturePropertyView |
| propertyOptions | The options to apply to each property in the property texture. |
| Callback | The type of the callback function. |
Definition at line 294 of file PropertyTextureView.h.
|
inlinenoexcept |
Gets the Class that this property texture conforms to.
Class. Returns nullptr if the PropertyTexture did not specify a valid class. Definition at line 86 of file PropertyTextureView.h.
| const ClassProperty * CesiumGltf::PropertyTextureView::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 PropertyTextureView is invalid or if no class property was found.
|
inline |
Gets a PropertyTexturePropertyView through a callback that accepts a property id and a PropertyTexturePropertyView that views the data of the property with the specified id.
This method will validate the EXT_structural_metadata format to ensure PropertyTexturePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_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 somehow invalid, an empty PropertyTexturePropertyView 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 PropertyTexturePropertyView |
| propertyOptions | The options to apply to the property. |
| Callback | The type of the callback function. |
Definition at line 165 of file PropertyTextureView.h.
|
inline |
Gets a PropertyTexturePropertyView that views the data of a property stored in the PropertyTexture.
This method will validate the EXT_structural_metadata format to ensure PropertyTexturePropertyView retrieves the correct data. T must be a scalar with a supported component type (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, float), a glm vecN composed of one of the scalar types, or a PropertyArrayView containing one of the scalar types.
If T does not match the type specified by the class property, this returns an invalid PropertyTexturePropertyView. 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 |
| propertyOptions | The options to apply to the property. |
PropertyTexturePropertyView of the property. If no valid property is found, the property view will be invalid. Definition at line 123 of file PropertyTextureView.h.
|
inlinenoexcept |
Gets the name of the property texture being viewed. Returns std::nullopt if no name was specified.
Definition at line 76 of file PropertyTextureView.h.
|
inlinenoexcept |
Gets the status of this property texture view.
Indicates whether the view accurately reflects the property texture's data, or whether an error occurred.
Definition at line 70 of file PropertyTextureView.h.