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 |
( |
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
-
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. |
Returns a copy of this instance of unit converter.
- Returns
- A copy of this unit converter.
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.
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
0
if the unit converter is not registered.
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.
The unit converter for kilometers.
- Returns
- The unit converter for kilometers.
The unit converter for international nautical miles.
- Returns
- The unit converter for international nautical miles.
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.
The unit converter for meters.
- Returns
- The unit converter for meters.
The unit converter for international statute miles.
- Returns
- The unit converter for international statute miles.
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
-
This method converts the measurement unit units to meters.
- Parameters
-
units | The 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.