VTK  9.3.0
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
19#ifndef vtkWriter_h
20#define vtkWriter_h
21
22#include "vtkAlgorithm.h"
23#include "vtkIOCoreModule.h" // For export macro
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkDataObject;
27
28#define VTK_ASCII 1
29#define VTK_BINARY 2
30
31class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
32{
33public:
34 vtkTypeMacro(vtkWriter, vtkAlgorithm);
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
42 virtual int Write();
43
50 void EncodeString(char* resname, const char* name, bool doublePercent);
51
59 void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
60
62
66 void SetInputData(int index, vtkDataObject* input);
68
71
72protected:
74 ~vtkWriter() override;
75
77 vtkInformationVector* outputVector) override;
78 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
79 vtkInformationVector* outputVector);
80
81 virtual void WriteData() = 0; // internal method subclasses must respond to
83
84private:
85 vtkWriter(const vtkWriter&) = delete;
86 void operator=(const vtkWriter&) = delete;
87};
88
89VTK_ABI_NAMESPACE_END
90#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:29
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:32
vtkTimeStamp WriteTime
Definition vtkWriter.h:82
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 void WriteData()=0
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
void EncodeString(char *resname, const char *name, bool doublePercent)
Encode the string so that the reader will not have problems.
void EncodeWriteString(ostream *out, const char *name, bool doublePercent)
Encode the string so that the reader will not have problems.
void SetInputData(vtkDataObject *input)
Set/get the input to this writer.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkDataObject * GetInput(int port)
~vtkWriter() override
void SetInputData(int index, vtkDataObject *input)
Set/get the input to this writer.
int vtkTypeBool
Definition vtkABI.h:64