mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Enabled coordinates for DBus
This commit is contained in:
@@ -20,8 +20,8 @@ template <class ImplVector> QString CVector3DBase<ImplVector>::stringForConverte
|
||||
{
|
||||
QString s = ("{%1, %2, %3}");
|
||||
s = s.arg(QString::number(this->m_i, 'f')).
|
||||
arg(QString::number(this->m_j, 'f')).
|
||||
arg(QString::number(this->m_k, 'f'));
|
||||
arg(QString::number(this->m_j, 'f')).
|
||||
arg(QString::number(this->m_k, 'f'));
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -131,6 +131,36 @@ template <class ImplVector> CMatrix3x1 CVector3DBase<ImplVector>::toMatrix3x1()
|
||||
return CMatrix3x1(this->m_i, this->m_j, this->m_k);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Stream to DBus
|
||||
* \param argument
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::marshallToDbus(QDBusArgument &argument) const {
|
||||
argument << this->m_i;
|
||||
argument << this->m_j;
|
||||
argument << this->m_k;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Stream from DBus
|
||||
* \param argument
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::unmarshallFromDbus(const QDBusArgument &argument) {
|
||||
argument >> this->m_i;
|
||||
argument >> this->m_j;
|
||||
argument >> this->m_k;
|
||||
}
|
||||
|
||||
/*
|
||||
* Register metadata
|
||||
*/
|
||||
template <class ImplVector> void CVector3DBase<ImplVector>::registerMetadata()
|
||||
{
|
||||
qRegisterMetaType<ImplVector>(typeid(ImplVector).name());
|
||||
qDBusRegisterMetaType<ImplVector>();
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
|
||||
template class CVector3DBase<CVector3D>;
|
||||
|
||||
Reference in New Issue
Block a user