コード例 #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
ファイル: CurvePrimitive.cs プロジェクト: UIKit0/ClearCanvas
		/// <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);
 }