Added iostream operators
This commit is contained in:
parent
d006ce627f
commit
f417974f5b
@ -236,18 +236,27 @@ class Vec4d
|
||||
return( norm );
|
||||
}
|
||||
|
||||
friend inline std::ostream& operator << (std::ostream& output, const Vec4d& vec)
|
||||
{
|
||||
output << vec._v[0] << " "
|
||||
<< vec._v[1] << " "
|
||||
<< vec._v[2] << " "
|
||||
<< vec._v[3];
|
||||
return output; // to enable cascading
|
||||
}
|
||||
|
||||
}; // end of class Vec4d
|
||||
|
||||
|
||||
// streaming operators
|
||||
|
||||
inline std::ostream& operator << (std::ostream& output, const Vec4d& vec)
|
||||
{
|
||||
output << vec._v[0] << " "
|
||||
<< vec._v[1] << " "
|
||||
<< vec._v[2] << " "
|
||||
<< vec._v[3];
|
||||
return output; // to enable cascading
|
||||
}
|
||||
|
||||
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. */
|
||||
inline Vec4d::value_type operator * (const Vec3d& lhs,const Vec4d& rhs)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user