VTK  9.7.1
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_6_0 VTK_DEPRECATED_IN_9_7_0
27 #include "vtkIOCoreModule.h" // For export macro
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkDataObject;
31 
32 #define VTK_ASCII 1
33 #define VTK_BINARY 2
34 
35 class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
36 {
37 public:
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 
64  VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
65  static void EncodeString(char* resname, const char* name, bool doublePercent);
67 
69 
74  static void EncodeWriteString(ostream* out, const char* name);
75 
84  VTK_DEPRECATED_IN_9_6_0("Use the version without doublePercent instead.")
85  static void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
87 
89 
92  void SetInputData(vtkDataObject* input);
93  void SetInputData(int index, vtkDataObject* input);
95 
96  vtkDataObject* GetInput();
97  vtkDataObject* GetInput(int port);
98 
99 protected:
100  vtkWriter();
101  ~vtkWriter() override;
102 
103  vtkTypeBool ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
104  vtkInformationVector* outputVector) override;
105  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
106  vtkInformationVector* outputVector);
107 
108  // When removing this deprecation remove this whole section and keep the section below instead
109  VTK_DEPRECATED_IN_9_7_0("Use and override WriteDataAndReturn instead.")
110  virtual void WriteData();
111  virtual bool WriteDataAndReturn();
112 
113 #if 0
114 
118  virtual bool WriteDataAndReturn() = 0;
119 #endif
120 
122 
123 private:
124  vtkWriter(const vtkWriter&) = delete;
125  void operator=(const vtkWriter&) = delete;
126 
127  // VTK_DEPRECATED_IN_9_7_0 remove both members
128  bool WriteDataFlag = true;
129  bool WriteDataOverrideError = false;
130 };
131 
132 VTK_ABI_NAMESPACE_END
133 #endif
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
abstract class to write data to file(s)
Definition: vtkWriter.h:35
vtkTimeStamp WriteTime
Definition: vtkWriter.h:121
#define VTK_DEPRECATED_IN_9_6_0(reason)
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:53
a simple class to control print indentation
Definition: vtkIndent.h:28
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:55
#define VTK_DEPRECATED_IN_9_7_0(reason)