16 #ifndef SURGSIM_SERIALIZE_SHAPESFACTORY_H 17 #define SURGSIM_SERIALIZE_SHAPESFACTORY_H 20 #include <boost/function.hpp> 21 #include <boost/functional/factory.hpp> 41 template <
class Derived>
47 std::shared_ptr<SurgSim::Math::Shape>
createShape(
const std::string& className);
64 #endif // SURGSIM_SERIALIZE_SHAPESFACTORY_H Definition: CompoundShapeToGraphics.cpp:29
std::map< std::string, ShapesFactoryFunction > m_registerDirectory
Look up table for shapes factory.
Definition: ShapesFactory.h:54
void registerShape(const std::string &className)
Template version to register a shape into the internal directory.
Definition: ShapesFactory-inl.h:27
virtual ~ShapesFactory()
Destructor.
Definition: ShapesFactory.cpp:29
ShapesFactory()
Constructor.
Definition: ShapesFactory.cpp:24
boost::function< std::shared_ptr< SurgSim::Math::Shape >)> ShapesFactoryFunction
A wrapper of function object.
Definition: ShapesFactory.h:51
A factory implementation for shapes.
Definition: ShapesFactory.h:29
std::shared_ptr< SurgSim::Math::Shape > createShape(const std::string &className)
Create an instance of derived rigid shape based on the specific class name.
Definition: ShapesFactory.cpp:34