VTK
dox/IO/Core/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 "vtkIOCoreModule.h" // For export macro
00058 #include "vtkWriter.h"
00059 #include "vtkStdString.h" // For string API
00060 
00061 class vtkArray;
00062 
00063 class VTKIOCORE_EXPORT vtkArrayWriter :
00064   public vtkWriter
00065 {
00066 public:
00067   static vtkArrayWriter *New();
00068   vtkTypeMacro(vtkArrayWriter, vtkWriter);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072 
00074   vtkSetStringMacro(FileName);
00075   vtkGetStringMacro(FileName);
00077 
00079 
00081   vtkSetMacro(Binary, int);
00082   vtkGetMacro(Binary, int);
00083   vtkBooleanMacro(Binary, int);
00085 
00087 
00088   virtual vtkStdString GetOutputString()
00089     { return this->OutputString; }
00091 
00093 
00095   vtkSetMacro(WriteToOutputString, bool);
00096   vtkGetMacro(WriteToOutputString, bool);
00097   vtkBooleanMacro(WriteToOutputString, bool);
00099 
00100   virtual int Write(); // This is necessary to get Write() wrapped for scripting languages.
00101 
00104   bool Write(const vtkStdString& FileName, bool WriteBinary = false);
00105 
00107   static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
00108 
00109 //BTX
00113   bool Write(ostream& stream, bool WriteBinary = false);
00114 
00116 
00119   static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
00120 //ETX
00122 
00126   vtkStdString Write(bool WriteBinary);
00127 
00129   static vtkStdString Write(vtkArray* array, bool WriteBinary = false);
00130 
00131 protected:
00132   vtkArrayWriter();
00133   ~vtkArrayWriter();
00134 
00135   virtual int FillInputPortInformation(int port, vtkInformation* info);
00136   virtual void WriteData();
00137 
00138   char* FileName;
00139   int Binary;
00140   bool WriteToOutputString;
00141   vtkStdString OutputString;
00142 
00143 private:
00144   vtkArrayWriter(const vtkArrayWriter&);  // Not implemented.
00145   void operator=(const vtkArrayWriter&);  // Not implemented.
00146 };
00147 
00148 #endif
00149