Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkWriter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkWriter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/08/19 13:20:42 $
00007   Version:   $Revision: 1.4 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkWriter_h
00021 #define __itkWriter_h
00022 
00023 #include "itkProcessObject.h"
00024 
00025 namespace itk
00026 {
00027 
00036 class ITK_EXPORT Writer : public ProcessObject
00037 {
00038 public:
00040   typedef Writer              Self;
00041   typedef ProcessObject  Superclass;
00042   typedef SmartPointer<Self>  Pointer;
00043   typedef SmartPointer<const Self>  ConstPointer;
00044 
00046   itkTypeMacro(Writer,ProcessObject);
00047 
00049   itkSetStringMacro(FileName);
00050   
00052   itkGetStringMacro(FileName);
00053   
00055   typedef  enum {ASCII,Binary} FileType;
00056   
00058   itkSetMacro(FileType,FileType);
00059   
00061   itkGetMacro(FileType,FileType);
00062                  
00064   void SetFileTypeToASCII() 
00065     {this->SetFileType(Writer::ASCII);}
00066 
00068   void SetFileTypeToBinary() 
00069     {this->SetFileType(Writer::Binary);}
00070 
00073   virtual void Write();
00074 
00076   virtual void Update()
00077     {this->Write();}
00078   
00079 protected:
00080   Writer();
00081   ~Writer();
00082   void PrintSelf(std::ostream& os, Indent indent) const;
00083 
00088   virtual void WriteData() = 0;
00089 
00090   void GenerateData() 
00091     {this->WriteData();}
00092   
00093 private:
00094   std::string        m_FileName;
00095   FileType           m_FileType;
00096   
00097   Writer(const Self&); //purposely not implemented
00098   void operator=(const Self&); //purposely not implemented
00099 };
00100 
00101   
00102 } // end namespace itk
00103   
00104 #endif
00105   

Generated at Wed Mar 12 01:13:14 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000