Enum (hwx.inspire.core)¶
Store a string with a predefined list of allowed values and labels
Public Methods¶
classmethod splitValues (cls, options)
castForSet (self, obj, value)
create (self, obj)
createList (self, listAttr, obj)
createListList (self, listAttr, obj)
disable (self, obj)
enable (self, obj)
getCreateArgs (self)
getDisplayName (self, obj)
getDisplayNames (self, obj)
getGuiValue (self, obj)
getInCoreValue (self, obj)
getUnits (self, obj)
getValueFromDisplayName (self, obj, displayName)
getValueList (self, obj)
getValueListList (self, obj)
getValues (self, obj)
getValuesAndDisplayNames (self, obj, valuesOnly=False)
initialize (self, objCls, name)
setInCoreValue (self, obj, value)
setValue (self, obj, value)
setValueList (self, obj, value)
setValueListList (self, obj, value)
Method Details¶
- classmethod apply(cls, **kwds)¶
Context manager to specify Attribute constructor kwds Useful to avoid repeating kwds while defining a related group
- classmethod splitValues(cls, options)¶
Splits the specified options into values and displayNames.
- castForSet(self, obj, value)¶
Converts and validates the enum values before setting.
- param obj
Object this attribute belongs to.
- type obj
GeneralObject
- param value
Value of the attribute to set.
- type value
list[str]
- returns
Validated and converted value.
- rtype
Enum
- create(self, obj)¶
Creates an enum attribute for the specified object.
- createList(self, listAttr, obj)¶
Creates an attribute that has list of values for the specified object.
- createListList(self, listAttr, obj)¶
Creates an attribute that has nested list of values for the specified object.
- disable(self, obj)¶
Disables the attribute.
- enable(self, obj)¶
Enables the attribute.
- getCreateArgs(self)¶
Helper used in create methods
- getDisplayName(self, obj)¶
Returns the display name of the attribute.
Display name is used show the objects attribute name in the Property editor.
- getDisplayNames(self, obj)¶
Returns the display name.
- getGuiValue(self, obj)¶
Returns the formatted value, as shown in the Property Editor.
- getInCoreValue(self, obj)¶
Calls the incore get method (defined in C++) of the attribute.
- param obj
Object this attribute belongs to.
- type obj
GeneralObject
- param value
Value of the attribute to get.
- type value
Any
- returns
Value returned by the incore get method.
- rtype
Any
- getUnits(self, obj)¶
Returns the units of the attribute.
- getValueFromDisplayName(self, obj, displayName)¶
Returns the value from the specified display name and object.
- getValueList(self, obj)¶
Returns the list of values from the specified object.
- getValueListList(self, obj)¶
Returns the nested list of values from the specified object.
- getValues(self, obj)¶
Returns the enum values.
- getValuesAndDisplayNames(self, obj, valuesOnly=False)¶
Returns all the enum value and the display names for it.
- initialize(self, objCls, name)¶
Initializes the attribute.
- param objCls
Object class this attribute belongs to.
- type objCls
class
- param name
Name of the attribute.
- type name
str
- setInCoreValue(self, obj, value)¶
Calls the incore set method (defined in C++) of the attribute.
- param obj
Object this attribute belongs to.
- type obj
GeneralObject
- param value
Value of the attribute to set.
- type value
Any
- setValue(self, obj, value)¶
Sets the value for the specified object attribute.
- setValueList(self, obj, value)¶
Sets the specified list of values for the attribute.
- setValueListList(self, obj, value)¶
Sets the specified nested list of values for the attribute.