core/vnl/xio/vnl_xio_quaternion.h
Go to the documentation of this file.
00001 // This is core/vnl/xio/vnl_xio_quaternion.h
00002 #ifndef vnl_xio_quaternion_h
00003 #define vnl_xio_quaternion_h
00004 //:
00005 // \file
00006 // \brief XML write a vnl_quaternion
00007 //  Two functions which write a valid XML fragment to an ostream.
00008 // - x_write() writes a single XML element node without content,
00009 //   but with the four values as attributes.
00010 // - x_write_tree() writes a 2-level XML fragment: one top element node,
00011 //                  and one level below it for the four elements
00012 //                  (element nodes x, y, z, and r with a single value each).
00013 //  The name of the top node can be chosen; by default, it is "vnl_quaternion".
00014 // \author Gamze D. Tunali
00015 // \date 22-Dec-2005
00016 // \verbatim
00017 //  Modifications
00018 //   29 July 2011 - Peter Vanroose - added documentation, tests, and x_write_tree()
00019 // \endverbatim
00020 
00021 #include <vnl/vnl_quaternion.h>
00022 #include <vcl_string.h>
00023 #include <vcl_iosfwd.h>
00024 
00025 //: XML save vnl_quaternion to stream.
00026 // \relatesalso vnl_quaternion
00027 template <class T>
00028 void x_write(vcl_ostream & os, vnl_quaternion<T> const& v,
00029              vcl_string name="vnl_quaternion");
00030 
00031 //: XML save vnl_quaternion as a 2-level tree to stream.
00032 // \relatesalso vnl_quaternion
00033 template <class T>
00034 void x_write_tree(vcl_ostream & os, vnl_quaternion<T> const& v,
00035                   vcl_string name="vnl_quaternion");
00036 
00037 #define VNL_XIO_QUATERNION_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_quaternion.txx> first"
00038 
00039 #endif // vnl_xio_quaternion_h