mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
refs #403 workaround different extern template behaviour with MinGW
This commit is contained in:
@@ -17,7 +17,77 @@ namespace BlackMisc
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
template <class LATorLON> LATorLON CEarthAngle<LATorLON>::fromWgs84(const QString &wgsCoordinate)
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON> &CEarthAngle<LATorLON>::operator +=(const CEarthAngle &latOrLon)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator +=(latOrLon);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON> &CEarthAngle<LATorLON>::operator -=(const CEarthAngle &latOrLon)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator -=(latOrLon);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON> &CEarthAngle<LATorLON>::operator *=(double multiply)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator *=(multiply);
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
bool CEarthAngle<LATorLON>::operator >(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >(latOrLon);
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
bool CEarthAngle<LATorLON>::operator <(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >(latOrLon);
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
bool CEarthAngle<LATorLON>::operator <=(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator <=(latOrLon);
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
bool CEarthAngle<LATorLON>::operator >=(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >=(latOrLon);
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON CEarthAngle<LATorLON>::operator +(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l += latOrLon;
|
||||
return l;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON CEarthAngle<LATorLON>::operator -(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l -= latOrLon;
|
||||
return l;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON CEarthAngle<LATorLON>::operator *(double multiply) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l *= multiply;
|
||||
return l;
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON CEarthAngle<LATorLON>::fromWgs84(const QString &wgsCoordinate)
|
||||
{
|
||||
// http://www.regular-expressions.info/floatingpoint.html
|
||||
const QString wgs = wgsCoordinate.simplified().trimmed();
|
||||
@@ -65,7 +135,35 @@ namespace BlackMisc
|
||||
return LATorLON(a);
|
||||
}
|
||||
|
||||
template <class LATorLON> CIcon CEarthAngle<LATorLON>::toIcon() const
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle()
|
||||
: CEarthAngle::CValueObject(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg())
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit)
|
||||
: CEarthAngle::CValueObject(value, unit)
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
CEarthAngle<LATorLON>::CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle)
|
||||
: CEarthAngle::CValueObject(angle)
|
||||
{ }
|
||||
|
||||
template <class LATorLON>
|
||||
QString CEarthAngle<LATorLON>::convertToQString(bool i18n) const
|
||||
{
|
||||
return this->valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CAngleUnit::deg(), 6, i18n);
|
||||
}
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON const *CEarthAngle<LATorLON>::derived() const { return static_cast<LATorLON const *>(this); }
|
||||
|
||||
template <class LATorLON>
|
||||
LATorLON *CEarthAngle<LATorLON>::derived() { return static_cast<LATorLON *>(this); }
|
||||
|
||||
template <class LATorLON>
|
||||
CIcon CEarthAngle<LATorLON>::toIcon() const
|
||||
{
|
||||
return BlackMisc::CIconList::iconByIndex(CIcons::GeoPosition);
|
||||
}
|
||||
|
||||
@@ -37,73 +37,33 @@ namespace BlackMisc
|
||||
{
|
||||
public:
|
||||
//! Plus operator +=
|
||||
CEarthAngle &operator +=(const CEarthAngle &latOrLon)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator +=(latOrLon);
|
||||
return *this;
|
||||
}
|
||||
CEarthAngle &operator +=(const CEarthAngle &latOrLon);
|
||||
|
||||
//! Minus operator-=
|
||||
CEarthAngle &operator -=(const CEarthAngle &latOrLon)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator -=(latOrLon);
|
||||
return *this;
|
||||
}
|
||||
CEarthAngle &operator -=(const CEarthAngle &latOrLon);
|
||||
|
||||
//! Multiply operator *=
|
||||
CEarthAngle operator *=(double multiply)
|
||||
{
|
||||
this->PhysicalQuantities::CAngle::operator *=(multiply);
|
||||
return *this;
|
||||
}
|
||||
CEarthAngle &operator *=(double multiply);
|
||||
|
||||
//! Greater operator >
|
||||
bool operator >(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >(latOrLon);
|
||||
}
|
||||
|
||||
bool operator >(const CEarthAngle &latOrLon) const;
|
||||
//! Less operator <
|
||||
bool operator <(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >(latOrLon);
|
||||
}
|
||||
bool operator <(const CEarthAngle &latOrLon) const;
|
||||
|
||||
//! Less equal operator <=
|
||||
bool operator <=(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator <=(latOrLon);
|
||||
}
|
||||
bool operator <=(const CEarthAngle &latOrLon) const;
|
||||
|
||||
//! Greater equal operator >=
|
||||
bool operator >=(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
return this->PhysicalQuantities::CAngle::operator >=(latOrLon);
|
||||
}
|
||||
bool operator >=(const CEarthAngle &latOrLon) const;
|
||||
|
||||
//! Plus operator +
|
||||
LATorLON operator +(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l += latOrLon;
|
||||
return l;
|
||||
}
|
||||
LATorLON operator +(const CEarthAngle &latOrLon) const;
|
||||
|
||||
//! Minus operator -
|
||||
LATorLON operator -(const CEarthAngle &latOrLon) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l -= latOrLon;
|
||||
return l;
|
||||
}
|
||||
LATorLON operator -(const CEarthAngle &latOrLon) const;
|
||||
|
||||
//! Multiply operator *
|
||||
LATorLON operator *(double multiply) const
|
||||
{
|
||||
LATorLON l(*this);
|
||||
l *= multiply;
|
||||
return l;
|
||||
}
|
||||
LATorLON operator *(double multiply) const;
|
||||
|
||||
//! \copydoc CValueObject::toIcon
|
||||
CIcon toIcon() const override;
|
||||
@@ -117,30 +77,27 @@ namespace BlackMisc
|
||||
|
||||
protected:
|
||||
//! Default constructor
|
||||
CEarthAngle() : CEarthAngle::CValueObject(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg()) {}
|
||||
CEarthAngle();
|
||||
|
||||
//! Init by double value
|
||||
CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit) : CEarthAngle::CValueObject(value, unit) {}
|
||||
CEarthAngle(double value, const BlackMisc::PhysicalQuantities::CAngleUnit &unit);
|
||||
|
||||
//! Init by CAngle value
|
||||
CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle) : CEarthAngle::CValueObject(angle) {}
|
||||
CEarthAngle(const BlackMisc::PhysicalQuantities::CAngle &angle);
|
||||
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
virtual QString convertToQString(bool i18n = false) const override
|
||||
{
|
||||
return this->valueRoundedWithUnit(BlackMisc::PhysicalQuantities::CAngleUnit::deg(), 6, i18n);
|
||||
}
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
|
||||
private:
|
||||
//! Easy access to derived class (CRTP template parameter)
|
||||
LATorLON const *derived() const { return static_cast<LATorLON const *>(this); }
|
||||
LATorLON const *derived() const;
|
||||
|
||||
//! Easy access to derived class (CRTP template parameter)
|
||||
LATorLON *derived() { return static_cast<LATorLON *>(this); }
|
||||
LATorLON *derived();
|
||||
};
|
||||
|
||||
extern template class CEarthAngle<CLatitude>;
|
||||
extern template class CEarthAngle<CLongitude>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE CEarthAngle<CLatitude>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE CEarthAngle<CLongitude>;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ namespace BlackMisc
|
||||
CONTAINER &container();
|
||||
};
|
||||
|
||||
extern template class IGeoObjectList<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>;
|
||||
extern template class IGeoObjectList<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>;
|
||||
extern template class IGeoObjectList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>;
|
||||
extern template class IGeoObjectList<BlackMisc::Simulation::CSimulatedAircraft, BlackMisc::Simulation::CSimulatedAircraftList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectList<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectList<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectList<BlackMisc::Simulation::CSimulatedAircraft, BlackMisc::Simulation::CSimulatedAircraftList>;
|
||||
|
||||
//! List of objects with geo coordinates.
|
||||
template<class OBJ, class CONTAINER>
|
||||
@@ -92,10 +92,10 @@ namespace BlackMisc
|
||||
|
||||
};
|
||||
|
||||
extern template class IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>;
|
||||
extern template class IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>;
|
||||
extern template class IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>;
|
||||
extern template class IGeoObjectWithRelativePositionList<BlackMisc::Simulation::CSimulatedAircraft, BlackMisc::Simulation::CSimulatedAircraftList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAtcStation, BlackMisc::Aviation::CAtcStationList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAircraft, BlackMisc::Aviation::CAircraftList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectWithRelativePositionList<BlackMisc::Aviation::CAirport, BlackMisc::Aviation::CAirportList>;
|
||||
extern template class BLACKMISC_EXPORT_TEMPLATE IGeoObjectWithRelativePositionList<BlackMisc::Simulation::CSimulatedAircraft, BlackMisc::Simulation::CSimulatedAircraftList>;
|
||||
|
||||
} //namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user