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>
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>
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

__init__

getRectangle

parse

Parse the document.

save

Save the content of the class in the file given in parameters.

setRectangle

Inherited Methods

Operators

__doc__

__init__

__module__

Attributes

SEQUENCE_ERROR

SEQUENCE_OK

__annotations__

class XmlCodeSequenceType(self, value: int)

Bases: pybind11_object

Values:

  • SEQUENCE_OK

  • SEQUENCE_ERROR

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
__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.

Parameters:
filename: str

name of the file 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.

Parameters:
filename: str

the name of the file used to record the data

append: bool = false

if true and if the file exists, the data will be added to the data already in the file

setRectangle(self, rectangle: visp._visp.core.RectOriented) None