1using System.Threading.Tasks;
23 : base(Document, Parent)
38 set => this.head = value;
47 set => this.tail = value;
54 public override Task
FromXml(XmlElement Input)
59 return base.FromXml(Input);
68 base.ExportAttributes(Output);
82 return new PolyLine(Document, Parent);
91 base.CopyContents(Destination);
107 await base.DoMeasureDimensions(State);
114 this.headElement =
Shape;
119 this.Document.TryGetElement(RefId.
Result, out Element) &&
120 Element is
Shape Shape2)
122 this.tailElement = Shape2;
126 private Shape headElement;
127 private Shape tailElement;
137 SKPaint Pen = await this.
GetPen(State);
139 using (SKPath
Path =
new SKPath())
157 if (!(this.tailElement is
null) || !(this.headElement is
null))
163 this.tailElement?.
DrawTail(State,
this, Pen, Fill);
164 this.headElement?.
DrawHead(State,
this, Pen, Fill);
168 await base.Draw(State);
178 public bool TryGetStart(out
float X, out
float Y, out
float Direction)
182 X = Y = Direction = 0;
203 public bool TryGetEnd(out
float X, out
float Y, out
float Direction)
209 X = Y = Direction = 0;
229 base.ExportStateAttributes(Output);
Contains a 2D layout document.
void Export(XmlWriter Output)
Exports the attribute.
void ExportState(XmlWriter Output)
Exports the state of the attribute.
static async Task< EvaluationResult< T > > TryEvaluate(Attribute< T > Attribute, Variables Session)
Tries to evaluate the attribute value.
Result of asynchronous evaluation.
T Result
Evaluated result, if successful.
bool Ok
If evaluation was successful.
StringAttribute CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
SKCanvas Canvas
Current drawing canvas.
Variables Session
Current session.
Layout2DDocument Document
Layout document.
bool defined
If element is well-defined.
static float CalcDirection(float x1, float y1, float x2, float y2)
Calculates the direction of the pen when drawing from (x1,y1) to (x2,y2).
Defines a shape for use elsewhere in the layout.
Task DrawTail(DrawingState State, IDirectedElement DirectedElement, SKPaint DefaultPen, SKPaint DefaultFill)
Draws shape as a tail
Task DrawHead(DrawingState State, IDirectedElement DirectedElement, SKPaint DefaultPen, SKPaint DefaultFill)
Draws shape as a head
Defines a vertex in the graf
float YCoordinate
Measured Y-coordinate
float XCoordinate
Measured X-coordinate
Interface for directed elements.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.