MCPcopy Create free account
hub / github.com/comaps/comaps / To

Method To

libs/platform/distance.cpp:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105Distance Distance::To(Units units) const
106{
107 if (m_units == units)
108 return *this;
109
110 /// @todo These double switches can be replaced with 4x4 factors matrix.
111 switch (m_units)
112 {
113 case Units::Meters: return MetersTo(m_distance, units);
114 case Units::Kilometers: return KilometersTo(m_distance, units);
115 case Units::Feet: return FeetTo(m_distance, units);
116 case Units::Miles: return MilesTo(m_distance, units);
117 default: UNREACHABLE();
118 }
119}
120
121Distance Distance::ToPlatformUnitsFormatted() const
122{

Callers 3

FormatAltitudeMethod · 0.45
GetFormattedDistanceMethod · 0.45
UNIT_TESTFunction · 0.45

Calls 4

MetersToFunction · 0.85
KilometersToFunction · 0.85
FeetToFunction · 0.85
MilesToFunction · 0.85

Tested by 1

UNIT_TESTFunction · 0.36