public void UpdateCurveFromClock(ModelClock modelClock, GraphDrawer.Curve curve, double timeBegin, double timeEnd, float min, float max) { var timeList = ListPool <double> .Take(); modelClock.ClockImpl.GetValues(timeBegin, timeEnd, timeList); UpdateCurveFromValues(modelClock.ClockImpl.Color, curve, min, max, timeList); ListPool <double> .Release(timeList); }
private static void UpdateCurveFromValues(Color color, GraphDrawer.Curve curve, float min, float max, List <double> timeList) { curve.Color = color; curve.Positions.Clear(); foreach (double time in timeList) { float t = (float)time; curve.Positions.Add(new Vector2(t, min)); curve.Positions.Add(new Vector2(t, max)); curve.Positions.Add(new Vector2(t, min)); } }
public void UpdateCurveFromStream(ModelStream modelStream, GraphDrawer.Curve curve, double timeBegin, double timeEnd, ref float min, ref float max) { var timeValueList = ListPool <(double, float)> .Take(); modelStream.StreamImpl.GetValues(timeBegin, timeEnd, timeValueList); Color c = modelStream.StreamImpl.Color; UpdateCurveFromValues(c, curve, ref min, ref max, timeValueList); ListPool <(double, float)> .Release(timeValueList); }
private static void UpdateCurveFromValues(Color color, GraphDrawer.Curve curve, ref float min, ref float max, List <(double, float)> timeValueList)