Skip to content

ENH: Supporting Definitions that can take any units

Definitions can now be assigned "*" for their units. This indicates that Attributes being defined by the Definition or Definitions derived from it can be assigned any unit that is supported by its units system.

Definitions can now inherit the units from their base Definition. When overriding the units being inherited, by default a Definition's units must be compatible with the units coming from its base Definition, though the method provides an option to force units to be set even if they are not compatible.

Attributes whose Definition's units are "*" are initially considered unit-less.

Please see unitAttributeUnits <https://gitlab.kitware.com/cmb/smtk/-/blob/master/smtk/attribute/testing/cxx/unitAttributeUnits.cxx>_ for a simple example of using units with Attributes and Definitions.

Note The method Definition::setUnits has been renamed Definition::setLocalUnits to be in line with Attribute's API since as in the case of Attributes, Definitions can now inherit units from their base Definitions.

Also moved the validator for qtUnitsLineEdit out of qtAttribute and into qtUnitsLineEdit

Merge request reports