VTK  9.1.0
vtkWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkWriter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
31#ifndef vtkWriter_h
32#define vtkWriter_h
33
34#include "vtkAlgorithm.h"
35#include "vtkIOCoreModule.h" // For export macro
36
37class vtkDataObject;
38
39#define VTK_ASCII 1
40#define VTK_BINARY 2
41
42class VTKIOCORE_EXPORT vtkWriter : public vtkAlgorithm
43{
44public:
45 vtkTypeMacro(vtkWriter, vtkAlgorithm);
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
53 virtual int Write();
54
61 void EncodeString(char* resname, const char* name, bool doublePercent);
62
70 void EncodeWriteString(ostream* out, const char* name, bool doublePercent);
71
73
77 void SetInputData(int index, vtkDataObject* input);
79
82
83protected:
85 ~vtkWriter() override;
86
88 vtkInformationVector* outputVector) override;
89 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
90 vtkInformationVector* outputVector);
91
92 virtual void WriteData() = 0; // internal method subclasses must respond to
94
95private:
96 vtkWriter(const vtkWriter&) = delete;
97 void operator=(const vtkWriter&) = delete;
98};
99
100#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:114
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:52
abstract class to write data to file(s)
Definition: vtkWriter.h:43
vtkTimeStamp WriteTime
Definition: vtkWriter.h:93
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.
@ port
Definition: vtkX3D.h:453
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
int vtkTypeBool
Definition: vtkABI.h:69