VTK  9.3.20240424
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
44VTK_ABI_NAMESPACE_BEGIN
45class vtkArrayData;
46
47class VTKIOCORE_EXPORT vtkArrayDataWriter : public vtkWriter
48{
49public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
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
120protected:
123
124 int FillInputPortInformation(int port, vtkInformation* info) override;
125 void WriteData() override;
126
127 char* FileName;
131
132private:
133 vtkArrayDataWriter(const vtkArrayDataWriter&) = delete;
134 void operator=(const vtkArrayDataWriter&) = delete;
135};
136
137VTK_ABI_NAMESPACE_END
138#endif
Serialize vtkArrayData to a file or stream.
static bool Write(vtkArrayData *array, ostream &stream, bool WriteBinary=false)
Write arbitrary data to a stream without using the pipeline.
int Write() override
Write data to output.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkArrayDataWriter() override
vtkGetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).
void WriteData() override
vtkSetFilePathMacro(FileName)
Get / set the filename where data will be stored (when used as a filter).
virtual vtkStdString GetOutputString()
The output string.
bool Write(const vtkStdString &FileName, bool WriteBinary=false)
Writes input port 0 data to a file, using an arbitrary filename and binary flag.
static vtkStdString Write(vtkArrayData *array, bool WriteBinary=false)
Write arbitrary data to a string without using the pipeline.
static vtkArrayDataWriter * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static bool Write(vtkArrayData *array, const vtkStdString &file_name, bool WriteBinary=false)
Write an arbitrary array to a file, without using the pipeline.
vtkStdString Write(bool WriteBinary)
Write input port 0 data to a string.
bool Write(ostream &stream, bool WriteBinary=false)
Write input port 0 data to an arbitrary stream.
Pipeline data object that contains multiple vtkArray objects.
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
abstract class to write data to file(s)
Definition vtkWriter.h:35
int vtkTypeBool
Definition vtkABI.h:64