VectorArgument

ArgumentReferences
[IoId("00000000-A020-4C47-986C-9C1A02173776")] public sealed class VectorArgument : Argument
A two-dimensional vector function argument. Vectors manifest themselves as grips in the function editor.

Constructors

VectorArgument

#
Create a custom vector.
public VectorArgument(
index,
Index of vector.
parentIndex,
Index of parent vector.
nomen,
Nomen of vector.
initial,
Grip location.
GripShape
shape,
Grip display style.
flourish
Grip display flourish.
)

VectorArgument

#
Create a primary vector.
public VectorArgument(
index,
Index of vector.
nomen,
Nomen of vector.
initial
Grip location.
)

VectorArgument

#
public VectorArgument(
reader
)

Properties

Flourish

#
Gets the display flourish ofd the grip.
public GripFlourish Flourish { 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

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

Location

#
Gets the current value of this vector argument.
public Point2d Location { get; }

Motion

#
Gets or sets the directions in which this grip may be dragged. A child grip follows a motion-locked parent by the parent's actual (constrained) motion, not the raw mouse motion.
public GripMotion Motion { get; set; }

Nomen

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

Parent

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

Selected

#
Gets or sets whether the grip is selected.
public bool Selected { get; set; }

Shape

#
Gets the display shape of the grip.
public GripShape Shape { get; set; }

State

#
Gets the most recent saved state for this vector argument.
public Point2d State { 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

#
Assign the State to the Location.
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

TryAssignValue

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

UpdateSavedState

#
Assign the Location to the State.
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