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

Manages and generates the CollisionDetectionAlgorithms. More...

#include <imstkCDObjectFactory.h>

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

Static Public Member Functions

static std::shared_ptr< CollisionDetectionAlgorithmmakeCollisionDetection (const std::string collisionTypeName)
 attempts to create a new CD algorithm More...
 
static std::string getCDType (const Geometry &obj1, const Geometry &obj2)
 Get the CD type from the types of objects colliding.
 
- Static Public Member Functions inherited from imstk::ObjectFactory< std::shared_ptr< CollisionDetectionAlgorithm > >
static std::shared_ptr< CollisionDetectionAlgorithmcreate (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< CollisionDetectionAlgorithm > >
using BaseType = std::shared_ptr< CollisionDetectionAlgorithm >
 
using Creator = std::function< std::shared_ptr< CollisionDetectionAlgorithm >(Args...)>
 Type of the function to generate a new object.
 

Detailed Description

Manages and generates the CollisionDetectionAlgorithms.

The factory is a singleton and can be accessed anywhere. Given a name of a geometry/geometry algorithm this will generate the appropriate object that should be executed. In by default the class name is the name that is used to look up the algorithm. The generation Will fail if the name is not known to the factory

There are multiple ways to register an collision detection algorithm, preferred should be ...

IMSTK_REGISTER_COLLISION_DETECTION(collisionDetectionType)

will register the delegate for the class-name of the algorithm, this will satisfy the default mechanism If want to register a custom delegate with more customization you can use

CDObjectRegistrar<delegateType> registrar("LookupTypeName");

Definition at line 36 of file imstkCDObjectFactory.h.

Member Function Documentation

◆ makeCollisionDetection()

std::shared_ptr< CollisionDetectionAlgorithm > imstk::CDObjectFactory::makeCollisionDetection ( const std::string  collisionTypeName)
static

attempts to create a new CD algorithm

Parameters
collisionTypeNamename of the class to look up

Definition at line 71 of file imstkCDObjectFactory.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: