Class ConstructAction.CurveInput
- Namespace
- CADability.Actions
- Assembly
- CADability.dll
Defines an input object for an action derived from ConstructAction. This input object extpects the user to click on a curve (IGeoObject that also implements ICurve. Pressing enter or TAB or clicking the mouse proceeds to the next input object.
public class ConstructAction.CurveInput : ConstructAction.InputObject
- Inheritance
-
ConstructAction.CurveInput
- Inherited Members
Constructors
CurveInput(string)
Creates a Curveinput object.
public CurveInput(string resourceId)
Parameters
resourceIdstringthe 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.
Fields
ModifiableOnly
true: only curves that may be modified are yielded false: any kind of curves curves are yielded
public bool ModifiableOnly
Field Value
PreferPath
Prefer path objects instead of single curves (when available)
public bool PreferPath
Field Value
Properties
Curves
The curves currently offered by this input: the curves under the cursor, or the curves set with SetCurves(ICurve[], ICurve). One of them is the SelectedCurve. Each change raises InputValueCurvesChangedEvent.
public ICurve[] Curves { get; }
Property Value
- ICurve[]
Decomposed
true: only decomposed curves are yielded, false: also path objects, that consist of several subcurves are yielded
public bool Decomposed { get; set; }
Property Value
FailCursor
Sets the cursor that will be displayed when no curve is hit
public string FailCursor { set; }
Property Value
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
HitCursor
Sets the cursor that will be displayed when a curve is hit
public string HitCursor { set; }
Property Value
SelectedCurve
The curve selected from Curves (shown highlighted in the view), or null if there is none. Each change raises InputValueSelectedCurveChangedEvent. Use SetSelectedCurve(ICurve) or SetCurves(ICurve[], ICurve) to change it.
public ICurve SelectedCurve { get; }
Property Value
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()
GetCurves()
Gets the currently selected curves.
public ICurve[] GetCurves()
Returns
- ICurve[]
GetSelectedCurve()
Returns the currently selected curve, see SelectedCurve.
public ICurve GetSelectedCurve()
Returns
- ICurve
The selected curve, or null if there is none
SetContextMenu(string, ICommandHandler)
Attaches a context menu to the entry of this input in the property page. The menu is loaded from the menu
resource by menuId and its commands are sent to handler. May only be
called after the entry has been built, i.e. when the action is active.
public void SetContextMenu(string menuId, ICommandHandler handler)
Parameters
menuIdstringId of a popup menu in the menu resource
handlerICommandHandlerReceives the commands of the menu
SetCurves(ICurve[], ICurve)
Forces the given curves to be displayed
public void SetCurves(ICurve[] curves, ICurve selectedCurve)
Parameters
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
errorMessagestringThe text to display, or an empty string to clear the error
SetSelectedCurve(ICurve)
Set the selected curve
public void SetSelectedCurve(ICurve curve)
Parameters
curveICurvethis curve should be selected
SplitAtMousePosition(ICurve)
Returns two curves (Path), that represent the given curve, splitted at the vertex which is closest to the mouse position. The endpoint of the first curve is the startpoint of the second curve. If the curve is not closed and the startpoint or endpoint is closest to the mouse position, en empty array will be returned.
public ICurve[] SplitAtMousePosition(ICurve composedCurve)
Parameters
composedCurveICurve
Returns
- ICurve[]
Events
CurveSelectionChangedEvent
Provide a method here to react on the user selecting a different curve
public event ConstructAction.CurveInput.CurveSelectionChangedDelegate CurveSelectionChangedEvent
Event Type
InputValueCurvesChangedEvent
Event will be rasied if the Curves changed
public event ConstructAction.CurveInput.InputValueCurvesChangedDelegate InputValueCurvesChangedEvent
Event Type
InputValueSelectedCurveChangedEvent
Event will be rasied if the SelectedCurve changed
public event ConstructAction.CurveInput.InputValueSelectedCurveChangedDelegate InputValueSelectedCurveChangedEvent
Event Type
MouseOverCurvesEvent
Provide a method here to react on the user moving the cursor over curves.
public event ConstructAction.CurveInput.MouseOverCurvesDelegate MouseOverCurvesEvent