![]() |
VR-Forces 4.6.1 Class Documentation
|
Repository for all unit converters. More...
Public Types | |
| enum | DisplayUnitType { Time, Distance, Altitude, Velocity, Acceleration, RotVelocity, Orientation, End_DisplayUnitTypes } |
| Indicates a type of display unit. More... | |
Public Member Functions | |
| DtUnitConverterCollection () | |
| CTOR. | |
| DtUnitConverterCollection (const DtUnitConverterCollection &) | |
| Copy CTOR. | |
| ~DtUnitConverterCollection () | |
| DTOR. | |
| void | addUnitConverter (DisplayUnitType type, unsigned int unit, const DtUnitConverter *converter) |
| Adds the converter to the unit converter dictionary. | |
Conversion Methods | |
| double | convertDistance (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits distUnits, double distance) const |
| Converts the distance to the given units from meters. | |
| double | convertSpeed (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits speedUnits, double speed) const |
| Converts the speed to the given units from m/s. | |
| DtVector | convertVelocity (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, const DtVector &velocity) const |
| Converts the speed to the given units from m/s. | |
| double | convertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, double accel) const |
| Converts the acceleration to the given units from m/s^2. | |
| DtVector | convertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, const DtVector &accel) const |
| Converts the acceleration to the given units from m/s^2. | |
| DtTaitBryan | convertOrientation (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, const DtTaitBryan &orientation) const |
| Converts the orientation to the given units from radians. | |
| double | convertAngle (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, double angle) const |
| Converts the angle to the given units from radians. | |
| DtVector | convertRotationalVelocity (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits wUnits, const DtVector &rotVel) const |
| Converts the rotational velocity to the given units from rad/s. | |
Revert Methods | |
| double | revertDistance (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits distUnits, double distance) const |
| Converts the distance from the given units to meters. | |
| double | revertSpeed (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, double speed) const |
| Converts the speed to the given units from m/s. | |
| DtVector | revertVelocity (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, const DtVector &velocity) const |
| Converts the speed to the given units from m/s. | |
| DtVector | revertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, const DtVector &accel) const |
| Converts the acceleration from the given units to m/s^2. | |
| double | revertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, double accel) const |
| Converts the acceleration from the given units to m/s^2. | |
| DtTaitBryan | revertOrientation (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, const DtTaitBryan &ori) const |
| Converts the orientation from the given units to radians. | |
| double | revertAngle (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, double angle) const |
| Converts the angle from the given units to radians. | |
| DtVector | revertRotationalVelocity (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits wUnits, const DtVector &rotVel) const |
| Converts the rotational velocity from the given units to rad/s. | |
Unit Converter Accessors | |
| const DtTimeUnitConverter * | timeConverterFor (makArchives::DtDisplayUnitsSettingsRecord::TimeUnits unit) const |
| Returns the velocity converter for the specified unit type. | |
| const DtDistanceUnitConverter * | distanceConverterFor (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits unit) const |
| Returns the distance converter for the specified unit type. | |
| const DtOrientationUnitConverter * | orientationConverterFor (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits unit) const |
| Returns the orientation converter for the specified unit type. | |
Protected Types | |
| typedef boost::unordered_map < unsigned int, const DtUnitConverter * > | UnitConverterMap |
| typedef boost::unordered_map < unsigned int, UnitConverterMap > | UnitConverterTypeMap |
Protected Member Functions | |
| void | addDefaultConverters () |
| Populates the converter collection. | |
Methods for getting the conversion factor for different units. | |
| double | distanceConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits units) const |
| Returns the factor for converting a distance to the given units. | |
| double | velocityConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits units) const |
| Returns the factor for converting a velocity to the given units. | |
| double | accelerationConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits units) const |
| Returns the factor for converting an acceleration to the given units. | |
| double | angleConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits units) const |
| Returns the factor for converting an angle to the given units. | |
| double | rotationalVelocityConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits units) const |
| Returns the factor for converting a rotational velocity to the given units. | |
Protected Attributes | |
| UnitConverterTypeMap | myConverters |
Private Member Functions | |
| DtUnitConverterCollection & | operator= (const DtUnitConverterCollection &) |
| Not implemented. | |
Repository for all unit converters.
Provides utility functions for converting value units without having to retrieve the appropriate unit converter(s) manually.
|
protected |
|
protected |
Indicates a type of display unit.
The values in this enumeration correspond to the various display unit enumerations in makArchives::DtDisplayUnitsSettingsRecord. E.g. DistanceUnits, VelocityUnits, OrientationUnits, etc.
| makVrv::DtUnitConverterCollection::DtUnitConverterCollection | ( | ) |
CTOR.
| makVrv::DtUnitConverterCollection::DtUnitConverterCollection | ( | const DtUnitConverterCollection & | ) |
Copy CTOR.
| makVrv::DtUnitConverterCollection::~DtUnitConverterCollection | ( | ) |
DTOR.
| double makVrv::DtUnitConverterCollection::convertDistance | ( | makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits | distUnits, |
| double | distance | ||
| ) | const |
Converts the distance to the given units from meters.
| double makVrv::DtUnitConverterCollection::convertSpeed | ( | makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits | speedUnits, |
| double | speed | ||
| ) | const |
Converts the speed to the given units from m/s.
| DtVector makVrv::DtUnitConverterCollection::convertVelocity | ( | makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits | velUnits, |
| const DtVector & | velocity | ||
| ) | const |
Converts the speed to the given units from m/s.
| double makVrv::DtUnitConverterCollection::convertAcceleration | ( | makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits | accelUnits, |
| double | accel | ||
| ) | const |
Converts the acceleration to the given units from m/s^2.
| DtVector makVrv::DtUnitConverterCollection::convertAcceleration | ( | makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits | accelUnits, |
| const DtVector & | accel | ||
| ) | const |
Converts the acceleration to the given units from m/s^2.
| DtTaitBryan makVrv::DtUnitConverterCollection::convertOrientation | ( | makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits | oriUnits, |
| const DtTaitBryan & | orientation | ||
| ) | const |
Converts the orientation to the given units from radians.
| double makVrv::DtUnitConverterCollection::convertAngle | ( | makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits | oriUnits, |
| double | angle | ||
| ) | const |
Converts the angle to the given units from radians.
| DtVector makVrv::DtUnitConverterCollection::convertRotationalVelocity | ( | makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits | wUnits, |
| const DtVector & | rotVel | ||
| ) | const |
Converts the rotational velocity to the given units from rad/s.
| double makVrv::DtUnitConverterCollection::revertDistance | ( | makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits | distUnits, |
| double | distance | ||
| ) | const |
Converts the distance from the given units to meters.
| double makVrv::DtUnitConverterCollection::revertSpeed | ( | makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits | velUnits, |
| double | speed | ||
| ) | const |
Converts the speed to the given units from m/s.
| DtVector makVrv::DtUnitConverterCollection::revertVelocity | ( | makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits | velUnits, |
| const DtVector & | velocity | ||
| ) | const |
Converts the speed to the given units from m/s.
| DtVector makVrv::DtUnitConverterCollection::revertAcceleration | ( | makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits | accelUnits, |
| const DtVector & | accel | ||
| ) | const |
Converts the acceleration from the given units to m/s^2.
| double makVrv::DtUnitConverterCollection::revertAcceleration | ( | makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits | accelUnits, |
| double | accel | ||
| ) | const |
Converts the acceleration from the given units to m/s^2.
| DtTaitBryan makVrv::DtUnitConverterCollection::revertOrientation | ( | makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits | oriUnits, |
| const DtTaitBryan & | ori | ||
| ) | const |
Converts the orientation from the given units to radians.
| double makVrv::DtUnitConverterCollection::revertAngle | ( | makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits | oriUnits, |
| double | angle | ||
| ) | const |
Converts the angle from the given units to radians.
| DtVector makVrv::DtUnitConverterCollection::revertRotationalVelocity | ( | makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits | wUnits, |
| const DtVector & | rotVel | ||
| ) | const |
Converts the rotational velocity from the given units to rad/s.
| void makVrv::DtUnitConverterCollection::addUnitConverter | ( | DisplayUnitType | type, |
| unsigned int | unit, | ||
| const DtUnitConverter * | converter | ||
| ) |
Adds the converter to the unit converter dictionary.
If a converter for the given unit exists, it is deleted and replaced. This converter collection takes ownership of the converter.
| const DtTimeUnitConverter* makVrv::DtUnitConverterCollection::timeConverterFor | ( | makArchives::DtDisplayUnitsSettingsRecord::TimeUnits | unit | ) | const |
Returns the velocity converter for the specified unit type.
| const DtDistanceUnitConverter* makVrv::DtUnitConverterCollection::distanceConverterFor | ( | makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits | unit | ) | const |
Returns the distance converter for the specified unit type.
| const DtOrientationUnitConverter* makVrv::DtUnitConverterCollection::orientationConverterFor | ( | makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits | unit | ) | const |
Returns the orientation converter for the specified unit type.
|
protected |
Populates the converter collection.
|
protected |
Returns the factor for converting a distance to the given units.
|
protected |
Returns the factor for converting a velocity to the given units.
|
protected |
Returns the factor for converting an acceleration to the given units.
|
protected |
Returns the factor for converting an angle to the given units.
|
protected |
Returns the factor for converting a rotational velocity to the given units.
|
private |
Not implemented.
|
protected |