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

A view on the normalized data of the PropertyTableProperty that is created by a PropertyTableView. More...

#include <CesiumGltf/PropertyTablePropertyView.h>

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

Public Member Functions

 PropertyTablePropertyView ()
 Constructs an invalid instance for a non-existent property.
 
 PropertyTablePropertyView (PropertyViewStatusType status)
 Constructs an invalid instance for an erroneous property.
 
 PropertyTablePropertyView (const ClassProperty &classProperty, int64_t size)
 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 PropertyTablePropertyView<ElementType, true>::get is called. However, PropertyTablePropertyView<ElementType, true>::getRaw cannot be used.
 
 PropertyTablePropertyView (const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, std::span< const std::byte > values) noexcept
 Construct an instance pointing to data specified by a PropertyTableProperty. Used for non-array or fixed-length array data.
 
 PropertyTablePropertyView (const PropertyTableProperty &property, const ClassProperty &classProperty, int64_t size, std::span< const std::byte > values, std::span< const std::byte > arrayOffsets, PropertyComponentType arrayOffsetType) noexcept
 Construct an instance pointing to the data specified by a PropertyTableProperty.
 
std::optional< PropertyValueViewToCopy< NormalizedType > > get (int64_t index) const noexcept
 Get the value of an element of the PropertyTable, with normalization and other value transforms applied. In other words, the value will be normalized, then transformed by the property's offset and scale, if they are defined.
 
ElementType getRaw (int64_t index) const noexcept
 Get the raw value of an element of the PropertyTable, without offset, scale, or normalization applied.
 
int64_t size () const noexcept
 Get the number of elements in this PropertyTablePropertyView. If the view is valid, this returns PropertyTable::count. Otherwise, this returns 0.
 
- 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::PropertyTablePropertyView< ElementType, true >

A view on the normalized data of the PropertyTableProperty that is created by a PropertyTableView.

It provides utility to retrieve the actual data stored in the PropertyTableProperty::values like an array of elements. Data of each instance can be accessed through the get method.

Parameters
ElementTypemust be one of the following: an integer scalar (uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t), a glm vecN composed of one of the integer scalar types, a glm matN composed of one of the integer scalar types, or PropertyArrayView<T> with T as one of the aforementioned types.

Definition at line 605 of file PropertyTablePropertyView.h.

Constructor & Destructor Documentation

◆ PropertyTablePropertyView() [1/5]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, true >::PropertyTablePropertyView ( )
inline

Constructs an invalid instance for a non-existent property.

Definition at line 614 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [2/5]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, true >::PropertyTablePropertyView ( PropertyViewStatusType status)
inline

Constructs an invalid instance for an erroneous property.

Parameters
statusThe value of PropertyTablePropertyViewStatus indicating the error with the property.

Definition at line 627 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [3/5]

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

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 PropertyTablePropertyView<ElementType, true>::get is called. However, PropertyTablePropertyView<ElementType, true>::getRaw cannot be used.

Parameters
classPropertyThe ClassProperty this property conforms to.
sizeThe number of elements in the property table specified by PropertyTable::count

Definition at line 648 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [4/5]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, true >::PropertyTablePropertyView ( const PropertyTableProperty & property,
const ClassProperty & classProperty,
int64_t size,
std::span< const std::byte > values )
inlinenoexcept

Construct an instance pointing to data specified by a PropertyTableProperty. Used for non-array or fixed-length array data.

Parameters
propertyThe PropertyTableProperty
classPropertyThe ClassProperty this property conforms to.
sizeThe number of elements in the property table specified by PropertyTable::count
valuesThe raw buffer specified by PropertyTableProperty::values

Definition at line 682 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [5/5]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, true >::PropertyTablePropertyView ( const PropertyTableProperty & property,
const ClassProperty & classProperty,
int64_t size,
std::span< const std::byte > values,
std::span< const std::byte > arrayOffsets,
PropertyComponentType arrayOffsetType )
inlinenoexcept

Construct an instance pointing to the data specified by a PropertyTableProperty.

Parameters
propertyThe PropertyTableProperty
classPropertyThe ClassProperty this property conforms to.
sizeThe number of elements in the property table specified by PropertyTable::count
valuesThe raw buffer specified by PropertyTableProperty::values
arrayOffsetsThe raw buffer specified by PropertyTableProperty::arrayOffsets
arrayOffsetTypeThe offset type of arrayOffsets specified by PropertyTableProperty::arrayOffsetType

Definition at line 706 of file PropertyTablePropertyView.h.

Member Function Documentation

◆ get()

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

Get the value of an element of the PropertyTable, with normalization and other value transforms applied. In other words, the value will be normalized, then transformed by the property's offset and scale, if they are defined.

If this property has a specified "no data" value, and the retrieved element is equal to that value, then this will return the property's specified default value. If the property did not provide a default value, this returns std::nullopt.

Parameters
indexThe element index
Returns
The value of the element, or std::nullopt if it matches the "no data" value

Definition at line 737 of file PropertyTablePropertyView.h.

◆ getRaw()

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

Get the raw value of an element of the PropertyTable, without offset, scale, or normalization applied.

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 element index
Returns
The value of the element

Definition at line 805 of file PropertyTablePropertyView.h.

◆ size()

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

Get the number of elements in this PropertyTablePropertyView. If the view is valid, this returns PropertyTable::count. Otherwise, this returns 0.

Returns
The number of elements in this PropertyTablePropertyView.

Definition at line 832 of file PropertyTablePropertyView.h.


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