core/vgl/xio/vgl_xio_vector_3d.txx
Go to the documentation of this file.
00001 // This is core/vgl/xio/vgl_xio_vector_3d.txx
00002 #ifndef vgl_xio_vector_3d_txx_
00003 #define vgl_xio_vector_3d_txx_
00004 //:
00005 // \file
00006 
00007 #include "vgl_xio_vector_3d.h"
00008 #include <vgl/vgl_vector_3d.h>
00009 #include <vsl/vsl_basic_xml_element.h>
00010 
00011 //============================================================================
00012 //: XML save self to stream.
00013 template<class T>
00014 void x_write(vcl_ostream &os, const vgl_vector_3d<T> & v, vcl_string element_name)
00015 {   
00016    vsl_basic_xml_element xml_element(element_name);
00017    xml_element.add_attribute("x", v.x());
00018    xml_element.add_attribute("y", v.y());
00019    xml_element.add_attribute("z", v.z());
00020    xml_element.x_write(os);  
00021      
00022 }
00023 
00024 #define VGL_XIO_VECTOR_3D_INSTANTIATE(T) \
00025 template void x_write(vcl_ostream &, const vgl_vector_3d<T > &, vcl_string) 
00026 
00027 #endif // vgl_xio_vector_3d_txx_