libigl v2.5.0
Loading...
Searching...
No Matches
igl::xml Namespace Reference

Namespaces

namespace  serialization_xml
 

Classes

class  XMLSerializable
 
struct  XMLSerializableBase
 

Functions

template<typename T >
void serialize_xml (const T &obj, const std::string &objectName, const std::string &filename, bool binary=false, bool overwrite=false)
 Serialize object to file.
 
template<typename T >
void serialize_xml (const T &obj, const std::string &filename)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void serialize_xml (const T &obj, const std::string &objectName, tinyxml2::XMLDocument *doc, tinyxml2::XMLElement *element, bool binary=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
void deserialize_xml (T &obj, const std::string &objectName, const std::string &filename)
 deserialize object to file
 
template<typename T >
void deserialize_xml (T &obj, const std::string &filename)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/xml/serialize_xml.h.
 
template<typename T >
void deserialize_xml (T &obj, const std::string &objectName, const tinyxml2::XMLDocument *doc, const tinyxml2::XMLElement *element)
 Deserialize to xml doc.
 
template<typename DerivedV , typename DerivedF >
bool write_triangle_mesh (const std::string str, const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F, const FileEncoding fe=FileEncoding::Ascii)
 write mesh to a file with automatic detection of file format.
 
template<typename DerivedV , typename DerivedF >
bool writeDAE (const std::string &filename, const Eigen::PlainObjectBase< DerivedV > &V, const Eigen::PlainObjectBase< DerivedF > &F)
 Write a mesh to a Collada .dae scene file.
 

Function Documentation

◆ serialize_xml() [1/3]

template<typename T >
void igl::xml::serialize_xml ( const T &  obj,
const std::string &  objectName,
const std::string &  filename,
bool  binary = false,
bool  overwrite = false 
)

Serialize object to file.

Template Parameters
Ttype of the object to serialize
Parameters
[in]objobject to serialize
[in]filenamename of the file containing the serialization Serialize object to file
Template Parameters
Ttype of the object to serialize
Parameters
[in]objobject to serialize
[in]objectNameunique object name,used for the identification
[in]filenamename of the file containing the serialization
[in]binaryset to true to serialize the object in binary format (faster for big data)
[in]overwriteset to true to overwrite an existing xml file

◆ serialize_xml() [2/3]

template<typename T >
void igl::xml::serialize_xml ( const T &  obj,
const std::string &  filename 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ serialize_xml() [3/3]

template<typename T >
void igl::xml::serialize_xml ( const T &  obj,
const std::string &  objectName,
tinyxml2::XMLDocument *  doc,
tinyxml2::XMLElement *  element,
bool  binary = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[in,out]doccontains current tinyxml2 virtual representation of the xml data
[in,out]elementtinyxml2 virtual representation of the current xml node

◆ deserialize_xml() [1/3]

template<typename T >
void igl::xml::deserialize_xml ( T &  obj,
const std::string &  objectName,
const std::string &  filename 
)

deserialize object to file

Template Parameters
Ttype of the object to serialize
Parameters
[in]objobject to serialize
[in]objectNameunique object name,used for the identification
[in]filenamename of the file containing the serialization
[in]binaryset to true to serialize the object in binary format (faster for big data)
[in]overwriteset to true to overwrite an existing xml file

include/igl/xml/serialize_xml.h

◆ deserialize_xml() [2/3]

template<typename T >
void igl::xml::deserialize_xml ( T &  obj,
const std::string &  filename 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.include/igl/xml/serialize_xml.h.

◆ deserialize_xml() [3/3]

template<typename T >
void igl::xml::deserialize_xml ( T &  obj,
const std::string &  objectName,
const tinyxml2::XMLDocument *  doc,
const tinyxml2::XMLElement *  element 
)

Deserialize to xml doc.

Parameters
[in,out]doccontains current tinyxml2 virtual representation of the xml data
[in,out]elementtinyxml2 virtual representation of the current xml node

include/igl/xml/serialize_xml.h

◆ write_triangle_mesh()

template<typename DerivedV , typename DerivedF >
bool igl::xml::write_triangle_mesh ( const std::string  str,
const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F,
const FileEncoding  fe = FileEncoding::Ascii 
)

write mesh to a file with automatic detection of file format.

supported: dae, or any of the formats supported by igl::write_triangle_mesh

Template Parameters
Scalartype for positions and vectors (will be read as double and cast to Scalar)
Indextype for indices (will be read as int and cast to Index)
Parameters
[in]strpath to file
[in]Veigen double matrix #V by 3
[in]Feigen int matrix #F by 3
Returns
true iff success

◆ writeDAE()

template<typename DerivedV , typename DerivedF >
bool igl::xml::writeDAE ( const std::string &  filename,
const Eigen::PlainObjectBase< DerivedV > &  V,
const Eigen::PlainObjectBase< DerivedF > &  F 
)

Write a mesh to a Collada .dae scene file.

The resulting scene contains a single "geometry" suitable for solid operaions (boolean union, intersection, etc.) in SketchUp.

Parameters
[in]filenamepath to .dae file
[in]V#V by 3 list of vertex positions
[in]F#F by 3 list of face indices
Returns
true iff success