VR-Forces 4.8 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. More...
 
 DtUnitConverterCollection (const DtUnitConverterCollection &)
 Copy CTOR. More...
 
 ~DtUnitConverterCollection ()
 DTOR. More...
 
void addUnitConverter (DisplayUnitType type, unsigned int unit, const DtUnitConverter *converter)
 Adds the converter to the unit converter dictionary. More...
 
Conversion Methods
double convertDistance (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits distUnits, double distance) const
 Converts the distance to the given units from meters. More...
 
double convertSpeed (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits speedUnits, double speed) const
 Converts the speed to the given units from m/s. More...
 
DtVector convertVelocity (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, const DtVector &velocity) const
 Converts the speed to the given units from m/s. More...
 
double convertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, double accel) const
 Converts the acceleration to the given units from m/s^2. More...
 
DtVector convertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, const DtVector &accel) const
 Converts the acceleration to the given units from m/s^2. More...
 
DtTaitBryan convertOrientation (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, const DtTaitBryan &orientation) const
 Converts the orientation to the given units from radians. More...
 
double convertAngle (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, double angle) const
 Converts the angle to the given units from radians. More...
 
DtVector convertRotationalVelocity (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits wUnits, const DtVector &rotVel) const
 Converts the rotational velocity to the given units from rad/s. More...
 
Revert Methods
double revertDistance (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits distUnits, double distance) const
 Converts the distance from the given units to meters. More...
 
double revertSpeed (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, double speed) const
 Converts the speed to the given units from m/s. More...
 
DtVector revertVelocity (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits velUnits, const DtVector &velocity) const
 Converts the speed to the given units from m/s. More...
 
DtVector revertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, const DtVector &accel) const
 Converts the acceleration from the given units to m/s^2. More...
 
double revertAcceleration (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits accelUnits, double accel) const
 Converts the acceleration from the given units to m/s^2. More...
 
DtTaitBryan revertOrientation (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, const DtTaitBryan &ori) const
 Converts the orientation from the given units to radians. More...
 
double revertAngle (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits oriUnits, double angle) const
 Converts the angle from the given units to radians. More...
 
DtVector revertRotationalVelocity (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits wUnits, const DtVector &rotVel) const
 Converts the rotational velocity from the given units to rad/s. More...
 
Unit Converter Accessors
const DtTimeUnitConvertertimeConverterFor (makArchives::DtDisplayUnitsSettingsRecord::TimeUnits unit) const
 Returns the velocity converter for the specified unit type. More...
 
const DtDistanceUnitConverterdistanceConverterFor (makArchives::DtDisplayUnitsSettingsRecord::DistanceUnits unit) const
 Returns the distance converter for the specified unit type. More...
 
const DtOrientationUnitConverterorientationConverterFor (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits unit) const
 Returns the orientation converter for the specified unit type. More...
 

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. More...
 
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. More...
 
double velocityConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::VelocityUnits units) const
 Returns the factor for converting a velocity to the given units. More...
 
double accelerationConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::AccelerationUnits units) const
 Returns the factor for converting an acceleration to the given units. More...
 
double angleConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::OrientationUnits units) const
 Returns the factor for converting an angle to the given units. More...
 
double rotationalVelocityConversionFactor (makArchives::DtDisplayUnitsSettingsRecord::RotVelocityUnits units) const
 Returns the factor for converting a rotational velocity to the given units. More...
 

Protected Attributes

UnitConverterTypeMap myConverters
 

Private Member Functions

DtUnitConverterCollectionoperator= (const DtUnitConverterCollection &)
 Not implemented. More...
 

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 Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)