VTK  9.3.20240424
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 "vtkIOCoreModule.h" // For export macro
27
28VTK_ABI_NAMESPACE_BEGIN
29class vtkDataObject;
30
31#define VTK_ASCII 1
32#define VTK_BINARY 2
33
34class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
35{
36public:
37 vtkTypeMacro(vtkWriter, vtkAlgorithm);
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
45 virtual int Write();
46
53 void EncodeString(char* resname, const char* name, bool doublePercent);
54
62 void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
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 virtual void WriteData() = 0; // internal method subclasses must respond to
86
87private:
88 vtkWriter(const vtkWriter&) = delete;
89 void operator=(const vtkWriter&) = delete;
90};
91
92VTK_ABI_NAMESPACE_END
93#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:35
vtkTimeStamp WriteTime
Definition vtkWriter.h:85
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