using RealTimeGraphX.EventArguments;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace RealTimeGraphX
{
///
/// Represents a graph renderer that can be connected as an output of an .
/// The graph renderer receives data points from the graph controller and prepares them for drawing.
/// The output of a graph renderer should be of type .
///
/// The type of the graph data series.
///
///
public interface IGraphRenderer : IGraphInputComponent>, IGraphOutputComponent> where TDataSeries : IGraphDataSeries
{
#region Events
///
/// Occurs when the current effective x-axis minimum/maximum has changed.
///
event EventHandler EffectiveRangeXChanged;
///
/// Occurs when the current effective y-axis minimum/maximum has changed.
///
event EventHandler EffectiveRangeYChanged;
#endregion
#region Properties
///
/// Gets the current effective x-axis minimum.
///
GraphDataPointBase EffectiveMinimumX { get; }
///
/// Gets the current effective x-axis maximum.
///
GraphDataPointBase EffectiveMaximumX { get; }
///
/// Gets the current effective y-axis minimum.
///
GraphDataPointBase EffectiveMinimumY { get; }
///
/// Gets the current effective y-axis maximum.
///
GraphDataPointBase EffectiveMaximumY { get; }
///
/// Gets or sets the renderer refresh rate.
/// Higher rate requires more CPU time.
///
TimeSpan RefreshRate { get; set; }
///
/// Gets the current data point x position.
///
double CurrentXPosition { get; }
///
/// Gets or sets a value indicating whether to pause the rendering.
///
bool IsPaused { get; set; }
#endregion
#region Methods
///
/// Invalidates the graph.
///
void Invalidate();
///
/// Clears the graph data.
///
void Clear();
#endregion
}
///
/// Represents a graph renderer that can be connected as an output of an .
/// The graph renderer receives data points from the graph controller and prepares them for drawing.
/// The output of a graph renderer should be of type .
///
/// The type of the graph data series.
/// The type of the x-axis data point.
/// The type of the y-axis data point.
///
///
public interface IGraphRenderer : IGraphRenderer, IGraphInputComponent> where XDataPoint : GraphDataPointBase where YDataPoint : GraphDataPointBase where TDataSeries : IGraphDataSeries
{
#region Methods
///
/// Renders the specified data points collection.
/// • The number of data series of x and y must match.
/// • The number of x and y collections must match.
/// • The number of x and y data points must match.
///
/// The series collection.
/// The x-axis series collection.
/// The y-axis series collection.
void Render(IEnumerable seriesCollection, IEnumerable> xxxx, IEnumerable> yyyy);
///
/// Gets the connected input controller.
///
new IGraphController Input { get; }
///
/// Occurs when the connected input controller has changed.
///
new event EventHandler>> InputChanged;
#endregion
}
}