Class SectorReshapingTool
- Namespace
- Northwoods.Go.Tools.Extensions
- Assembly
- SectorReshapingWinForms.dll
The SectorReshapingTool class lets the user interactively modify the angles of a "pie"-shaped sector of a circle.
public class SectorReshapingTool : Tool
- Inheritance
-
SectorReshapingTool
- Inherited Members
Remarks
When a node is selected, this tool shows two handles for changing the angles of the sides of the sector and one handle for changing the radius.
This depends on there being three data properties, "Angle", "Sweep", and "Radius", that hold the needed information to be able to reproduce the sector.
Constructors
SectorReshapingTool()
Constructs a SectorReshapingTool and sets the name for the tool.
public SectorReshapingTool()
Properties
AngleProperty
Gets or sets the name of the data property for the sector start angle.
public string AngleProperty { get; set; }
Property Value
Remarks
The default value is "Angle".
RadiusProperty
Gets or sets the name of the data property for the sector radius.
public string RadiusProperty { get; set; }
Property Value
Remarks
The default value is "Radius".
SweepProperty
Gets or sets the name of the data property for the sector sweep angle.
public string SweepProperty { get; set; }
Property Value
Remarks
The default value is "Sweep".
Methods
CanStart()
This tool can only start if AllowReshape is true and the mouse-down event is at a tool handle created by this tool.
public override bool CanStart()
Returns
DoActivate()
Remember the original angles and radius and start a transaction.
public override void DoActivate()
DoCancel()
Restore the original angles and radius and then stop this tool.
public override void DoCancel()
DoDeactivate()
Stop the transaction.
public override void DoDeactivate()
DoMouseMove()
Depending on the current handle being dragged, update the "Radius", the "Angle", or the "Sweep" properties on the model data.
public override void DoMouseMove()
Remarks
The data property names can be updated via RadiusProperty, AngleProperty, and SweepProperty.
DoMouseUp()
Finish the transaction and stop the tool.
public override void DoMouseUp()
UpdateAdornments(Part)
If the Part is selected, show two angle-changing tool handles and one radius-changing tool handle.
public override void UpdateAdornments(Part part)
Parameters
part
Part