Пример #1
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected CurvePrimitive(CurvePrimitive source, ICloningContext context)
 {
     context.CloneFields(source, this);
     _points = new PointsList(source._points, this);
 }
Пример #2
0
		/// <summary>
		/// Draws a <see cref="CurvePrimitive"/>. Must be overridden and implemented.
		/// </summary>
		protected abstract void DrawCurvePrimitive(CurvePrimitive curve);
Пример #3
0
		/// <summary>
		/// Draws a <see cref="CurvePrimitive"/>.
		/// </summary>
		protected override void DrawCurvePrimitive(CurvePrimitive curve)
		{
			Surface.FinalBuffer.Graphics.Transform = curve.SpatialTransform.CumulativeTransform;
			curve.CoordinateSystem = CoordinateSystem.Source;

			Surface.FinalBuffer.Graphics.SmoothingMode = SmoothingMode.AntiAlias;

			// Draw drop shadow
			_pen.Color = Color.Black;
			_pen.Width = CalculateScaledPenWidth(curve, 1, Dpi);

			SetDashStyle(curve);

			SizeF dropShadowOffset = GetDropShadowOffset(curve, Dpi);
			PointF[] pathPoints = GetCurvePoints(curve.Points, dropShadowOffset);

			if (curve.Points.IsClosed)
				Surface.FinalBuffer.Graphics.DrawClosedCurve(_pen, pathPoints);
			else
				Surface.FinalBuffer.Graphics.DrawCurve(_pen, pathPoints);

			// Draw line
			_pen.Color = curve.Color;
			pathPoints = GetCurvePoints(curve.Points, SizeF.Empty);

			if (curve.Points.IsClosed)
				Surface.FinalBuffer.Graphics.DrawClosedCurve(_pen, pathPoints);
			else
				Surface.FinalBuffer.Graphics.DrawCurve(_pen, pathPoints);

			Surface.FinalBuffer.Graphics.SmoothingMode = SmoothingMode.None;

			curve.ResetCoordinateSystem();
			Surface.FinalBuffer.Graphics.ResetTransform();
		}
Пример #4
0
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		protected CurvePrimitive(CurvePrimitive source, ICloningContext context)
		{
			context.CloneFields(source, this);
			_points = new PointsList(source._points, this);
		}
Пример #5
0
		/// <summary>
		/// Cloning constructor.
		/// </summary>
		/// <param name="source">The source object from which to clone.</param>
		/// <param name="context">The cloning context object.</param>
		protected CurvePrimitive(CurvePrimitive source, ICloningContext context)
			: base(source, context)
		{
			context.CloneFields(source, this);
		}
Пример #6
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 /// <param name="source">The source object from which to clone.</param>
 /// <param name="context">The cloning context object.</param>
 protected CurvePrimitive(CurvePrimitive source, ICloningContext context)
     : base(source, context)
 {
     context.CloneFields(source, this);
 }