class
GUIGraphTicks
Generates a set of locations that can be used for rendering ticks on a graph.
As input the class takes valid range, size of the area the ticks will be displayed on, type of ticks and minimum/maximum spacing and outputs a set of coordinates along which ticks should be positioned. Ticks are reported as multiple separate levels with different strengths, depending on how close their distribution is to the upper valid range.
Public
Constructors
GUIGraphTicks
Contructs a new tick generating object.
- stepType
- Determines how will ticks be distributed.
Methods
GetNumLevels
Number of tick levels that will be generated.
SetRange
Sets the range which ticks are to be displayed for, and the range along which the ticks will be displayed.
- valueRangeStart
- Start of the range the ticks are to display.
- valueRangeEnd
- End of the range the ticks are to display.
- pixelRange
- Width or height on which the ticks will be rendered. In pixels.
SetTickSpacing
Sets valid spacing between two ticks.
Tick strength will be determined by how far away are they from either end of this range.
- minPx
- Minimum spacing between two ticks, in pixels.
- maxPx
- Maximum spacing between two ticks, in pixels.
GetLevelStrength
Returns the strength of a particular tick level.
Levels are ordered in descending order of strength (level 0 is the strongest).
- level
- Level for which to retrieve the strength. Must not be larger than getNumLevels() - 1.
Returns: Strength of the ticks at this level, in range [0, 1].
GetTicks
Returns positions of all ticks of the provided level.
The ticks will be within the range provided to setRange().
- level
- Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.
Returns: Positions of all ticks of the provided level.
Protected
Methods
Rebuild
Rebuilds the tick positions and strengths after some relevant parameter changes.
SetTimeSteps
Sets tick steps corresponding to time values.
This will split the ticks into intervals relevant for displaying times.
SetGenericSteps
Sets tick steps corresponding to generic values (as opposed to displaying time values).