From 8bf4a98a913bb2b0c6d16e96fe003b8fd598cbed Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 16 Apr 2005 17:44:11 +0000 Subject: [PATCH] From Marco Jez, added operator >> for Plane and Quat to io_utils, and added OSG_EXPORT to PerContextProgram. --- include/osg/Program | 2 +- include/osg/io_utils | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/osg/Program b/include/osg/Program index 24e5f3934..71cc35199 100644 --- a/include/osg/Program +++ b/include/osg/Program @@ -373,7 +373,7 @@ class OSG_EXPORT Program : public osg::StateAttribute friend class PerContextProgram; /** PerContextProgram (PCP) is an OSG-internal encapsulation of glPrograms per-GL context. */ - class PerContextProgram : public osg::Referenced + class OSG_EXPORT PerContextProgram : public osg::Referenced { public: diff --git a/include/osg/io_utils b/include/osg/io_utils index a232e786f..16209fbf9 100644 --- a/include/osg/io_utils +++ b/include/osg/io_utils @@ -166,6 +166,12 @@ inline std::ostream& operator << (std::ostream& output, const UByte4& vec) return output; // to enable cascading } +inline std::istream& operator >> (std::istream& input, UByte4& vec) +{ + input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3]; + return input; +} + ////////////////////////////////////////////////////////////////////////// // Quat steaming operators. @@ -178,6 +184,13 @@ inline std::ostream& operator << (std::ostream& output, const Quat& vec) return output; // to enable cascading } +inline std::istream& operator >> (std::istream& input, Quat& vec) +{ + input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3]; + return input; +} + + ////////////////////////////////////////////////////////////////////////// // Plane steaming operators. @@ -190,5 +203,11 @@ inline std::ostream& operator << (std::ostream& output, const Plane& pl) return output; // to enable cascading } +inline std::istream& operator >> (std::istream& input, Plane& vec) +{ + input >> vec[0] >> vec[1] >> vec[2] >> vec[3]; + return input; +} + } // end of namespace osg #endif