Class SectorReshapingTool
The SectorReshapingTool class lets the user interactively modify the angles of a "pie"-shaped sector of a circle.
Namespace: Northwoods.Go.Tools.Extensions
Assembly: SectorReshapingAvalonia.dll
Syntax
public class SectorReshapingTool : Tool
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.
Declaration
public SectorReshapingTool()
Properties
AngleProperty
Gets or sets the name of the data property for the sector start angle.
Declaration
public string AngleProperty { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The default value is "Angle".
RadiusProperty
Gets or sets the name of the data property for the sector radius.
Declaration
public string RadiusProperty { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The default value is "Radius".
SweepProperty
Gets or sets the name of the data property for the sector sweep angle.
Declaration
public string SweepProperty { get; set; }
Property Value
Type | Description |
---|---|
string |
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.
Declaration
public override bool CanStart()
Returns
Type | Description |
---|---|
bool |
Overrides
DoActivate()
Remember the original angles and radius and start a transaction.
Declaration
public override void DoActivate()
Overrides
DoCancel()
Restore the original angles and radius and then stop this tool.
Declaration
public override void DoCancel()
Overrides
DoDeactivate()
Stop the transaction.
Declaration
public override void DoDeactivate()
Overrides
DoMouseMove()
Depending on the current handle being dragged, update the "Radius", the "Angle", or the "Sweep" properties on the model data.
Declaration
public override void DoMouseMove()
Overrides
Remarks
The data property names can be updated via RadiusProperty, AngleProperty, and SweepProperty.
DoMouseUp()
Finish the transaction and stop the tool.
Declaration
public override void DoMouseUp()
Overrides
UpdateAdornments(Part)
If the Part is selected, show two angle-changing tool handles and one radius-changing tool handle.
Declaration
public override void UpdateAdornments(Part part)
Parameters
Type | Name | Description |
---|---|---|
Part | part |