00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00033 #ifndef __vtkWriter_h
00034 #define __vtkWriter_h
00035 
00036 #include "vtkAlgorithm.h"
00037 
00038 class vtkDataObject;
00039 
00040 #define VTK_ASCII 1
00041 #define VTK_BINARY 2
00042 
00043 class VTK_IO_EXPORT vtkWriter : public vtkAlgorithm
00044 {
00045 public:
00046   vtkTypeMacro(vtkWriter,vtkAlgorithm);
00047   void PrintSelf(ostream& os, vtkIndent indent);
00048   
00052   virtual int Write();
00053 
00058   void EncodeString(char* resname, const char* name, bool doublePercent);
00059   
00065   void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
00066   
00068 
00069   void SetInput(vtkDataObject *input);
00070   void SetInput(int index, vtkDataObject *input);
00071 
00072   vtkDataObject *GetInput();
00073   vtkDataObject *GetInput(int port);
00074 
00076 
00077 protected:
00078   vtkWriter();
00079   ~vtkWriter();
00080 
00081   virtual int ProcessRequest(vtkInformation *request,
00082                              vtkInformationVector **inputVector,
00083                              vtkInformationVector *outputVector);
00084   virtual int RequestData(vtkInformation *request,
00085                           vtkInformationVector **inputVector,
00086                           vtkInformationVector *outputVector);
00087 
00088   virtual void WriteData() = 0; 
00089   vtkTimeStamp WriteTime;
00090 private:
00091   vtkWriter(const vtkWriter&);  
00092   void operator=(const vtkWriter&);  
00093 };
00094 
00095 #endif