cesium-native 0.62.0
Loading...
Searching...
No Matches
CesiumGltf::PropertyAttributePropertyView< ElementType, true > Class Template Reference

A view of the normalized data specified by a PropertyAttributeProperty. More...

#include <CesiumGltf/PropertyAttributePropertyView.h>

Inheritance diagram for CesiumGltf::PropertyAttributePropertyView< ElementType, true >:
CesiumGltf::PropertyView< ElementType, true >

Public Member Functions

 PropertyAttributePropertyView () noexcept
 Constructs an invalid instance for a non-existent property.
 
 PropertyAttributePropertyView (PropertyViewStatusType status) noexcept
 Constructs an invalid instance for an erroneous property.
 
 PropertyAttributePropertyView (const ClassProperty &classProperty, int64_t size) noexcept
 Constructs an instance of an empty property that specifies a default value. Although this property has no data, it can return the default value when get is called. However, getRaw cannot be used.
 
 PropertyAttributePropertyView (const PropertyAttributeProperty &property, const ClassProperty &classProperty, const AccessorView< ElementType > &accessorView) noexcept
 Construct a view of the data specified by a PropertyAttributeProperty.
 
std::optional< NormalizedType > get (int64_t index) const noexcept
 Gets the value of the property for the given vertex index with all value transforms applied. That is, if the property specifies an offset and scale, they will be applied to the value before the value is returned.
 
ElementType getRaw (int64_t index) const noexcept
 Gets the raw value of the property for the given vertex index.
 
int64_t size () const noexcept
 Get the number of elements in this PropertyAttributePropertyView. If the view is valid, this returns the count of the elements in the attribute's accessor. Otherwise, this returns 0.
 
const AccessorView< ElementType > & accessorView () const
 Gets the underlying AccessorView from the PropertyAttributePropertyView.
 
- Public Member Functions inherited from CesiumGltf::PropertyView< ElementType, true >
 PropertyView ()
 Constructs an empty property instance.
 
 PropertyView (const ClassProperty &classProperty)
 Constructs a property instance from a class definition only.
 
PropertyViewStatusType status () const noexcept
 Constructs an empty property instance. false>status
 
const std::optional< std::string > & name () const noexcept
 Constructs an empty property instance. false>name
 
const std::optional< std::string > & semantic () const noexcept
 Constructs an empty property instance. false>semantic
 
const std::optional< std::string > & description () const noexcept
 Constructs an empty property instance. false>description
 
int64_t arrayCount () const noexcept
 Constructs an empty property instance. false>arrayCount
 
bool normalized () const noexcept
 Constructs an empty property instance. false>normalized
 
std::optional< NormalizedType > offset () const noexcept
 Constructs an empty property instance. false>offset
 
std::optional< NormalizedType > scale () const noexcept
 Constructs an empty property instance. false>scale
 
std::optional< NormalizedType > max () const noexcept
 Constructs an empty property instance. false>max
 
std::optional< NormalizedType > min () const noexcept
 Constructs an empty property instance. false>min
 
bool required () const noexcept
 Constructs an empty property instance. false>required
 
std::optional< ElementType > noData () const noexcept
 Constructs an empty property instance. false>noData
 
std::optional< NormalizedType > defaultValue () const noexcept
 Constructs an empty property instance. false>defaultValue
 
PropertyType propertyType () const noexcept
 Returns the PropertyType of the property this view is accessing.
 

Additional Inherited Members

- Protected Member Functions inherited from CesiumGltf::PropertyView< ElementType, true >
 PropertyView (PropertyViewStatusType status)
 Constructs an invalid instance for an erroneous property.
 
 PropertyView (const ClassProperty &classProperty, const PropertyTableProperty &property)
 Constructs a property instance from a property table property and its class definition.
 
 PropertyView (const ClassProperty &classProperty, const PropertyTextureProperty &property)
 Constructs a property instance from a property texture property and its class definition.
 
 PropertyView (const ClassProperty &classProperty, const PropertyAttributeProperty &property)
 Constructs a property instance from a property attribute property and its class definition.
 
- Protected Attributes inherited from CesiumGltf::PropertyView< ElementType, true >
PropertyViewStatusType _status
 Indicates the status of a property view.
 

Detailed Description

template<typename ElementType>
class CesiumGltf::PropertyAttributePropertyView< ElementType, true >

A view of the normalized data specified by a PropertyAttributeProperty.

Ideally, property attribute properties can be initialized as vertex attributes in the target rendering context. However, some runtime engines do not allow custom vertex attributes. This view can be used instead to sample the property attributes property via vertex index.

Template Parameters
ElementTypeThe type of the elements represented in the property view

Definition at line 277 of file PropertyAttributePropertyView.h.

Constructor & Destructor Documentation

◆ PropertyAttributePropertyView() [1/4]

template<typename ElementType>
CesiumGltf::PropertyAttributePropertyView< ElementType, true >::PropertyAttributePropertyView ( )
inlinenoexcept

Constructs an invalid instance for a non-existent property.

Definition at line 286 of file PropertyAttributePropertyView.h.

◆ PropertyAttributePropertyView() [2/4]

template<typename ElementType>
CesiumGltf::PropertyAttributePropertyView< ElementType, true >::PropertyAttributePropertyView ( PropertyViewStatusType status)
inlinenoexcept

Constructs an invalid instance for an erroneous property.

Parameters
statusThe code from PropertyAttributePropertyViewStatus indicating the error with the property.

Definition at line 294 of file PropertyAttributePropertyView.h.

◆ PropertyAttributePropertyView() [3/4]

template<typename ElementType>
CesiumGltf::PropertyAttributePropertyView< ElementType, true >::PropertyAttributePropertyView ( const ClassProperty & classProperty,
int64_t size )
inlinenoexcept

Constructs an instance of an empty property that specifies a default value. Although this property has no data, it can return the default value when get is called. However, getRaw cannot be used.

Parameters
classPropertyThe ClassProperty this property conforms to.
sizeThe number of elements in the primitive's POSITION accessor. Used as a substitute since no actual accessor is defined.

Definition at line 310 of file PropertyAttributePropertyView.h.

◆ PropertyAttributePropertyView() [4/4]

template<typename ElementType>
CesiumGltf::PropertyAttributePropertyView< ElementType, true >::PropertyAttributePropertyView ( const PropertyAttributeProperty & property,
const ClassProperty & classProperty,
const AccessorView< ElementType > & accessorView )
inlinenoexcept

Construct a view of the data specified by a PropertyAttributeProperty.

Parameters
propertyThe PropertyAttributeProperty
classPropertyThe ClassProperty this property conforms to.
accessorViewThe AccessorView for the data that this property is associated with.

Definition at line 342 of file PropertyAttributePropertyView.h.

Member Function Documentation

◆ accessorView()

template<typename ElementType>
const AccessorView< ElementType > & CesiumGltf::PropertyAttributePropertyView< ElementType, true >::accessorView ( ) const
inline

Gets the underlying AccessorView from the PropertyAttributePropertyView.

Definition at line 444 of file PropertyAttributePropertyView.h.

◆ get()

template<typename ElementType>
std::optional< NormalizedType > CesiumGltf::PropertyAttributePropertyView< ElementType, true >::get ( int64_t index) const
inlinenoexcept

Gets the value of the property for the given vertex index with all value transforms applied. That is, if the property specifies an offset and scale, they will be applied to the value before the value is returned.

If this property has a specified "no data" value, this will return the property's default value for any elements that equal this "no data" value. If the property did not specify a default value, this returns std::nullopt.

Parameters
indexThe vertex index.
Returns
The value of the property for the given vertex, or std::nullopt if it matches the "no data" value

Definition at line 368 of file PropertyAttributePropertyView.h.

◆ getRaw()

template<typename ElementType>
ElementType CesiumGltf::PropertyAttributePropertyView< ElementType, true >::getRaw ( int64_t index) const
inlinenoexcept

Gets the raw value of the property for the given vertex index.

If this property has a specified "no data" value, the raw value will still be returned, even if it equals the "no data" value.

Parameters
indexThe vertex index.
Returns
The value of the property for the given vertex.

Definition at line 418 of file PropertyAttributePropertyView.h.

◆ size()

template<typename ElementType>
int64_t CesiumGltf::PropertyAttributePropertyView< ElementType, true >::size ( ) const
inlinenoexcept

Get the number of elements in this PropertyAttributePropertyView. If the view is valid, this returns the count of the elements in the attribute's accessor. Otherwise, this returns 0.

Returns
The number of elements in this PropertyAttributePropertyView.

Definition at line 438 of file PropertyAttributePropertyView.h.


The documentation for this class was generated from the following file: