VTK  9.5.20250831
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
22#ifndef vtkWriter_h
23#define vtkWriter_h
24
25#include "vtkAlgorithm.h"
26#include "vtkDeprecation.h" // For VTK_DEPRECATED_9_5_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
57 static void EncodeString(char* resname, const char* name);
58 VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
59 static void EncodeString(char* resname, const char* name, bool doublePercent);
61
63
71 static void EncodeWriteString(ostream* out, const char* name);
72 VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
73 static void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
75
77
80 void SetInputData(vtkDataObject* input);
81 void SetInputData(int index, vtkDataObject* input);
83
84 vtkDataObject* GetInput();
85 vtkDataObject* GetInput(int port);
86
87protected:
89 ~vtkWriter() override;
90
91 vtkTypeBool ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
92 vtkInformationVector* outputVector) override;
93 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
94 vtkInformationVector* outputVector);
95
96 virtual void WriteData() = 0; // internal method subclasses must respond to
97 vtkTimeStamp WriteTime;
98
99private:
100 vtkWriter(const vtkWriter&) = delete;
101 void operator=(const vtkWriter&) = delete;
102};
103
104VTK_ABI_NAMESPACE_END
105#endif
Superclass for all sources, filters, and sinks in VTK.
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
abstract class to write data to file(s)
Definition vtkWriter.h:36
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int Write()
Write data to output.
static void EncodeString(char *resname, const char *name)
Encode the string so that the reader will not have problems.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_6_0(reason)