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

Represents a non-normalized metadata property in EXT_structural_metadata. More...

#include <CesiumGltf/PropertyView.h>

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

Public Member Functions

 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.
 

Protected Member Functions

 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

PropertyViewStatusType _status
 Indicates the status of a property view.
 

Detailed Description

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

Represents a non-normalized metadata property in EXT_structural_metadata.

Whether they belong to property tables, property textures, or property attributes, properties have their own sub-properties affecting the actual property values. Although they are typically defined via class property, they may be overridden by individual instances of the property themselves. The constructor is responsible for resolving those differences.

Template Parameters
ElementTypeThe C++ type of the values in this property

Definition at line 362 of file PropertyView.h.

Constructor & Destructor Documentation

◆ PropertyView() [1/7]

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

Constructs an empty property instance.

Definition at line 367 of file PropertyView.h.

◆ PropertyView() [2/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( const ClassProperty & classProperty)
inline

Constructs a property instance from a class definition only.

Definition at line 384 of file PropertyView.h.

◆ PropertyView() [3/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( const ClassProperty & classProperty,
const CesiumGltf::Enum * pEnumDefinition )
inline

Constructs a property instance from a class definition and enum definition.

Definition at line 391 of file PropertyView.h.

◆ PropertyView() [4/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( PropertyViewStatusType status)
inlineprotected

Constructs an invalid instance for an erroneous property.

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

Definition at line 469 of file PropertyView.h.

◆ PropertyView() [5/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( const ClassProperty & classProperty,
const PropertyTableProperty & property,
const CesiumGltf::Enum * pEnumDefinition = nullptr )
inlineprotected

Constructs a property instance from a property table property and its class definition, with an optional associated enum definition.

Definition at line 487 of file PropertyView.h.

◆ PropertyView() [6/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( const ClassProperty & classProperty,
const PropertyTextureProperty & property,
const CesiumGltf::Enum * pEnumDefinition = nullptr )
inlineprotected

Constructs a property instance from a property texture property, class definition, and an optional associated enum definition.

Definition at line 506 of file PropertyView.h.

◆ PropertyView() [7/7]

template<typename ElementType>
CesiumGltf::PropertyView< ElementType, false >::PropertyView ( const ClassProperty & classProperty,
const PropertyAttributeProperty & property,
const CesiumGltf::Enum * pEnumDefinition = nullptr )
inlineprotected

Constructs a property instance from a property attribute property and its class definition, along with an optional enum definition.

Definition at line 524 of file PropertyView.h.

Member Function Documentation

◆ arrayCount()

template<typename ElementType>
int64_t CesiumGltf::PropertyView< ElementType, false >::arrayCount ( ) const
inlinenoexcept

Get the element count of the fixed-length arrays in this property. Only applicable when the property is an array type.

Returns
The count of this property.

Definition at line 578 of file PropertyView.h.

◆ defaultValue()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::defaultValue ( ) const
inlinenoexcept

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.

Returns
The property's default value, or std::nullopt if it was not specified.

Definition at line 651 of file PropertyView.h.

◆ description()

template<typename ElementType>
const std::optional< std::string > & CesiumGltf::PropertyView< ElementType, false >::description ( ) const
inlinenoexcept

Gets the description of the property being viewed. Returns std::nullopt if no description was specified.

Definition at line 568 of file PropertyView.h.

◆ max()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::max ( ) const
inlinenoexcept

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.

Returns
The property's maximum value, or std::nullopt if it was not specified.

Definition at line 612 of file PropertyView.h.

◆ min()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::min ( ) const
inlinenoexcept

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.

Returns
The property's minimum value, or std::nullopt if it was not specified.

Definition at line 623 of file PropertyView.h.

◆ name()

template<typename ElementType>
const std::optional< std::string > & CesiumGltf::PropertyView< ElementType, false >::name ( ) const
inlinenoexcept

Gets the name of the property being viewed. Returns std::nullopt if no name was specified.

Definition at line 552 of file PropertyView.h.

◆ noData()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::noData ( ) const
inlinenoexcept

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.

Returns
The property's "no data" value, or std::nullopt if it was not specified.

Definition at line 641 of file PropertyView.h.

◆ normalized()

template<typename ElementType>
bool CesiumGltf::PropertyView< ElementType, false >::normalized ( ) const
inlinenoexcept

Whether this property has a normalized integer type.

Definition at line 583 of file PropertyView.h.

◆ offset()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::offset ( ) const
inlinenoexcept

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.

Returns
The property's offset, or std::nullopt if it was not specified.

Definition at line 592 of file PropertyView.h.

◆ propertyType()

template<typename ElementType>
PropertyType CesiumGltf::PropertyView< ElementType, false >::propertyType ( ) const
inlinenoexcept

Returns the PropertyType of the property this view is accessing.

Definition at line 659 of file PropertyView.h.

◆ required()

template<typename ElementType>
bool CesiumGltf::PropertyView< ElementType, false >::required ( ) const
inlinenoexcept

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.

Definition at line 630 of file PropertyView.h.

◆ scale()

template<typename ElementType>
std::optional< ElementType > CesiumGltf::PropertyView< ElementType, false >::scale ( ) const
inlinenoexcept

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.

Returns
The property's scale, or std::nullopt if it was not specified.

Definition at line 601 of file PropertyView.h.

◆ semantic()

template<typename ElementType>
const std::optional< std::string > & CesiumGltf::PropertyView< ElementType, false >::semantic ( ) const
inlinenoexcept

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.

Definition at line 560 of file PropertyView.h.

◆ status()

template<typename ElementType>
PropertyViewStatusType CesiumGltf::PropertyView< ElementType, false >::status ( ) const
inlinenoexcept

Gets the status of this property view, indicating whether an error occurred.

Returns
The status of this property view.

Definition at line 546 of file PropertyView.h.

Member Data Documentation

◆ _status

template<typename ElementType>
PropertyViewStatusType CesiumGltf::PropertyView< ElementType, false >::_status
protected

Indicates the status of a property view.

The PropertyView constructor always completes successfully. However, there may be fundamental errors with the property definition. In such cases, this enumeration provides the reason.

This is defined with a class of static consts as opposed to an enum, so that derived property view classes can extend the statuses with their own specific errors.

Definition at line 663 of file PropertyView.h.


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