vnl_xio_quaternion.h
Go to the documentation of this file.
1 // This is core/vnl/xio/vnl_xio_quaternion.h
2 #ifndef vnl_xio_quaternion_h
3 #define vnl_xio_quaternion_h
4 //:
5 // \file
6 // \brief XML write a vnl_quaternion
7 // Two functions which write a valid XML fragment to an ostream.
8 // - x_write() writes a single XML element node without content,
9 // but with the four values as attributes.
10 // - x_write_tree() writes a 2-level XML fragment: one top element node,
11 // and one level below it for the four elements
12 // (element nodes x, y, z, and r with a single value each).
13 // The name of the top node can be chosen; by default, it is "vnl_quaternion".
14 // \author Gamze D. Tunali
15 // \date 22-Dec-2005
16 // \verbatim
17 // Modifications
18 // 29 July 2011 - Peter Vanroose - added documentation, tests, and x_write_tree()
19 // \endverbatim
20 
21 #include <string>
22 #include <iosfwd>
23 #include <vnl/vnl_quaternion.h>
24 #ifdef _MSC_VER
25 # include <vcl_msvc_warnings.h>
26 #endif
27 
28 //: XML save vnl_quaternion to stream.
29 // \relatesalso vnl_quaternion
30 template <class T>
31 void x_write(std::ostream & os, vnl_quaternion<T> const& v,
32  std::string name="vnl_quaternion");
33 
34 //: XML save vnl_quaternion as a 2-level tree to stream.
35 // \relatesalso vnl_quaternion
36 template <class T>
37 void x_write_tree(std::ostream & os, vnl_quaternion<T> const& v,
38  std::string name="vnl_quaternion");
39 
40 #define VNL_XIO_QUATERNION_INSTANTIATE(T) extern "Please #include <vnl/xio/vnl_xio_quaternion.hxx> first"
41 
42 #endif // vnl_xio_quaternion_h
4-element vector that represents rotation in 3D.
Definition: vnl_fwd.h:29
void VNL_EXPORT x_write_tree(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix as a 3-level tree to stream.
#define v
Definition: vnl_vector.h:42
Unit quaternion represents rotation in 3D.
void VNL_EXPORT x_write(std::ostream &os, vnl_matrix< T > const &v, std::string name="vnl_matrix")
XML save vnl_matrix to stream.