Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
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 <mitkSurfaceVtkWriter.h>
23 #include <vtkXMLPolyDataWriter.h>
24 
25 namespace mitk
26 {
27  template <class T>
28  class CreateSurfaceWriter : public itk::CreateObjectFunctionBase
29  {
30  public:
32  typedef CreateSurfaceWriter Self;
34 
36  itkFactorylessNewMacro(Self);
37  LightObject::Pointer CreateObject() override
38  {
39  typename T::Pointer p = T::New();
40  p->Register();
41  return p.GetPointer();
42  }
43 
44  protected:
45  CreateSurfaceWriter() {}
46  ~CreateSurfaceWriter() {}
47  private:
48  CreateSurfaceWriter(const Self &); // purposely not implemented
49  void operator=(const Self &); // purposely not implemented
50  };
51 
53  {
54  this->RegisterOverride("IOWriter",
55  "SurfaceVtkWriter",
56  "Surface Vtk Writer",
57  1,
58  mitk::CreateSurfaceWriter<mitk::SurfaceVtkWriter<vtkXMLPolyDataWriter>>::New());
59  }
60 
62  const char *SurfaceVtkWriterFactory::GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
63  const char *SurfaceVtkWriterFactory::GetDescription() const { return "SurfaceVtkWriterFactory"; }
64 } // end namespace mitk
itk::SmartPointer< Self > Pointer
VTK-based writer for mitk::Surface.
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.