class GUIGraphTicks

Inherits: IScriptExportable

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

GUIGraphTicks(GUITickStepType stepType = GUITickStepType::Generic)

Contructs a new tick generating object.

stepType
Determines how will ticks be distributed.

Methods

GetNumLevels

u32 GetNumLevels() const

Number of tick levels that will be generated.

SetRange

void SetRange(float valueRangeStart, float valueRangeEnd, GUILogicalUnit pixelRange)

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

void SetTickSpacing(GUILogicalUnit minPx, GUILogicalUnit maxPx)

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

float GetLevelStrength(u32 level)

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

Vector<float> GetTicks(u32 level)

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

void Rebuild()

Rebuilds the tick positions and strengths after some relevant parameter changes.

SetTimeSteps

void SetTimeSteps()

Sets tick steps corresponding to time values.

This will split the ticks into intervals relevant for displaying times.

SetGenericSteps

void SetGenericSteps()

Sets tick steps corresponding to generic values (as opposed to displaying time values).

Fields

mPixelRange

GUILogicalUnit mPixelRange

mValueRangeStart

float mValueRangeStart

mValueRangeEnd

float mValueRangeEnd

mMinTickSpacingPx

GUILogicalUnit mMinTickSpacingPx

mMaxTickSpacingPx

GUILogicalUnit mMaxTickSpacingPx

mValidSteps

Vector<float> mValidSteps

mLevelStrengths

Vector<float> mLevelStrengths

mNumLevels

u32 mNumLevels

mMaxLevel

u32 mMaxLevel