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 "vtkIOCoreModule.h" // For export macro
58 #include "vtkWriter.h"
59 #include "vtkStdString.h" // For string API
60 
61 class vtkArray;
62 
64  public vtkWriter
65 {
66 public:
67  static vtkArrayWriter *New();
68  vtkTypeMacro(vtkArrayWriter, vtkWriter);
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
74  vtkSetStringMacro(FileName);
75  vtkGetStringMacro(FileName);
77 
79 
81  vtkSetMacro(Binary, int);
82  vtkGetMacro(Binary, int);
83  vtkBooleanMacro(Binary, int);
85 
87 
89  { return this->OutputString; }
91 
93 
95  vtkSetMacro(WriteToOutputString, bool);
96  vtkGetMacro(WriteToOutputString, bool);
97  vtkBooleanMacro(WriteToOutputString, bool);
99 
100  virtual int Write(); // This is necessary to get Write() wrapped for scripting languages.
101 
104  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
105 
107  static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
108 
109 //BTX
113  bool Write(ostream& stream, bool WriteBinary = false);
114 
116 
119  static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
120 //ETX
122 
126  vtkStdString Write(bool WriteBinary);
127 
129  static vtkStdString Write(vtkArray* array, bool WriteBinary = false);
130 
131 protected:
132  vtkArrayWriter();
133  ~vtkArrayWriter();
134 
136  virtual void WriteData();
137 
138  char* FileName;
139  int Binary;
142 
143 private:
144  vtkArrayWriter(const vtkArrayWriter&); // Not implemented.
145  void operator=(const vtkArrayWriter&); // Not implemented.
146 };
147 
148 #endif
149 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
Serialize sparse and dense arrays to a file or stream.
Store vtkAlgorithm input/output information.
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:69
#define VTKIOCORE_EXPORT
abstract class to write data to file(s)
Definition: vtkWriter.h:44
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int Write()
vtkStdString OutputString
static vtkAlgorithm * New()
virtual void WriteData()=0
virtual vtkStdString GetOutputString()
void PrintSelf(ostream &os, vtkIndent indent)