RobWorkProject  24.5.15-
Classes | Public Types | Static Public Member Functions | List of all members
XMLBasisTypes Class Reference

Utility class to help read in the content of a XML-files parsed with Xerces. More...

#include <XMLBasisTypes.hpp>

Classes

class  Initializer
 Utility class which initializes local static variables. More...
 

Public Types

typedef std::pair< std::string, std::string > StringPair
 Definition of a pair of strings.
 

Static Public Member Functions

static const XMLCh * idQ ()
 Identifier for rw::math::Q in the XML format. More...
 
static const XMLCh * idVector3D ()
 Identifier for rw::math::Vector3D<> in the XML format. More...
 
static const XMLCh * idVector2D ()
 Identifier for rw::math::Vector2D<> in the XML format. More...
 
static const XMLCh * idRotation3D ()
 Identifier for rw::math::Rotation3D<> in the XML format. More...
 
static const XMLCh * idRPY ()
 Identifier for rw::math::RPY<> in the XML format. More...
 
static const XMLCh * idEAA ()
 Identifier for rw::math::EAA<> in the XML format. More...
 
static const XMLCh * idQuaternion ()
 Identifier for rw::math::Quaternion<> in the XML format. More...
 
static const XMLCh * idRotation2D ()
 Identifier for rw::math::Rotation2D<> in the XML format. More...
 
static const XMLCh * idTransform3D ()
 Identifier for rw::math::Transform3D<> in the XML format. More...
 
static const XMLCh * idVelocityScrew6D ()
 Identifier for rw::math::VelocityScrew6D<> in the XML format. More...
 
static const XMLCh * idPos ()
 Identifier for the position specification used in Transform3D. More...
 
static const XMLCh * idMatrix ()
 Identifier for matrix specification used in Transform3D. More...
 
static const XMLCh * idLinear ()
 Identifier for specifying the linear part in a VelocityScrew6D. More...
 
static const XMLCh * idAngular ()
 Identifier for specifying the angular part in a VelocityScrew6D. More...
 
static const XMLCh * idState ()
 Identifier for specifying a State. More...
 
static const XMLCh * idQState ()
 Identifier for specifying a State. More...
 
static const XMLCh * idTreeState ()
 Identifier for specifying a State. More...
 
static const XMLCh * idBoolean ()
 Identifier for specifying a boolean. More...
 
static const XMLCh * idDouble ()
 Identifier for specifying a double. More...
 
static const XMLCh * idFloat ()
 Identifier for specifying a float. More...
 
static const XMLCh * idInteger ()
 Identifier for specifying a integer. More...
 
static const XMLCh * idString ()
 Identifier for specifying a string. More...
 
static const XMLCh * idStringList ()
 Identifier for specifying a list of strings. More...
 
static const XMLCh * idIntList ()
 Identifier for specifying a list of integers. More...
 
static const XMLCh * idDoubleList ()
 Identifier for specifying a list of doubles. More...
 
static const XMLCh * idStringPair ()
 Identifier for specifying a pair of strings. More...
 
static const XMLCh * idUnitAttribute ()
 Identifier for the unit attribute. More...
 
static double getUnit (const XMLCh *key)
 Returns the conversion value for a given unit. More...
 
static rw::math::Q readQ (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Q element read from element. More...
 
static rw::math::Vector3D readVector3D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Vector3D<> element read from element. More...
 
static rw::math::Vector2D readVector2D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Vector2D<> element read from element. More...
 
static rw::math::RPY readRPY (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::RPY<> element read from element. More...
 
static rw::math::EAA readEAA (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::EAA<> element read from element. More...
 
static rw::math::Quaternion readQuaternion (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Quaternion<> element read from element. More...
 
static rw::math::Rotation3D readRotation3D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Rotation3D<> element read from element. More...
 
static rw::math::Rotation2D readRotation2D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Rotation2D<> element read from element. More...
 
static rw::math::Rotation3D readRotation3DStructure (xercesc::DOMElement *element)
 Returns rw::math::Rotation3D<> element read from element. More...
 
static rw::math::Transform3D readTransform3D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::Transform3D<> element read from element. More...
 
static rw::math::VelocityScrew6D readVelocityScrew6D (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns rw::math::VelocityScrew6D<> element read from element. More...
 
static rw::kinematics::State readState (xercesc::DOMElement *element, rw::core::Ptr< rw::models::WorkCell > workcell, bool doCheckHeader=false)
 Returns rw::kinematics::State<> element read from element. More...
 
static StringPair readStringPair (xercesc::DOMElement *element, bool doCheckHeader=false)
 Returns pair of strings from element. More...
 
static std::vector< StringPairreadStringPairs (xercesc::DOMElement *element)
 Reads in a list of string pairs that are childs of element. More...
 
static std::vector< std::string > readStringList (xercesc::DOMElement *element)
 Reads in a list of strings that are childs of element. More...
 
static std::string readString (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a string element. More...
 
static double readDouble (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a double element. More...
 
static float readFloat (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a double element. More...
 
static int readInt (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in an integer element. More...
 
static std::vector< int > readIntList (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a list of integers from element. More...
 
static std::vector< double > readDoubleList (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a list of doubles from element. More...
 
static bool readBool (xercesc::DOMElement *element, bool doCheckHeader=false)
 Reads in a boolean element. More...
 
static std::string readElementText (xercesc::DOMElement *element, bool exceptionOnEmpty=true)
 Reads the text of a node. More...
 
static const XMLCh * readElementTextXMLCh (xercesc::DOMElement *element, bool exceptionOnEmpty=true)
 Read element text and return as XMLCh*. More...
 
static xercesc::DOMElement * createElement (const XMLCh *id, const XMLCh *value, xercesc::DOMDocument *doc)
 Create an element with name id and content value in the DOMDocument doc. More...
 
static xercesc::DOMElement * createQ (const rw::math::Q &q, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent q. More...
 
static xercesc::DOMElement * createVector3D (const rw::math::Vector3D<> &v, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent v. More...
 
static xercesc::DOMElement * createVector2D (const rw::math::Vector2D<> &v, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent v. More...
 
static xercesc::DOMElement * createRPY (const rw::math::RPY<> &rpy, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent rpy. More...
 
static xercesc::DOMElement * createEAA (const rw::math::EAA<> &eaa, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent eaa. More...
 
static xercesc::DOMElement * createQuaternion (const rw::math::Quaternion<> &quat, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent quat. More...
 
static xercesc::DOMElement * createRotation3D (const rw::math::Rotation3D<> &rot, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent rot. More...
 
static xercesc::DOMElement * createRotation2D (const rw::math::Rotation2D<> &rot, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent rot. More...
 
static xercesc::DOMElement * createTransform3D (const rw::math::Transform3D<> &trans, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent trans. More...
 
static xercesc::DOMElement * createVelocityScrew6D (const rw::math::VelocityScrew6D<> &vs, xercesc::DOMDocument *doc)
 Creates a DOMElement to represent vs. More...
 
static xercesc::DOMElement * createState (const rw::kinematics::State &state, xercesc::DOMDocument *doc)
 Creates an element to represent state. More...
 
static xercesc::DOMElement * createQState (const rw::kinematics::State &state, xercesc::DOMDocument *doc)
 Creates an element to represent the rw::kinematics::QState contained in state. More...
 
static xercesc::DOMElement * createTreeState (const rw::kinematics::State &state, xercesc::DOMDocument *doc)
 Creates an element to represent the rw::kinematics::TreeState contained in state. More...
 
static xercesc::DOMElement * createBoolean (bool value, xercesc::DOMDocument *doc)
 Creates an element to represent value. More...
 
static xercesc::DOMElement * createDouble (double value, xercesc::DOMDocument *doc)
 Creates an element to represent value. More...
 
static xercesc::DOMElement * createFloat (float value, xercesc::DOMDocument *doc)
 Creates an element to represent value. More...
 
static xercesc::DOMElement * createInteger (int value, xercesc::DOMDocument *doc)
 Creates an element to represent value. More...
 
static xercesc::DOMElement * createString (const std::string &string, xercesc::DOMDocument *doc)
 Creates an element to represent string. More...
 
static xercesc::DOMElement * createStringList (const std::vector< std::string > &strings, xercesc::DOMDocument *doc)
 Creates an element to represent strings. More...
 
static xercesc::DOMElement * createIntList (const std::vector< int > &ints, xercesc::DOMDocument *doc)
 Creates an element to represent ints. More...
 
static xercesc::DOMElement * createDoubleList (const std::vector< double > &doubles, xercesc::DOMDocument *doc)
 Creates an element to represent doubles. More...
 
static xercesc::DOMElement * createStringPair (const std::string &first, const std::string &second, xercesc::DOMDocument *doc)
 Creates an element to represent strings first and second. More...
 

Detailed Description

Utility class to help read in the content of a XML-files parsed with Xerces.

Member Function Documentation

◆ createBoolean()

static xercesc::DOMElement* createBoolean ( bool  value,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent value.

Creates a DOMElement owned by doc and representing value

The method may throw a rw::core::Exception in case of errors

Parameters
value[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createDouble()

static xercesc::DOMElement* createDouble ( double  value,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent value.

Creates a DOMElement owned by doc and representing value

The method may throw a rw::core::Exception in case of errors

Parameters
value[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createDoubleList()

static xercesc::DOMElement* createDoubleList ( const std::vector< double > &  doubles,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent doubles.

Creates a DOMElement owned by doc and representing doubles

The method may throw a rw::core::Exception in case of errors

Parameters
doubles[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createEAA()

static xercesc::DOMElement* createEAA ( const rw::math::EAA<> &  eaa,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent eaa.

Creates a DOMElement owned by doc and representing eaa

This method may throw a rw::core::Exception in case of errors

Parameters
eaa[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createElement()

static xercesc::DOMElement* createElement ( const XMLCh *  id,
const XMLCh *  value,
xercesc::DOMDocument *  doc 
)
static

Create an element with name id and content value in the DOMDocument doc.

Create an element named id and adds a DOMText-node containing value as a child to it.

Parameters
id[in] Name of the new element
value[in] Text value of the new element
doc[in] Document for which the new element shall be created
Returns
The new element.

◆ createFloat()

static xercesc::DOMElement* createFloat ( float  value,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent value.

Creates a DOMElement owned by doc and representing value

The method may throw a rw::core::Exception in case of errors

Parameters
value[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createInteger()

static xercesc::DOMElement* createInteger ( int  value,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent value.

Creates a DOMElement owned by doc and representing value

The method may throw a rw::core::Exception in case of errors

Parameters
value[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createIntList()

static xercesc::DOMElement* createIntList ( const std::vector< int > &  ints,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent ints.

Creates a DOMElement owned by doc and representing ints

The method may throw a rw::core::Exception in case of errors

Parameters
ints[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createQ()

static xercesc::DOMElement* createQ ( const rw::math::Q q,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent q.

Creates a DOMElement owned by doc and representing q

This method may throw a rw::core::Exception in case of errors

Parameters
q[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createQState()

static xercesc::DOMElement* createQState ( const rw::kinematics::State state,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent the rw::kinematics::QState contained in state.

Creates a DOMElement owned by doc and representing the rw::kinematics::QState contained in state

The method may throw a rw::core::Exception in case of errors

Parameters
state[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createQuaternion()

static xercesc::DOMElement* createQuaternion ( const rw::math::Quaternion<> &  quat,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent quat.

Creates a DOMElement owned by doc and representing quat

This method may throw a rw::core::Exception in case of errors

Parameters
quat[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createRotation2D()

static xercesc::DOMElement* createRotation2D ( const rw::math::Rotation2D<> &  rot,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent rot.

Creates a DOMElement owned by doc and representing rot

This method may throw a rw::core::Exception in case of errors

Parameters
rot[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createRotation3D()

static xercesc::DOMElement* createRotation3D ( const rw::math::Rotation3D<> &  rot,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent rot.

Creates a DOMElement owned by doc and representing rot

This method may throw a rw::core::Exception in case of errors

Parameters
rot[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createRPY()

static xercesc::DOMElement* createRPY ( const rw::math::RPY<> &  rpy,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent rpy.

Creates a DOMElement owned by doc and representing rpy

This method may throw a rw::core::Exception in case of errors

Parameters
rpy[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createState()

static xercesc::DOMElement* createState ( const rw::kinematics::State state,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent state.

Creates a DOMElement owned by doc and representing state

The method may throw a rw::core::Exception in case of errors

Parameters
state[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createString()

static xercesc::DOMElement* createString ( const std::string &  string,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent string.

Creates a DOMElement owned by doc and representing string

The method may throw a rw::core::Exception in case of errors

Parameters
string[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createStringList()

static xercesc::DOMElement* createStringList ( const std::vector< std::string > &  strings,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent strings.

Creates a DOMElement owned by doc and representing strings

The method may throw a rw::core::Exception in case of errors

Parameters
strings[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createStringPair()

static xercesc::DOMElement* createStringPair ( const std::string &  first,
const std::string &  second,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent strings first and second.

Creates a DOMElement owned by doc and representing strings first and second

The method may throw a rw::core::Exception in case of errors

Parameters
first[in] First string in the pair
second[in] Second string in the pair
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createTransform3D()

static xercesc::DOMElement* createTransform3D ( const rw::math::Transform3D<> &  trans,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent trans.

Creates a DOMElement owned by doc and representing trans

This method may throw a rw::comon::Exception in case of errors

Parameters
trans[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createTreeState()

static xercesc::DOMElement* createTreeState ( const rw::kinematics::State state,
xercesc::DOMDocument *  doc 
)
static

Creates an element to represent the rw::kinematics::TreeState contained in state.

Creates a DOMElement owned by doc and representing the rw::kinematics::QState contained in state

The method may throw a rw::core::Exception in case of errors

Parameters
state[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createVector2D()

static xercesc::DOMElement* createVector2D ( const rw::math::Vector2D<> &  v,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent v.

Creates a DOMElement owned by doc and representing v

This method may throw a rw::core::Exception in case of errors

Parameters
v[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createVector3D()

static xercesc::DOMElement* createVector3D ( const rw::math::Vector3D<> &  v,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent v.

Creates a DOMElement owned by doc and representing v

This method may throw a rw::core::Exception in case of errors

Parameters
v[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ createVelocityScrew6D()

static xercesc::DOMElement* createVelocityScrew6D ( const rw::math::VelocityScrew6D<> &  vs,
xercesc::DOMDocument *  doc 
)
static

Creates a DOMElement to represent vs.

Creates a DOMElement owned by doc and representing vs

This method may throw a rw::core::Exception in case of errors

Parameters
vs[in] Value to represent
doc[in] Document which should contain the element
Returns
Pointer to the newly created DOMElement

◆ getUnit()

static double getUnit ( const XMLCh *  key)
static

Returns the conversion value for a given unit.

The value returned can be used to convert the values specified in the element to the standard units used in RobWork.

Throws an exception if key cannot be matched to a unit

Parameters
key[in] The key for which the get the unit
Returns
Conversion value

◆ idAngular()

static const XMLCh* idAngular ( )
static

Identifier for specifying the angular part in a VelocityScrew6D.

Returns
the identifier.

◆ idBoolean()

static const XMLCh* idBoolean ( )
static

Identifier for specifying a boolean.

Returns
the identifier.

◆ idDouble()

static const XMLCh* idDouble ( )
static

Identifier for specifying a double.

Returns
the identifier.

◆ idDoubleList()

static const XMLCh* idDoubleList ( )
static

Identifier for specifying a list of doubles.

Returns
the identifier.

◆ idEAA()

static const XMLCh* idEAA ( )
static

Identifier for rw::math::EAA<> in the XML format.

Returns
the identifier.

◆ idFloat()

static const XMLCh* idFloat ( )
static

Identifier for specifying a float.

Returns
the identifier.

◆ idInteger()

static const XMLCh* idInteger ( )
static

Identifier for specifying a integer.

Returns
the identifier.

◆ idIntList()

static const XMLCh* idIntList ( )
static

Identifier for specifying a list of integers.

Returns
the identifier.

◆ idLinear()

static const XMLCh* idLinear ( )
static

Identifier for specifying the linear part in a VelocityScrew6D.

Returns
the identifier.

◆ idMatrix()

static const XMLCh* idMatrix ( )
static

Identifier for matrix specification used in Transform3D.

Returns
the identifier.

◆ idPos()

static const XMLCh* idPos ( )
static

Identifier for the position specification used in Transform3D.

Returns
the identifier.

◆ idQ()

static const XMLCh* idQ ( )
static

Identifier for rw::math::Q in the XML format.

Returns
the identifier.

◆ idQState()

static const XMLCh* idQState ( )
static

Identifier for specifying a State.

Returns
the identifier.

◆ idQuaternion()

static const XMLCh* idQuaternion ( )
static

Identifier for rw::math::Quaternion<> in the XML format.

Returns
the identifier.

◆ idRotation2D()

static const XMLCh* idRotation2D ( )
static

Identifier for rw::math::Rotation2D<> in the XML format.

Returns
the identifier.

◆ idRotation3D()

static const XMLCh* idRotation3D ( )
static

Identifier for rw::math::Rotation3D<> in the XML format.

Returns
the identifier.

◆ idRPY()

static const XMLCh* idRPY ( )
static

Identifier for rw::math::RPY<> in the XML format.

Returns
the identifier.

◆ idState()

static const XMLCh* idState ( )
static

Identifier for specifying a State.

Returns
the identifier.

◆ idString()

static const XMLCh* idString ( )
static

Identifier for specifying a string.

Returns
the identifier.

◆ idStringList()

static const XMLCh* idStringList ( )
static

Identifier for specifying a list of strings.

Returns
the identifier.

◆ idStringPair()

static const XMLCh* idStringPair ( )
static

Identifier for specifying a pair of strings.

Returns
the identifier.

◆ idTransform3D()

static const XMLCh* idTransform3D ( )
static

Identifier for rw::math::Transform3D<> in the XML format.

Returns
the identifier.

◆ idTreeState()

static const XMLCh* idTreeState ( )
static

Identifier for specifying a State.

Returns
the identifier.

◆ idUnitAttribute()

static const XMLCh* idUnitAttribute ( )
static

Identifier for the unit attribute.

Returns
the identifier.

◆ idVector2D()

static const XMLCh* idVector2D ( )
static

Identifier for rw::math::Vector2D<> in the XML format.

Returns
the identifier.

◆ idVector3D()

static const XMLCh* idVector3D ( )
static

Identifier for rw::math::Vector3D<> in the XML format.

Returns
the identifier.

◆ idVelocityScrew6D()

static const XMLCh* idVelocityScrew6D ( )
static

Identifier for rw::math::VelocityScrew6D<> in the XML format.

Returns
the identifier.

◆ readBool()

static bool readBool ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a boolean element.

Read in element and converts the content to a bool. Only if the content of the node equals "true" is true returned. Otherwise the method returns false.

Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
bool represented in element

◆ readDouble()

static double readDouble ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a double element.

Read in element and converts the content to a double Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
double represented in element

◆ readDoubleList()

static std::vector<double> readDoubleList ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a list of doubles from element.

Read in element and converts the content to a list of doubles Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
std::vector<double> represented in element

◆ readEAA()

static rw::math::EAA readEAA ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::EAA<> element read from element.

Read in element and returns a rw::math::EAA<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches EAA. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readElementText()

static std::string readElementText ( xercesc::DOMElement *  element,
bool  exceptionOnEmpty = true 
)
static

Reads the text of a node.

Runs through all children of element until a DOMText-node if found. The value of this node is the returned. In case of multiple nodes only the content of the first is returned.

If no DOMText-nodes can be found and exceptionOnEmpty is true it throws a rw::core::Exception. Otherwise an empty string is returned.

Parameters
element[in] Element to read in
exceptionOnEmpty[in] Determines whether to throw an exception or return an empty string.
Returns
string content of first child DOMText-node

◆ readElementTextXMLCh()

static const XMLCh* readElementTextXMLCh ( xercesc::DOMElement *  element,
bool  exceptionOnEmpty = true 
)
static

Read element text and return as XMLCh*.

Runs through all children of element until a DOMText-node if found. The value of this node is the returned. In case of multiple nodes only the content of the first is returned.

If no DOMText-nodes can be found and exceptionOnEmpty is true it throws a rw::core::Exception. Otherwise an empty string is returned.

Parameters
element[in] Element to read in
exceptionOnEmpty[in] Determines whether to throw an exception or return an empty string.
Returns
string content of first child DOMText-node

◆ readFloat()

static float readFloat ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a double element.

Read in element and converts the content to a double Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
double represented in element

◆ readInt()

static int readInt ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in an integer element.

Read in element and converts the content to an integer Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
int represented in element

◆ readIntList()

static std::vector<int> readIntList ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a list of integers from element.

Read in element and converts the content to a list of integers Throws a rw::core::Exception if failing to read or parse.

Parameters
element[in] Element to read in
doCheckHeader[in] True if the element name should be checked
Returns
std::vector<int> represented in element

◆ readQ()

static rw::math::Q readQ ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Q element read from element.

Read in element and returns a rw::math::Q corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches QId. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readQuaternion()

static rw::math::Quaternion readQuaternion ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Quaternion<> element read from element.

Read in element and returns a rw::math::Quaternion<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Quaternion. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readRotation2D()

static rw::math::Rotation2D readRotation2D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Rotation2D<> element read from element.

Read in element and returns a rw::math::Rotation2D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Rotation2D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readRotation3D()

static rw::math::Rotation3D readRotation3D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Rotation3D<> element read from element.

Read in element and returns a rw::math::Rotation3D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Rotation3D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readRotation3DStructure()

static rw::math::Rotation3D readRotation3DStructure ( xercesc::DOMElement *  element)
static

Returns rw::math::Rotation3D<> element read from element.

Read in element and returns a rw::math::Rotation3D corresponding to the content. The content can be either a RPY, EAA, Quaternion or Rotation3D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
Returns
The element read

◆ readRPY()

static rw::math::RPY readRPY ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::RPY<> element read from element.

Read in element and returns a rw::math::RPY<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches RPY. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readState()

static rw::kinematics::State readState ( xercesc::DOMElement *  element,
rw::core::Ptr< rw::models::WorkCell workcell,
bool  doCheckHeader = false 
)
static

Returns rw::kinematics::State<> element read from element.

Reads in element and returns a rw::kinematics::State corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches State. If the name does not an exception is thrown. If the structure of the state does not match an exception is thrown.

Parameters
element[in] Element to read
workcell[in] WorkCell to which the state should match.
doCheckHeader[in] True if the header name should be checked
Returns
The State read from element

◆ readString()

static std::string readString ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Reads in a string element.

Reads in element as a string element. Throws a rw::core::Exception on error

Parameters
element[in] Element to parse
doCheckHeader[in] True if the element name should be checked
Returns
String giving the content of element

◆ readStringList()

static std::vector<std::string> readStringList ( xercesc::DOMElement *  element)
static

Reads in a list of strings that are childs of element.

Reads in all strings which are childs of the element element.

Throws rw::core::Exception if failing to read and parse content.

Parameters
element[in] Element which string pairs as children
Returns
List of strings

◆ readStringPair()

static StringPair readStringPair ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns pair of strings from element.

Reads in element and returns a pair of strings. If doCheckHeader = true it checks that the element tag name matches XMLBasicTypes::StringPairId. Throws a rw::core::Exception if header does not match or if failing to read two strings.

Parameters
element[in] Element to read
doCheckHeader[in] True if the element name should be checked
Returns
Pair of strings

◆ readStringPairs()

static std::vector<StringPair> readStringPairs ( xercesc::DOMElement *  element)
static

Reads in a list of string pairs that are childs of element.

Reads in all string pairs which are childs of the element element. This is for example used when reading in DAF setups.

Throws rw::core::Exception if failing to read and parse content.

Parameters
element[in] Element which string pairs as children
Returns
List of string pairs

◆ readTransform3D()

static rw::math::Transform3D readTransform3D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Transform3D<> element read from element.

Read in element and returns a rw::math::Transform3D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Transform3D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readVector2D()

static rw::math::Vector2D readVector2D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Vector2D<> element read from element.

Read in element and returns a rw::math::Vector2D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Vector2D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readVector3D()

static rw::math::Vector3D readVector3D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::Vector3D<> element read from element.

Read in element and returns a rw::math::Vector3D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches Vector3D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

◆ readVelocityScrew6D()

static rw::math::VelocityScrew6D readVelocityScrew6D ( xercesc::DOMElement *  element,
bool  doCheckHeader = false 
)
static

Returns rw::math::VelocityScrew6D<> element read from element.

Read in element and returns a rw::math::VelocityScrew6D<> corresponding to the content. If doCheckHeader = true it checks that the elements tag name matches VelocityScrew6D. If the name does not an exception is thrown.

Parameters
element[in] Element to read
doCheckHeader[in] True if the header name should be checked
Returns
The element read

The documentation for this class was generated from the following file: