![]() |
RobWorkProject
23.9.11-
|
Factory for construction of drawables based on their type. More...
#include <Model3DFactory.hpp>
Static Public Member Functions | |
static rw::graphics::Model3D::Ptr | getModel (const std::string &str, const std::string &name, bool useCache=true, rw::graphics::Model3D::Material mat=rw::graphics::Model3D::Material("stlmat", 0.6f, 0.6f, 0.6f)) |
Factory method for constructing a Drawable based on a string. More... | |
static rw::graphics::Model3D::Ptr | loadModel (const std::string &filename, const std::string &name, bool useCache=true, rw::graphics::Model3D::Material mat=rw::graphics::Model3D::Material("stlmat", 0.6f, 0.6f, 0.6f)) |
Factory method constructing a Drawable from a file. More... | |
static rw::graphics::Model3D::Ptr | constructFromGeometry (const std::string &str, const std::string &name, bool useCache=false, rw::graphics::Model3D::Material mat=rw::graphics::Model3D::Material("stlmat", 0.6f, 0.6f, 0.6f)) |
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 |
mat | [in] default material to be used by the model. |
|
static |
Factory method for constructing a Drawable based on a string.
The method probes the string to see if it describes a geometric primitive or a file name. In case of a geometric primitive it forwards to call to constructFromGeometry. Otherwise it calls loadModel 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 |
useCache | [in] save resources by resusing an already loaded file, but only if not modified since last load of the file. |
mat | [in] default material to be used by the model. |
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.