VTK
vtkArrayWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayWriter.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
54 #ifndef __vtkArrayWriter_h
55 #define __vtkArrayWriter_h
56 
57 #include <vtkWriter.h>
58 
59 class vtkArray;
60 class vtkStdString;
61 
63  public vtkWriter
64 {
65 public:
66  static vtkArrayWriter *New();
67  vtkTypeMacro(vtkArrayWriter, vtkWriter);
68  void PrintSelf(ostream& os, vtkIndent indent);
69 
71 
73  vtkSetStringMacro(FileName);
74  vtkGetStringMacro(FileName);
76 
78 
80  vtkSetMacro(Binary, int);
81  vtkGetMacro(Binary, int);
82  vtkBooleanMacro(Binary, int);
84 
85  virtual int Write(); // This is necessary to get Write() wrapped for scripting languages.
86 
89  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
90 
92  static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
93 
94 //BTX
96  bool Write(ostream& stream, bool WriteBinary = false);
97 
99 
100  static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
101 //ETX
103 
104 protected:
105  vtkArrayWriter();
106  ~vtkArrayWriter();
107 
109  virtual void WriteData();
110 
111  char* FileName;
112  int Binary;
113 
114 private:
115  vtkArrayWriter(const vtkArrayWriter&); // Not implemented.
116  void operator=(const vtkArrayWriter&); // Not implemented.
117 };
118 
119 #endif
120