VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | 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...

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

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

makVrv::DtUnitConverterCollection::DtUnitConverterCollection ( )

CTOR.

makVrv::DtUnitConverterCollection::DtUnitConverterCollection ( const DtUnitConverterCollection )

Copy CTOR.

makVrv::DtUnitConverterCollection::~DtUnitConverterCollection ( )

DTOR.

Member Function Documentation

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.

void makVrv::DtUnitConverterCollection::addDefaultConverters ( )
protected

Populates the converter collection.

double makVrv::DtUnitConverterCollection::distanceConversionFactor ( makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits  units) const
protected

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

double makVrv::DtUnitConverterCollection::velocityConversionFactor ( makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits  units) const
protected

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

double makVrv::DtUnitConverterCollection::accelerationConversionFactor ( makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits  units) const
protected

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

double makVrv::DtUnitConverterCollection::angleConversionFactor ( makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits  units) const
protected

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

double makVrv::DtUnitConverterCollection::rotationalVelocityConversionFactor ( makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits  units) const
protected

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

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

Not implemented.

Member Data Documentation

UnitConverterTypeMap makVrv::DtUnitConverterCollection::myConverters
protected

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

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)