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

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

#include <CesiumGltf/PropertyTablePropertyView.h>

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

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, false>::get is called. However, PropertyTablePropertyView<ElementType, false>::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, const CesiumGltf::Enum *pEnumDefinition, int64_t size, std::span< const std::byte > values) noexcept
 Construct an instance pointing to data specified by a PropertyTableProperty, with an enum definition attached. 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, std::span< const std::byte > stringOffsets, PropertyComponentType arrayOffsetType, PropertyComponentType stringOffsetType) noexcept
 Construct an instance pointing to the data specified by a PropertyTableProperty.
 
 PropertyTablePropertyView (const PropertyTableProperty &property, const ClassProperty &classProperty, const CesiumGltf::Enum *pEnumDefinition, int64_t size, std::span< const std::byte > values, std::span< const std::byte > arrayOffsets, std::span< const std::byte > stringOffsets, PropertyComponentType arrayOffsetType, PropertyComponentType stringOffsetType) noexcept
 Construct an instance pointing to the data specified by a PropertyTableProperty, with an enum definition attached.
 
std::optional< PropertyValueViewToCopy< ElementType > > get (int64_t index) const noexcept
 Get the value of an element in the PropertyTable, 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
 Get the raw value of an element of the PropertyTable, without offset or scale 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, false >
 PropertyView ()
 Constructs an empty property instance.
 
 PropertyView (const ClassProperty &classProperty)
 Constructs a property instance from a class definition only.
 
 PropertyView (const ClassProperty &classProperty, const CesiumGltf::Enum *pEnumDefinition)
 Constructs a property instance from a class definition and enum definition.
 
PropertyViewStatusType status () const noexcept
 Gets the status of this property view, indicating whether an error occurred.
 
const std::optional< std::string > & name () const noexcept
 Gets the name of the property being viewed. Returns std::nullopt if no name was specified.
 
const std::optional< std::string > & semantic () const noexcept
 Gets the semantic of the property being viewed. The semantic is an identifier that describes how this property should be interpreted, and cannot be used by other properties in the class. Returns std::nullopt if no semantic was specified.
 
const std::optional< std::string > & description () const noexcept
 Gets the description of the property being viewed. Returns std::nullopt if no description was specified.
 
int64_t arrayCount () const noexcept
 Get the element count of the fixed-length arrays in this property. Only applicable when the property is an array type.
 
bool normalized () const noexcept
 Whether this property has a normalized integer type.
 
std::optional< ElementType > offset () const noexcept
 Gets the offset to apply to property values. Only applicable to SCALAR, VECN, and MATN types when the component type is FLOAT32 or FLOAT64, or when the property is normalized.
 
std::optional< ElementType > scale () const noexcept
 Gets the scale to apply to property values. Only applicable to SCALAR, VECN, and MATN types when the component type is FLOAT32 or FLOAT64, or when the property is normalized.
 
std::optional< ElementType > max () const noexcept
 Gets the maximum allowed value for the property. Only applicable to SCALAR, VECN, and MATN types. This is the maximum of all property values, after the transforms based on the normalized, offset, and scale properties have been applied.
 
std::optional< ElementType > min () const noexcept
 Gets the minimum allowed value for the property. Only applicable to SCALAR, VECN, and MATN types. This is the minimum of all property values, after the transforms based on the normalized, offset, and scale properties have been applied.
 
bool required () const noexcept
 Whether the property must be present in every entity conforming to the class. If not required, instances of the property may include "no data" values, or the entire property may be omitted.
 
std::optional< ElementType > noData () const noexcept
 Gets the "no data" value, i.e., the value representing missing data in the property wherever it appears. Also known as a sentinel value. This is given as the plain property value, without the transforms from the normalized, offset, and scale properties.
 
std::optional< ElementType > defaultValue () const noexcept
 Gets the default value to use when encountering a "no data" value or an omitted property. The value is given in its final form, taking the effect of normalized, offset, and scale properties into account.
 
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, false >
 PropertyView (PropertyViewStatusType status)
 Constructs an invalid instance for an erroneous property.
 
 PropertyView (const ClassProperty &classProperty, const PropertyTableProperty &property, const CesiumGltf::Enum *pEnumDefinition=nullptr)
 Constructs a property instance from a property table property and its class definition, with an optional associated enum definition.
 
 PropertyView (const ClassProperty &classProperty, const PropertyTextureProperty &property, const CesiumGltf::Enum *pEnumDefinition=nullptr)
 Constructs a property instance from a property texture property, class definition, and an optional associated enum definition.
 
 PropertyView (const ClassProperty &classProperty, const PropertyAttributeProperty &property, const CesiumGltf::Enum *pEnumDefinition=nullptr)
 Constructs a property instance from a property attribute property and its class definition, along with an optional enum definition.
 
- Protected Attributes inherited from CesiumGltf::PropertyView< ElementType, false >
PropertyViewStatusType _status
 Indicates the status of a property view.
 

Detailed Description

template<typename ElementType>
class CesiumGltf::PropertyTablePropertyView< ElementType, false >

A view on the 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 PropertyTablePropertyView<ElementType, false>::get method.

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

Definition at line 162 of file PropertyTablePropertyView.h.

Constructor & Destructor Documentation

◆ PropertyTablePropertyView() [1/7]

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

Constructs an invalid instance for a non-existent property.

Definition at line 168 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [2/7]

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

Constructs an invalid instance for an erroneous property.

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

Definition at line 184 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [3/7]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, false >::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, false>::get is called. However, PropertyTablePropertyView<ElementType, false>::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 208 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [4/7]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, false >::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 245 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [5/7]

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

Construct an instance pointing to data specified by a PropertyTableProperty, with an enum definition attached. Used for non-array or fixed-length array data.

Parameters
propertyThe PropertyTableProperty.
classPropertyThe ClassProperty this property conforms to.
pEnumDefinitionA pointer to the enum definition used for this value.
sizeThe number of elements in the property table specified by PropertyTable::count.
valuesThe raw buffer specified by PropertyTableProperty::values.

Definition at line 268 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [6/7]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, false >::PropertyTablePropertyView ( const PropertyTableProperty & property,
const ClassProperty & classProperty,
int64_t size,
std::span< const std::byte > values,
std::span< const std::byte > arrayOffsets,
std::span< const std::byte > stringOffsets,
PropertyComponentType arrayOffsetType,
PropertyComponentType stringOffsetType )
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
stringOffsetsThe raw buffer specified by PropertyTableProperty::stringOffsets
arrayOffsetTypeThe offset type of arrayOffsets specified by PropertyTableProperty::arrayOffsetType
stringOffsetTypeThe offset type of stringOffsets specified by PropertyTableProperty::stringOffsetType

Definition at line 297 of file PropertyTablePropertyView.h.

◆ PropertyTablePropertyView() [7/7]

template<typename ElementType>
CesiumGltf::PropertyTablePropertyView< ElementType, false >::PropertyTablePropertyView ( const PropertyTableProperty & property,
const ClassProperty & classProperty,
const CesiumGltf::Enum * pEnumDefinition,
int64_t size,
std::span< const std::byte > values,
std::span< const std::byte > arrayOffsets,
std::span< const std::byte > stringOffsets,
PropertyComponentType arrayOffsetType,
PropertyComponentType stringOffsetType )
inlinenoexcept

Construct an instance pointing to the data specified by a PropertyTableProperty, with an enum definition attached.

Parameters
propertyThe PropertyTableProperty.
classPropertyThe ClassProperty this property conforms to.
pEnumDefinitionA pointer to the enum definition used for this value.
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.
stringOffsetsThe raw buffer specified by PropertyTableProperty::stringOffsets.
arrayOffsetTypeThe offset type of arrayOffsets specified by PropertyTableProperty::arrayOffsetType.
stringOffsetTypeThe offset type of stringOffsets specified by PropertyTableProperty::stringOffsetType.

Definition at line 331 of file PropertyTablePropertyView.h.

Member Function Documentation

◆ get()

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

Get the value of an element in the PropertyTable, 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, 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 368 of file PropertyTablePropertyView.h.

◆ getRaw()

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

Get the raw value of an element of the PropertyTable, without offset or scale 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 400 of file PropertyTablePropertyView.h.

◆ size()

template<typename ElementType>
int64_t CesiumGltf::PropertyTablePropertyView< ElementType, false >::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 443 of file PropertyTablePropertyView.h.


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