iMSTK
Interactive Medical Simulation Toolkit
imstkCDObjectFactory.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkFactory.h"
10 
11 namespace imstk
12 {
13 class CollisionDetectionAlgorithm;
14 class Geometry;
15 
36 class CDObjectFactory : public ObjectFactory<std::shared_ptr<CollisionDetectionAlgorithm>>
37 {
38 public:
42  static std::shared_ptr<CollisionDetectionAlgorithm> makeCollisionDetection(const std::string collisionTypeName);
45  static std::string getCDType(
46  const Geometry& obj1,
47  const Geometry& obj2);
48 };
49 
52 template<typename T>
54 
55 #define IMSTK_REGISTER_COLLISION_DETECTION(objType) CDObjectRegistrar<objType> _imstk_registercd ## objType(#objType)
56 } // namespace imstk
Generic Factory class that can take objects with constructor parameters.
Definition: imstkFactory.h:24
Compound Geometry.
static std::shared_ptr< CollisionDetectionAlgorithm > makeCollisionDetection(const std::string collisionTypeName)
attempts to create a new CD algorithm
Base class for any geometrical representation.
Definition: imstkGeometry.h:22
static std::string getCDType(const Geometry &obj1, const Geometry &obj2)
Get the CD type from the types of objects colliding.
Manages and generates the CollisionDetectionAlgorithms.
Templated class that can add to the object factory with objects that will be generated via std::make_...
Definition: imstkFactory.h:87