RobWorkProject  24.12.4-
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
DOMPathLoader Class Reference

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

#include <DOMPathLoader.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

 DOMPathLoader (const std::string &filename, rw::core::Ptr< rw::models::WorkCell > workcell=NULL, const std::string &schemaFileName="")
 Constructs DOMPathLoader and parser filename. More...
 
 DOMPathLoader (std::istream &instream, rw::core::Ptr< rw::models::WorkCell > workcell=NULL, const std::string &schemaFileName="")
 Constructs DOMPathLoader and parser input from instream. More...
 
 DOMPathLoader (rw::core::Ptr< rw::core::DOMElem > element)
 Constructs DOMPathLoader and load in path in element. More...
 
virtual ~DOMPathLoader ()
 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...
 

Static Public Member Functions

static const std::string & idQPath ()
 Identifier for rw::trajectory::QPath in the XML format. More...
 
static const std::string & idV3DPath ()
 Identifier for rw::trajectory::Vector3DPath in the XML format. More...
 
static const std::string & idR3DPath ()
 Identifier for rw::trajectory::Rotation3DPath in the XML format. More...
 
static const std::string & idT3DPath ()
 Identifier for rw::trajectory::Transform3DPath in the XML format. More...
 
static const std::string & idStatePath ()
 Identifier for rw::trajectory::StatePath in the XML format. More...
 
static const std::string & idTimedQPath ()
 Identifier for rw::trajectory::TimedQPath in the XML format. More...
 
static const std::string & idTimedState ()
 Identifier for rw::trajectory::TimedState in the XML format. More...
 
static const std::string & idTimedQ ()
 Identifier for rw::trajectory::TimedQ in the XML format. More...
 
static const std::string & idTimedStatePath ()
 Identifier for rw::trajectory::TimedStatePath in the XML format. More...
 
static const std::string & idTime ()
 Identifier for time attribute used for rw::trajectory::TimedQPath and rw::trajectory::TimedStatePath in the XML format. More...
 

Detailed Description

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

The DOMPathLoader 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 DOMPathLoader::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

◆ DOMPathLoader() [1/3]

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

Constructs DOMPathLoader 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.

◆ DOMPathLoader() [2/3]

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

Constructs DOMPathLoader 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.

◆ DOMPathLoader() [3/3]

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

◆ idQPath()

static const std::string& idQPath ( )
static

Identifier for rw::trajectory::QPath in the XML format.

Returns
the identifier.

◆ idR3DPath()

static const std::string& idR3DPath ( )
static

Identifier for rw::trajectory::Rotation3DPath in the XML format.

Returns
the identifier.

◆ idStatePath()

static const std::string& idStatePath ( )
static

Identifier for rw::trajectory::StatePath in the XML format.

Returns
the identifier.

◆ idT3DPath()

static const std::string& idT3DPath ( )
static

Identifier for rw::trajectory::Transform3DPath in the XML format.

Returns
the identifier.

◆ idTime()

static const std::string& idTime ( )
static

Identifier for time attribute used for rw::trajectory::TimedQPath and rw::trajectory::TimedStatePath in the XML format.

Returns
the identifier.

◆ idTimedQ()

static const std::string& idTimedQ ( )
static

Identifier for rw::trajectory::TimedQ in the XML format.

Returns
the identifier.

◆ idTimedQPath()

static const std::string& idTimedQPath ( )
static

Identifier for rw::trajectory::TimedQPath in the XML format.

Returns
the identifier.

◆ idTimedState()

static const std::string& idTimedState ( )
static

Identifier for rw::trajectory::TimedState in the XML format.

Returns
the identifier.

◆ idTimedStatePath()

static const std::string& idTimedStatePath ( )
static

Identifier for rw::trajectory::TimedStatePath in the XML format.

Returns
the identifier.

◆ idV3DPath()

static const std::string& idV3DPath ( )
static

Identifier for rw::trajectory::Vector3DPath in the XML format.

Returns
the identifier.

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