C# Class NPlot.PlotSurface2D

Implements the surface on which IDrawables are drawn. Is extended by Bitmap.PlotSurface2D, Windows.PlotSurface2D etc. TODO: better explanation.
Inheritance: IPlotSurface2D
Mostra file Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Methods

Method Description
Add ( IDrawable p ) : void

Adds a drawable object to the plot surface with z-order 0. If the object is an IPlot, the PlotSurface2D axes will also be updated.

Add ( IDrawable p, int zOrder ) : void

Adds a drawable object to the plot surface. If the object is an IPlot, the PlotSurface2D axes will also be updated.

AddAxesConstraint ( AxesConstraint constraint ) : void

Add an axis constraint to the plot surface. Axes constraints give you control over where NPlot positions each axes, and the world - pixel ratio.

Clear ( ) : void

Clears the plot and resets all state to the default.

Draw ( Graphics g, Rectangle bounds ) : void

Draw the the PlotSurface2D and all contents [axes, drawables] on the supplied graphics surface.

HitTest ( Point p ) : ArrayList

Performs a hit test with the given point and returns information about the object being hit.

PlotSurface2D ( ) : System

Default constructor.

Remove ( IDrawable p, bool updateAxes ) : void

Remove a drawable object. Note that axes are not updated.

Private Methods

Method Description
DetermineAxesToDraw ( Axis &xAxis1, Axis &xAxis2, Axis &yAxis1, Axis &yAxis2 ) : void
DeterminePhysicalAxesToDraw ( Rectangle bounds, Axis xAxis1, Axis xAxis2, Axis yAxis1, Axis yAxis2, PhysicalAxis &pXAxis1, PhysicalAxis &pXAxis2, PhysicalAxis &pYAxis1, PhysicalAxis &pYAxis2 ) : void
DetermineScaleFactor ( int w, int h ) : float
Init ( ) : void
RefreshZOrdering ( ) : void

If a plot is removed, then the ordering_ list needs to be recalculated.

UpdateAxes ( bool recalculateAll ) : void

Method Details

Add() public method

Adds a drawable object to the plot surface with z-order 0. If the object is an IPlot, the PlotSurface2D axes will also be updated.
public Add ( IDrawable p ) : void
p IDrawable The IDrawable object to add to the plot surface.
return void

Add() public method

Adds a drawable object to the plot surface. If the object is an IPlot, the PlotSurface2D axes will also be updated.
public Add ( IDrawable p, int zOrder ) : void
p IDrawable The IDrawable object to add to the plot surface.
zOrder int The z-ordering when drawing (objects with lower numbers are drawn first)
return void

AddAxesConstraint() public method

Add an axis constraint to the plot surface. Axes constraints give you control over where NPlot positions each axes, and the world - pixel ratio.
public AddAxesConstraint ( AxesConstraint constraint ) : void
constraint AxesConstraint The axis constraint to add.
return void

Clear() public method

Clears the plot and resets all state to the default.
public Clear ( ) : void
return void

Draw() public method

Draw the the PlotSurface2D and all contents [axes, drawables] on the supplied graphics surface.
public Draw ( Graphics g, Rectangle bounds ) : void
g System.Drawing.Graphics The graphics surface on which to draw.
bounds System.Drawing.Rectangle A bounding box on this surface that denotes the area on the /// surface to confine drawing to.
return void

HitTest() public method

Performs a hit test with the given point and returns information about the object being hit.
public HitTest ( Point p ) : ArrayList
p Point The point to test.
return System.Collections.ArrayList

PlotSurface2D() public method

Default constructor.
public PlotSurface2D ( ) : System
return System

Remove() public method

Remove a drawable object. Note that axes are not updated.
public Remove ( IDrawable p, bool updateAxes ) : void
p IDrawable Drawable to remove.
updateAxes bool if true, the axes are updated.
return void