VTK  9.6.20260314
vtkWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
21
22#ifndef vtkWriter_h
23#define vtkWriter_h
24
25#include "vtkAlgorithm.h"
26#include "vtkDeprecation.h" // For VTK_DEPRECATED_9_6_0 VTK_DEPRECATED_IN_9_7_0
27#include "vtkIOCoreModule.h" // For export macro
28
29VTK_ABI_NAMESPACE_BEGIN
30class vtkDataObject;
31
32#define VTK_ASCII 1
33#define VTK_BINARY 2
34
35class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
36{
37public:
38 vtkTypeMacro(vtkWriter, vtkAlgorithm);
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
46 virtual int Write();
47
49
54 static void EncodeString(char* resname, const char* name);
55
64 VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
65 static void EncodeString(char* resname, const char* name, bool doublePercent);
67
69
74 static void EncodeWriteString(ostream* out, const char* name);
75
84 VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
85 static void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
87
89
93 void SetInputData(int index, vtkDataObject* input);
95
98
99protected:
101 ~vtkWriter() override;
102
104 vtkInformationVector* outputVector) override;
105 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
106 vtkInformationVector* outputVector);
107
108 // When removing this deprecation remove this whole section and keep the section below instead
109 VTK_DEPRECATED_IN_9_7_0("Use and override WriteDataAndReturn instead.")
110 virtual void WriteData();
111 virtual bool WriteDataAndReturn();
112
113#if 0
118 virtual bool WriteDataAndReturn() = 0;
119#endif
120
122
123private:
124 vtkWriter(const vtkWriter&) = delete;
125 void operator=(const vtkWriter&) = delete;
126
127 // VTK_DEPRECATED_IN_9_7_0 remove both members
128 bool WriteDataFlag = true;
129 bool WriteDataOverrideError = false;
130};
131
132VTK_ABI_NAMESPACE_END
133#endif
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
static void EncodeWriteString(ostream *out, const char *name)
Encode the string so that the reader will not have problems.
vtkTimeStamp WriteTime
Definition vtkWriter.h:121
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataObject * GetInput()
virtual int Write()
Write data to output.
virtual bool WriteDataAndReturn()
static void EncodeString(char *resname, const char *name)
Encode the string so that the reader will not have problems.
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
void SetInputData(vtkDataObject *input)
Set/get the input to this writer.
virtual void WriteData()
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_7_0(reason)
#define VTK_DEPRECATED_IN_9_6_0(reason)