vrdMetadataEntry¶
-
class
vrdMetadataEntry
¶
(Inherits vrdObject
)
This class gives access to an entry of a vrdMetadataSet.
Each entry has a key and a value of a specific value type. The key must occur only once in a vrdMetadataSet. The same key can be used across different metadata sets.
A tag is a special metadata entry. Old tags are converted to tag entries. A tag entry has the tag name as the key and a fixed value set to string “VRED-Tag”.
Summary¶
- Functions:
- getIcon() → QIcon
- getKey() → string
- getSet() → vrdMetadataSet
- getValue() → QVariant
- getValueAsColor() → QColor
- getValueAsMatrix(order) → QMatrix4x4
- getValueAsVector3D() → QVector3D
- getValueType() → vrMetadataTypes.ValueType
- isTag() → bool
- setKey(key)
- setTag(tag)
- setValue(value)
- setValueFromColor(color)
- setValueFromMatrix(matrix)
- setValueFromVector3D(vector)
- setValueType(valueType)
Functions¶
-
vrdMetadataEntry.
getIcon
()¶ Each metadata set has an icon. Method to query the icon from the set, which contains this entry.
Returns: The current used icon. Return type: QIcon
-
vrdMetadataEntry.
getKey
()¶ Returns: The current key. Return type: string
-
vrdMetadataEntry.
getSet
()¶ Returns: The set which contains this entry. Return type: vrdMetadataSet
-
vrdMetadataEntry.
getValue
()¶ Returns: The current value. Return type: QVariant
-
vrdMetadataEntry.
getValueAsColor
()¶ Returns: The current value as QColor if possible, otherwise returns QColor(). Can convert from list of integers (0..255) or floats (0..1). Return type: QColor
-
vrdMetadataEntry.
getValueAsMatrix
(order=vrMetadataTypes.MatrixOrder.RowMajor)¶ Parameters: order (vrMetadataTypes.MatrixOrder) – The order used to convert the float list to matrix Returns: The current value as QMatrix4x4 if possible, otherwise returns QMatrix4x4(). Return type: QMatrix4x4
-
vrdMetadataEntry.
getValueAsVector3D
()¶ Returns: The current value as QVector3D if possible, otherwise returns QVector3D(). Return type: QVector3D
-
vrdMetadataEntry.
getValueType
()¶ Returns: The current value type. Return type: vrMetadataTypes.ValueType
-
vrdMetadataEntry.
isTag
()¶ Returns: True, if this entry is a tag entry. In this case query the tag name with vrdMetadataEntry.getKey(). Return type: bool
-
vrdMetadataEntry.
setKey
(key)¶ Sets a new key.
Parameters: key (string) – New key.
-
vrdMetadataEntry.
setTag
(tag)¶ Changes this entry to a tag entry with the given tag name. The key is set to the tag name, the value is set to string “VRED-Tag”.
Parameters: tag (string) – The name of this tag.
-
vrdMetadataEntry.
setValue
(value)¶ Method sets a new value. The value may be of any value type.
Parameters: value (QVariant) – A QVariant, which contains the new value.
-
vrdMetadataEntry.
setValueFromColor
(color)¶ Changes the value to a list of 4 floats (RGBA values).
Parameters: color (QColor) – New RGBA color value.
-
vrdMetadataEntry.
setValueFromMatrix
(matrix)¶ Changes the value to a list of 16 floats. Row-major order is used.
Parameters: matrix (QMatrix4x4) – A QMatrix4x4 with float values.
-
vrdMetadataEntry.
setValueFromVector3D
(vector)¶ Changes the value to a list of 3 floats.
Parameters: vector (QVector3D) – Vector with the new 3 float values.
-
vrdMetadataEntry.
setValueType
(valueType)¶ Changes the value type of the entry and sets a default value of that type.
Parameters: valueType (vrMetadataTypes.ValueType) – The new value type.