Property | Type | Description | |
---|---|---|---|
Init | void | ||
UpdateScale | void | ||
WorldTickPositions_FirstPass | void | ||
WorldTickPositions_SecondPass | void |
Method | Description | |
---|---|---|
Axis ( ) : System |
Default constructor
|
|
Axis ( |
Copy constructor.
|
|
Axis ( double worldMin, double worldMax ) : System |
Constructor that takes only world min and max values.
|
|
Clone ( ) : object |
Deep copy of Axis. This method includes a check that guards against derived classes forgetting to implement their own Clone method. If Clone is called on a object derived from Axis, and the Clone method hasn't been overridden by that object, then the test this.GetType == typeof(Axis) will fail. |
|
Draw ( |
Draw the axis. This involves three steps: (1) Draw the axis line. (2) Draw the tick marks. (3) Draw the label.
|
|
DrawLabel ( |
Draw the Axis Label
|
|
DrawTick ( |
Draw a tick on the axis.
|
|
IncreaseRange ( double percent ) : void |
Moves the world min and max values so that the world axis length is [percent] bigger. If the current world max and min values are the same, they are moved appart an arbitrary amount. This arbitrary amount is currently 0.01, and will probably be configurable in the future. Works for the case WorldMax is less than WorldMin. |
|
LUB ( |
Sets the world extent of the current axis to be just large enough to encompas the current world extent of the axis, and the world extent of the passed in axis
|
|
OutOfRange ( double coord ) : bool |
Determines whether a world value is outside range WorldMin -> WorldMax
|
|
PhysicalToWorld ( |
Return the world coordinate of the projection of the point p onto the axis.
|
|
WorldTickPositions ( Point physicalMin, Point physicalMax, List |
Determines the positions of all Large and Small ticks.
|
|
WorldToPhysical ( double coord, |
World to physical coordinate transform. Not sure how much time is spent in this often called function. If it's lots, then worth optimizing (there is scope to do so). |
Method | Description | |
---|---|---|
DoClone ( |
Helper method for Clone. Does all the copying - can be called by derived types so they don't need to implement this part of the copying themselves. also useful in constructor of derived types that takes Axis class.
|
|
DrawTicks ( |
DrawTicks method. In base axis class this does nothing.
|
|
UpdateOffsetAndBounds ( object &labelOffset, object &boundingBox, Point mergeLabelOffset, |
Update the bounding box and label offset associated with an axis to encompass the additionally specified mergeBoundingBox and mergeLabelOffset respectively.
|
|
getDefaultLabelOffset ( Point physicalMin, Point physicalMax ) : Point |
returns a suitable offset for the axis label in the case that there are no ticks or tick text in the way.
|
Method | Description | |
---|---|---|
Init ( ) : void |
Helper function for constructors. Do initialization here so that Clear() method is handled properly
|
|
UpdateScale ( ) : void | ||
WorldTickPositions_FirstPass ( Point physicalMin, Point physicalMax, List |
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. This default implementation returns empty large ticks list and null small tick list.
|
|
WorldTickPositions_SecondPass ( Point physicalMin, Point physicalMax, List |
Determines the positions, in world coordinates, of the small ticks if they have not already been generated. This default implementation creates an empty smallTickPositions list if it doesn't already exist.
|
public Axis ( double worldMin, double worldMax ) : System | ||
worldMin | double | The minimum world coordinate. |
worldMax | double | The maximum world coordinate. |
return | System |
protected static DoClone ( |
||
b | ||
a | ||
return | void |
public Draw ( |
||
g | The drawing 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. |
boundingBox | out The bounding rectangle of the axis including axis line, label, tick marks and tick mark labels | |
return | void |
public DrawLabel ( |
||
g | The GDI+ drawing surface on which to draw. | |
offset | Point | offset from axis. Should be calculated so as to make sure axis label misses tick labels. |
axisPhysicalMin | Point | The physical position corresponding to the world minimum of the axis. |
axisPhysicalMax | Point | The physical position corresponding to the world maximum of the axis. |
return | object |
public DrawTick ( |
||
g | The graphics surface on which to draw. | |
w | double | The tick position in world coordinates. |
size | float | The size of the tick (in pixels) |
text | string | The text associated with the tick |
textOffset | Point | The Offset to draw from the auto calculated position |
axisPhysMin | Point | The minimum physical extent of the axis |
axisPhysMax | Point | The maximum physical extent of the axis |
labelOffset | Point | out: offset from the axies required for axis label |
boundingBox | out: The bounding rectangle for the tick and tickLabel drawn | |
return | void |
protected DrawTicks ( |
||
g | 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 | is set to a suitable offset from the axis to draw the axis label. In this base method, set to null. |
boundingBox | object | is set to the smallest box that bounds the ticks and the tick text. In this base method, set to null. |
return | void |
public IncreaseRange ( double percent ) : void | ||
percent | double | Percentage to increase world length by. |
return | void |
public OutOfRange ( double coord ) : bool | ||
coord | double | the world value to test |
return | bool |
public PhysicalToWorld ( |
||
p | The point to project onto the axis | |
physicalMin | The physical position corresponding to the world minimum of the axis. | |
physicalMax | The physical position corresponding to the world maximum of the axis. | |
clip | bool | If true, the world value will be clipped to WorldMin or WorldMax as appropriate if it lies outside this range. |
return | double |
protected static UpdateOffsetAndBounds ( object &labelOffset, object &boundingBox, Point mergeLabelOffset, |
||
labelOffset | object | Current axis label offset. |
boundingBox | object | Current axis bounding box. |
mergeLabelOffset | Point | the label offset to merge. The current label offset will be replaced by this if it's norm is larger. |
mergeBoundingBox | the bounding box to merge. The current bounding box will be replaced by this if null, or by the least upper bound of bother bounding boxes otherwise. | |
return | void |
public WorldTickPositions ( Point physicalMin, Point physicalMax, List |
||
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. |
largeTickPositions | List |
ArrayList containing the positions of the large ticks. |
smallTickPositions | List |
ArrayList containing the positions of the small ticks. |
return | void |
public WorldToPhysical ( double coord, |
||
coord | double | The coordinate value to transform. |
physicalMin | The physical position corresponding to the world minimum of the axis. | |
physicalMax | The physical position corresponding to the world maximum of the axis. | |
clip | bool | if false, then physical value may extend outside worldMin / worldMax. If true, the physical value returned will be clipped to physicalMin or physicalMax if it lies outside this range. |
return |
protected getDefaultLabelOffset ( Point physicalMin, Point physicalMax ) : Point | ||
physicalMin | Point | physical point corresponding to the axis world maximum. |
physicalMax | Point | physical point corresponding to the axis world minimum. |
return | Point |