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

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

VectorArgument

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

VectorArgument

#
public VectorArgument(IReader reader)
reader (IReader)

Properties

Flourish

#
public GripFlourish Flourish { get; set; }
Gets the display flourish ofd the grip.

Id

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

Index

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

IsScalar

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

IsVector

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

Location

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

Motion

#
public GripMotion Motion { get; set; }
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.

Nomen

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

Parent

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

Selected

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

Shape

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

State

#
public Point2d State { get; }
Gets the most recent saved state for this vector argument.

Methods

AsScalar

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

AsVector

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

OnArgumentChanged

protected void OnArgumentChanged()
inherited fromArgument

RevertToSavedState

#
public void RevertToSavedState()
Assign the State to the Location.

Store

#
public override void Store(IWriter writer)
writer (IWriter)
Argument.Store

ToFunction

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

ToScalar

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

ToVector

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

TryAssignValue

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

UpdateSavedState

#
public void UpdateSavedState()
Assign the Location to the State.

Events

ArgumentChanged

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