VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtUnitConverterCollection Class Reference

Repository for all unit converters. More...

List of all members.

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, 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 DtTimeUnitConvertertimeConverterFor (makArchives::DtDisplayUnitsSettingsRecord::TimeUnits unit) const
 Returns the velocity converter for the specified unit type.
const DtDistanceUnitConverterdistanceConverterFor (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits unit) const
 Returns the distance converter for the specified unit type.
const DtOrientationUnitConverterorientationConverterFor (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

DtUnitConverterCollectionoperator= (const DtUnitConverterCollection &)
 Not implemented.

Detailed Description

Repository for all unit converters.

Provides utility functions for converting value units without having to retrieve the appropriate unit converter(s) manually.


Member Typedef Documentation

typedef boost::unordered_map<unsigned int,const DtUnitConverter*> makVrv::DtUnitConverterCollection::UnitConverterMap [protected]
typedef boost::unordered_map<unsigned int,UnitConverterMap> makVrv::DtUnitConverterCollection::UnitConverterTypeMap [protected]

Member Enumeration Documentation

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.

Enumerator:
Time 
Distance 
Altitude 
Velocity 
Acceleration 
RotVelocity 
Orientation 
End_DisplayUnitTypes 

Constructor & Destructor Documentation

CTOR.

Copy CTOR.

DTOR.


Member Function Documentation

Converts the distance to the given units from meters.

Converts the speed to the given units from m/s.

Converts the speed to the given units from m/s.

Converts the acceleration to the given units from m/s^2.

Converts the acceleration to the given units from m/s^2.

Converts the orientation to the given units from radians.

Converts the angle to the given units from radians.

Converts the rotational velocity to the given units from rad/s.

Converts the distance from the given units to meters.

Converts the speed to the given units from m/s.

Converts the speed to the given units from m/s.

Converts the acceleration from the given units to m/s^2.

Converts the acceleration from the given units to m/s^2.

Converts the orientation from the given units to radians.

Converts the angle from the given units to radians.

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.

Returns the velocity converter for the specified unit type.

Returns the distance converter for the specified unit type.

Returns the orientation converter for the specified unit type.

Populates the converter collection.

Returns the factor for converting a distance to the given units.

Returns the factor for converting a velocity to the given units.

Returns the factor for converting an acceleration to the given units.

Returns the factor for converting an angle to the given units.

Returns the factor for converting a rotational velocity to the given units.

DtUnitConverterCollection& makVrv::DtUnitConverterCollection::operator= ( const DtUnitConverterCollection ) [private]

Not implemented.


Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)