2using System.Threading.Tasks;
26 private bool clockDir;
27 private bool includeCenter;
35 : base(Document, Parent)
50 set => this.radiusX = value;
59 set => this.radiusY = value;
67 get => this.startDegrees;
68 set => this.startDegrees = value;
76 get => this.endDegrees;
77 set => this.endDegrees = value;
85 get => this.spanDegrees;
86 set => this.spanDegrees = value;
94 get => this.clockwise;
95 set => this.clockwise = value;
104 set => this.center = value;
111 public override Task
FromXml(XmlElement Input)
121 return base.FromXml(Input);
130 base.ExportAttributes(Output);
132 this.radiusX?.
Export(Output);
133 this.radiusY?.
Export(Output);
134 this.startDegrees?.
Export(Output);
135 this.endDegrees?.
Export(Output);
136 this.spanDegrees?.
Export(Output);
137 this.clockwise?.
Export(Output);
138 this.center?.
Export(Output);
158 base.CopyContents(Destination);
179 await base.DoMeasureDimensions(State);
185 this.defined =
false;
191 this.defined =
false;
193 this.clockDir = await this.clockwise.Evaluate(State.
Session,
true);
194 this.includeCenter = await this.center.Evaluate(State.
Session,
false);
198 this.start = (float)Math.IEEERemainder(Degrees.
Result, 360);
200 this.defined =
false;
205 this.end = (float)Math.IEEERemainder(Degrees.
Result, 360);
208 this.span = this.end - this.start;
210 this.span = this.start - this.end;
220 this.span = Degrees.
Result;
222 this.end = this.start + this.span;
224 this.end = this.start - this.span;
226 this.end = (float)Math.IEEERemainder(
this.end, 360);
229 this.defined =
false;
234 if (this.span >= 360)
243 float a = this.start;
244 float r = (float)Math.IEEERemainder(
this.start, 90);
251 if (this.end < this.start)
269 if (this.end > this.start)
286 if (this.start != this.end)
289 if (this.includeCenter)
303 if (this.span >= 360)
309 SKPaint Pen = await this.
TryGetPen(State);
315 float Sweep = this.clockDir ? this.span : -this.span;
316 SKRect Oval =
new SKRect(
320 this.start = (float)Math.IEEERemainder(
this.start, 360);
324 this.end = (float)Math.IEEERemainder(
this.end, 360);
330 State.
Canvas.DrawArc(Oval, this.start, Sweep, this.includeCenter, Fill);
332 SKPaint Pen = await this.
TryGetPen(State);
334 State.
Canvas.DrawArc(Oval, this.start, Sweep, this.includeCenter, Pen);
338 await base.Draw(State);
347 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.
BooleanAttribute CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
Result of asynchronous evaluation.
T Result
Evaluated result, if successful.
bool Ok
If evaluation was successful.
Floating point (Single) attribute
FloatAttribute CopyIfNotPreset(Layout2DDocument ForDocument)
Copies the attribute object if undefined, or defined by an expression. Returns a reference to itself,...
LengthAttribute 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.
void CalcDrawingSize(Length L, ref float Size, bool Horizontal, ILayoutElement Element)
Converts a defined length to drawing size.
void IncludePoint(float X, float Y, float RX, float RY, float Angle)
Includes a point in the area measurement.
Layout2DDocument Document
Layout document.
bool defined
If element is well-defined.
Base interface for all layout elements.
Layout2DDocument Document
Layout document.