Class GeneralAngleAction
- Namespace
- CADability.Actions
- Assembly
- CADability.dll
Action which lets the user set the value of an AngleProperty with the mouse. While the action is active the angle is the direction from a fixed point to the current (snapped) mouse position, measured in the active drawing plane, or, if the action was constructed with a local plane, the direction from the origin of that plane to the mouse position projected into it; a CalculateAngleEvent handler may compute the angle from the mouse position instead. A mouse click or Enter accepts the value, Escape restores the initial value. Typically started by the hotspot of an angle property.
public class GeneralAngleAction : Action, ICommandHandler
- Inheritance
-
GeneralAngleAction
- Implements
- Inherited Members
Constructors
GeneralAngleAction(AngleProperty, GeoPoint)
Creates the action for angleProperty. The angle is the direction from fixPoint
to the mouse position, both projected into the active drawing plane.
public GeneralAngleAction(AngleProperty angleProperty, GeoPoint fixPoint)
Parameters
anglePropertyAnglePropertyThe property to modify
fixPointGeoPointThe vertex of the angle in model coordinates, e.g. the center of an ellipse
GeneralAngleAction(AngleProperty, Plane)
Creates the action for angleProperty. The angle is the direction from the location of
localPlane to the mouse position projected into that plane, measured from the plane's x-axis.
public GeneralAngleAction(AngleProperty angleProperty, Plane localPlane)
Parameters
anglePropertyAnglePropertyThe property to modify
localPlanePlaneThe plane in which the angle is measured, e.g. the plane of a circle (whose location is the center)
Methods
GetID()
Must be implemented by derived class. Returns an identification string. All CADability actions return the unique strings like "Draw.Line.TwoPoints" or "Zoom"
public override string GetID()
Returns
- string
the identification of the action
OnActivate(Action, bool)
Implements OnActivate(Action, bool). If you override this method don't forget to call the bas implementation.
public override void OnActivate(Action OldActiveAction, bool SettingAction)
Parameters
OnEnter()
This method will be called when the user presses the enter key. The default implementation does nothing.
public override bool OnEnter()
Returns
OnEscape()
This method will be called when the user presses the escape key. The default implementation does nothing.
public override bool OnEscape()
Returns
OnInactivate(Action, bool)
Implements OnInactivate(Action, bool). If you override this method don't forget to call the bas implementation.
public override void OnInactivate(Action NewActiveAction, bool RemovingAction)
Parameters
NewActiveActionActionthe action that will become active
RemovingActionbooltrue: if called because the action is removed, false: if called when a new action is set on top of this action
OnMouseMove(MouseEventArgs, IView)
Implements OnMouseMove(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.
public override void OnMouseMove(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsMouseEventArgs of the call
vwIViewthe IView which contains the mouse
OnMouseUp(MouseEventArgs, IView)
Implements OnMouseUp(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.
public override void OnMouseUp(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsMouseEventArgs of the call
vwIViewthe IView which contains the mouse
OnRemoveAction()
Last event that is called when the action is removed from the action stack.
public override void OnRemoveAction()
OnSetAction()
Implements OnSetAction(). If you override this method don't forget to call the bas implementation.
public override void OnSetAction()
Events
CalculateAngleEvent
If a handler is attached, it computes the angle from the mouse position instead of the default calculation, e.g. the parameter of an ellipse for the start angle of an elliptical arc.
public event GeneralAngleAction.CalculateAngleDelegate CalculateAngleEvent