A one-dimensional scalar function argument. Scalars manifest themselves as sliders in the function editor.
Constructors
Properties
Id
The id of this parameter. This is how the function editor UI can tell apart various parameters for various functions.
Index
The index of this parameter. This is used by the FunctionUI to access specific parameters. It can therefore not be modified during the lifetime of the parameter.
IsReferenced
#Gets whether this scalar is a reference to a function, rather than some constant value.
ReferentId
#Gets the ID of the function UI which provides the current referent. If this ID is Guid.Empty, no function is referenced, although a function may still be assigned.
Methods
Parameters:
| scalar (out ScalarArgument) |
Parameters:
| vector (out VectorArgument) |
OnArgumentChanged
protected void OnArgumentChanged()
RevertToSavedState
#public void RevertToSavedState()
Revert the Number to the most recently saved state.
ToFunction
Convert the value inside this argument to a function. This method will fail if the argument is a Vector.
ToScalar
Convert the value inside this argument to a scalar. This method will fail if the argument is a Referent, or if the argument is a Vector.
ToVector
Convert the value inside this argument to a vector. This method will fail if the argument is not of type vector.
TryAssignDomain
#Assign a new slider domain to this scalar, dropping any referent and clamping the current value into the new range. This is how a referenced parameter is turned back into a plain slider with a chosen domain.
TryAssignValue
#Set and update the current state.
Parameters:
| newValue (decimal) | New value. |
Returns: True if the state actually changed.
TryAssignValue
#Set and update the current state.
Parameters:
| newValue (double) | New value. |
Returns: True if the state actually changed.
TryAssignValue
#Try and assign a new value.
Events
ArgumentChanged
Raised whenever one of the arguments in this collection is given a different value. Oftentimes arguments are modified in quick succession, so it's best to not take immediate action based on this event, but merely to expire caches or set dirty flags.