RobWorkProject  23.9.11-
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 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::core::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.");
static models::WorkCell::Ptr load(const std::string &filename)
Loads/imports a WorkCell from a file.

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.");
static rw::core::Ptr< WorkCellLoader > getWorkCellLoader(const std::string &format)
Get loaders for a specific format.
rw::core::Ptr< WorkCellLoader > Ptr
Smart pointer of WorkCellLoader.
Definition: WorkCellLoader.hpp:74

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.


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