mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
committed by
Mathew Sutcliffe
parent
229d7c6068
commit
978f3c88e5
@@ -9,113 +9,113 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief Earth centered, earth fixed position
|
||||
*/
|
||||
class CCoordinateEcef : public BlackMisc::Math::CVector3DBase<CCoordinateEcef>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CCoordinateEcef() : CVector3DBase() {}
|
||||
|
||||
/*!
|
||||
* \brief Constructor by values
|
||||
* \param x
|
||||
* \param y
|
||||
* \param z
|
||||
*/
|
||||
CCoordinateEcef(double x, double y, double z) : CVector3DBase(x, y, z) {}
|
||||
|
||||
/*!
|
||||
* \brief Constructor by math vector
|
||||
* \param vector
|
||||
*/
|
||||
explicit CCoordinateEcef(const BlackMisc::Math::CVector3D vector) : CVector3DBase(vector.i(), vector.j(), vector.k()) {}
|
||||
|
||||
/*!
|
||||
* \brief x
|
||||
* \return
|
||||
*/
|
||||
double x() const
|
||||
namespace Geo
|
||||
{
|
||||
return this->m_i;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief y
|
||||
* \return
|
||||
*/
|
||||
double y() const
|
||||
{
|
||||
return this->m_j;
|
||||
}
|
||||
/*!
|
||||
* \brief Earth centered, earth fixed position
|
||||
*/
|
||||
class CCoordinateEcef : public BlackMisc::Math::CVector3DBase<CCoordinateEcef>
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CCoordinateEcef() : CVector3DBase() {}
|
||||
|
||||
/*!
|
||||
* \brief z
|
||||
* \return
|
||||
*/
|
||||
double z() const
|
||||
{
|
||||
return this->m_k;
|
||||
}
|
||||
/*!
|
||||
* \brief Constructor by values
|
||||
* \param x
|
||||
* \param y
|
||||
* \param z
|
||||
*/
|
||||
CCoordinateEcef(double x, double y, double z) : CVector3DBase(x, y, z) {}
|
||||
|
||||
/*!
|
||||
* \brief Set x
|
||||
* \param x
|
||||
*/
|
||||
void setX(double x)
|
||||
{
|
||||
this->m_i = x;
|
||||
}
|
||||
/*!
|
||||
* \brief Constructor by math vector
|
||||
* \param vector
|
||||
*/
|
||||
explicit CCoordinateEcef(const BlackMisc::Math::CVector3D vector) : CVector3DBase(vector.i(), vector.j(), vector.k()) {}
|
||||
|
||||
/*!
|
||||
* \brief Set y
|
||||
* \param y
|
||||
*/
|
||||
void setY(double y)
|
||||
{
|
||||
this->m_j = y;
|
||||
}
|
||||
/*!
|
||||
* \brief x
|
||||
* \return
|
||||
*/
|
||||
double x() const
|
||||
{
|
||||
return this->m_i;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set z
|
||||
* \param z
|
||||
*/
|
||||
void setZ(double z)
|
||||
{
|
||||
this->m_k = z;
|
||||
}
|
||||
/*!
|
||||
* \brief y
|
||||
* \return
|
||||
*/
|
||||
double y() const
|
||||
{
|
||||
return this->m_j;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Concrete implementation of a 3D vector
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Math::CVector3D toMathVector() const
|
||||
{
|
||||
return BlackMisc::Math::CVector3D(this->x(), this->y(), this->z());
|
||||
}
|
||||
/*!
|
||||
* \brief z
|
||||
* \return
|
||||
*/
|
||||
double z() const
|
||||
{
|
||||
return this->m_k;
|
||||
}
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* \brief String for converter
|
||||
* \return
|
||||
*/
|
||||
virtual QString convertToQString() const
|
||||
{
|
||||
QString s = "ECEF: {x %1, y %2, z %3}";
|
||||
s = s.arg(QString::number(this->x(), 'f', 6)).
|
||||
arg(QString::number(this->y(), 'f', 6)).
|
||||
arg(QString::number(this->z(), 'f', 6));
|
||||
return s;
|
||||
}
|
||||
};
|
||||
/*!
|
||||
* \brief Set x
|
||||
* \param x
|
||||
*/
|
||||
void setX(double x)
|
||||
{
|
||||
this->m_i = x;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
/*!
|
||||
* \brief Set y
|
||||
* \param y
|
||||
*/
|
||||
void setY(double y)
|
||||
{
|
||||
this->m_j = y;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Set z
|
||||
* \param z
|
||||
*/
|
||||
void setZ(double z)
|
||||
{
|
||||
this->m_k = z;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Concrete implementation of a 3D vector
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Math::CVector3D toMathVector() const
|
||||
{
|
||||
return BlackMisc::Math::CVector3D(this->x(), this->y(), this->z());
|
||||
}
|
||||
|
||||
protected:
|
||||
/*!
|
||||
* \brief String for converter
|
||||
* \return
|
||||
*/
|
||||
virtual QString convertToQString() const
|
||||
{
|
||||
QString s = "ECEF: {x %1, y %2, z %3}";
|
||||
s = s.arg(QString::number(this->x(), 'f', 6)).
|
||||
arg(QString::number(this->y(), 'f', 6)).
|
||||
arg(QString::number(this->z(), 'f', 6));
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::Geo::CCoordinateEcef)
|
||||
|
||||
Reference in New Issue
Block a user