XmlParserRectOriented¶
- class XmlParserRectOriented(self)¶
Bases:
pybind11_object
XML parser to load and save an oriented rectangle in a file.
The following example shows how to save an oriented rectangle in an xml file:
#include <visp3/core/vpRectOriented.h> #include <visp3/core/vpXmlParserRectOriented.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpRectOriented rect(vpImagePoint(10, 15), 20, 12, 0.25); vpXmlParserRectOriented parser; parser.setRectangle(rect); std::string filename = "myRectangle.xml"; parser.save(filename); return 0; }
The following example shows how to read an oriented rectangle from an xml file:
#include <visp3/core/vpRectOriented.h> #include <visp3/core/vpXmlParserRectOriented.h> #ifdef ENABLE_VISP_NAMESPACE using namespace VISP_NAMESPACE_NAME; #endif int main() { vpXmlParserRectOriented parser; std::string filename = "myRectangle.xml"; parser.parse(filename); vpRectOriented rect = parser.getRectangle(); return 0; }
Warning
This class is only available if pugixml third-party is successfully built.
Methods
Parse the document.
Save the content of the class in the file given in parameters.
Inherited Methods
Operators
__doc__
__module__
Attributes
SEQUENCE_ERROR
SEQUENCE_OK
__annotations__
- class XmlCodeSequenceType(self, value: int)¶
Bases:
pybind11_object
Values:
SEQUENCE_OK
SEQUENCE_ERROR
- __init__(self)¶
- getRectangle(self) visp._visp.core.RectOriented ¶
- parse(self, filename: str) None ¶
Parse the document. The data in the file are stored in the attributes of the child class. This method calls the readMainClass method which has to be implemented for every child class depending on the content to parse.
- save(self, filename: str, append: bool = false) None ¶
Save the content of the class in the file given in parameters. The data of the class are in the child class. This method calls the write_main_class method which has to be implemented for every class depending on the data to save.
- setRectangle(self, rectangle: visp._visp.core.RectOriented) None ¶