VTK
dox/IO/Core/vtkArrayDataWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkArrayDataWriter.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 
00053 #ifndef __vtkArrayDataWriter_h
00054 #define __vtkArrayDataWriter_h
00055 
00056 #include "vtkIOCoreModule.h" // For export macro
00057 #include "vtkWriter.h"
00058 #include "vtkStdString.h" // For string API
00059 
00060 class vtkArrayData;
00061 
00062 class VTKIOCORE_EXPORT vtkArrayDataWriter :
00063   public vtkWriter
00064 {
00065 public:
00066   static vtkArrayDataWriter *New();
00067   vtkTypeMacro(vtkArrayDataWriter, 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 
00086 
00087   virtual vtkStdString GetOutputString()
00088     { return this->OutputString; }
00090 
00092 
00094   vtkSetMacro(WriteToOutputString, bool);
00095   vtkGetMacro(WriteToOutputString, bool);
00096   vtkBooleanMacro(WriteToOutputString, bool);
00098 
00099   virtual int Write(); // This is necessary to get Write() wrapped for scripting languages.
00100 
00103   bool Write(const vtkStdString& FileName, bool WriteBinary = false);
00104 
00106   static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false);
00107 
00108 //BTX
00112   bool Write(ostream& stream, bool WriteBinary = false);
00113 
00115 
00118   static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false);
00119 //ETX
00121 
00125   vtkStdString Write(bool WriteBinary);
00126 
00128   static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false);
00129 
00130 protected:
00131   vtkArrayDataWriter();
00132   ~vtkArrayDataWriter();
00133 
00134   virtual int FillInputPortInformation(int port, vtkInformation* info);
00135   virtual void WriteData();
00136 
00137   char* FileName;
00138   int Binary;
00139   bool WriteToOutputString;
00140   vtkStdString OutputString;
00141 
00142 private:
00143   vtkArrayDataWriter(const vtkArrayDataWriter&);  // Not implemented.
00144   void operator=(const vtkArrayDataWriter&);  // Not implemented.
00145 };
00146 
00147 #endif