Inheritance diagram for DzERCLink:
Enumerations | |
enum | ERCType { ERCDeltaAdd = 0, ERCDivideInto, ERCDivideBy, ERCMultiply, ERCSubtract, ERCAdd } |
Properties | |
Boolean | active |
Number | addend |
Boolean | autoOverride |
Number | scalar |
ERCType | type |
Constructors | |
DzERCLink (ERCType type, DzNumericProperty property, Number scalar=1.0, Number addend=0.0) | |
DzERCLink (DzNumericProperty property, Number scalar=1.0, Number addend=0.0) | |
DzERCLink () | |
Methods | |
DzNumericProperty | getCurrentProperty () |
DzNumericProperty | getProperty () |
void | setProperty (DzNumericProperty prop) |
Signals | |
void | propertyDeleted (DzProperty prop) |
Signature: "propertyDeleted(DzProperty*)" |
This numeric controller implements an algorithm that is based on the value of another property. There are six formulas which correspond to the ERCType of the object - the default ERCType is ERCDeltaAdd. The formulas are:
Where:
As an example of ERC in action, lets say that there are 3 properties A, B, and C. B is linked to A with a 'ERCDeltaAdd' DzERCLink with a multiplier of 1.0 and an additive value of 0.0. C is linked to B with a 'ERCDeltaAdd' DzERCLink with a multiplier of 2.0 and an additive value of 1.0. So, if the keyed value of A is 10.0, B is 0.0, and C is 0.0, the final values of the properties would be calculated as:
A = 10.0 B = 0.0 + (10.0 * 1.0) + 0.0 = 10.0 C = 0.0 + (10.0 * 2.0) + 1.0 = 21.0
If B and C have keyed values - for example B is 5.0 and C is 2.0 - the final property values would be calculated as:
A = 10.0 B = 5.0 + (10.0 * 1.0) + 0.0 = 15.0 C = 2.0 + (15.0 * 2.0) + 1.0 = 33.0
enum DzERCLink::ERCType |
The types of ERC that can be represented by this class.
DzERCLink::DzERCLink | ( | ) |
Default constructor.
DzERCLink::DzERCLink | ( | DzNumericProperty | property, | |
Number | scalar = 1.0 , |
|||
Number | addend = 0.0 | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Creates a controller that is driven by property
prop | The property that drives this controller | |
scalar | The multiplier of the value | |
addend | The addend to the value |
DzERCLink::DzERCLink | ( | ERCType | type, | |
DzNumericProperty | property, | |||
Number | scalar = 1.0 , |
|||
Number | addend = 0.0 | |||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Creates a controller that is driven by property
type | The type of this controller | |
prop | The property that drives this controller | |
scalar | The multiplier of the value | |
addend | The addend to the value |
DzNumericProperty DzERCLink::getCurrentProperty | ( | ) |
DzNumericProperty DzERCLink::getProperty | ( | ) |
void DzERCLink::propertyDeleted | ( | DzProperty | prop | ) | [signal] |
Signature: "propertyDeleted(DzProperty*)"
Emitted when the source property or current property is deleted.
void DzERCLink::setProperty | ( | DzNumericProperty | prop | ) |
Set the linked property.
prop | A pointer to the property that this link follows. |
This property determines whether or not the controller is applied.
This property holds the addend for the property link.
This property determines whether or not the control will automatically be redirected when its owner is fit to another figure.
This property holds the scalar (multiplier) for the property link.
This property holds the type of property link.