private IEnumerable <Point> GetPointDataFromEnumerable(Range <int> range) { IEnumerable <double> xSeq = XSequence.Skip(range.Min).Take(range.GetLength()); IEnumerable <double> ySeq = YSequence.Skip(range.Min).Take(range.GetLength()); IEnumerator <double> xEnumerator = xSeq.GetEnumerator(); IEnumerator <double> yEnumerator = ySeq.GetEnumerator(); while (xEnumerator.MoveNext() && yEnumerator.MoveNext()) { yield return(new Point(xEnumerator.Current, yEnumerator.Current)); } }
static public int constructor(IntPtr l) { try { XSequence o; o = new XSequence(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int AppendInterval(IntPtr l) { try { XSequence self = (XSequence)checkSelf(l); System.Single a1; checkType(l, 2, out a1); var ret = self.AppendInterval(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int AppendCallback(IntPtr l) { try { XSequence self = (XSequence)checkSelf(l); SLua.LuaFunction a1; checkType(l, 2, out a1); var ret = self.AppendCallback(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int Prepend(IntPtr l) { try { XSequence self = (XSequence)checkSelf(l); XTween a1; checkType(l, 2, out a1); var ret = self.Prepend(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int InsertCallback(IntPtr l) { try { XSequence self = (XSequence)checkSelf(l); System.Single a1; checkType(l, 2, out a1); SLua.LuaFunction a2; checkType(l, 3, out a2); var ret = self.InsertCallback(a1, a2); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
protected override IEnumerable GetDataCore(DataSourceEnvironment environment) { if (XSequence == null || YSequence == null) { throw new InvalidOperationException(xAndYShouldNotBeNull); } IEnumerator <double> xEnumerator = XSequence.GetEnumerator(); IEnumerator <double> yEnumerator = YSequence.GetEnumerator(); double xMin = Double.MaxValue; double xMax = Double.MinValue; double yMin = Double.MaxValue; double yMax = Double.MinValue; while (xEnumerator.MoveNext() && yEnumerator.MoveNext()) { double x = xEnumerator.Current; double y = yEnumerator.Current; if (x < xMin) { xMin = x; } if (x > xMax) { xMax = x; } if (y < yMin) { yMin = y; } if (y > yMax) { yMax = y; } yield return(new Point(x, y)); } environment.ContentBounds = new DataRect(new Point(xMin, yMin), new Point(xMax, yMax)); }