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

Enables loading in path file specified in the RobWork Path XML format. More...

#include <XMLPathLoader.hpp>

Classes

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

Public Types

enum  Type {
  QType = 0 , Vector3DType , Rotation3DType , Transform3DType ,
  StateType , TimedQType , TimedStateType
}
 Enumeration specifying which type of path, that has been loaded. More...
 

Public Member Functions

 XMLPathLoader (const std::string &filename, rw::core::Ptr< rw::models::WorkCell > workcell=NULL, const std::string &schemaFileName="")
 Constructs XMLPathLoader and parser filename. More...
 
 XMLPathLoader (std::istream &instream, rw::core::Ptr< rw::models::WorkCell > workcell=NULL, const std::string &schemaFileName="")
 Constructs XMLPathLoader and parser input from instream. More...
 
 XMLPathLoader (xercesc::DOMElement *element)
 Constructs XMLPathLoader and load in path in element. More...
 
virtual ~XMLPathLoader ()
 Destructor.
 
Type getType ()
 Returns the type of the path loaded.
 
rw::trajectory::QPath::Ptr getQPath ()
 Returns path loaded. More...
 
rw::trajectory::Vector3DPath::Ptr getVector3DPath ()
 Returns path loaded. More...
 
rw::trajectory::Rotation3DPath::Ptr getRotation3DPath ()
 Returns path loaded. More...
 
rw::trajectory::Transform3DPath::Ptr getTransform3DPath ()
 Returns loaded path. More...
 
rw::trajectory::StatePath::Ptr getStatePath ()
 Returns loaded path. More...
 
rw::trajectory::TimedQPath::Ptr getTimedQPath ()
 Returns loaded path. More...
 
rw::trajectory::TimedStatePath::Ptr getTimedStatePath ()
 Returns loaded path. More...
 

Detailed Description

Enables loading in path file specified in the RobWork Path XML format.

The XMLPathLoader loads in a file containing a path specified according to the rwxml_path.xsd schema. The XML-file can be parsed either with or without schema verification. The schema can either be specified in the XML-file or given as argument to the constructor.

A path can contain either rw::math::Q, rw::math::Vector3D, rw::math::Rotation3D or rw::math::Transform3D elements. If the type of the path in the file in unknown it can be determined using the XMLPathLoader::getType after loading.

If reading in a path fails an exception is thrown

Member Enumeration Documentation

◆ Type

enum Type

Enumeration specifying which type of path, that has been loaded.

Enumerator
Vector3DType 

rw::trajectory::QPath

Rotation3DType 

rw::trajectory::Vector3DPath

Transform3DType 

rw::trajectory::Rotation3DPath

StateType 

rw::trajectory::Transform3DPath

TimedQType 

rw::trajectory::StatePath

TimedStateType 

rw::trajectory::TimedQPath

rw::trajectory::TimedStatePath

Constructor & Destructor Documentation

◆ XMLPathLoader() [1/3]

XMLPathLoader ( const std::string &  filename,
rw::core::Ptr< rw::models::WorkCell workcell = NULL,
const std::string &  schemaFileName = "" 
)

Constructs XMLPathLoader and parser filename.

It is possible to specify whether to use the default schema which is the default behavior. If a schema is specified in the XML-file or no schema should be used set useDefaultSchema to false.

If reading in the path fails an exception is thrown

Parameters
filename[in] The file to load
workcelldocumentation missing !
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.

◆ XMLPathLoader() [2/3]

XMLPathLoader ( std::istream &  instream,
rw::core::Ptr< rw::models::WorkCell workcell = NULL,
const std::string &  schemaFileName = "" 
)

Constructs XMLPathLoader and parser input from instream.

It is possible to specify whether to use the default schema which is the default behavior. If a schema is specified in the XML-file or no schema should be used set useDefaultSchema to false.

Throw rw::core::Exception if reading the path fails

Parameters
instream[in] The input stream to read from
workcelldocumentation missing !
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.

◆ XMLPathLoader() [3/3]

XMLPathLoader ( xercesc::DOMElement *  element)

Constructs XMLPathLoader and load in path in element.

No validation is applied hence the syntax of the element is assumed correct.

If loading the path fails an exception is thrown

Parameters
element[in] DOMElement representing the path

Member Function Documentation

◆ getQPath()

Returns path loaded.

If the loaded path is not of type QPath a rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getRotation3DPath()

rw::trajectory::Rotation3DPath::Ptr getRotation3DPath ( )

Returns path loaded.

If the loaded path is not of type Rotation3DPath a rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getStatePath()

Returns loaded path.

If the loaded path is not of type StatePath a rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getTimedQPath()

Returns loaded path.

If the loaded path is not of type TimedQPath a rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getTimedStatePath()

rw::trajectory::TimedStatePath::Ptr getTimedStatePath ( )

Returns loaded path.

If the loaded path is not of type TimedStatePath a rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getTransform3DPath()

rw::trajectory::Transform3DPath::Ptr getTransform3DPath ( )

Returns loaded path.

If the loaded path is not of type Transform3DPatha rw::core::Exception is thrown.

Returns
Pointer to the path

◆ getVector3DPath()

rw::trajectory::Vector3DPath::Ptr getVector3DPath ( )

Returns path loaded.

If the loaded path is not of type Vector3DPath a rw::core::Exception is thrown.

Returns
Pointer to the path

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