예제 #1
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected CurvePrimitive(CurvePrimitive source, ICloningContext context)
 {
     context.CloneFields(source, this);
     _points = new PointsList(source._points, this);
 }
예제 #2
0
파일: RendererBase.cs 프로젝트: nhannd/Xian
		/// <summary>
		/// Draws a <see cref="CurvePrimitive"/>. Must be overridden and implemented.
		/// </summary>
		protected abstract void DrawCurvePrimitive(CurvePrimitive curve);
예제 #3
0
파일: GDIRenderer.cs 프로젝트: nhannd/Xian
		/// <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);
 }