VTK  9.3.20240419
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 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkDataObject;
30 
31 #define VTK_ASCII 1
32 #define VTK_BINARY 2
33 
34 class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
35 {
36 public:
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 
75 protected:
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 
87 private:
88  vtkWriter(const vtkWriter&) = delete;
89  void operator=(const vtkWriter&) = delete;
90 };
91 
92 VTK_ABI_NAMESPACE_END
93 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:162
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
Definition: vtkTimeStamp.h:44
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.
virtual int Write()
Write data to output.
vtkDataObject * GetInput()
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.
vtkDataObject * GetInput(int port)
void SetInputData(vtkDataObject *input)
Set/get the input to this writer.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
~vtkWriter() override
void SetInputData(int index, vtkDataObject *input)
Set/get the input to this writer.
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
int vtkTypeBool
Definition: vtkABI.h:64