00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #include "mitkSurfaceVtkWriterFactory.h" 00019 00020 #include "itkCreateObjectFunction.h" 00021 #include "itkVersion.h" 00022 00023 #include <mitkSurfaceVtkWriter.h> 00024 #include <vtkXMLPolyDataWriter.h> 00025 00026 namespace mitk 00027 { 00028 00029 template <class T> 00030 class CreateSurfaceWriter : public itk::CreateObjectFunctionBase 00031 { 00032 public: 00033 00035 typedef CreateSurfaceWriter Self; 00036 typedef itk::SmartPointer<Self> Pointer; 00037 00039 itkFactorylessNewMacro(Self); 00040 LightObject::Pointer CreateObject() { typename T::Pointer p = T::New(); 00041 p->Register(); 00042 return p.GetPointer(); 00043 } 00044 00045 protected: 00046 CreateSurfaceWriter() {} 00047 ~CreateSurfaceWriter() {} 00048 00049 private: 00050 CreateSurfaceWriter(const Self&); //purposely not implemented 00051 void operator=(const Self&); //purposely not implemented 00052 }; 00053 00054 SurfaceVtkWriterFactory::SurfaceVtkWriterFactory() 00055 { 00056 this->RegisterOverride("IOWriter", 00057 "SurfaceVtkWriter", 00058 "Surface Vtk Writer", 00059 1, 00060 mitk::CreateSurfaceWriter< mitk::SurfaceVtkWriter<vtkXMLPolyDataWriter> >::New()); 00061 } 00062 00063 SurfaceVtkWriterFactory::~SurfaceVtkWriterFactory() 00064 { 00065 } 00066 00067 const char* SurfaceVtkWriterFactory::GetITKSourceVersion() const 00068 { 00069 return ITK_SOURCE_VERSION; 00070 } 00071 00072 const char* SurfaceVtkWriterFactory::GetDescription() const 00073 { 00074 return "SurfaceVtkWriterFactory"; 00075 } 00076 00077 } // end namespace mitk