Table of Contents

Class ConstructAction.GeoVectorInput

Namespace
CADability.Actions
Assembly
CADability.dll

Defines an input object for an action derived from ConstructAction. This input object extpects the input of a vector. The vector may be either entered on the keyboard or by moving the mouse. The calculation of a vector from the mouse position depends on various settings. Pressing enter or TAB or clicking the mouse proceeds to the next input object.

public class ConstructAction.GeoVectorInput : ConstructAction.InputObject
Inheritance
ConstructAction.GeoVectorInput
Inherited Members

Constructors

GeoVectorInput(string)

Constructs a LengthInput object.

public GeoVectorInput(string resourceId)

Parameters

resourceId string

the resource id to specify a string from the StringTable. ResourceId+".Label": the Label left of the edit box. ResourceId+".ShortInfo": a short tooltip text ResourceId+"DetailedInfo": a longer tooltip text.

GeoVectorInput(string, GeoVector)

Constructs a LengthInput object with an initial value

public GeoVectorInput(string resourceId, GeoVector StartValue)

Parameters

resourceId string

the resource id to specify a string from the StringTable. ResourceId+".Label": the Label left of the edit box. ResourceId+".ShortInfo": a short tooltip text ResourceId+"DetailedInfo": a longer tooltip text.

StartValue GeoVector

the initial value

Properties

DefaultGeoVector

Sets a DefaultGeoVector, which should be a static value, that carries the last input value of this vector to the next instantiation of the action.

public ConstructAction.DefaultGeoVector DefaultGeoVector { set; }

Property Value

ConstructAction.DefaultGeoVector

ForwardMouseInputTo

Mouse input should be forwarded to another input object and only processed by this input, when the other input object is fixed.

public object ForwardMouseInputTo { get; set; }

Property Value

object

IsAngle

Whether the vector is interpreted as an angle (true) or as a direction (false).

public bool IsAngle { get; set; }

Property Value

bool

The vector should be interpreted as an angle (IsAngle==true) or as a direction (IsAngle==false). For an angle there is no vector length, i.e. the length will always be 1 (unit vector). The PropertyDisplay will only display a single value (the angle in the drawing plane), the subentries will contain two angles: drawingplane angle and elevation from drawing plane

PlaneForAngle

Defines the plane in which the angle should be computed. The input point will be projected into this plane and the Angle to the x-axis will be used as the input

public Plane PlaneForAngle { get; set; }

Property Value

Plane

ReadOnly

true: this input field does not accept user input, false: normal input field that requires user input

public override bool ReadOnly { get; set; }

Property Value

bool

Vector

The current vector of this input in model coordinates. It is updated by mouse and keyboard input and by ForceValue(GeoVector); each change raises InputValueChangedEvent. It cannot be set directly, use ForceValue(GeoVector).

public GeoVector Vector { get; }

Property Value

GeoVector

Methods

AdjustHighlight()

Called whenever ReadOnly, Optional or Fixed changes, so that the input can update the highlight of its entry in the property page: an input is highlighted while it still expects a value, i.e. while it is neither optional, fixed nor read-only. The default implementation does nothing; the concrete input objects override it.

protected override void AdjustHighlight()

ForceValue(GeoVector)

Forces the input object to the specified value. The input filed is updated accordingly.

public void ForceValue(GeoVector val)

Parameters

val GeoVector

the value to set

SetError(string)

Shows errorMessage as an error on the entry of this input in the property page, e.g. when the value entered by the user is not acceptable for the action. The default implementation does nothing; inputs with an edit field forward the message to their property entry, inputs without one ignore it.

public override void SetError(string errorMessage)

Parameters

errorMessage string

The text to display, or an empty string to clear the error

SetVectorFromPoint(GeoPoint)

Sets the point as a basis for the calculation of the vector. The calculated vector is the vector from this point to the mouseposition.

public void SetVectorFromPoint(GeoPoint basePoint)

Parameters

basePoint GeoPoint

the point

Events

CalculateGeoVectorEvent

Provide a method here, if you want to calculate the vector yourself, i.e. if vector from point, line or plane is not appropriate to your needs.

public event ConstructAction.GeoVectorInput.CalculateGeoVectorDelegate CalculateGeoVectorEvent

Event Type

ConstructAction.GeoVectorInput.CalculateGeoVectorDelegate

GetGeoVectorEvent

Provide a method here, if the vector not only depends from this input, but is also modified by other means.

public event ConstructAction.GeoVectorInput.GetGeoVectorDelegate GetGeoVectorEvent

Event Type

ConstructAction.GeoVectorInput.GetGeoVectorDelegate

InputValueChangedEvent

This event is raised if the Vector property is changed

public event ConstructAction.GeoVectorInput.InputValueChangedDelegate InputValueChangedEvent

Event Type

ConstructAction.GeoVectorInput.InputValueChangedDelegate

MouseClickEvent

Event that is fired when a mousclick happens and this input has the focus.

public event ConstructAction.MouseClickDelegate MouseClickEvent

Event Type

ConstructAction.MouseClickDelegate

SetGeoVectorEvent

Provide a method here to get the result of this input (and modify your object)

public event ConstructAction.GeoVectorInput.SetGeoVectorDelegate SetGeoVectorEvent

Event Type

ConstructAction.GeoVectorInput.SetGeoVectorDelegate