Basic Image AlgorithmS Library
2.8.0
|
Base class with interface for xml output. More...
#include <Base/Common/XMLBase.hh>
Public Member Functions | |
xmlNodePtr | XMLAdd (const xmlNodePtr Node, XMLIO &XMLObject) const |
call this to add the class to a node of a given xml tree More... | |
virtual int | XMLGetClassName (std::string &TopLevelTag, double &Version) const =0 |
derived classes must implement this, so that it returns the name of the class for the top level tag in the XML file More... | |
virtual int | XMLIn (const xmlNodePtr Node, XMLIO &XMLObject)=0 |
derived classes must implement this to read everything in Node into (*this). More... | |
virtual int | XMLOut (const xmlNodePtr Node, XMLIO &XMLObject) const =0 |
derived classes must implement this to write the code of (*this) into the XML tree. More... | |
int | XMLRead (const std::string &Filename) |
derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this). More... | |
int | XMLReadFromString (const std::string &str) |
reconstruct xml tree from string More... | |
int | XMLWrite (const std::string &Filename, int CompressionLevel=0, bool AutoAddCompressionSuffix=true, std::string encoding="UTF-8") const |
call this to add the class to a new xml tree and write it to the file Filename. More... | |
int | XMLWriteToString (std::string &str, std::string encoding="UTF-8") const |
serialize xml tree to string More... | |
virtual | ~XMLBase () |
Base class with interface for xml output.
All classes with xml i/o support should be derived from this class. You can then call XMLWrite to write the object to an XML file or XMLAdd(n) to attach the object to a node n of a given xml structure. For this to work you must:
This class is empty if no XML2 support is available.
Definition at line 56 of file XMLBase.hh.
|
inlinevirtual |
Definition at line 59 of file XMLBase.hh.
xmlNodePtr XMLBase::XMLAdd | ( | const xmlNodePtr | Node, |
XMLIO & | XMLObject | ||
) | const |
call this to add the class to a node of a given xml tree
Definition at line 26 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), and BIAS::XMLIO::addChildNode().
|
pure virtual |
derived classes must implement this, so that it returns the name of the class for the top level tag in the XML file
Implemented in BIAS::ProjectionParametersBase, BIAS::ProjectionParametersPerspective, BIAS::ProjectionParametersDynamicLoad, BIAS::Projection, BIAS::PMatrix, BIAS::ProjectionParametersSpherical, BIAS::ProjectionParametersPerspectiveDepth, BIAS::ProjectionParametersSphericalFast, BIAS::ProjectionParametersProjective, BIAS::ProjectionParametersZoom, BIAS::LocalAffineFrame, BIAS::ProjectionParametersCylindric, BIAS::ProjectionParametersSphericalSimple, BIAS::Pose, BIAS::NodeInfoMap, BIAS::ProjectionParametersGreatCircles, BIAS::ProjectionParametersOrthographic, BIAS::ProjectionParametersBufferedRay, BIAS::NodeInfo, BIAS::SceneText, and BIAS::SceneTextScreen.
|
pure virtual |
derived classes must implement this to read everything in Node into (*this).
Called by XMLRead of XMLBase.
Implemented in BIAS::ProjectionParametersBase, BIAS::ProjectionParametersPerspective, BIAS::ProjectionParametersDynamicLoad, BIAS::Projection, BIAS::PMatrix, BIAS::ProjectionParametersSpherical, BIAS::ProjectionParametersPerspectiveDepth, BIAS::ProjectionParametersSphericalFast, BIAS::ProjectionParametersProjective, BIAS::ProjectionParametersZoom, BIAS::LocalAffineFrame, BIAS::ProjectionParametersCylindric, BIAS::ProjectionParametersSphericalSimple, BIAS::Pose, BIAS::NodeInfoMap, BIAS::ProjectionParametersGreatCircles, BIAS::ProjectionParametersOrthographic, BIAS::ProjectionParametersBufferedRay, BIAS::NodeInfo, BIAS::SceneText, and BIAS::SceneTextScreen.
|
pure virtual |
derived classes must implement this to write the code of (*this) into the XML tree.
Called by XMLRead of XMLBase.
node | always points to a node with a name given by the function XMLGetTopLevelName |
Implemented in BIAS::ProjectionParametersBase, BIAS::ProjectionParametersPerspective, BIAS::ProjectionParametersDynamicLoad, BIAS::Projection, BIAS::PMatrix, BIAS::ProjectionParametersSpherical, BIAS::ProjectionParametersPerspectiveDepth, BIAS::ProjectionParametersSphericalFast, BIAS::ProjectionParametersProjective, BIAS::ProjectionParametersZoom, BIAS::LocalAffineFrame, BIAS::ProjectionParametersCylindric, BIAS::NodeInfoMap, BIAS::ProjectionParametersSphericalSimple, BIAS::Pose, BIAS::ProjectionParametersGreatCircles, BIAS::ProjectionParametersOrthographic, BIAS::NodeInfo, BIAS::ProjectionParametersBufferedRay, BIAS::SceneText, and BIAS::SceneTextScreen.
int XMLBase::XMLRead | ( | const std::string & | Filename | ) |
derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this).
Definition at line 78 of file XMLBase.cpp.
References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::read().
Referenced by BIAS::biasGLviewerGLUT::Init(), BIAS::SceneOpenSceneGraph::Load(), and BIAS::GLProjectionParametersPerspective::XMLRead().
int XMLBase::XMLReadFromString | ( | const std::string & | str | ) |
reconstruct xml tree from string
Definition at line 111 of file XMLBase.cpp.
References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::ReadFromString().
Referenced by BIAS::IOUtils::GetProjection().
int XMLBase::XMLWrite | ( | const std::string & | Filename, |
int | CompressionLevel = 0 , |
||
bool | AutoAddCompressionSuffix = true , |
||
std::string | encoding = "UTF-8" |
||
) | const |
call this to add the class to a new xml tree and write it to the file Filename.
Calls function XMLOut of derived class
CompressionLevel | 0..9 (0=off, 9=highest compression) |
Definition at line 40 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetCompression(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::write().
Referenced by BIAS::SphericalDepthPanorama::GetTriangleMesh(), BIAS::SceneOpenSceneGraph::Save(), BIAS::ScreenShotListener::StoreNextScreenShot_(), and BIAS::GLProjectionParametersPerspective::XMLWrite().
int XMLBase::XMLWriteToString | ( | std::string & | str, |
std::string | encoding = "UTF-8" |
||
) | const |
serialize xml tree to string
Definition at line 61 of file XMLBase.cpp.
References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::WriteToString().