rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvTimeScalePaintContext Class Reference

Utility class for IlvTimeScale. More...

#include <ilviews/graphics/timescale.h>

Public Member Functions

 IlvTimeScalePaintContext (IlDate visibleTime, IlvDuration duration, IlDouble XTranslation=0.0, IlDouble XZoomFactor=1.0, IlvFont *font=0)
 Constructor. More...
 
 IlvTimeScalePaintContext (const IlvTimeScale *tscale)
 Constructor. More...
 
 IlvTimeScalePaintContext (const IlvTimeScalePaintContext &)
 Copy constructor.
 
IlvFontgetFont () const
 Gets the font used to paint the labels of the time scale. More...
 
IlvDuration getVisibleDuration () const
 Returns the duration of the time interval painted by the scale. More...
 
IlDate getVisibleTime () const
 Returns the beginning of the time interval displayed by the scale. More...
 
IlDouble getXTranslation () const
 Returns the horizontal translation used while painting the time scale. More...
 
IlDouble getXZoomFactor () const
 Returns the horizontal zoom factor used while painting the time scale. More...
 
IlDouble inverseTransform (IlDouble x) const
 Inverse transforms a horizontal coordinate. More...
 
void setFont (IlvFont *font)
 Sets the font used to paint the labels of the time scale. More...
 
void setVisibleDuration (IlvDuration duration)
 Sets the duration of the time interval painted by the scale. More...
 
void setVisibleTime (IlDate time)
 Sets the beginning of the time interval painted by the scale. More...
 
void setXTranslation (IlDouble translation)
 Sets the horizontal translation used while painting the time scale. More...
 
void setXZoomFactor (IlDouble factor)
 Sets the horizontal zoom factor used while painting the time scale. More...
 
IlDouble transform (IlDouble x) const
 Transforms a horizontal coordinate. More...
 

Detailed Description

Utility class for IlvTimeScale.

Library: views

A IlvTimeScalePaintContext defines the context in which the time scale paints.

It defines the following parameters required for painting the time scale:

The IlvTimeScalePaintContext is generally used by the method IlvTimeScale::draw(). The time scale has a cached IlvTimeScalePaintContext that can be retrieved by calling IlvTimeScale::getPaintContext. It is the paint context used to paint the time scale when the IlvTimeScale::draw method is called.

See Also
IlvTimeScale::getPaintContext
IlvTimeScale::draw

Constructor & Destructor Documentation

IlvTimeScalePaintContext::IlvTimeScalePaintContext ( IlDate  visibleTime,
IlvDuration  duration,
IlDouble  XTranslation = 0.0,
IlDouble  XZoomFactor = 1.0,
IlvFont font = 0 
)

Constructor.

Initializes a new IlvTimeScalePaintContext for the specified visible interval, the transformation, the zoom factor, and the font.

Parameters
visibleTimeThe begin of the visible time interval to be painted.
durationThe duration of the visible time interval to be painted.
XTranslationThe horizontal translation used to paint the time scale.
XZoomFactorThe horizontal zoom factor used to paint the time scale.
fontThe font used to paint the labels of the time scale.
IlvTimeScalePaintContext::IlvTimeScalePaintContext ( const IlvTimeScale tscale)

Constructor.

Creates a new IlvTimeScalePaintContext by copying parameters (duration, zoom factor and horizontal translation) from an existing IlvTimeScale.

Parameters
tscaleThe existing time scale to copy from.

Member Function Documentation

IlvFont* IlvTimeScalePaintContext::getFont ( ) const

Gets the font used to paint the labels of the time scale.

Returns
The font.
See Also
setFont
IlvDuration IlvTimeScalePaintContext::getVisibleDuration ( ) const

Returns the duration of the time interval painted by the scale.

See Also
setVisibleDuration
IlDate IlvTimeScalePaintContext::getVisibleTime ( ) const

Returns the beginning of the time interval displayed by the scale.

See Also
setVisibleTime
IlDouble IlvTimeScalePaintContext::getXTranslation ( ) const

Returns the horizontal translation used while painting the time scale.

Returns
The horizontal translation.
See Also
transform
inverseTransform
IlDouble IlvTimeScalePaintContext::getXZoomFactor ( ) const

Returns the horizontal zoom factor used while painting the time scale.

Returns
The horizontal zoom factor.
See Also
transform
inverseTransform
IlDouble IlvTimeScalePaintContext::inverseTransform ( IlDouble  x) const

Inverse transforms a horizontal coordinate.

The value is transformed as follows:

(x - XTranslation) / XZoomFactor

Parameters
xThe coordinate to be inverse transformed.
Returns
The transformed coordinate.
See Also
setXTranslation
getXTranslation
setXZoomFactor
getXZoomFactor
transform
void IlvTimeScalePaintContext::setFont ( IlvFont font)

Sets the font used to paint the labels of the time scale.

This parameter can be 0. In this case the font parameter in the context is ignored. The fonts defined for the time scale rows are used instead.

Parameters
fontThe font.
void IlvTimeScalePaintContext::setVisibleDuration ( IlvDuration  duration)

Sets the duration of the time interval painted by the scale.

Parameters
durationThe new duration value.
See Also
getVisibleDuration
void IlvTimeScalePaintContext::setVisibleTime ( IlDate  time)

Sets the beginning of the time interval painted by the scale.

This function adjusts the horizontal translation so that the specified date appears at the beginning of the painted time scale.

Parameters
timeThe new time value.
See Also
getVisibleTime
void IlvTimeScalePaintContext::setXTranslation ( IlDouble  translation)

Sets the horizontal translation used while painting the time scale.

Parameters
translationThe new horizontal translation.
See Also
transform
inverseTransform
void IlvTimeScalePaintContext::setXZoomFactor ( IlDouble  factor)

Sets the horizontal zoom factor used while painting the time scale.

Parameters
factorThe new horizontal zoom factor, which cannot be 0.0.
See Also
transform
inverseTransform
IlDouble IlvTimeScalePaintContext::transform ( IlDouble  x) const

Transforms a horizontal coordinate.

The value is transformed as follows:

x * XZoomFactor + XTranslation

Parameters
xThe coordinate to be transformed.
Returns
The transformed coordinate.
See Also
setXTranslation
getXTranslation
setXZoomFactor
getXZoomFactor
inverseTransform

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.