Added iostream operators

This commit is contained in:
Robert Osfield 2005-04-07 21:28:57 +00:00
parent d006ce627f
commit f417974f5b

View File

@ -236,7 +236,12 @@ class Vec4d
return( norm ); return( norm );
} }
friend inline std::ostream& operator << (std::ostream& output, const Vec4d& vec) }; // end of class Vec4d
// streaming operators
inline std::ostream& operator << (std::ostream& output, const Vec4d& vec)
{ {
output << vec._v[0] << " " output << vec._v[0] << " "
<< vec._v[1] << " " << vec._v[1] << " "
@ -245,7 +250,11 @@ class Vec4d
return output; // to enable cascading return output; // to enable cascading
} }
}; // end of class Vec4d inline std::istream& operator >> (std::istream& input, Vec4d& vec)
{
input >> vec._v[0] >> vec._v[1] >> vec._v[2] >> vec._v[3];
return input;
}
/** Compute the dot product of a (Vec3,1.0) and a Vec4d. */ /** Compute the dot product of a (Vec3,1.0) and a Vec4d. */