Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkImageWriter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageWriter.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00037 #ifndef __vtkImageWriter_h
00038 #define __vtkImageWriter_h
00039 
00040 #include "vtkProcessObject.h"
00041 
00042 class vtkImageData;
00043 
00044 class VTK_IO_EXPORT vtkImageWriter : public vtkProcessObject
00045 {
00046 public:
00047   static vtkImageWriter *New();
00048   vtkTypeRevisionMacro(vtkImageWriter,vtkProcessObject);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050   
00052 
00055   void SetFileName(const char *);
00056   vtkGetStringMacro(FileName);
00058 
00060 
00063   void SetFilePrefix(char *filePrefix);
00064   vtkGetStringMacro(FilePrefix);
00066 
00068 
00069   void SetFilePattern(const char *filePattern);
00070   vtkGetStringMacro(FilePattern);
00072 
00074 
00077   vtkSetMacro(FileDimensionality, int);
00078   vtkGetMacro(FileDimensionality, int);
00080   
00082 
00083   virtual void SetInput(vtkImageData *input);
00084   vtkImageData *GetInput();
00086 
00088   virtual void Write();
00089 
00090   void DeleteFiles();
00091 
00092 protected:
00093   vtkImageWriter();
00094   ~vtkImageWriter();
00095 
00096   int FileDimensionality;
00097   char *FilePrefix;
00098   char *FilePattern;
00099   char *FileName;
00100   int FileNumber;
00101   int FileLowerLeft;
00102   char *InternalFileName;
00103 
00104   virtual void RecursiveWrite(int dim, vtkImageData *region, ofstream *file);
00105   virtual void RecursiveWrite(int dim, vtkImageData *cache, 
00106                               vtkImageData *data, ofstream *file);
00107   virtual void WriteFile(ofstream *file, vtkImageData *data, int extent[6]);
00108   virtual void WriteFileHeader(ofstream *, vtkImageData *) {};
00109   virtual void WriteFileTrailer(ofstream *, vtkImageData *) {};
00110   
00111   int MinimumFileNumber;
00112   int MaximumFileNumber;
00113   int FilesDeleted;
00114   
00115 private:
00116   vtkImageWriter(const vtkImageWriter&);  // Not implemented.
00117   void operator=(const vtkImageWriter&);  // Not implemented.
00118 };
00119 
00120 #endif