RobWorkProject  23.9.11-
Public Member Functions | Static Public Member Functions | List of all members
GeometryFactory Class Reference

Factory for geometric primitive. More...

#include <GeometryFactory.hpp>

Inherits ExtensionPoint< rw::geometry::GeometryData >.

Public Member Functions

 GeometryFactory ()
 Constructor.
 
- Public Member Functions inherited from ExtensionPoint< rw::geometry::GeometryData >
 ExtensionPoint (const std::string &id, const std::string &name, Plugin *plugin=NULL)
 Constructor. More...
 
const std::string & getId () const
 get unique identifier of this extensionpoint
 
const std::string & getName () const
 get human readable name of this extension point
 
const rw::core::PropertyMapgetSchema () const
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. It contain examples of all possible configuration options. This can be used to configure any extensions that needs to attach to this extension point.
 
std::vector< rw::core::Extension::DescriptorgetExtensionDescriptors () const
 get all extension descriptions of this extension point
 
std::vector< rw::core::Ptr< Extension > > getExtensions () const
 get all extensions of this extension point
 

Static Public Member Functions

static rw::geometry::Geometry::Ptr load (const std::string &str, bool useCache=true)
 Factory method for geometric primitive. More...
 
static rw::geometry::Geometry::Ptr getGeometry (const std::string &str, bool useCache=true)
 Factory method for geometric primitive. More...
 
static void clearGeometryCache ()
 Clear the geometry cache.
 

Additional Inherited Members

- Public Types inherited from ExtensionPoint< rw::geometry::GeometryData >
typedef rw::core::Ptr< ExtensionPointPtr
 smart pointer type of ExtensionPoint
 
- Protected Member Functions inherited from ExtensionPoint< rw::geometry::GeometryData >
rw::core::PropertyMapgetSchema ()
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. The schema property map should just be loaded with all possible configuration options which the extension might use. More...
 

Detailed Description

Factory for geometric primitive.

The following primitives are supported

Box: Syntax: "#Box dx dy dz" where "dx, dy, dz" are floats specifying the dimensions

Cylinder: Syntax: "#Cylinder radius height level" where "radius" and "height" are float specifying radius and height and "level" is a non-negative integer specifying the discretization level.

Sphere: Syntax: "#Sphere radi level" where radi is the radius of the sphere

Tube: Syntax: "#Tube radius height level where "radius" and "height" are float specifying radius and height and "level" is a non-negative integer specifying the discretization level.

Cone: Syntax: "#Cone radius height level where "height" is a float specifying cone height, and "radius" is a float specyfying cone radius at at the bottom.

Pyramid: Syntax: "#Pyramid dx dy height" where "dx", "dy" are floats specifying the base dimensions, and "height" is a float specyfying the pyramid height.

Custom: Syntax: "#Custom type parameters where "type" is a custom geometry type provided by extensions, "parameters" is a space separated string with custom geometry parameters.

Member Function Documentation

◆ getGeometry()

static rw::geometry::Geometry::Ptr getGeometry ( const std::string &  str,
bool  useCache = true 
)
static

Factory method for geometric primitive.

The Factory takes no ownership of the Geometry objects it constructs and thus returns the geometry by smart pointer.

An exception is thrown if the string cannot be parsed correctly.

Parameters
str[in] string to parse
useCache[in] set true to return cached geometry if available
Returns
Pointer to a new geometry object

◆ load()

static rw::geometry::Geometry::Ptr load ( const std::string &  str,
bool  useCache = true 
)
static

Factory method for geometric primitive.

The Factory takes no ownership of the Geometry objects it constructs and thus returns the geometry by smart pointer.

An exception is thrown if the string cannot be parsed correctly.

Parameters
str[in] string to parse
useCache[in] set true to return cached geometry if available
Returns
Pointer to a new geometry object

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