ImFusion C++ SDK 4.5.0
ImFusion::DeformationFactory Class Reference

#include <ImFusion/GL/DeformationFactory.h>

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

Inheritance diagram for ImFusion::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.

Static Public Member Functions

static DeformationFactory & get ()
 Returns the DeformationFactory singleton object.

Member Function Documentation

◆ registerDeformation() [1/2]

template<class T, typename = std::enable_if_t<std::is_base_of_v<Deformation, T>>>
bool ImFusion::DeformationFactory::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 ImFusion::DeformationFactory::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 > ImFusion::DeformationFactory::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:
  • ImFusion/GL/DeformationFactory.h
Search Tab / S to search, Esc to close