Rogue Wave Views
Maps Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
IlvUnitConverter Class Reference

This class provides facilities to convert Cartesian data to various measurement units. More...

#include <ilviews/maps/unitconv.h>

Public Member Functions

 IlvUnitConverter (IlDouble toMeters, const char *unit, const char *description=0)
 Initializes a new instance of IlvUnitConverter using the specified coefficient to convert the measurement unit to meters, and the specified unit name and description. More...
 
IlvUnitConvertercopy () const
 Returns a copy of this instance of unit converter. More...
 
IlDouble fromMeters (IlDouble meters) const
 This method converts a measurement expressed in meters to the measurement unit. More...
 
const char * getDescription () const
 This method returns the description of the measurement unit of this converter. More...
 
IlDouble getToMeters () const
 Returns the coefficient used to convert the measurement unit to meters. More...
 
const char * getUnit () const
 This method returns the name of the measurement unit of this converter. More...
 
void save (IlvOutputFile &file) const
 This method saves an instance of IlvUnitConverter to the specified output file. More...
 
IlDouble toMeters (IlDouble units) const
 This method converts the measurement unit units to meters. More...
 

Static Public Member Functions

static const IlvUnitConverterFT ()
 The unit converter for feet. More...
 
static const IlvUnitConverterGetRegisteredConverter (const char *unit)
 Returns the registered IlvUnitConverter whose name is specified. More...
 
static const IlvUnitConverter *const * GetRegisteredConverters (IlUInt &count)
 Returns the list of all registered unit converters. More...
 
static const IlvUnitConverterKILOMETERS ()
 The unit converter for kilometers. More...
 
static const IlvUnitConverterKMI ()
 The unit converter for international nautical miles. More...
 
static IlvUnitConverterLoad (IlvInputFile &file, IlvMapsError *status=0)
 Loads an IlvUnitConverter from the specified input. More...
 
static const IlvUnitConverterMETERS ()
 The unit converter for meters. More...
 
static const IlvUnitConverterMI ()
 The unit converter for international statute miles. More...
 

Detailed Description

This class provides facilities to convert Cartesian data to various measurement units.

Library: ilvmaps

See also
IlvMaps

Constructor & Destructor Documentation

IlvUnitConverter::IlvUnitConverter ( IlDouble  toMeters,
const char *  unit,
const char *  description = 0 
)

Initializes a new instance of IlvUnitConverter using the specified coefficient to convert the measurement unit to meters, and the specified unit name and description.

Parameters
toMetersThe coefficient used to convert the measurement unit to meters.
unitThe name of the measurement unit.
descriptionThe description of the measurement unit.

Member Function Documentation

IlvUnitConverter* IlvUnitConverter::copy ( ) const

Returns a copy of this instance of unit converter.

Returns
A copy of this unit converter.
IlDouble IlvUnitConverter::fromMeters ( IlDouble  meters) const

This method converts a measurement expressed in meters to the measurement unit.

Parameters
metersThe measurement to be converted, expressed in meters.
Returns
The measurement expressed in the units of this converter.
static const IlvUnitConverter* IlvUnitConverter::FT ( )
static

The unit converter for feet.

Returns
The unit converter for feet.
const char* IlvUnitConverter::getDescription ( ) const

This method returns the description of the measurement unit of this converter.

Returns
A string representing the description of the unit.
static const IlvUnitConverter* IlvUnitConverter::GetRegisteredConverter ( const char *  unit)
static

Returns the registered IlvUnitConverter whose name is specified.

This static member method returns the registered unit converter whose name is specified as the unit argument.

Parameters
unitThe name of the unit converter to be retrieved.
Returns
A pointer to the registerd converter or 0 if the unit converter is not registered.
static const IlvUnitConverter* const* IlvUnitConverter::GetRegisteredConverters ( IlUInt count)
static

Returns the list of all registered unit converters.

This static member function returns an array of count converters that includes all the registered unit converters.

Parameters
countReturns the total number of registered unit converters.
Returns
An array of all registered unit converters.
IlDouble IlvUnitConverter::getToMeters ( ) const

Returns the coefficient used to convert the measurement unit to meters.

Returns
The coefficient used to convert the measurement unit to meters.
const char* IlvUnitConverter::getUnit ( ) const

This method returns the name of the measurement unit of this converter.

Returns
A string representing the name of the unit.
static const IlvUnitConverter* IlvUnitConverter::KILOMETERS ( )
static

The unit converter for kilometers.

Returns
The unit converter for kilometers.
static const IlvUnitConverter* IlvUnitConverter::KMI ( )
static

The unit converter for international nautical miles.

Returns
The unit converter for international nautical miles.
static IlvUnitConverter* IlvUnitConverter::Load ( IlvInputFile file,
IlvMapsError *  status = 0 
)
static

Loads an IlvUnitConverter from the specified input.

This static member method loads an instance of IlvUnitConverter from the specified input file. It can be used, for example, within the read() method of a subclass of IlvNamedProperty.

Parameters
fileThe IlvInputFile to read a converter from.
statusA status holder. If this parameter is specified, it will contain IlvMaps::NoError() if no error occurs, an error code otherwise.
Returns
The read unit converter or a null pointer if an error occurs while reading.
static const IlvUnitConverter* IlvUnitConverter::METERS ( )
static

The unit converter for meters.

Returns
The unit converter for meters.
static const IlvUnitConverter* IlvUnitConverter::MI ( )
static

The unit converter for international statute miles.

Returns
The unit converter for international statute miles.
void IlvUnitConverter::save ( IlvOutputFile file) const

This method saves an instance of IlvUnitConverter to the specified output file.

It can be used, for example, within the write() method of a subclass of IlvNamedProperty.

Parameters
fileThe IlvOutputFile this converter is to be saved in.
IlDouble IlvUnitConverter::toMeters ( IlDouble  units) const

This method converts the measurement unit units to meters.

Parameters
unitsThe measurement to be converted.
Returns
The measurement converted to meters.

© Copyright 2016, 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.