![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GL/DeformationFactory.h>
Factory singleton for creating Deformations from string IDs. More...
Factory singleton for creating Deformations from string IDs.
Public Types | |
using | FactoryMethod = std::function<std::unique_ptr<Deformation>(std::unique_ptr<SharedImageSet> optionalSupportingImages)> |
Alias for a DeformationFactory factory method creating a specific Deformation. | |
Public Member Functions | |
template<class T, typename = std::enable_if_t<std::is_base_of_v<Deformation, T>>> | |
bool | registerDeformation (const std::string &id) |
Registers a Deformation with the DeformationFactory. | |
bool | registerDeformation (const std::string &id, FactoryMethod factoryMethod) |
Registers a Deformation with the DeformationFactory. | |
std::unique_ptr< Deformation > | createDeformation (const std::string &id, std::unique_ptr< SharedImageSet > supportImages=nullptr, const Properties *p=nullptr) |
Instantiates a Deformation specified by the given ID. | |
std::vector< std::string > | registeredDeformationIds () const |
Returns the Unique IDs of all Deformations registered with this factory. | |
![]() | |
FactoryBase () | |
No license check is performed for the module instantiated with this constructor. | |
FactoryBase (std::string module, bool checkLicense=true) | |
std::string | moduleName () const |
Returns the module name of the factory. | |
Static Public Member Functions | |
static DeformationFactory & | get () |
Returns the DeformationFactory singleton object. | |
Additional Inherited Members | |
![]() | |
virtual | ~FactoryBase () |
Virtual destructor. | |
std::string | getComponentPath (const std::string &componentName) const |
Returns the path to the component referred to by name . | |
bool | isLicensed (const std::string &name) |
Return true if the license allows the use of the component referred to by name . | |
![]() | |
static std::string | getComponentPath (const std::string &moduleName, const std::string &componentName) |
Returns the path to the component referred to by name . | |
static bool | isLicensed (const std::string &moduleName, const std::string &name) |
Return true if the license allows the use of the component referred to by name . | |
![]() | |
std::string | m_factoryModule |
bool | m_checkLicense |
|
inline |
Registers a Deformation with the DeformationFactory.
id | Unique string ID for the Deformation to register. |
bool registerDeformation | ( | const std::string & | id, |
FactoryMethod | factoryMethod ) |
Registers a Deformation with the DeformationFactory.
id | Unique string ID for the Deformation to register. |
factoryMethod | Method to use for instantiating the Deformation to register. |
|
nodiscard |
Instantiates a Deformation specified by the given ID.
id | Unique ID of the Deformation to create. |
image | Optional pointer to a SharedImage, used to construct the Deformation. |
p | Optional pointer to a Properties object. If not null, it will be used to configure the newly created Deformation. |