ITK  5.3.0
Insight Toolkit
itkTransformFactoryBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkTransformFactoryBase_h
29 #define itkTransformFactoryBase_h
30 
31 #include "itkObjectFactoryBase.h"
32 
33 namespace itk
34 {
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(TransformFactoryBase);
44 
50 
52  const char *
53  GetITKSourceVersion() const override;
54 
55  const char *
56  GetDescription() const override;
57 
60 
62  itkFactorylessNewMacro(Self);
63 
65  static void
67 
69  static TransformFactoryBase *
70  GetFactory();
71 
86  void
87  RegisterTransform(const char * classOverride,
88  const char * overrideClassName,
89  const char * description,
90  bool enableFlag,
91  CreateObjectFunctionBase * createFunction)
92  {
93 
94  // Ensure there is only one transform registered by a name, this
95  // may happen on windows where this library is static, and the
96  // global init flag may not be unique.
97  LightObject::Pointer test = this->CreateInstance(classOverride);
98  if (test.IsNotNull())
99  {
100  itkDebugMacro("Refusing to register transform \"" << classOverride << "\" again!");
101  test->UnRegister();
102  }
103  else
104  {
105  this->RegisterOverride(classOverride, overrideClassName, description, enableFlag, createFunction);
106  }
107  }
108 
109 protected:
111  ~TransformFactoryBase() override;
112 
113 private:
114  // Sub private functions of RegisterDefaultTransforms
115  static void
117  static void
119 
120 
121  // Called by the type specific methods
122  template <typename TParameterType>
123  static void
125 
127 };
128 } // end namespace itk
129 
130 #endif
itk::ObjectFactoryBase
Create instances of classes using an object factory.
Definition: itkObjectFactoryBase.h:62
itk::ObjectFactoryBase::RegisterOverride
void RegisterOverride(const char *classOverride, const char *subclass, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
itk::TransformFactoryBase::m_Factory
static TransformFactoryBase * m_Factory
Definition: itkTransformFactoryBase.h:126
itk::SmartPointer< Self >
itk::TransformFactoryBase::RegisterTransformFactory
static void RegisterTransformFactory()
itk::TransformFactoryBase::RegisterTransformFactoryFloatParameters
static void RegisterTransformFactoryFloatParameters()
itk::CreateObjectFunctionBase
Define API for object creation callback functions.
Definition: itkCreateObjectFunction.h:31
itk::ObjectFactoryBase::CreateInstance
static LightObject::Pointer CreateInstance(const char *itkclassname)
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkObjectFactoryBase.h
test
int test(char *INfilename, char *OUTfilename, bool IsBinary)
Definition: itkMeshFileTestHelper.h:250
itk::TransformFactoryBase::RegisterTransformFactoryDoubleParameters
static void RegisterTransformFactoryDoubleParameters()
itk::ObjectFactoryBase::ObjectFactoryBase
ObjectFactoryBase()
itk::TransformFactoryBase::RegisterDefaultTransforms
static void RegisterDefaultTransforms()
itk::TransformFactoryBase::GetDescription
const char * GetDescription() const override
itk::TransformFactoryBase::GetFactory
static TransformFactoryBase * GetFactory()
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TransformFactoryBase::GetITKSourceVersion
const char * GetITKSourceVersion() const override
itk::TransformFactoryBase::TransformFactoryBase
TransformFactoryBase()
itk::TransformFactoryBase
Create instances of Transforms.
Definition: itkTransformFactoryBase.h:40
itk::TransformFactoryBase::RegisterTransform
void RegisterTransform(const char *classOverride, const char *overrideClassName, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
Definition: itkTransformFactoryBase.h:87
itk::TransformFactoryBase::~TransformFactoryBase
~TransformFactoryBase() override