Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvLinearTimeConverter Class Reference

Linear time converter class. More...

#include <ilviews/graphics/timeconverter.h>

Inheritance diagram for IlvLinearTimeConverter:
IlvTimeConverter

Public Member Functions

 IlvLinearTimeConverter ()
 Constructor. More...
 
 IlvLinearTimeConverter (const IlvLinearTimeConverter &)
 Copy Constructor.
 
 IlvLinearTimeConverter (IlDate refTime, IlvDuration unit)
 Constructor. More...
 
virtual IlDate getTime (IlDouble units)
 Converts a double value to a IlDate. More...
 
IlvDuration getUnitDuration ()
 Returns the unit duration. More...
 
virtual IlDouble getUnits (IlDate time)
 Converts a IlDate to a double. More...
 
void setUnitDuration (IlvDuration d)
 Sets the unit duration. More...
 
- Public Member Functions inherited from IlvTimeConverter
 IlvTimeConverter (const IlvTimeConverter &)
 Copy Constructor.
 
 IlvTimeConverter (IlDate refTime)
 Constructor. More...
 
IlDate getReferenceTime ()
 Returns the reference time. More...
 
void lock ()
 Locks the time converter. More...
 
IlUInt refCount () const
 Get the time converter reference count.
 
void setReferenceTime (IlDate d)
 Sets the reference time. More...
 
virtual void unLock ()
 Unlocks the resource. More...
 

Detailed Description

Linear time converter class.

Library: views

An IlvLinearTimeConverter is capable of converting a IlDate to a double value, and a double value to a IlDate in a linear way.

The converter is defined by a reference time and a unit duration. The reference time represents the time where the double value is 0, and the unit duration is the duration of a double value of 1.

Here is the conversion formula:

double value = ( time value - reference time ) / unit duration

Constructor & Destructor Documentation

◆ IlvLinearTimeConverter() [1/2]

IlvLinearTimeConverter::IlvLinearTimeConverter ( IlDate  refTime,
IlvDuration  unit 
)

Constructor.

Creates a linear time converter.

Parameters
refTimeGives the reference time for the new converter.
unitDefines the unit time used for the conversion. The value provided should not be 0.

◆ IlvLinearTimeConverter() [2/2]

IlvLinearTimeConverter::IlvLinearTimeConverter ( )

Constructor.

Creates an IlvLinearTimeConverter with a reference time set to the current time, and a unit duration set to one hour.

Member Function Documentation

◆ getTime()

virtual IlDate IlvLinearTimeConverter::getTime ( IlDouble  units)
virtual

Converts a double value to a IlDate.

Parameters
unitsThe double value to be converted.

Implements IlvTimeConverter.

◆ getUnitDuration()

IlvDuration IlvLinearTimeConverter::getUnitDuration ( )

Returns the unit duration.

See also
setUnitDuration

◆ getUnits()

virtual IlDouble IlvLinearTimeConverter::getUnits ( IlDate  time)
virtual

Converts a IlDate to a double.

Parameters
timeThe IlDate to be converted.

Implements IlvTimeConverter.

◆ setUnitDuration()

void IlvLinearTimeConverter::setUnitDuration ( IlvDuration  d)

Sets the unit duration.

Parameters
dThe new unit duration. The value provided should not be 0.
See also
getUnitDuration