diff -r 1e2391b78d17 -r c6d5ba08c62c src/types/vertex.cpp --- a/src/types/vertex.cpp Mon Apr 02 10:33:17 2018 +0300 +++ b/src/types/vertex.cpp Mon Apr 02 10:59:38 2018 +0300 @@ -191,11 +191,26 @@ }; } +/* + * Returns the distance from one vertex to another. + */ +qreal distance(const Vertex& one, const Vertex& other) +{ + return (one - other).length(); +} + +/* + * Inserts this vertex into a data stream. This is needed for vertices to be + * stored in QSettings. + */ QDataStream& operator<<(QDataStream& out, const Vertex& vertex) { return out << vertex.x << vertex.y << vertex.z; } +/* + * Takes a vertex from a data stream. + */ QDataStream& operator>>(QDataStream& in, Vertex& vertex) { return in >> vertex.x >> vertex.y >> vertex.z;