VTK: IO/Core/vtkArrayDataWriter.h Source File

| VTK 9.3.1

vtkArrayDataWriter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4
37 #ifndef vtkArrayDataWriter_h
38 #define vtkArrayDataWriter_h
39
40 #include "vtkIOCoreModule.h" // For export macro
41 #include "vtkStdString.h" // For string API
42 #include "vtkWriter.h"
43
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkArrayData;
46
47 class VTKIOCORE_EXPORT vtkArrayDataWriter : public vtkWriter
48 {
49 public:
50 static vtkArrayDataWriter* New();
51 vtkTypeMacro(vtkArrayDataWriter, vtkWriter);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
58 vtkSetFilePathMacro(FileName);
59 vtkGetFilePathMacro(FileName);
61
63
66 vtkSetMacro(Binary, vtkTypeBool);
67 vtkGetMacro(Binary, vtkTypeBool);
68 vtkBooleanMacro(Binary, vtkTypeBool);
70
74 virtual vtkStdString GetOutputString() { return this->OutputString; }
75
77
80 vtkSetMacro(WriteToOutputString, bool);
81 vtkGetMacro(WriteToOutputString, bool);
82 vtkBooleanMacro(WriteToOutputString, bool);
84
85 int Write() override; // This is necessary to get Write() wrapped for scripting languages.
86
90 bool Write(const vtkStdString& FileName, bool WriteBinary = false);
91
95 static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false);
96
101 bool Write(ostream& stream, bool WriteBinary = false);
102
107 static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false);
108
113 vtkStdString Write(bool WriteBinary);
114
118 static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false);
119
120 protected:
121 vtkArrayDataWriter();
122 ~vtkArrayDataWriter() override;
123
124 int FillInputPortInformation(int port, vtkInformation* info) override;
125 void WriteData() override;
126
127 char* FileName;
128 vtkTypeBool Binary;
129 bool WriteToOutputString;
130 vtkStdString OutputString;
131
132 private:
133 vtkArrayDataWriter(const vtkArrayDataWriter&) = delete;
134 void operator=(const vtkArrayDataWriter&) = delete;
135 };
136
137 VTK_ABI_NAMESPACE_END
138 #endif
vtkArrayDataWriter
Serialize vtkArrayData to a file or stream.
Definition: vtkArrayDataWriter.h:48
vtkArrayDataWriter::WriteToOutputString
bool WriteToOutputString
Definition: vtkArrayDataWriter.h:129
vtkArrayDataWriter::FileName
char * FileName
Definition: vtkArrayDataWriter.h:127
vtkArrayDataWriter::Write
static bool Write(vtkArrayData *array, ostream &stream, bool WriteBinary=false)
Write arbitrary data to a stream without using the pipeline.
vtkArrayDataWriter::OutputString
vtkStdString OutputString
Definition: vtkArrayDataWriter.h:130
vtkArrayDataWriter::Write
int Write() override
Write data to output.
vtkArrayDataWriter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkArrayDataWriter::~vtkArrayDataWriter
~vtkArrayDataWriter() override
vtkArrayDataWriter::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).
vtkArrayDataWriter::New
static vtkArrayDataWriter * New()
vtkArrayDataWriter::WriteData
void WriteData() override
vtkArrayDataWriter::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).
vtkArrayDataWriter::GetOutputString
virtual vtkStdString GetOutputString()
The output string.
Definition: vtkArrayDataWriter.h:74
vtkArrayDataWriter::Write
bool Write(const vtkStdString &FileName, bool WriteBinary=false)
Writes input port 0 data to a file, using an arbitrary filename and binary flag.
vtkArrayDataWriter::Binary
vtkTypeBool Binary
Definition: vtkArrayDataWriter.h:128
vtkArrayDataWriter::Write
static vtkStdString Write(vtkArrayData *array, bool WriteBinary=false)
Write arbitrary data to a string without using the pipeline.
vtkArrayDataWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkArrayDataWriter::Write
static bool Write(vtkArrayData *array, const vtkStdString &file_name, bool WriteBinary=false)
Write an arbitrary array to a file, without using the pipeline.
vtkArrayDataWriter::Write
vtkStdString Write(bool WriteBinary)
Write input port 0 data to a string.
vtkArrayDataWriter::Write
bool Write(ostream &stream, bool WriteBinary=false)
Write input port 0 data to an arbitrary stream.
vtkArrayDataWriter::vtkArrayDataWriter
vtkArrayDataWriter()
vtkArrayData
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:35
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkStdString.h
vtkWriter.h