rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Maps Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvUnitConverter Class Reference

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

#include <ilviews/maps/unitconv.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

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

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 
)

This constructor 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:
toMeters The coefficient used to convert the measurement unit to meters.
unit The name of the measurement unit.
description The 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:
meters The 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:
unit The name of the unit converter to be retrieved.
Returns:
A pointer to the registerd converter or a null pointer 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:
count Returns 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:
file The IlvInputFile to read a converter from.
status A 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:
file The IlvOutputFile this converter is to be saved in.
IlDouble IlvUnitConverter::toMeters ( IlDouble  units  )  const

This method converts the measurement unit units to meters.

Parameters:
units The measurement to be converted.
Returns:
The measurement converted to meters.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.