mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #345 Removed nonsense code (copy-paste mistake).
This commit is contained in:
@@ -216,36 +216,6 @@ namespace BlackMisc
|
||||
this->m_i = jsonArray.at(2).toDouble();
|
||||
}
|
||||
|
||||
/*
|
||||
* To JSON
|
||||
*/
|
||||
template <class ImplMatrix, int Rows, int Columns> QJsonObject CMatrixBase<ImplMatrix, Rows, Columns>::toJson() const
|
||||
{
|
||||
QJsonObject json;
|
||||
QJsonArray jsonArray;
|
||||
foreach(double v, this->toList())
|
||||
{
|
||||
jsonArray.append(QJsonValue(v));
|
||||
}
|
||||
json.insert("matrix", QJsonValue(jsonArray));
|
||||
return json;
|
||||
}
|
||||
|
||||
/*
|
||||
* From Json
|
||||
*/
|
||||
template <class ImplMatrix, int Rows, int Columns> void CMatrixBase<ImplMatrix, Rows, Columns>::convertFromJson(const QJsonObject &json)
|
||||
{
|
||||
QJsonArray jsonArray = json.value("matrix").toArray();
|
||||
QList<double> list;
|
||||
for (auto i = jsonArray.begin(); i != jsonArray.end(); ++i)
|
||||
{
|
||||
list.append((*i).toDouble());
|
||||
}
|
||||
this->fromList(list);
|
||||
}
|
||||
|
||||
|
||||
// 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