ImFusion SDK 4.3
DeformationFactory Class Reference

#include <ImFusion/GL/DeformationFactory.h>

Factory singleton for creating Deformations from string IDs. More...

+ Inheritance diagram for DeformationFactory:

Detailed Description

Factory singleton for creating Deformations from string IDs.

See also
Deformation

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< DeformationcreateDeformation (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::stringregisteredDeformationIds () const
 Returns the Unique IDs of all Deformations registered with this factory.
 
- Public Member Functions inherited from FactoryBase
 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 DeformationFactoryget ()
 Returns the DeformationFactory singleton object.
 

Additional Inherited Members

- Protected Member Functions inherited from FactoryBase
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 Protected Member Functions inherited from FactoryBase
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.
 
- Protected Attributes inherited from FactoryBase
std::string m_factoryModule
 
bool m_checkLicense
 

Member Function Documentation

◆ registerDeformation() [1/2]

template<class T, typename = std::enable_if_t<std::is_base_of_v<Deformation, T>>>
bool registerDeformation ( const std::string & id)
inline

Registers a Deformation with the DeformationFactory.

Note
The string IDs of Deformations have to be unique. If you register an ID a second time, the previously registered factory method will be overwritten.
Parameters
idUnique string ID for the Deformation to register.
Returns
true if the deformation has been successfully registered

◆ registerDeformation() [2/2]

bool registerDeformation ( const std::string & id,
FactoryMethod factoryMethod )

Registers a Deformation with the DeformationFactory.

Note
The string IDs of Deformations have to be unique. If you register an ID a second time, the previously registered factory method will be overwritten.
Parameters
idUnique string ID for the Deformation to register.
factoryMethodMethod to use for instantiating the Deformation to register.
Returns
true if the deformation has been successfully registered

◆ createDeformation()

std::unique_ptr< Deformation > createDeformation ( const std::string & id,
std::unique_ptr< SharedImageSet > supportImages = nullptr,
const Properties * p = nullptr )
nodiscard

Instantiates a Deformation specified by the given ID.

Parameters
idUnique ID of the Deformation to create.
imageOptional pointer to a SharedImage, used to construct the Deformation.
pOptional pointer to a Properties object. If not null, it will be used to configure the newly created Deformation.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close