diff --git a/common/mathlib.cc b/common/mathlib.cc index afcac9b6..92bb250b 100644 --- a/common/mathlib.cc +++ b/common/mathlib.cc @@ -26,8 +26,6 @@ #include #include -#include -#include using namespace polylib; diff --git a/common/qvec.cc b/common/qvec.cc index a5ce66e7..a9317af6 100644 --- a/common/qvec.cc +++ b/common/qvec.cc @@ -19,6 +19,8 @@ #include +#include + /* * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. @@ -136,3 +138,10 @@ qmat2x2f qv::invert(const qmat2x2f &m, bool *ok) return result * (1.0f/det); } + +std::string qv::to_string(const qvec<3,float> &v1) +{ + std::stringstream ss; + ss << v1[0] << " " << v1[1] << " " << v1[2]; + return ss.str(); +} diff --git a/include/common/qvec.hh b/include/common/qvec.hh index 30e75613..5003a112 100644 --- a/include/common/qvec.hh +++ b/include/common/qvec.hh @@ -23,6 +23,7 @@ #include #include #include +#include #ifndef qmax // FIXME: Remove this ifdef #define qmax(a,b) (((a)>(b)) ? (a) : (b)) @@ -205,6 +206,8 @@ namespace qv { T distance(const qvec &v1, const qvec &v2) { return length(v2 - v1); } + + std::string to_string(const qvec<3,float> &v1); };