======================= Enum (hwx.inspire.core) ======================= Store a string with a predefined list of allowed values and labels -------------- Public Methods -------------- +---------------------------------------------------------+ | classmethod apply_ (cls, **kwds) | +---------------------------------------------------------+ | 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 -------------- .. _apply: .. classmethod:: apply(cls, **kwds) Context manager to specify Attribute constructor kwds Useful to avoid repeating kwds while defining a related group .. _splitValues: .. classmethod:: splitValues(cls, options) Splits the specified options into values and displayNames. .. _castForSet: .. method:: 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: .. method:: create(self, obj) Creates an enum attribute for the specified object. .. _createList: .. method:: createList(self, listAttr, obj) Creates an attribute that has list of values for the specified object. .. _createListList: .. method:: createListList(self, listAttr, obj) Creates an attribute that has nested list of values for the specified object. .. _disable: .. method:: disable(self, obj) Disables the attribute. .. _enable: .. method:: enable(self, obj) Enables the attribute. .. _getCreateArgs: .. method:: getCreateArgs(self) Helper used in create methods .. _getDisplayName: .. method:: getDisplayName(self, obj) Returns the display name of the attribute. Display name is used show the objects attribute name in the Property editor. .. _getDisplayNames: .. method:: getDisplayNames(self, obj) Returns the display name. .. _getGuiValue: .. method:: getGuiValue(self, obj) Returns the formatted value, as shown in the Property Editor. .. _getInCoreValue: .. method:: 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: .. method:: getUnits(self, obj) Returns the units of the attribute. .. _getValueFromDisplayName: .. method:: getValueFromDisplayName(self, obj, displayName) Returns the value from the specified display name and object. .. _getValueList: .. method:: getValueList(self, obj) Returns the list of values from the specified object. .. _getValueListList: .. method:: getValueListList(self, obj) Returns the nested list of values from the specified object. .. _getValues: .. method:: getValues(self, obj) Returns the enum values. .. _getValuesAndDisplayNames: .. method:: getValuesAndDisplayNames(self, obj, valuesOnly=False) Returns all the enum value and the display names for it. .. _initialize: .. method:: 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: .. method:: 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: .. method:: setValue(self, obj, value) Sets the value for the specified object attribute. .. _setValueList: .. method:: setValueList(self, obj, value) Sets the specified list of values for the attribute. .. _setValueListList: .. method:: setValueListList(self, obj, value) Sets the specified nested list of values for the attribute.