Dashboard/Quik/QuikDraw.cs

43 lines
2.6 KiB
C#

using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
namespace Quik
{
/// <summary>
/// QUIK draw command provider.
/// </summary>
public class QuikDraw
{
/// <summary>
/// The draw command queue.
/// </summary>
public Queue<QuikCommand> Commands { get; } = new Queue<QuikCommand>();
public void Clear() => Commands.Clear();
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()));
public void StencilClear() => Commands.Enqueue(new QuikCommandStencilClear());
public void StencilBegin() => Commands.Enqueue(new QuikCommandStencilBegin());
public void StencilEnd() => Commands.Enqueue(new QuikCommandStencilEnd());
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));
}
}