Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkSurfaceVtkWriterFactory.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 
15 #include "itkCreateObjectFunction.h"
16 #include "itkVersion.h"
17 
18 #include <mitkSurfaceVtkWriter.h>
19 #include <vtkXMLPolyDataWriter.h>
20 
21 namespace mitk
22 {
23  template <class T>
24  class CreateSurfaceWriter : public itk::CreateObjectFunctionBase
25  {
26  public:
28  typedef CreateSurfaceWriter Self;
29  typedef itk::SmartPointer<Self> Pointer;
30 
32  itkFactorylessNewMacro(Self);
33  LightObject::Pointer CreateObject() override
34  {
35  typename T::Pointer p = T::New();
36  p->Register();
37  return p.GetPointer();
38  }
39 
40  protected:
41  CreateSurfaceWriter() {}
42  ~CreateSurfaceWriter() override {}
43  private:
44  CreateSurfaceWriter(const Self &); // purposely not implemented
45  void operator=(const Self &); // purposely not implemented
46  };
47 
49  {
50  this->RegisterOverride("IOWriter",
51  "SurfaceVtkWriter",
52  "Surface Vtk Writer",
53  true,
54  mitk::CreateSurfaceWriter<mitk::SurfaceVtkWriter<vtkXMLPolyDataWriter>>::New());
55  }
56 
58  const char *SurfaceVtkWriterFactory::GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
59  const char *SurfaceVtkWriterFactory::GetDescription() const { return "SurfaceVtkWriterFactory"; }
60 } // end namespace mitk
const char * GetITKSourceVersion(void) const override
VTK-based writer for mitk::Surface.
DataCollection - Class to facilitate loading/accessing structured data.
const char * GetDescription(void) const override