iMSTK
Interactive Medical Simulation Toolkit
Static Public Member Functions | List of all members
imstk::RenderDelegateObjectFactory Class Reference

Manages and generates the VTKRenderdelegates for all VisualModels. More...

#include <imstkRenderDelegateObjectFactory.h>

Inheritance diagram for imstk::RenderDelegateObjectFactory:
Inheritance graph
[legend]
Collaboration diagram for imstk::RenderDelegateObjectFactory:
Collaboration graph
[legend]

Static Public Member Functions

static std::shared_ptr< VTKRenderDelegatemakeRenderDelegate (std::shared_ptr< VisualModel > visualModel)
 attempt to create a delegate for the given visual model More...
 
- Static Public Member Functions inherited from imstk::ObjectFactory< std::shared_ptr< VTKRenderDelegate > >
static std::shared_ptr< VTKRenderDelegatecreate (const std::string &name, Args &&... args)
 tries to construct the object give name, it will forward the given paramters More...
 
static void add (const std::string &name, Creator c)
 adds a new creation function to the factory More...
 
static bool contains (const std::string &name)
 
static const std::vector< std::string > getNames ()
 

Additional Inherited Members

- Public Types inherited from imstk::ObjectFactory< std::shared_ptr< VTKRenderDelegate > >
using BaseType = std::shared_ptr< VTKRenderDelegate >
 
using Creator = std::function< std::shared_ptr< VTKRenderDelegate >(Args...)>
 Type of the function to generate a new object.
 

Detailed Description

Manages and generates the VTKRenderdelegates for all VisualModels.

The factory is a singleton and can be accessed anywhere. Given a visual model this will, if available generate a renderdelegate that may be able to render the model.

See also
VisualModel::delegateHint() is used to determine what delegate should be returned. delegateHint() has some functionality to determine a default Hint and can be overridden by the user. The generation Will fail if the name is not known to the factory

There are multiple ways to register a renderdelegate

IMSTK_REGISTER_RENDERDELEGATE(geometryType, delegateType)

will register the delegate for the class-name of the geometry, this will satisfy the default mechanism If a custom delegate is wanted this form may be preferable

RenderDelegateRegistrar<delegateType> registrar("HintName");

Definition at line 46 of file imstkRenderDelegateObjectFactory.h.

Member Function Documentation

◆ makeRenderDelegate()

std::shared_ptr< VTKRenderDelegate > imstk::RenderDelegateObjectFactory::makeRenderDelegate ( std::shared_ptr< VisualModel visualModel)
static

attempt to create a delegate for the given visual model

Parameters
visualModelthe model we need a delegate for

Definition at line 64 of file imstkRenderDelegateObjectFactory.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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