internal override void UpdatePlotData(Telerik.Windows.Data.RadObservableCollection <PlotInfo> dataCollection, Plot2DRange plotRange, uint samplesCount) { if (!this.IsValid) { return; } dataCollection.SuspendNotifications(); dataCollection.Clear(); double step = (plotRange.YMax - plotRange.YMin) / samplesCount; for (double y = plotRange.YMin; y <= plotRange.YMax; y += step) { double x = this.F(y); if (Double.IsInfinity(x) || Double.IsNaN(x)) { continue; } dataCollection.Add(new PlotInfo(x, y)); } dataCollection.ResumeNotifications(); }
private FunctionViewModel(FunctionBase function, Plot2DRange plotRange, uint samplesCount) { this.PlotData = new Telerik.Windows.Data.RadObservableCollection<PlotInfo>(); this.isBeingEdited = false; this.samplesCount = samplesCount; this.Function = function; this.Function.PropertyChanged += (s,e) => this.UpdatePlotData(); this.PlotRange = plotRange; this.PlotRange.PropertyChanged += (s, e) => this.UpdatePlotData(); }
public static FunctionViewModel CreateInverseRealFunctionVM(Plot2DRange plotRange) { return new FunctionViewModel( new InverselRealFunction(), plotRange, 1000); }
private FunctionViewModel(Plot2DRange plotRange) : this(new RealFunction(), plotRange, 1000) { }
public static FunctionViewModel CreateRealFunctionVM(Plot2DRange plotRange, uint samplesCount) { return new FunctionViewModel(new RealFunction(), plotRange, samplesCount); }
public static FunctionViewModel CreateRealFunctionVM(string functionString, Plot2DRange plotRange) { var f = new FunctionViewModel(plotRange); f.Function.FunctionString = functionString; return f; }
public static FunctionViewModel CreateRealFunctionVM(Plot2DRange plotRange) { return new FunctionViewModel(plotRange); }
internal abstract void UpdatePlotData(Telerik.Windows.Data.RadObservableCollection<PlotInfo> dataCollection, Plot2DRange plotRange, uint samplesCount);
internal override void UpdatePlotData(Telerik.Windows.Data.RadObservableCollection<PlotInfo> dataCollection, Plot2DRange plotRange, uint samplesCount) { if (!this.IsValid) return; dataCollection.SuspendNotifications(); dataCollection.Clear(); double step = (plotRange.XMax - plotRange.XMin) / samplesCount; for (double x = plotRange.XMin; x <= plotRange.XMax; x += step) { double y = this.F(x); if (Double.IsInfinity(y) || Double.IsNaN(y)) dataCollection.Add(new PlotInfo(x, double.NaN)); dataCollection.Add(new PlotInfo(x, y)); } dataCollection.ResumeNotifications(); }
internal abstract void UpdatePlotData(Telerik.Windows.Data.RadObservableCollection <PlotInfo> dataCollection, Plot2DRange plotRange, uint samplesCount);