Dashboard/Quik/QuikDraw.cs

43 lines
2.6 KiB
C#
Raw Normal View History

2022-08-03 14:04:40 +02:00
using System.Collections.Generic;
2022-08-19 15:13:19 +02:00
using System.IO.Compression;
2022-08-03 14:04:40 +02:00
using System.Linq;
namespace Quik
{
/// <summary>
/// QUIK draw command provider.
/// </summary>
public class QuikDraw
{
/// <summary>
/// The draw command queue.
/// </summary>
2022-08-04 15:40:58 +02:00
public Queue<QuikCommand> Commands { get; } = new Queue<QuikCommand>();
2022-08-03 14:04:40 +02:00
2022-08-20 11:57:57 +02:00
public void Clear() => Commands.Clear();
2022-08-03 14:04:40 +02:00
public void Mask(QuikRectangle bounds) => Commands.Enqueue(new QuikCommandMask(bounds));
public void Line(QuikLine line) => Commands.Enqueue(new QuikCommandLine(line));
public void Line(params QuikLine[] lines) => Commands.Enqueue(new QuikCommandLines(lines));
public void Line(IEnumerable<QuikLine> lines) => Commands.Enqueue(new QuikCommandLines(lines.ToArray()));
public void Bezier(params QuikBezier[] curve) => Commands.Enqueue(new QuikCommandBezier(curve));
public void Bezier(IEnumerable<QuikBezier> curve) => Commands.Enqueue(new QuikCommandBezier(curve.ToArray()));
public void Rectangle(QuikRectangle rectangle) => Commands.Enqueue(new QuikCommandRectangle(rectangle));
public void Rectangle(params QuikRectangle[] rectangles) =>
Commands.Enqueue(new QuikCommandRectangles(rectangles));
public void Rectangle(IEnumerable<QuikRectangle> rectangles) =>
Commands.Enqueue(new QuikCommandRectangles(rectangles.ToArray()));
public void Triangle(QuikTriangle triangle) => Commands.Enqueue(new QuikCommandTriangle(triangle));
public void Triangle(params QuikTriangle[] triangles) => Commands.Enqueue(new QuikCommandTriangles(triangles));
public void Triangle(IEnumerable<QuikTriangle> triangles) =>
Commands.Enqueue(new QuikCommandTriangles(triangles.ToArray()));
public void Polygon(params QuikVec2[] polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon));
public void Polygon(IEnumerable<QuikVec2> polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon.ToArray()));
2022-08-03 14:04:40 +02:00
public void StencilClear() => Commands.Enqueue(new QuikCommandStencilClear());
public void StencilBegin() => Commands.Enqueue(new QuikCommandStencilBegin());
public void StencilEnd() => Commands.Enqueue(new QuikCommandStencilEnd());
2022-08-19 15:13:19 +02:00
public void PutChar(char chr, QuikVec2 position) => Commands.Enqueue(new QuikCommandPutChar(chr, position));
public void PutText(string text, QuikVec2 position) => Commands.Enqueue(new QuikCommandPutText(text, position));
public void FlowText(string text, QuikRectangle bounds) => Commands.Enqueue(new QuikCommandFlowText(text, bounds));
2022-08-03 14:04:40 +02:00
}
}