Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CubicToRel.cs
1using System.Threading.Tasks;
2using SkiaSharp;
3
5{
9 public class CubicToRel : CubicTo
10 {
17 : base(Document, Parent)
18 {
19 }
20
24 public override string LocalName => "CubicToRel";
25
32 public override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
33 {
34 return new CubicToRel(Document, Parent);
35 }
36
42 public override Task Measure(DrawingState State, PathState PathState)
43 {
44 if (this.defined)
45 {
49 }
50
51 return Task.CompletedTask;
52 }
53
60 public override Task Draw(DrawingState State, PathState PathState, SKPath Path)
61 {
62 if (this.defined)
63 {
64 this.P0 = Path.LastPoint;
65 this.P1 = PathState.Add(this.xCoordinate, this.yCoordinate);
66 this.P2 = PathState.Add(this.xCoordinate2, this.yCoordinate2);
67 this.P3 = PathState.Add(this.xCoordinate3, this.yCoordinate3);
68 Path.CubicTo(this.P1, this.P2, this.P3);
69 }
70
71 return Task.CompletedTask;
72 }
73 }
74}
Contains a 2D layout document.
Draws a cubic curve to a point, relative to the origio of the current container
Definition: CubicTo.cs:10
Draws a cubic curve to a point, relative to the end of the last segment
Definition: CubicToRel.cs:10
override Task Measure(DrawingState State, PathState PathState)
Measures layout entities and defines unassigned properties.
Definition: CubicToRel.cs:42
override Task Draw(DrawingState State, PathState PathState, SKPath Path)
Draws layout entities.
Definition: CubicToRel.cs:60
CubicToRel(Layout2DDocument Document, ILayoutElement Parent)
Draws a cubic curve to a point, relative to the end of the last segment
Definition: CubicToRel.cs:16
override string LocalName
Local name of type of element.
Definition: CubicToRel.cs:24
override ILayoutElement Create(Layout2DDocument Document, ILayoutElement Parent)
Creates a new instance of the layout element.
Definition: CubicToRel.cs:32
SKPoint Add(float DeltaX, float DeltaY)
Sets a new coordinate
Definition: PathState.cs:185
bool defined
If element is well-defined.
float yCoordinate2
Measured Y-coordinate
Definition: Point2.cs:122
float xCoordinate2
Measured X-coordinate
Definition: Point2.cs:117
float xCoordinate3
Measured X-coordinate
Definition: Point3.cs:117
float yCoordinate3
Measured Y-coordinate
Definition: Point3.cs:122
float yCoordinate
Measured Y-coordinate
Definition: Point.cs:122
float xCoordinate
Measured X-coordinate
Definition: Point.cs:117
Base interface for all layout elements.