VTK
|
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 "vtkWriter.h" 00057 #include "vtkStdString.h" // For string API 00058 00059 class vtkArrayData; 00060 00061 class VTK_IO_EXPORT vtkArrayDataWriter : 00062 public vtkWriter 00063 { 00064 public: 00065 static vtkArrayDataWriter *New(); 00066 vtkTypeMacro(vtkArrayDataWriter, vtkWriter); 00067 void PrintSelf(ostream& os, vtkIndent indent); 00068 00070 00072 vtkSetStringMacro(FileName); 00073 vtkGetStringMacro(FileName); 00075 00077 00079 vtkSetMacro(Binary, int); 00080 vtkGetMacro(Binary, int); 00081 vtkBooleanMacro(Binary, int); 00083 00085 00086 virtual vtkStdString GetOutputString() 00087 { return this->OutputString; } 00089 00091 00093 vtkSetMacro(WriteToOutputString, bool); 00094 vtkGetMacro(WriteToOutputString, bool); 00095 vtkBooleanMacro(WriteToOutputString, bool); 00097 00098 virtual int Write(); // This is necessary to get Write() wrapped for scripting languages. 00099 00102 bool Write(const vtkStdString& FileName, bool WriteBinary = false); 00103 00105 static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false); 00106 00107 //BTX 00111 bool Write(ostream& stream, bool WriteBinary = false); 00112 00114 00117 static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false); 00118 //ETX 00120 00124 vtkStdString Write(bool WriteBinary); 00125 00127 static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false); 00128 00129 protected: 00130 vtkArrayDataWriter(); 00131 ~vtkArrayDataWriter(); 00132 00133 virtual int FillInputPortInformation(int port, vtkInformation* info); 00134 virtual void WriteData(); 00135 00136 char* FileName; 00137 int Binary; 00138 bool WriteToOutputString; 00139 vtkStdString OutputString; 00140 00141 private: 00142 vtkArrayDataWriter(const vtkArrayDataWriter&); // Not implemented. 00143 void operator=(const vtkArrayDataWriter&); // Not implemented. 00144 }; 00145 00146 #endif