This class provides facilities to convert Cartesian data to various measurement units.
More...
#include <ilviews/maps/unitconv.h>
This class provides facilities to convert Cartesian data to various measurement units.
Library: ilvmaps
- See also
IlvMaps
.
§ IlvUnitConverter()
IlvUnitConverter::IlvUnitConverter |
( |
IlDouble |
toMeters, |
|
|
const char * |
unit, |
|
|
const char * |
description = 0 |
|
) |
| |
Initializes a new IlvUnitConverter
instance 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. |
§ copy()
Returns a copy of this instance of unit converter.
- Returns
- A copy of this unit converter.
§ fromMeters()
This method converts a measurement expressed in meters to a measurement unit.
- Parameters
-
meters | The measurement to be converted, expressed in meters. |
- Returns
- The measurement expressed in the units of this converter.
§ FT()
The unit converter for feet.
- Returns
- The unit converter for feet.
§ getDescription()
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.
§ GetRegisteredConverter()
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
0
if the unit converter is not registered.
§ GetRegisteredConverters()
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.
§ getToMeters()
IlDouble IlvUnitConverter::getToMeters |
( |
| ) |
const |
Returns the coefficient used to convert a measurement unit to meters.
- Returns
- The coefficient used to convert the measurement unit to meters.
§ getUnit()
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.
§ KILOMETERS()
The unit converter for kilometers.
- Returns
- The unit converter for kilometers.
§ KMI()
The unit converter for international nautical miles.
- Returns
- The unit converter for international nautical miles.
§ Load()
Loads an IlvUnitConverter
from an input file.
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.
§ METERS()
The unit converter for meters.
- Returns
- The unit converter for meters.
§ MI()
The unit converter for international statute miles.
- Returns
- The unit converter for international statute miles.
§ save()
This method saves an instance of IlvUnitConverter
to an output file.
It can be used, for example, within the write()
method of a subclass of IlvNamedProperty
.
- Parameters
-
§ toMeters()
This method converts a measurement unit to meters.
- Parameters
-
units | The measurement to be converted. |
- Returns
- The measurement converted to meters.
© Copyright 2018, 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.