/home/hauberg/Dokumenter/Capture/humim-tracker-0.1/src/OpenTissue/OpenTissue/core/containers/t4mesh/io/t4mesh_xml_write.h

XML Document creation routine. Useful lower­level routine for when you want to keep a reference to the created doc.

Parameters:
doc Reference to XML doc to be written.
mesh Mesh to be serialized.
points Node coordinates will be read from this container.
Returns:
If succesfully written to the specified file then the return value is true otherwise it is false.
 template<typename skin_type>
 void skin_xml_embed_extra(skin_type const & skin, TiXmlDocument & doc)
 {
   // iterate over 'POINT' nodes and add normals
   TiXmlElement * point = TiXmlHandle(&doc).FirstChild("T4MESH").FirstChild("POINT").Element();
   for( int i = 0; point; point=point->NextSiblingElement("POINT"), ++i )
   {
     skin_type::const_node_iterator n = skin.const_node(i);
 
     std::stringstream normal;
     normal << n->m_original_normal;
 
     point->SetAttribute("normal", normal.str());
   }
 }
 
 // write the tetrahedral mesh
 mesh_type skin;
 TiXmlDocument doc;
 t4mesh::xml_make_doc(doc, skin, default_point_container<mesh_type>(&skin));
 skin_xml_embed_extra(skin, doc);
 doc.SaveFile("skin.xml");