From f4be038d4689c74547bb9e1da74d1098e91ef072 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 15 Apr 2005 20:59:24 +0000 Subject: [PATCH] Moved Plane and Quat << operators into the io_utils headers --- include/osg/Plane | 12 ------------ include/osg/Quat | 11 ----------- include/osg/io_utils | 24 ++++++++++++++++++++++++ src/osg/TexGen.cpp | 1 + src/osgPlugins/osg/TexGen.cpp | 1 + 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/include/osg/Plane b/include/osg/Plane index edd768548..053eae247 100644 --- a/include/osg/Plane +++ b/include/osg/Plane @@ -206,9 +206,6 @@ class OSG_EXPORT Plane calculateUpperLowerBBCorners(); } - friend inline std::ostream& operator << (std::ostream& output, const Plane& pl); - - protected: Vec4 _fv; @@ -220,15 +217,6 @@ class OSG_EXPORT Plane }; -inline std::ostream& operator << (std::ostream& output, const Plane& pl) -{ - output << pl._fv[0] << " " - << pl._fv[1] << " " - << pl._fv[2] << " " - << pl._fv[3]; - return output; // to enable cascading -} - } // end of namespace #endif diff --git a/include/osg/Quat b/include/osg/Quat index 42c0f8c66..67cccbdb1 100644 --- a/include/osg/Quat +++ b/include/osg/Quat @@ -383,22 +383,11 @@ class OSG_EXPORT Quat uuv *= 2.0f; return v + uv + uuv; } - - friend inline std::ostream& operator << (std::ostream& output, const Quat& vec); protected: }; // end of class prototype -inline std::ostream& operator << (std::ostream& output, const Quat& vec) -{ - output << vec._v[0] << " " - << vec._v[1] << " " - << vec._v[2] << " " - << vec._v[3]; - return output; // to enable cascading -} - } // end of namespace #endif diff --git a/include/osg/io_utils b/include/osg/io_utils index 1d0016693..a232e786f 100644 --- a/include/osg/io_utils +++ b/include/osg/io_utils @@ -21,6 +21,7 @@ #include #include #include +#include namespace osg { @@ -166,5 +167,28 @@ inline std::ostream& operator << (std::ostream& output, const UByte4& vec) } +////////////////////////////////////////////////////////////////////////// +// Quat steaming operators. +inline std::ostream& operator << (std::ostream& output, const Quat& vec) +{ + output << vec._v[0] << " " + << vec._v[1] << " " + << vec._v[2] << " " + << vec._v[3]; + return output; // to enable cascading +} + + +////////////////////////////////////////////////////////////////////////// +// Plane steaming operators. +inline std::ostream& operator << (std::ostream& output, const Plane& pl) +{ + output << pl[0] << " " + << pl[1] << " " + << pl[2] << " " + << pl[3]; + return output; // to enable cascading +} + } // end of namespace osg #endif diff --git a/src/osg/TexGen.cpp b/src/osg/TexGen.cpp index 58ba0c27a..abd31e299 100644 --- a/src/osg/TexGen.cpp +++ b/src/osg/TexGen.cpp @@ -12,6 +12,7 @@ */ #include #include +#include using namespace osg; diff --git a/src/osgPlugins/osg/TexGen.cpp b/src/osgPlugins/osg/TexGen.cpp index e37b557e2..d9447c1cf 100644 --- a/src/osgPlugins/osg/TexGen.cpp +++ b/src/osgPlugins/osg/TexGen.cpp @@ -3,6 +3,7 @@ #endif #include "osg/TexGen" +#include "osg/io_utils" #include "osgDB/Registry" #include "osgDB/Input"