VTK  9.1.0
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 
71 #ifndef vtkArrayWriter_h
72 #define vtkArrayWriter_h
73 
74 #include "vtkIOCoreModule.h" // For export macro
75 #include "vtkStdString.h" // For string API
76 #include "vtkWriter.h"
77 
78 class vtkArray;
79 
80 class VTKIOCORE_EXPORT vtkArrayWriter : public vtkWriter
81 {
82 public:
83  static vtkArrayWriter* New();
84  vtkTypeMacro(vtkArrayWriter, vtkWriter);
85  void PrintSelf(ostream& os, vtkIndent indent) override;
86 
88 
94 
96 
99  vtkSetMacro(Binary, vtkTypeBool);
100  vtkGetMacro(Binary, vtkTypeBool);
101  vtkBooleanMacro(Binary, vtkTypeBool);
103 
107  virtual vtkStdString GetOutputString() { return this->OutputString; }
108 
110 
113  vtkSetMacro(WriteToOutputString, bool);
114  vtkGetMacro(WriteToOutputString, bool);
115  vtkBooleanMacro(WriteToOutputString, bool);
117 
118  int Write() override; // This is necessary to get Write() wrapped for scripting languages.
119 
123  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
124 
128  static bool Write(vtkArray* array, const vtkStdString& file_name, bool WriteBinary = false);
129 
134  bool Write(ostream& stream, bool WriteBinary = false);
135 
140  static bool Write(vtkArray* array, ostream& stream, bool WriteBinary = false);
141 
146  vtkStdString Write(bool WriteBinary);
147 
151  static vtkStdString Write(vtkArray* array, bool WriteBinary = false);
152 
153 protected:
155  ~vtkArrayWriter() override;
156 
158  void WriteData() override;
159 
160  char* FileName;
164 
165 private:
166  vtkArrayWriter(const vtkArrayWriter&) = delete;
167  void operator=(const vtkArrayWriter&) = delete;
168 };
169 
170 #endif
vtkArrayWriter::Write
vtkStdString Write(bool WriteBinary)
Write input port 0 data to a string.
vtkStdString.h
vtkArrayWriter::Write
int Write() override
Write data to output.
vtkArrayWriter::New
static vtkArrayWriter * New()
vtkArrayWriter::Write
static bool Write(vtkArray *array, ostream &stream, bool WriteBinary=false)
Write arbitrary data to a stream without using the pipeline.
vtkArrayWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkArrayWriter::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).
vtkArrayWriter::OutputString
vtkStdString OutputString
Definition: vtkArrayWriter.h:163
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkArrayWriter::FileName
char * FileName
Definition: vtkArrayWriter.h:160
vtkArrayWriter::WriteData
void WriteData() override
vtkArrayWriter
Serialize sparse and dense arrays to a file or stream.
Definition: vtkArrayWriter.h:81
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:46
vtkArray
Abstract interface for N-dimensional arrays.
Definition: vtkArray.h:65
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkWriter.h
vtkArrayWriter::~vtkArrayWriter
~vtkArrayWriter() override
vtkArrayWriter::Binary
vtkTypeBool Binary
Definition: vtkArrayWriter.h:161
vtkArrayWriter::Write
static vtkStdString Write(vtkArray *array, bool WriteBinary=false)
Write arbitrary data to a string without using the pipeline.
vtkArrayWriter::vtkArrayWriter
vtkArrayWriter()
vtkArrayWriter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkArrayWriter::Write
bool Write(ostream &stream, bool WriteBinary=false)
Write input port 0 data to an arbitrary stream.
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
vtkArrayWriter::Write
static bool Write(vtkArray *array, const vtkStdString &file_name, bool WriteBinary=false)
Write an arbitrary array to a file, without using the pipeline.
vtkArrayWriter::WriteToOutputString
bool WriteToOutputString
Definition: vtkArrayWriter.h:162
vtkArrayWriter::Write
bool Write(const vtkStdString &FileName, bool WriteBinary=false)
Writes input port 0 data to a file, using an arbitrary filename and binary flag.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkArrayWriter::GetOutputString
virtual vtkStdString GetOutputString()
The output string.
Definition: vtkArrayWriter.h:107
vtkArrayWriter::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).