VTK  9.7.20260723
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_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
57
62 static void EncodeWriteString(ostream* out, const char* name);
63
65
69 void SetInputData(int index, vtkDataObject* input);
71
74
75protected:
77 ~vtkWriter() override;
78
80 vtkInformationVector* outputVector) override;
81 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
82 vtkInformationVector* outputVector);
83
84 // When removing this deprecation remove this whole section and keep the section below instead
85 VTK_DEPRECATED_IN_9_7_0("Use and override WriteDataAndReturn instead.")
86 virtual void WriteData();
87 virtual bool WriteDataAndReturn();
88
89#if 0
94 virtual bool WriteDataAndReturn() = 0;
95#endif
96
98
99private:
100 vtkWriter(const vtkWriter&) = delete;
101 void operator=(const vtkWriter&) = delete;
102
103 // VTK_DEPRECATED_IN_9_7_0 remove both members
104 bool WriteDataFlag = true;
105 bool WriteDataOverrideError = false;
106};
107
108VTK_ABI_NAMESPACE_END
109#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:97
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)
vtkDataObject * GetInput(int port)
~vtkWriter() override
void SetInputData(int index, vtkDataObject *input)
Encode the string so that the reader will not have problems.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_7_0(reason)