/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="LineItem"/> object from which to copy</param> public FilledLineItem(FilledLineItem rhs) : base(rhs) { _symbol = new Symbol(rhs.Symbol); _line = new FilledLine(rhs.FilledLine); LowerPoints = rhs.LowerPoints; }
public override void CloseCurve(GraphPane pane, CurveItem curve, PointF[] arrPoints, int count, double yMin, System.Drawing.Drawing2D.GraphicsPath path) { if (pane.LineType == LineType.Stack) { throw new NotSupportedException("Filled lines cannot be stacked"); } FilledLineItem filledCurve = curve as FilledLineItem; if (filledCurve == null) { throw new ArgumentException("Curve was of the wrong type. Expected FilledLineItem but was " + curve.GetType(), "curve"); } // Build another points array consisting of the low points (It gets these from the LowerPoints property of the curve) PointF[] arrPoints2; int count2; BuildLowPointsArray(pane, curve, out arrPoints2, out count2); // Add the new points to the GraphicsPath float tension = _isSmooth ? _smoothTension : 0f; path.AddCurve(arrPoints2, 0, count2 - 2, tension); }
/// <summary> /// Draw this <see cref="CurveItem"/> to the specified <see cref="Graphics"/> /// device as a symbol at each defined point. The routine /// only draws the symbols; the lines are draw by the /// <see cref="Line.DrawCurve"/> method. This method /// is normally only called by the Draw method of the /// <see cref="CurveItem"/> object /// </summary> /// <param name="g"> /// A graphic device object to be drawn into. This is normally e.Graphics from the /// PaintEventArgs argument to the Paint() method. /// </param> /// <param name="pane"> /// A reference to the <see cref="GraphPane"/> object that is the parent or /// owner of this object. /// </param> /// <param name="curve">A <see cref="LineItem"/> representing this /// curve.</param> /// <param name="scaleFactor"> /// The scaling factor to be used for rendering objects. This is calculated and /// passed down by the parent <see cref="GraphPane"/> object using the /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust /// font sizes, etc. according to the actual size of the graph. /// </param> /// <param name="isSelected">Indicates that the <see cref="Symbol" /> should be drawn /// with attributes from the <see cref="Selection" /> class. /// </param> public void Draw(IGraphics g, GraphPane pane, LineItem curve, float scaleFactor, bool isSelected) { Symbol source = this; if (isSelected) { source = Selection.Symbol; } //int tmpX, tmpY; int minX = (int)pane.Chart.Rect.Left; int maxX = (int)pane.Chart.Rect.Right; int minY = (int)pane.Chart.Rect.Top; int maxY = (int)pane.Chart.Rect.Bottom; // (Dale-a-b) we'll set an element to true when it has been drawn bool[,] isPixelDrawn = new bool[maxX + 1, maxY + 1]; //double curX, curY, lowVal; DrawPoints(pane, maxX, maxY, curve, curve.Points, g, source, scaleFactor, minX, minY, isPixelDrawn); // Need to check if this is a "Filled" line item, if it is, it may have lower points, in which case the lower points need to be output as well FilledLineItem filledLineItem = curve as FilledLineItem; if (filledLineItem != null) { DrawPoints(pane, maxX, maxY, curve, filledLineItem.LowerPoints, g, source, scaleFactor, minX, minY, isPixelDrawn); } }
protected override IPointList GetPointsForLowPointsArray(CurveItem curve) { FilledLineItem filledCurve = curve as FilledLineItem; if (filledCurve == null) { throw new ArgumentException("Curve was of the wrong type. Expected FilledLineItem but was " + curve.GetType(), "curve"); } return(filledCurve.LowerPoints); }
/// <summary> /// The Copy Constructor /// </summary> /// <param name="rhs">The <see cref="LineItem"/> object from which to copy</param> public FilledLineItem(FilledLineItem rhs) : base(rhs) { _symbol = new Symbol( rhs.Symbol ); _line = new FilledLine( rhs.FilledLine ); LowerPoints = rhs.LowerPoints; }