Cesium for Unity 1.15.4
Loading...
Searching...
No Matches
CesiumForUnity.CesiumMetadataValue Class Reference

Represents a value from a property in glTF metadata. More...

Public Member Functions

 CesiumMetadataValue ()
 
 CesiumMetadataValue (System.Object value)
 
Boolean GetBoolean (Boolean defaultValue=false)
 Attempts to retrieve the value as a boolean.
 
SByte GetSByte (SByte defaultValue=0)
 Attempts to retrieve the value as a signed 8-bit integer.
 
Byte GetByte (Byte defaultValue=0)
 Attempts to retrieve the value as an unsigned 8-bit integer.
 
Int16 GetInt16 (Int16 defaultValue=0)
 Attempts to retrieve the value as a signed 16-bit integer.
 
UInt16 GetUInt16 (UInt16 defaultValue=0)
 Attempts to retrieve the value as a unsigned 16-bit integer.
 
Int32 GetInt32 (Int32 defaultValue=0)
 Attempts to retrieve the value as a signed 32-bit integer.
 
UInt32 GetUInt32 (UInt32 defaultValue=0)
 Attempts to retrieve the value as a unsigned 32-bit integer.
 
Int64 GetInt64 (Int64 defaultValue=0)
 Attempts to retrieve the value as a signed 64-bit integer.
 
UInt64 GetUInt64 (UInt64 defaultValue=0)
 Attempts to retrieve the value as a unsigned 64-bit integer.
 
float GetFloat (float defaultValue=0)
 Attempts to retrieve the value as a single-precision floating-point number.
 
double GetDouble (double defaultValue=0)
 Attempts to retrieve the value as a double-precision floating-point number.
 
int2 GetInt2 (int2 defaultValue)
 Attempts to retrieve the value as an int2.
 
uint2 GetUInt2 (uint2 defaultValue)
 Attempts to retrieve the value as a uint2.
 
float2 GetFloat2 (float2 defaultValue)
 Attempts to retrieve the value as a float2.
 
double2 GetDouble2 (double2 defaultValue)
 Attempts to retrieve the value as a double2.
 
int3 GetInt3 (int3 defaultValue)
 Attempts to retrieve the value as an int3.
 
uint3 GetUInt3 (uint3 defaultValue)
 Attempts to retrieve the value as an uint3.
 
float3 GetFloat3 (float3 defaultValue)
 Attempts to retrieve the value as a float3.
 
double3 GetDouble3 (double3 defaultValue)
 Attempts to retrieve the value as a double3.
 
int4 GetInt4 (int4 defaultValue)
 Attempts to retrieve the value as an int4.
 
uint4 GetUInt4 (uint4 defaultValue)
 Attempts to retrieve the value as a uint4.
 
float4 GetFloat4 (float4 defaultValue)
 Attempts to retrieve the value as a float4.
 
double4 GetDouble4 (double4 defaultValue)
 Attempts to retrieve the value as a double4.
 
int2x2 GetInt2x2 (int2x2 defaultValue)
 Attempts to retrieve the value as a int2x2.
 
uint2x2 GetUInt2x2 (uint2x2 defaultValue)
 Attempts to retrieve the value as a uint2x2.
 
float2x2 GetFloat2x2 (float2x2 defaultValue)
 Attempts to retrieve the value as a float2x2.
 
double2x2 GetDouble2x2 (double2x2 defaultValue)
 Attempts to retrieve the value as a double2x2.
 
int3x3 GetInt3x3 (int3x3 defaultValue)
 Attempts to retrieve the value as a int3x3.
 
uint3x3 GetUInt3x3 (uint3x3 defaultValue)
 Attempts to retrieve the value as a uint3x3.
 
float3x3 GetFloat3x3 (float3x3 defaultValue)
 Attempts to retrieve the value as a float3x3.
 
double3x3 GetDouble3x3 (double3x3 defaultValue)
 Attempts to retrieve the value as a double3x3.
 
int4x4 GetInt4x4 (int4x4 defaultValue)
 Attempts to retrieve the value as a int4x4.
 
uint4x4 GetUInt4x4 (uint4x4 defaultValue)
 Attempts to retrieve the value as a uint4x4.
 
float4x4 GetFloat4x4 (float4x4 defaultValue)
 Attempts to retrieve the value as a float4x4.
 
double4x4 GetDouble4x4 (double4x4 defaultValue)
 Attempts to retrieve the value as a double4x4.
 
String GetString (String defaultValue="")
 Attempts to retrieve the value as a String.
 
CesiumPropertyArray GetArray ()
 Attempts to retrieve the value as a CesiumPropertyArray.
 

Static Public Member Functions

static Dictionary< String, StringGetValuesAsStrings (Dictionary< String, CesiumMetadataValue > values)
 Gets the given dictionary of CesiumMetadataValues as a new dictionary of strings, mapped by name.
 

Properties

CesiumMetadataValueType valueType [get]
 The type of the metadata value as defined in the EXT_structural_metadata extension.
 
bool isEmpty [get]
 Whether the value is empty, i.e., whether it does not actually represent any data.
 

Detailed Description

Represents a value from a property in glTF metadata.

The value belong to one of the supported property types in EXT_structural_metadata.

Definition at line 12 of file CesiumMetadataValue.cs.

Constructor & Destructor Documentation

◆ CesiumMetadataValue() [1/2]

CesiumForUnity.CesiumMetadataValue.CesiumMetadataValue ( )
inline

Definition at line 56 of file CesiumMetadataValue.cs.

◆ CesiumMetadataValue() [2/2]

CesiumForUnity.CesiumMetadataValue.CesiumMetadataValue ( System.Object value)
inline

Definition at line 59 of file CesiumMetadataValue.cs.

Member Function Documentation

◆ GetArray()

CesiumPropertyArray CesiumForUnity.CesiumMetadataValue.GetArray ( )
inline

Attempts to retrieve the value as a CesiumPropertyArray.

If the value is not an array type, this returns an empty array.

Returns
The value as a CesiumPropertyArray.

Definition at line 1392 of file CesiumMetadataValue.cs.

◆ GetBoolean()

Boolean CesiumForUnity.CesiumMetadataValue.GetBoolean ( Boolean defaultValue = false)
inline

Attempts to retrieve the value as a boolean.

If the value is a boolean, it is returned as-is.

If the value is a scalar, zero is converted to false, while any other value is converted to true.

If the value is a string, "0", "false", and "no" (case-insensitive) are converted to false, while "1", "true", and "yes" are converted to true. All other strings, including strings that can be converted to numbers, will return the default value.

All other types return the default value.

Parameters
defaultValueThe default value to fall back on.
Returns
The value as a Boolean.

Definition at line 132 of file CesiumMetadataValue.cs.

◆ GetByte()

Byte CesiumForUnity.CesiumMetadataValue.GetByte ( Byte defaultValue = 0)
inline

Attempts to retrieve the value as an unsigned 8-bit integer.

If the value is an integer between 0 and 255, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between 0 and 255, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Byte.
Returns
The property value as a Byte.

Definition at line 200 of file CesiumMetadataValue.cs.

◆ GetDouble()

double CesiumForUnity.CesiumMetadataValue.GetDouble ( double defaultValue = 0)
inline

Attempts to retrieve the value as a double-precision floating-point number.

If the value is already a single- or double- floating-point number, it is returned as-is.

If the value is an integer, it is converted to the closest representable double-precision floating-point number.

If the value is a boolean, 1.0 is returned for true and 0.0 for false.

If the value is a string and the entire string can be parsed as a number, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Double.
Returns
The property value as a Double.

Definition at line 478 of file CesiumMetadataValue.cs.

◆ GetDouble2()

double2 CesiumForUnity.CesiumMetadataValue.GetDouble2 ( double2 defaultValue)
inline

Attempts to retrieve the value as a double2.

If the value is a 2-dimensional vector, its components will be converted to double-precision floating-point numbers.

If the value is a 3- or 4-dimensional vector, it will use the first two components to construct the double2.

If the value is a scalar, the resulting double2 will have this value in both of its components.

If the value is a boolean, (1.0, 1.0) is returned for true, while (0.0, 0.0) is returned for false.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double2.
Returns
The property value as a double2.

Definition at line 616 of file CesiumMetadataValue.cs.

◆ GetDouble2x2()

double2x2 CesiumForUnity.CesiumMetadataValue.GetDouble2x2 ( double2x2 defaultValue)
inline

Attempts to retrieve the value as a double2x2.

If the value is a 2-by-2 matrix, its components will be converted to double-precision floating-point numbers.

If the value is a 3-by-3 or 4-by-4 matrix, the double2x2 will be constructed from the first 2 components of the first 2 columns.

If the value is a scalar, then the resulting double2x2 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0 for true and 0.0 for false. Then, the resulting double2x2 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double2x2.
Returns
The property value as a double2x2.

Definition at line 1055 of file CesiumMetadataValue.cs.

◆ GetDouble3()

double3 CesiumForUnity.CesiumMetadataValue.GetDouble3 ( double3 defaultValue)
inline

Attempts to retrieve the value as a double3.

If the value is a 3-dimensional vector, its components will be converted to double-precision floating-point numbers.

If the value is a 4-dimensional vector, a double3 containing the first three components will be returned.

If the value is a 2-dimensional vector, it will become the XY-components of the double3. The Z-component will be set to zero.

If the value is a scalar, the resulting double3 will have this value in both of its components.

If the value is a boolean, (1.0, 1.0, 1.0) is returned for true, while (0.0, 0.0, 0.0) is returned for false.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double3.
Returns
The property value as a double3.

Definition at line 766 of file CesiumMetadataValue.cs.

◆ GetDouble3x3()

double3x3 CesiumForUnity.CesiumMetadataValue.GetDouble3x3 ( double3x3 defaultValue)
inline

Attempts to retrieve the value as a double3x3.

If the value is a 3-by-3 matrix, its components will be converted to the double-precision floating point numbers.

If the value is a 2-by-2 matrix, its components will be used to fill the corresponding components in the double3x3. All other components will be initialized as zero.

If the value is a 4-by-4 matrix, the double3x3 will be constructed from the first 3 components of the first 3 columns.

If the value is a scalar, then the resulting double3x3 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0 for true and 0.0 for false. Then, the resulting double3x3 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double3x3.
Returns
The property value as a double3x3.

Definition at line 1212 of file CesiumMetadataValue.cs.

◆ GetDouble4()

double4 CesiumForUnity.CesiumMetadataValue.GetDouble4 ( double4 defaultValue)
inline

Attempts to retrieve the value as a double4.

If the value is a 4-dimensional vector, its components will be converted to double-precision floating-point numbers.

If the value is a 3-dimensional vector, it will become the XYZ-components of the double4. The W-component will be set to zero.

If the value is a 2-dimensional vector, it will become the XY-components of the double4. The Z- and W-components will be set to zero.

If the value is a scalar, the resulting double4 will have this value in both of its components.

If the value is a boolean, (1.0, 1.0, 1.0, 1.0) is returned for true, while (0.0, 0.0, 0.0, 0.0) is returned for false.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double4.
Returns
The property value as a double4.

Definition at line 914 of file CesiumMetadataValue.cs.

◆ GetDouble4x4()

double4x4 CesiumForUnity.CesiumMetadataValue.GetDouble4x4 ( double4x4 defaultValue)
inline

Attempts to retrieve the value as a double4x4.

If the value is a 4-by-4 matrix, its components will be converted to the double-precision floating point numbers.

If the value is a 2-by-2 or 3-by-3 matrix, its components will be used to fill the corresponding components in the double4x4. All other components will be initialized as zero.

If the value is a scalar, then the resulting double4x4 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0 for true and 0.0 for false. Then, the resulting double4x4 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a double4x4.
Returns
The value as a double4x4.

Definition at line 1353 of file CesiumMetadataValue.cs.

◆ GetFloat()

float CesiumForUnity.CesiumMetadataValue.GetFloat ( float defaultValue = 0)
inline

Attempts to retrieve the value as a single-precision floating-point number.

If the value is already a single-precision floating-point number, it is returned as-is.

If the value is a scalar of any other type within the range of values that a single-precision float can represent, it is converted to its closest representation as a single-precision float and returned.

If the value is a boolean, 1.0f is returned for true and 0.0f for false.

If the value is a string and the entire string can be parsed as a number, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Float.
Returns
The property value as a Float.

Definition at line 444 of file CesiumMetadataValue.cs.

◆ GetFloat2()

float2 CesiumForUnity.CesiumMetadataValue.GetFloat2 ( float2 defaultValue)
inline

Attempts to retrieve the value as a float2.

If the value is a 2-dimensional vector, its components will be converted to the closest representable single-precision floats, if possible.

If the value is a 3- or 4-dimensional vector, it will use the first two components to construct the float2.

If the value is a scalar that can be converted to a single-precision floating-point number, the resulting float2 will have this value in both of its components.

If the value is a boolean, (1.0f, 1.0f) is returned for true, while (0.0f, 0.0f) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a single-precision floating-point number, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float2.
Returns
The property value as a float2.

Definition at line 584 of file CesiumMetadataValue.cs.

◆ GetFloat2x2()

float2x2 CesiumForUnity.CesiumMetadataValue.GetFloat2x2 ( float2x2 defaultValue)
inline

Attempts to retrieve the value as a float2x2.

If the value is a 2-by-2 matrix, its components will be converted to the closest representable single-precision floats.

If the value is a 3-by-3 or 4-by-4 matrix, the float2x2 will be constructed from the first 2 components of the first 2 columns.

If the value is a scalar that can be converted to a single-precision floating point number, then the resulting float2x2 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0f for true and 0.0f for false. Then, the resulting float2x2 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a single-precision floating-point number, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float2x2.
Returns
The property value as a float2x2.

Definition at line 1022 of file CesiumMetadataValue.cs.

◆ GetFloat3()

float3 CesiumForUnity.CesiumMetadataValue.GetFloat3 ( float3 defaultValue)
inline

Attempts to retrieve the value as a float3.

If the value is a 3-dimensional vector, its components will be converted to the closest representable single-precision floats, if possible.

If the value is a 4-dimensional vector, a float3 containing the first three components will be returned.

If the value is a 2-dimensional vector, it will become the XY-components of the float3. The Z-component will be set to zero.

If the value is a scalar that can be converted to a single-precision floating-point number, the resulting float3 will have this value in both of its components.

If the value is a boolean, (1.0f, 1.0f, 1.0f) is returned for true, while (0.0f, 0.0f, 0.0f) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a single-precision floating-point number, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float3.
Returns
The property value as a float3.

Definition at line 731 of file CesiumMetadataValue.cs.

◆ GetFloat3x3()

float3x3 CesiumForUnity.CesiumMetadataValue.GetFloat3x3 ( float3x3 defaultValue)
inline

Attempts to retrieve the value as a float3x3.

If the value is a 3-by-3 matrix, its components will be converted to the closest representable single-precision floats if possible.

If the value is a 2-by-2 matrix, its components will be used to fill the corresponding components in the float3x3. All other components will be initialized as zero.

If the value is a 4-by-4 matrix, the float3x3 will be constructed from the first 3 components of the first 3 columns.

If the value is a scalar that can be converted to a single-precision floating point number, then the resulting float3x3 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0f for true and 0.0f for false. Then, the resulting float3x3 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a single-precision floating-point number, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float3x3.
Returns
The property value as a float3x3.

Definition at line 1175 of file CesiumMetadataValue.cs.

◆ GetFloat4()

float4 CesiumForUnity.CesiumMetadataValue.GetFloat4 ( float4 defaultValue)
inline

Attempts to retrieve the value as a float4.

If the value is a 4-dimensional vector, its components will be converted to the closest representable single-precision floats, if possible.

If the value is a 3-dimensional vector, it will become the XYZ-components of the float4. The W-component will be set to zero.

If the value is a 2-dimensional vector, it will become the XY-components of the float4. The Z- and W-components will be set to zero.

If the value is a scalar, the resulting float4 will have this value in both of its components.

If the value is a boolean, (1.0f, 1.0f, 1.0f, 1.0f) is returned for true, while (0.0f, 0.0f, 0.0f, 0.0f) is returned for false.
In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a single-precision floating-point number, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float4.
Returns
The property value as a float4.

Definition at line 879 of file CesiumMetadataValue.cs.

◆ GetFloat4x4()

float4x4 CesiumForUnity.CesiumMetadataValue.GetFloat4x4 ( float4x4 defaultValue)
inline

Attempts to retrieve the value as a float4x4.

If the value is a 4-by-4 matrix, its components will be converted to the closest representable single-precision floats if possible.

If the value is a 2-by-2 or 3-by-3 matrix, its components will be used to fill the corresponding components in the float4x4. All other components will be initialized as zero.

If the value is a scalar that can be converted to a single-precision floating point number, then the resulting float4x4 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1.0f for true and 0.0f for false. Then, the resulting float4x4 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a float4x4.
Returns
The value as a float4x4.

Definition at line 1319 of file CesiumMetadataValue.cs.

◆ GetInt16()

Int16 CesiumForUnity.CesiumMetadataValue.GetInt16 ( Int16 defaultValue = 0)
inline

Attempts to retrieve the value as a signed 16-bit integer.

If the value is an integer between -32768 and 32767, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between -32768 and 32767, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Int16.
Returns
The property value as a Int16.

Definition at line 234 of file CesiumMetadataValue.cs.

◆ GetInt2()

int2 CesiumForUnity.CesiumMetadataValue.GetInt2 ( int2 defaultValue)
inline

Attempts to retrieve the value as an int2.

If the value is a 2-dimensional vector, its components will be converted to 32-bit signed integers if possible.

If the value is a 3- or 4-dimensional vector, it will use the first two components to construct the int2.

If the value is a scalar that can be converted to a 32-bit signed integer, the resulting int2 will have this value in both of its components.

If the value is a boolean, (1, 1) is returned for true, while (0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int2.
Returns
The property value as a int2.

Definition at line 513 of file CesiumMetadataValue.cs.

◆ GetInt2x2()

int2x2 CesiumForUnity.CesiumMetadataValue.GetInt2x2 ( int2x2 defaultValue)
inline

Attempts to retrieve the value as a int2x2.

If the value is a 2-by-2 matrix, its components will be converted to 32-bit signed integers if possible.

If the value is a 3-by-3 or 4-by-4 matrix, the int2x2 will be constructed from the first 2 components of the first 2 columns.

If the value is a scalar that can be converted to a 32-bit signed integer, then the resulting int2x2 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting int2x2 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int2x2.
Returns
The property value as a int2x2.

Definition at line 950 of file CesiumMetadataValue.cs.

◆ GetInt3()

int3 CesiumForUnity.CesiumMetadataValue.GetInt3 ( int3 defaultValue)
inline

Attempts to retrieve the value as an int3.

If the value is a 3-dimensional vector, its components will be converted to 32-bit signed integers if possible.

If the value is a 4-dimensional vector, it will use the first three components to construct the int3.

If the value is a 2-dimensional vector, it will become the XY-components of the int3. The Z component will be set to zero.

If the value is a scalar that can be converted to a 32-bit signed integer, the resulting int3 will have this value in both of its components.

If the value is a boolean, (1, 1, 1) is returned for true, while (0, 0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int3.
Returns
The property value as a int3.

Definition at line 654 of file CesiumMetadataValue.cs.

◆ GetInt32()

Int32 CesiumForUnity.CesiumMetadataValue.GetInt32 ( Int32 defaultValue = 0)
inline

Attempts to retrieve the value as a signed 32-bit integer.

If the value is an integer between -2,147,483,648 and 2,147,483,647, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between -2,147,483,648 and 2,147,483,647, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.

In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Int32.
Returns
The property value as a Int32.

Definition at line 305 of file CesiumMetadataValue.cs.

◆ GetInt3x3()

int3x3 CesiumForUnity.CesiumMetadataValue.GetInt3x3 ( int3x3 defaultValue)
inline

Attempts to retrieve the value as a int3x3.

If the value is a 3-by-3 matrix, its components will be converted to 32-bit signed integers if possible.

If the value is a 2-by-2 matrix, its components will be used to fill the corresponding components in the int3x3. All other components will be initialized as zero.

If the value is a 4-by-4 matrix, the int3x3 will be constructed from the first 3 components of the first 3 columns.

If the value is a scalar that can be converted to a 32-bit signed integer, then the resulting int3x3 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting int3x3 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int3x3.
Returns
The property value as a int3x3.

Definition at line 1095 of file CesiumMetadataValue.cs.

◆ GetInt4()

int4 CesiumForUnity.CesiumMetadataValue.GetInt4 ( int4 defaultValue)
inline

Attempts to retrieve the value as an int4.

If the value is a 4-dimensional vector, its components will be converted to 32-bit signed integers if possible.

If the value is a 3-dimensional vector, it will become the XYZ-components of the int4. The W-component will be set to zero.

If the value is a 2-dimensional vector, it will become the XY-components of the int4. The Z- and W-components will be set to zero.

If the value is a scalar that can be converted to a 32-bit signed integer, the resulting int4 will have this value in both of its components.

If the value is a boolean, (1, 1, 1, 1) is returned for true, while (0, 0, 0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int4.
Returns
The property value as a int4.

Definition at line 804 of file CesiumMetadataValue.cs.

◆ GetInt4x4()

int4x4 CesiumForUnity.CesiumMetadataValue.GetInt4x4 ( int4x4 defaultValue)
inline

Attempts to retrieve the value as a int4x4.

If the value is a 4-by-4 matrix, its components will be converted to 32-bit signed integers if possible.

If the value is a 2-by-2 or 3-by-3 matrix, its components will be used to fill the corresponding components in the int4x4. All other components will be initialized as zero.

If the value is a scalar that can be converted to a 32-bit signed integer, then the resulting int4x4 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting int4x4 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a 32-bit signed integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a int4x4.
Returns
The property value as a int4x4.

Definition at line 1249 of file CesiumMetadataValue.cs.

◆ GetInt64()

Int64 CesiumForUnity.CesiumMetadataValue.GetInt64 ( Int64 defaultValue = 0)
inline

Attempts to retrieve the value as a signed 64-bit integer.

If the value is an integer between -2^63 and (2^63 - 1), it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between -2^63 and (2^63 - 1), the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.

In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a Int64.
Returns
The property value as a Int64.

Definition at line 375 of file CesiumMetadataValue.cs.

◆ GetSByte()

SByte CesiumForUnity.CesiumMetadataValue.GetSByte ( SByte defaultValue = 0)
inline

Attempts to retrieve the value as a signed 8-bit integer.

If the value is an integer between -128 and 127, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between -128 and 127, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a SByte.
Returns
The property value as a SByte.

Definition at line 166 of file CesiumMetadataValue.cs.

◆ GetString()

String CesiumForUnity.CesiumMetadataValue.GetString ( String defaultValue = "")
inline

Attempts to retrieve the value as a String.

String values are returned as-is.
Scalar values are converted to a string with ToString().
Boolean values are converted to "true" or "false".
Array values return the default value.

Parameters
defaultValueThe default value to use if the value cannot be converted to a String.
Returns
The property value as a String.

Definition at line 1377 of file CesiumMetadataValue.cs.

◆ GetUInt16()

UInt16 CesiumForUnity.CesiumMetadataValue.GetUInt16 ( UInt16 defaultValue = 0)
inline

Attempts to retrieve the value as a unsigned 16-bit integer.

If the value is an integer between 0 and 65535, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between 0 and 65535, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.

In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a UInt16.
Returns
The property value as a UInt16.

Definition at line 269 of file CesiumMetadataValue.cs.

◆ GetUInt2()

uint2 CesiumForUnity.CesiumMetadataValue.GetUInt2 ( uint2 defaultValue)
inline

Attempts to retrieve the value as a uint2.

If the value is a 2-dimensional vector, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 3- or 4-dimensional vector, it will use the first two components to construct the uint2.

If the value is a scalar that can be converted to a 32-bit unsigned integer, the resulting uint2 will have this value in both of its components.

If the value is a boolean, (1, 1) is returned for true, while (0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit unsigned integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint2.
Returns
The property value as a uint2.

Definition at line 548 of file CesiumMetadataValue.cs.

◆ GetUInt2x2()

uint2x2 CesiumForUnity.CesiumMetadataValue.GetUInt2x2 ( uint2x2 defaultValue)
inline

Attempts to retrieve the value as a uint2x2.

If the value is a 2-by-2 matrix, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 3-by-3 or 4-by-4 matrix, the uint2x2 will be constructed from the first 2 components of the first 2 columns.

If the value is a scalar that can be converted to a 32-bit unsigned integer, then the resulting uint2x2 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting uint2x2 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a 32-bit unsigned integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint2x2.
Returns
The property value as a uint2x2.

Definition at line 986 of file CesiumMetadataValue.cs.

◆ GetUInt3()

uint3 CesiumForUnity.CesiumMetadataValue.GetUInt3 ( uint3 defaultValue)
inline

Attempts to retrieve the value as an uint3.

If the value is a 3-dimensional vector, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 4-dimensional vector, it will use the first three components to construct the uint3.

If the value is a 2-dimensional vector, it will become the XY-components of the uint3. The Z component will be set to zero.

If the value is a scalar that can be converted to a 32-bit signed integer, the resulting uint3 will have this value in both of its components.

If the value is a boolean, (1, 1, 1) is returned for true, while (0, 0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit unsigned integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint3.
Returns
The property value as a uint3.

Definition at line 692 of file CesiumMetadataValue.cs.

◆ GetUInt32()

UInt32 CesiumForUnity.CesiumMetadataValue.GetUInt32 ( UInt32 defaultValue = 0)
inline

Attempts to retrieve the value as a unsigned 32-bit integer.

If the value is an integer between 0 and 4,294,967,295, it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between 0 and 4,294,967,295, the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a UInt32.
Returns
The property value as a UInt32.

Definition at line 339 of file CesiumMetadataValue.cs.

◆ GetUInt3x3()

uint3x3 CesiumForUnity.CesiumMetadataValue.GetUInt3x3 ( uint3x3 defaultValue)
inline

Attempts to retrieve the value as a uint3x3.

If the value is a 3-by-3 matrix, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 2-by-2 matrix, its components will be used to fill the corresponding components in the uint3x3. All other components will be initialized as zero.

If the value is a 4-by-4 matrix, the uint3x3 will be constructed from the first 3 components of the first 3 columns.

If the value is a scalar that can be converted to a 32-bit unsigned integer, then the resulting uint3x3 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting uint3x3 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned. In all matrix cases, if any of the relevant components cannot be represented as a 32-bit unsigned integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint3x3.
Returns
The property value as a uint3x3.

Definition at line 1135 of file CesiumMetadataValue.cs.

◆ GetUInt4()

uint4 CesiumForUnity.CesiumMetadataValue.GetUInt4 ( uint4 defaultValue)
inline

Attempts to retrieve the value as a uint4.

If the value is a 4-dimensional vector, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 3-dimensional vector, it will become the XYZ-components of the uint4. The W-component will be set to zero.

If the value is a 2-dimensional vector, it will become the XY-components of the uint4. The Z- and W-components will be set to zero.

If the value is a scalar that can be converted to a 32-bit unsigned integer, the resulting uint4 will have this value in both of its components.

If the value is a boolean, (1, 1, 1, 1) is returned for true, while (0, 0, 0, 0) is returned for false.

In all other cases, the user-defined default value is returned. In all vector cases, if any of the relevant components cannot be represented as a 32-bit unsigned integer, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint4.
Returns
The property value as a uint4.

Definition at line 842 of file CesiumMetadataValue.cs.

◆ GetUInt4x4()

uint4x4 CesiumForUnity.CesiumMetadataValue.GetUInt4x4 ( uint4x4 defaultValue)
inline

Attempts to retrieve the value as a uint4x4.

If the value is a 4-by-4 matrix, its components will be converted to 32-bit unsigned integers if possible.

If the value is a 2-by-2 or 3-by-3 matrix, its components will be used to fill the corresponding components in the uint4x4. All other components will be initialized as zero.

If the value is a scalar that can be converted to a 32-bit unsigned integer, then the resulting uint4x4 will have this value along its diagonal. All other entries will be zero.

If the value is a boolean, it is converted to 1 for true and 0 for false. Then, the resulting uint4x4 will have this value along its diagonal, while all other entries will be zero.
In all other cases, the user-defined default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a uint4x4.
Returns
The value as a uint4x4.

Definition at line 1284 of file CesiumMetadataValue.cs.

◆ GetUInt64()

UInt64 CesiumForUnity.CesiumMetadataValue.GetUInt64 ( UInt64 defaultValue = 0)
inline

Attempts to retrieve the value as a unsigned 64-bit integer.

If the value is an integer between 0 and (2^64-1), it is returned as-is.

If the value is a floating-point number in the aforementioned range, it is truncated (rounded toward zero) and returned.

If the value is a boolean, 1 is returned for true and 0 for false.

If the value is a string and the entire string can be parsed as an integer between 0 and (2^64-1), the parsed value is returned. The string is parsed in a locale-independent way and does not support the use of commas or other delimiters to group digits together.
In all other cases, the default value is returned.

Parameters
defaultValueThe default value to use if the value cannot be converted to a UInt64.
Returns
The property value as a UInt64.

Definition at line 409 of file CesiumMetadataValue.cs.

◆ GetValuesAsStrings()

static Dictionary< String, String > CesiumForUnity.CesiumMetadataValue.GetValuesAsStrings ( Dictionary< String, CesiumMetadataValue > values)
inlinestatic

Gets the given dictionary of CesiumMetadataValues as a new dictionary of strings, mapped by name.

This is useful for displaying the values from a property table or property texture as strings in a user interface.

Array properties cannot be converted to strings, so empty strings will be returned for their values.

Parameters
valuesThe dictionary of CesiumMetadataValues mapped by name.
Returns
The dictionary of values converted to strings, mapped by name.

Definition at line 1413 of file CesiumMetadataValue.cs.

Property Documentation

◆ isEmpty

bool CesiumForUnity.CesiumMetadataValue.isEmpty
get

Whether the value is empty, i.e., whether it does not actually represent any data.

A CesiumMetadataValue can be empty, similar to how a C# nullable may be null. For example, when the raw value of a property matches the property's specified "no data" value, it will return an empty CesiumMetadataValue.

Returns
Whether the value is empty.

Definition at line 49 of file CesiumMetadataValue.cs.

◆ valueType

CesiumMetadataValueType CesiumForUnity.CesiumMetadataValue.valueType
get

The type of the metadata value as defined in the EXT_structural_metadata extension.

Some of these types are not accessible from Unity, but can be converted to a close-fitting type.

Definition at line 31 of file CesiumMetadataValue.cs.


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