// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Media
{
using System;
using Perspex.Platform;
///
/// Describes a geometry using drawing commands.
///
///
/// This class is used to define the geometry of a . An instance
/// of is obtained by calling
/// .
///
/// TODO: This class is just a wrapper around IStreamGeometryContextImpl: is it needed?
public class StreamGeometryContext : IDisposable
{
private IStreamGeometryContextImpl impl;
///
/// Initializes a new instance of the class.
///
/// The platform-specific implementation.
public StreamGeometryContext(IStreamGeometryContextImpl impl)
{
this.impl = impl;
}
///
/// Draws an arc to the specified point.
///
/// The destination point.
/// The radii of an oval whose perimeter is used to draw the angle.
/// The rotation angle of the oval that specifies the curve.
/// true to draw the arc greater than 180 degrees; otherwise, false.
///
/// A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
///
public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)
{
this.impl.ArcTo(point, size, rotationAngle, isLargeArc, sweepDirection);
}
///
/// Begins a new figure.
///
/// The starting point for the figure.
/// Whether the figure is filled.
public void BeginFigure(Point startPoint, bool isFilled)
{
this.impl.BeginFigure(startPoint, isFilled);
}
///
/// Draws a Bezier curve to the specified point.
///
/// The first control point used to specify the shape of the curve.
/// The second control point used to specify the shape of the curve.
/// The destination point for the end of the curve.
public void BezierTo(Point point1, Point point2, Point point3)
{
this.impl.BezierTo(point1, point2, point3);
}
///
/// Draws a line to the specified point.
///
/// The destination point.
public void LineTo(Point point)
{
this.impl.LineTo(point);
}
///
/// Ends the figure started by .
///
/// Whether the figure is closed.
public void EndFigure(bool isClosed)
{
this.impl.EndFigure(isClosed);
}
///
/// Finishes the drawing session.
///
public void Dispose()
{
this.impl.Dispose();
}
}
}