RobWorkProject  0.7.0
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
WorkCellLoader Class Referenceabstract

Extendible interface for loading of WorkCells from files. More...

#include <WorkCellLoader.hpp>

Inherited by TULLoader, and XMLRWLoader.

Classes

class  Factory
 A factory for WorkCellLoader. This factory also defines the "rw.loaders.WorkCellLoader" extension point where new loaders can be registered. More...
 

Public Types

typedef rw::common::Ptr< WorkCellLoaderPtr
 Smart pointer of WorkCellLoader.
 

Public Member Functions

virtual ~WorkCellLoader ()
 Destructor.
 
virtual models::WorkCell::Ptr loadWorkCell (const std::string &filename)=0
 Load a WorkCell from a file. More...
 

Protected Member Functions

 WorkCellLoader ()
 Constructor.
 

Detailed Description

Extendible interface for loading of WorkCells from files.

By default, the following formats are supported:

The Factory defines an extension point "rw.loaders.WorkCellLoader" that makes it possible to add loaders for other file formats than the ones above. Extensions take precedence over the default loaders.

The WorkCell loader is chosen based on a case-insensitive file extension name. So "scene.wc.xml" will be loaded by the same loader as "scene.WC.XML"

WorkCells are supposed to be loaded using the Factory::load function:

WorkCell::Ptr wc = WorkCellLoader::Factory::load("scene.wc.xml");
if (wc.isNull())
RW_TRHOW("WorkCell could not be loaded.");

Alternatively a WorkCell can be loaded in the less convenient way:

WorkCell::Ptr wc = loader.loadWorkCell("scene.wc.xml");
if (wc.isNull())
RW_TRHOW("WorkCell could not be loaded.");

Member Function Documentation

◆ loadWorkCell()

virtual models::WorkCell::Ptr loadWorkCell ( const std::string &  filename)
pure virtual

Load a WorkCell from a file.

Parameters
filename[in] path to workcell file.

Implemented in XMLRWLoader, and TULLoader.


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