Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Output Stream Methods: operator<<( ... ).

Output GMTL data types to an ostream. More...

Output Stream Operators

template<class DATA_TYPE, unsigned SIZE> std::ostream & operator<< (std::ostream &out, const VecBase< DATA_TYPE, SIZE > &v)
 Outputs a string representation of the given VecBase type to the given output stream. More...

template<class DATA_TYPE, typename ROTATION_ORDER> std::ostream & operator<< (std::ostream &out, const EulerAngle< DATA_TYPE, ROTATION_ORDER > &e)
 Outputs a string representation of the given EulerAngle type to the given output stream. More...

template<class DATA_TYPE, unsigned ROWS, unsigned COLS> std::ostream & operator<< (std::ostream &out, const Matrix< DATA_TYPE, ROWS, COLS > &m)
 Outputs a string representation of the given Matrix to the given output stream. More...

template<typename DATA_TYPE> std::ostream & operator<< (std::ostream &out, const Quat< DATA_TYPE > &q)
 Outputs a string representation of the given Matrix to the given output stream. More...

template<typename DATA_TYPE> std::ostream & operator<< (std::ostream &out, const Tri< DATA_TYPE > &t)
 Outputs a string representation of the given Tri to the given output stream. More...

template<typename DATA_TYPE> std::ostream & operator<< (std::ostream &out, const Plane< DATA_TYPE > &p)
 Outputs a string representation of the given Plane to the given output stream. More...

template<typename DATA_TYPE> std::ostream & operator<< (std::ostream &out, const Sphere< DATA_TYPE > &s)
 Outputs a string representation of the given Sphere to the given output stream. More...

template<typename DATA_TYPE> std::ostream & operator<< (std::ostream &out, const AABox< DATA_TYPE > &b)
 Outputs a string representation of the given AABox to the given output stream. More...


Detailed Description

Output GMTL data types to an ostream.

std::ostream& operator<< methods...


Function Documentation

template<typename DATA_TYPE>
std::ostream& operator<< std::ostream &    out,
const AABox< DATA_TYPE > &    b
 

Outputs a string representation of the given AABox to the given output stream.

The output is formatted such that AABox<int>( Point<int, 3>(1,2,3), Point<int, 3>(4,5,6) ) will appear as "(1,2,3) (4,5,6) false".

Parameters:
out  the stream to write to
b  the AABox to output
Returns:
out after it has been written to

Definition at line 228 of file Output.h.

00229    {
00230       out << b.mMin << " " << b.mMax << " ";
00231       out << (b.mEmpty ? "true" : "false");
00232       return out;
00233    }

template<typename DATA_TYPE>
std::ostream& operator<< std::ostream &    out,
const Sphere< DATA_TYPE > &    s
 

Outputs a string representation of the given Sphere to the given output stream.

The output is formatted such that Sphere<int>( Point<int, 3>(1,2,3), 4 ) will appear as "(1, 2, 3), 4)".

Parameters:
out  the stream to write to
s  the Sphere to output
Returns:
out after it has been written to

Definition at line 207 of file Output.h.

00208    {
00209       out << s.mCenter << ", " << s.mRadius;
00210       return out;
00211    }

template<typename DATA_TYPE>
std::ostream& operator<< std::ostream &    out,
const Plane< DATA_TYPE > &    p
 

Outputs a string representation of the given Plane to the given output stream.

The output is formatted such that Plane<int>( Vec<int, 3>(1,2,3), 4 ) will appear as "(1, 2, 3), 4)".

Parameters:
out  the stream to write to
p  the Plane to output
Returns:
out after it has been written to

Definition at line 186 of file Output.h.

00187    {
00188       out << p.mNorm << ", " << p.mOffset;
00189       return out;
00190    }

template<typename DATA_TYPE>
std::ostream& operator<< std::ostream &    out,
const Tri< DATA_TYPE > &    t
 

Outputs a string representation of the given Tri to the given output stream.

The output is formatted such that Tri<int>( Point<int, 3>(1,2,3), Point<int, 3>(4,5,6), Point<int, 3>(7,8,9) ) will appear as "(1, 2, 3), (4, 5, 6), (7, 8, 9)".

Parameters:
out  the stream to write to
t  the Tri to output
Returns:
out after it has been written to

Definition at line 165 of file Output.h.

00166    {
00167       out << t[0] << ", " << t[1] << ", " << t[2];
00168       return out;
00169    }

template<typename DATA_TYPE>
std::ostream& operator<< std::ostream &    out,
const Quat< DATA_TYPE > &    q
 

Outputs a string representation of the given Matrix to the given output stream.

The output is formatted such that Quat<int>(1,2,3,4) will appear as "(1, 2, 3, 4)".

Parameters:
out  the stream to write to
q  the Quat to output
Returns:
out after it has been written to

Definition at line 143 of file Output.h.

00144    {
00145       out << q.mData;
00146       return out;
00147    }

template<class DATA_TYPE, unsigned ROWS, unsigned COLS>
std::ostream& operator<< std::ostream &    out,
const Matrix< DATA_TYPE, ROWS, COLS > &    m
 

Outputs a string representation of the given Matrix to the given output stream.

The output is formatted along the lines of:

    | 1 2 3 4 |
    | 5 6 7 8 |
    | 9 10 11 12 |
 
Parameters:
out  the stream to write to
m  the Matrix to output
Returns:
out after it has been written to

Definition at line 117 of file Output.h.

00119    {
00120       for ( unsigned row=0; row<ROWS; ++row )
00121       {
00122          out << "|";
00123          for ( unsigned col=0; col<COLS; ++col )
00124          {
00125             out << " " << m(row, col);
00126          }
00127          out << " |" << std::endl;
00128       }
00129       return out;
00130    }

template<class DATA_TYPE, typename ROTATION_ORDER>
std::ostream& operator<< std::ostream &    out,
const EulerAngle< DATA_TYPE, ROTATION_ORDER > &    e
 

Outputs a string representation of the given EulerAngle type to the given output stream.

Format is {ang1,ang2,ang3}

Parameters:
out  the stream to write to
e  the EulerAngle type to output
Returns:
out after it has been written to

Definition at line 93 of file Output.h.

00095    {
00096       const DATA_TYPE* angle_data(e.getData());
00097       out << "{" << angle_data[0] << ", " << angle_data[1] << ", " << angle_data[2] << "}";
00098       return out;
00099    }

template<class DATA_TYPE, unsigned SIZE>
std::ostream& operator<< std::ostream &    out,
const VecBase< DATA_TYPE, SIZE > &    v
 

Outputs a string representation of the given VecBase type to the given output stream.

This works for both Point and Vec types. The output is formatted such that Vec<int, 4>(1,2,3,4) will appear as "(1, 2, 3, 4)".

Parameters:
out  the stream to write to
v  the VecBase type to output
Returns:
out after it has been written to

Definition at line 67 of file Output.h.

00069    {
00070       out << "(";
00071       for ( unsigned i=0; i<SIZE; ++i )
00072       {
00073          if ( i != 0 )
00074          {
00075             out << ", ";
00076          }
00077          out << v[i];
00078       }
00079       out << ")";
00080       return out;
00081    }


Generated on Mon Apr 7 15:29:25 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002