Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlanarFigureWriterFactory.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 
19 #include "itkCreateObjectFunction.h"
20 #include "itkVersion.h"
21 
22 #include <mitkPlanarFigureWriter.h>
23 
24 namespace mitk
25 {
26  template <class T>
27  class CreatePlanarFigureWriter : public itk::CreateObjectFunctionBase
28  {
29  public:
31  typedef CreatePlanarFigureWriter Self;
33 
35  itkFactorylessNewMacro(Self) LightObject::Pointer CreateObject() override
36  {
37  typename T::Pointer p = T::New();
38  p->Register();
39  return p.GetPointer();
40  }
41 
42  protected:
43  CreatePlanarFigureWriter() {}
44  ~CreatePlanarFigureWriter() {}
45  private:
46  CreatePlanarFigureWriter(const Self &); // purposely not implemented
47  void operator=(const Self &); // purposely not implemented
48  };
49 
51  {
52  this->RegisterOverride("IOWriter",
53  "PlanarFigureWriter",
54  "PlanarFigure xml Writer",
55  1,
57  }
58 
60  itk::ObjectFactoryBase::Pointer PlanarFigureWriterFactory::GetInstance()
61  {
63  return factory;
64  }
65 
67  {
68  if (GetInstance()->GetReferenceCount() == 1)
69  {
70  ObjectFactoryBase::RegisterFactory(GetInstance().GetPointer());
71  }
72  }
73 
75  {
76  ObjectFactoryBase::UnRegisterFactory(GetInstance().GetPointer());
77  }
78 
79  const char *PlanarFigureWriterFactory::GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
80  const char *PlanarFigureWriterFactory::GetDescription() const { return "PlanarFigureWriterFactory"; }
81 } // end namespace mitk
itk::SmartPointer< Self > Pointer
DataCollection - Class to facilitate loading/accessing structured data.
virtual const char * GetDescription(void) const override
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.