ScalarArgument

ArgumentReferences
[IoId("00000000-4667-44E6-B66B-55D79EF1788D")] public sealed class ScalarArgument : Argument
A one-dimensional scalar function argument. Scalars manifest themselves as sliders in the function editor.

Constructors

ScalarArgument

#
public ScalarArgument(
reader
)

Properties

CanBeReferenced

#
Gets or sets whether this scalar has support for referenced functions.
public bool CanBeReferenced { get; set; }

Id

The id of this parameter. This is how the function editor UI can tell apart various parameters for various functions.
public Guid Id { get; }
inherited fromArgument

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.
public int Index { get; }
inherited fromArgument

IsReferenced

#
Gets whether this scalar is a reference to a function, rather than some constant value.
public bool IsReferenced { get; }

IsScalar

Gets whether this parameter is a 1D scalar.
public bool IsScalar { get; }
inherited fromArgument

IsVector

Gets whether this parameter is a 2D vector.
public bool IsVector { get; }
inherited fromArgument

Nomen

Description of this argument. Used to populate tooltips.
public Nomen Nomen { get; set; }
inherited fromArgument

Number

#
Gets the limits for this scalar.
public UiNumber Number { get; }

Parent

Grip or Scalar which serves as a parent for this argument.
public int Parent { get; }
inherited fromArgument

Referent

#
Gets the assigned referent, if any.
public Function Referent { get; }

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.
public Guid ReferentId { get; }

ReferentName

#
Gets the name of the referent function, if any.
public string ReferentName { get; }

Methods

AsScalar

Cast this parameter to a scalar.
public bool AsScalar(
scalar
)
inherited fromArgument

AsVector

Cast this parameter to a vector.
public bool AsVector(
vector
)
inherited fromArgument

OnArgumentChanged

protected void OnArgumentChanged()
inherited fromArgument

RevertToSavedState

#
Revert the Number to the most recently saved state.
public void RevertToSavedState()

Store

#
public override void Store(
writer
)
Argument.Store

ToFunction

Convert the value inside this argument to a function. This method will fail if the argument is a Vector.
public Function ToFunction()
inherited fromArgument

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.
public double ToScalar()
inherited fromArgument

ToVector

Convert the value inside this argument to a vector. This method will fail if the argument is not of type vector.
public Point2d ToVector()
inherited fromArgument

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.
public bool TryAssignDomain(
lower,
New lower limit.
upper,
New upper limit.
decimals
Number of decimals to show.
)
True if the state actually changed.

TryAssignValue

#
Set and update the current state.
public bool TryAssignValue(
newValue
New value.
)
True if the state actually changed.

TryAssignValue

#
Set and update the current state.
public bool TryAssignValue(
newValue
New value.
)
True if the state actually changed.

TryAssignValue

#
Try and assign a new value.
public bool TryAssignValue(
value,
source
)

UpdateSavedState

#
Create a new most recent saved state based on the current Number.
public void UpdateSavedState()

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.
public event EventHandler<EventArgs> ArgumentChanged
inherited fromArgument