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 
52 #ifndef vtkArrayWriter_h
53 #define vtkArrayWriter_h
54 
55 #include "vtkIOCoreModule.h" // For export macro
56 #include "vtkWriter.h"
57 #include "vtkStdString.h" // For string API
58 
59 class vtkArray;
60 
61 class VTKIOCORE_EXPORT vtkArrayWriter :
62  public vtkWriter
63 {
64 public:
65  static vtkArrayWriter *New();
66  vtkTypeMacro(vtkArrayWriter, vtkWriter);
67  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
68 
70 
73  vtkSetStringMacro(FileName);
74  vtkGetStringMacro(FileName);
76 
78 
81  vtkSetMacro(Binary, int);
82  vtkGetMacro(Binary, int);
83  vtkBooleanMacro(Binary, int);
85 
90  { return this->OutputString; }
91 
93 
96  vtkSetMacro(WriteToOutputString, bool);
97  vtkGetMacro(WriteToOutputString, bool);
98  vtkBooleanMacro(WriteToOutputString, bool);
100 
101  int Write() VTK_OVERRIDE; // This is necessary to get Write() wrapped for scripting languages.
102 
106  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
107 
111  static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
112 
117  bool Write(ostream& stream, bool WriteBinary = false);
118 
123  static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
124 
129  vtkStdString Write(bool WriteBinary);
130 
134  static vtkStdString Write(vtkArray* array, bool WriteBinary = false);
135 
136 protected:
137  vtkArrayWriter();
138  ~vtkArrayWriter() VTK_OVERRIDE;
139 
140  int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
141  void WriteData() VTK_OVERRIDE;
142 
143  char* FileName;
144  int Binary;
147 
148 private:
149  vtkArrayWriter(const vtkArrayWriter&) VTK_DELETE_FUNCTION;
150  void operator=(const vtkArrayWriter&) VTK_DELETE_FUNCTION;
151 };
152 
153 #endif
154 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
Serialize sparse and dense arrays to a file or stream.
Store vtkAlgorithm input/output information.
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:64
abstract class to write data to file(s)
Definition: vtkWriter.h:42
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual int Write()
Write data to output.
vtkStdString OutputString
static vtkAlgorithm * New()
virtual void WriteData()=0
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual vtkStdString GetOutputString()
The output string.