UnitsUnion (hwx.inspire.core)

Group of mutually exclusive attributes where only one is active at at time.

The active attribute is controlled by units.

Public Methods

classmethod apply (cls, **kwds)

castForGet (self, obj, value)

castForSet (self, obj, value)

create (self, obj)

createList (self, listAttr, obj)

createListList (self, listAttr, obj)

disable (self, obj)

enable (self, obj)

getActiveAttribute (self, obj)

getActiveKey (self, obj)

getCreateArgs (self)

getDisplayName (self, obj)

getGuiValue (self, obj)

getInCoreValue (self, obj)

getUnits (self, obj)

getValue (self, obj)

getValueList (self, obj)

getValueListList (self, obj)

initialize (self, objCls, name)

loadValue (self, obj, value)

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

castForGet(self, obj, value)

Converts and returns the attribute value to its external type.

param obj

Object this attribute belongs to.

type obj

GeneralObject

param value

Value of the attribute to be converted.

type value

Any

returns

Converted value.

rtype

value (Any)

castForSet(self, obj, value)

Validates and returns the active attribute value before setting.

create(self, obj)

Creates a attribute for the specified object.

Overridden by the child class create method.

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.

getActiveAttribute(self, obj)

Returns the active attribute.

getActiveKey(self, obj)

Returns the active attribute.

getCreateArgs(self)

Helper used in create methods

getDisplayName(self, obj)

Returns the display name of the active attribute.

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 for the active attribute.

getValue(self, obj)

Returns the value of the active attribute.

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.

initialize(self, objCls, name)

Initializes the attribute.

loadValue(self, obj, value)

Loads and sets the value, when a model is loaded.

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 specified value for the active 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.