C# Class NPlot.LinearAxis

Provides functionality for drawing axes with a linear numeric scale.
Inheritance: Axis, System.ICloneable
Mostra file Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Properties

Property Type Description
ApproxNumberLargeTicks float
Mantissas double[]
SmallTickCounts int[]

Public Methods

Method Description
AdjustedWorldValue ( double world ) : double

Adjusts a real world value to one that has been modified to reflect the Axis Scale and Offset properties.

Clone ( ) : object

Deep copy of LinearAxis.

LinearAxis ( ) : System

Default constructor.

LinearAxis ( Axis a ) : System

Copy constructor

LinearAxis ( double worldMin, double worldMax ) : System

Construct a linear axis with the provided world min and max values.

Protected Methods

Method Description
DoClone ( LinearAxis b, LinearAxis a ) : void

Helper method for Clone.

DrawTicks ( Graphics g, Point physicalMin, Point physicalMax, object &labelOffset, object &boundingBox ) : void

Draws the large and small ticks [and tick labels] for this axis.

Private Methods

Method Description
DetermineLargeTickStep ( float physicalLength, bool &shouldCullMiddle ) : double

Calculates the world spacing between large ticks, based on the physical axis length (parameter), world axis length, Mantissa values and MinPhysicalLargeTickStep. A value such that at least two

TODO: This can be optimised a bit.

DetermineNumberSmallTicks ( double bigTickDist ) : int

Given the large tick step, determine the number of small ticks that should be placed in between.

Init ( ) : void
WorldTickPositions_FirstPass ( Point physicalMin, Point physicalMax, List &largeTickPositions, List &smallTickPositions ) : void

Determines the positions, in world coordinates, of the large ticks. When the physical extent of the axis is small, some of the positions that were generated in this pass may be converted to small tick positions and returned as well. If the LargeTickStep isn't set then this is calculated automatically and depends on the physical extent of the axis.

WorldTickPositions_SecondPass ( Point physicalMin, Point physicalMax, List largeTickPositions, List &smallTickPositions ) : void

Determines the positions, in world coordinates, of the small ticks if they have not already been generated.

Method Details

AdjustedWorldValue() public method

Adjusts a real world value to one that has been modified to reflect the Axis Scale and Offset properties.
public AdjustedWorldValue ( double world ) : double
world double world value to adjust
return double

Clone() public method

Deep copy of LinearAxis.
public Clone ( ) : object
return object

DoClone() protected method

Helper method for Clone.
protected DoClone ( LinearAxis b, LinearAxis a ) : void
b LinearAxis
a LinearAxis
return void

DrawTicks() protected method

Draws the large and small ticks [and tick labels] for this axis.
protected DrawTicks ( Graphics g, Point physicalMin, Point physicalMax, object &labelOffset, object &boundingBox ) : void
g System.Drawing.Graphics The graphics surface on which to draw.
physicalMin Point The physical position corresponding to the world minimum of the axis.
physicalMax Point The physical position corresponding to the world maximum of the axis.
labelOffset object out: offset from the axis to draw the axis label.
boundingBox object out: smallest box that completely surrounds all ticks and associated labels for this axis.
return void

LinearAxis() public method

Default constructor.
public LinearAxis ( ) : System
return System

LinearAxis() public method

Copy constructor
public LinearAxis ( Axis a ) : System
a Axis The Axis to clone
return System

LinearAxis() public method

Construct a linear axis with the provided world min and max values.
public LinearAxis ( double worldMin, double worldMax ) : System
worldMin double the world minimum value of the axis.
worldMax double the world maximum value of the axis.
return System

Property Details

ApproxNumberLargeTicks public_oe property

If LargeTickStep isn't specified, then a suitable value is calculated automatically. To determine the tick spacing, the world axis length is divided by ApproximateNumberLargeTicks and the next lowest distance m*10^e for some m in the Mantissas set and some integer e is used as the large tick spacing.
public float ApproxNumberLargeTicks
return float

Mantissas public_oe property

If LargeTickStep isn't specified, then a suitable value is calculated automatically. The value will be of the form m*10^e for some m in this set.
public double[] Mantissas
return double[]

SmallTickCounts public_oe property

If NumberOfSmallTicks isn't specified then .... If specified LargeTickStep manually, then no small ticks unless NumberOfSmallTicks specified.
public int[] SmallTickCounts
return int[]