VTK
dox/IO/vtkArrayWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkArrayWriter.h
00005 
00006 -------------------------------------------------------------------------
00007   Copyright 2008 Sandia Corporation.
00008   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009   the U.S. Government retains certain rights in this software.
00010 -------------------------------------------------------------------------
00011 
00012   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00013   All rights reserved.
00014   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00018      PURPOSE.  See the above copyright notice for more information.
00019 
00020 =========================================================================*/
00021 
00054 #ifndef __vtkArrayWriter_h
00055 #define __vtkArrayWriter_h
00056 
00057 #include <vtkWriter.h>
00058 
00059 class vtkArray;
00060 class vtkStdString;
00061 
00062 class VTK_IO_EXPORT vtkArrayWriter :
00063   public vtkWriter
00064 {
00065 public:
00066   static vtkArrayWriter *New();
00067   vtkTypeMacro(vtkArrayWriter, vtkWriter);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071 
00073   vtkSetStringMacro(FileName);
00074   vtkGetStringMacro(FileName);
00076 
00078 
00080   vtkSetMacro(Binary, int);
00081   vtkGetMacro(Binary, int);
00082   vtkBooleanMacro(Binary, int);
00084 
00085   virtual int Write(); // This is necessary to get Write() wrapped for scripting languages.
00086 
00089   bool Write(const vtkStdString& FileName, bool WriteBinary = false);
00090 
00092   static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
00093 
00094 //BTX
00096   bool Write(ostream& stream, bool WriteBinary = false);
00097 
00099 
00100   static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
00101 //ETX
00103 
00104 protected:
00105   vtkArrayWriter();
00106   ~vtkArrayWriter();
00107 
00108   virtual int FillInputPortInformation(int port, vtkInformation* info);
00109   virtual void WriteData();
00110 
00111   char* FileName;
00112   int Binary;
00113 
00114 private:
00115   vtkArrayWriter(const vtkArrayWriter&);  // Not implemented.
00116   void operator=(const vtkArrayWriter&);  // Not implemented.
00117 };
00118 
00119 #endif
00120