![]() |
RobWorkProject
23.9.11-
|
Factory for construction of drawables based on their type. More...
#include <DrawableFactory.hpp>
Static Public Member Functions | |
static Drawable::Ptr | getDrawable (const std::string &str, const std::string &name) |
Factory method for constructing a Drawable based on a string. More... | |
static Drawable::Ptr | loadDrawableFile (const std::string &filename, const std::string &name) |
Factory method constructing a Drawable from a file. More... | |
static Drawable::Ptr | constructFromGeometry (const std::string &str, const std::string &name, bool useCache=false) |
Factory method constructing a Drawable based on a Geometry ID string. More... | |
Factory for construction of drawables based on their type.
|
static |
Factory method constructing a Drawable based on a Geometry ID string.
The method constructs a Drawable representing the geometry described in the string
An exception is thrown if the string cannot be parsed correctly.
str | [in] Geometry ID string |
name | [in] the id/name of the drawable |
useCache | [in] True to use caching. Default false |
|
static |
Factory method for constructing a Drawable based on a string.
The method probes the string to see it describes a geometric primitive or a file name. In case of a geometric primitive it forwards to call to DrawableFactory::ConstructDrawableFromGeometry. Otherwise it calls DrawableFactory::LoadDrawableFile otherwise
|
static |
Factory method constructing a Drawable from a file.
filename | [in] path and name of file to load |
name | [in] the id/name of the drawable |
The factory determines which type of Drawable to used based on the filename extension. In case no extension exists if test whether a file with the same name or a .stl, .stla, .stlb, .3ds, .ac or .ac3d exists.
An exception is thrown if the file can't be loaded.