/// <summary> /// Creates a curve evaluator for a curve</summary> /// <param name="curve">Curve</param> /// <returns>Curve evaluator</returns> /// <remarks>A curve evaluator calculates y-coordinates from x-coordinates using appropriate interpolation for a curve</remarks> public static ICurveEvaluator CreateCurveEvaluator(ICurve curve) { ICurveEvaluator cv = null; if (curve.CurveInterpolation == InterpolationTypes.Linear) cv = new LinearCurveEvaluator(curve); else if (curve.CurveInterpolation == InterpolationTypes.Hermite) cv = new HermiteCurveEvaluator(curve); else throw new NotImplementedException("CurveEvaluator not implement for " + curve.CurveInterpolation); return cv; }
/// <summary> /// Creates a curve evaluator for a curve</summary> /// <param name="curve">Curve</param> /// <returns>Curve evaluator</returns> /// <remarks>A curve evaluator calculates y-coordinates from x-coordinates using appropriate interpolation for a curve</remarks> public static ICurveEvaluator CreateCurveEvaluator(ICurve curve) { ICurveEvaluator cv = null; if (curve.CurveInterpolation == InterpolationTypes.Linear) { cv = new LinearCurveEvaluator(curve); } else if (curve.CurveInterpolation == InterpolationTypes.Hermite) { cv = new HermiteCurveEvaluator(curve); } else { throw new NotImplementedException("CurveEvaluator not implement for " + curve.CurveInterpolation); } return(cv); }