VTK
dox/IO/vtkWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkWriter.h
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 =========================================================================*/
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 //BTX
00072   vtkDataObject *GetInput();
00073   vtkDataObject *GetInput(int port);
00074 //ETX
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; //internal method subclasses must respond to
00089   vtkTimeStamp WriteTime;
00090 private:
00091   vtkWriter(const vtkWriter&);  // Not implemented.
00092   void operator=(const vtkWriter&);  // Not implemented.
00093 };
00094 
00095 #endif