cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumGltf::ClassProperty Struct Referencefinal

A class property. More...

#include <CesiumGltf/ClassProperty.h>

Inheritance diagram for CesiumGltf::ClassProperty:
CesiumUtility::ExtensibleObject

Classes

struct  ComponentType
 Known values for The datatype of the element's components. Only applicable to SCALAR, VECN, and MATN types. More...
 
struct  Type
 Known values for The element type. More...
 

Public Member Functions

int64_t getSizeBytes () const
 Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. This will NOT include the size of any extensions attached to the object. Calling this method may be slow as it requires traversing the object's entire structure.
 
- Public Member Functions inherited from CesiumUtility::ExtensibleObject
template<typename T >
bool hasExtension () const noexcept
 Checks if an extension exists given its static type.
 
template<typename T >
const T * getExtension () const noexcept
 Gets an extension given its static type.
 
template<typename T >
T * getExtension () noexcept
 Gets an extension given its static type.
 
const JsonValuegetGenericExtension (const std::string &extensionName) const noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
JsonValuegetGenericExtension (const std::string &extensionName) noexcept
 Gets a generic extension with the given name as a CesiumUtility::JsonValue.
 
template<typename T , typename... ConstructorArgumentTypes>
T & addExtension (ConstructorArgumentTypes &&... constructorArguments)
 Adds a statically-typed extension to this object.
 
template<typename T >
void removeExtension ()
 Removes a statically-typed extension from this object.
 
int64_t getSizeBytes () const
 Calculates the size in bytes of this ExtensibleObject, including all of its extras but NOT including its extensions. Calling this method may be slow as it requires traversing the entire object.
 

Public Attributes

std::optional< std::string > name
 The name of the property, e.g. for display purposes.
 
std::optional< std::string > description
 The description of the property.
 
std::string type = Type::SCALAR
 The element type.
 
std::optional< std::string > componentType
 The datatype of the element's components. Only applicable to SCALAR, VECN, and MATN types.
 
std::optional< std::string > enumType
 Enum ID as declared in the enums dictionary. Required when type is ENUM.
 
bool array = false
 Whether the property is an array. When count is defined the property is a fixed-length array. Otherwise the property is a variable-length array.
 
std::optional< int64_t > count
 The number of array elements. May only be defined when array is true.
 
bool normalized = false
 Specifies whether integer values are normalized. Only applicable to SCALAR, VECN, and MATN types with integer component types. For unsigned integer component types, values are normalized between [0.0, 1.0]. For signed integer component types, values are normalized between [-1.0, 1.0]. For all other component types, this property must be false.
 
std::optional< CesiumUtility::JsonValueoffset
 An 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< CesiumUtility::JsonValuescale
 A 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< CesiumUtility::JsonValuemax
 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< CesiumUtility::JsonValuemin
 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 = false
 If required, the property must be present in every entity conforming to the class. If not required, individual entities may include noData values, or the entire property may be omitted. As a result, noData has no effect on a required property. Client implementations may use required properties to make performance optimizations.
 
std::optional< CesiumUtility::JsonValuenoData
 A noData value represents missing data — also known as a sentinel value — wherever it appears. BOOLEAN properties may not specify noData values. This is given as the plain property value, without the transforms from the normalized, offset, and scale properties. Must not be defined if required is true.
 
std::optional< CesiumUtility::JsonValuedefaultProperty
 A default value to use when encountering a noData value or an omitted property. The value is given in its final form, taking the effect of normalized, offset, and scale properties into account. Must not be defined if required is true.
 
std::optional< std::string > semantic
 An identifier that describes how this property should be interpreted. The semantic cannot be used by other properties in the class.
 
- Public Attributes inherited from CesiumUtility::ExtensibleObject
std::unordered_map< std::string, std::any > extensions
 The extensions attached to this object.
 
JsonValue::Object extras
 Application-specific data.
 
JsonValue::Object unknownProperties
 Unknown properties that exist on this object but do not have any representation in the statically-typed classes.
 

Static Public Attributes

static constexpr const char * TypeName = "ClassProperty"
 The original name of this type.
 

Detailed Description

A class property.

Definition at line 17 of file ClassProperty.h.

Member Function Documentation

◆ getSizeBytes()

int64_t CesiumGltf::ClassProperty::getSizeBytes ( ) const
inline

Calculates the size in bytes of this object, including the contents of all collections, pointers, and strings. This will NOT include the size of any extensions attached to the object. Calling this method may be slow as it requires traversing the object's entire structure.

Definition at line 219 of file ClassProperty.h.

Member Data Documentation

◆ array

bool CesiumGltf::ClassProperty::array = false

Whether the property is an array. When count is defined the property is a fixed-length array. Otherwise the property is a variable-length array.

Definition at line 133 of file ClassProperty.h.

◆ componentType

std::optional<std::string> CesiumGltf::ClassProperty::componentType

The datatype of the element's components. Only applicable to SCALAR, VECN, and MATN types.

Known values are defined in ComponentType.

Definition at line 120 of file ClassProperty.h.

◆ count

std::optional<int64_t> CesiumGltf::ClassProperty::count

The number of array elements. May only be defined when array is true.

Definition at line 139 of file ClassProperty.h.

◆ defaultProperty

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::defaultProperty

A default value to use when encountering a noData value or an omitted property. The value is given in its final form, taking the effect of normalized, offset, and scale properties into account. Must not be defined if required is true.

Definition at line 205 of file ClassProperty.h.

◆ description

std::optional<std::string> CesiumGltf::ClassProperty::description

The description of the property.

Definition at line 103 of file ClassProperty.h.

◆ enumType

std::optional<std::string> CesiumGltf::ClassProperty::enumType

Enum ID as declared in the enums dictionary. Required when type is ENUM.

Definition at line 126 of file ClassProperty.h.

◆ max

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::max

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.

Definition at line 171 of file ClassProperty.h.

◆ min

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::min

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.

Definition at line 179 of file ClassProperty.h.

◆ name

std::optional<std::string> CesiumGltf::ClassProperty::name

The name of the property, e.g. for display purposes.

Definition at line 98 of file ClassProperty.h.

◆ noData

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::noData

A noData value represents missing data — also known as a sentinel value — wherever it appears. BOOLEAN properties may not specify noData values. This is given as the plain property value, without the transforms from the normalized, offset, and scale properties. Must not be defined if required is true.

Definition at line 197 of file ClassProperty.h.

◆ normalized

bool CesiumGltf::ClassProperty::normalized = false

Specifies whether integer values are normalized. Only applicable to SCALAR, VECN, and MATN types with integer component types. For unsigned integer component types, values are normalized between [0.0, 1.0]. For signed integer component types, values are normalized between [-1.0, 1.0]. For all other component types, this property must be false.

Definition at line 149 of file ClassProperty.h.

◆ offset

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::offset

An 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.

Definition at line 156 of file ClassProperty.h.

◆ required

bool CesiumGltf::ClassProperty::required = false

If required, the property must be present in every entity conforming to the class. If not required, individual entities may include noData values, or the entire property may be omitted. As a result, noData has no effect on a required property. Client implementations may use required properties to make performance optimizations.

Definition at line 188 of file ClassProperty.h.

◆ scale

std::optional<CesiumUtility::JsonValue> CesiumGltf::ClassProperty::scale

A 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.

Definition at line 163 of file ClassProperty.h.

◆ semantic

std::optional<std::string> CesiumGltf::ClassProperty::semantic

An identifier that describes how this property should be interpreted. The semantic cannot be used by other properties in the class.

Definition at line 211 of file ClassProperty.h.

◆ type

std::string CesiumGltf::ClassProperty::type = Type::SCALAR

The element type.

Known values are defined in Type.

Definition at line 111 of file ClassProperty.h.

◆ TypeName

const char* CesiumGltf::ClassProperty::TypeName = "ClassProperty"
staticconstexpr

The original name of this type.

Definition at line 22 of file ClassProperty.h.


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