VTK  9.7.1
vtkDataObjectWriter.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
21 #ifndef vtkDataObjectWriter_h
22 #define vtkDataObjectWriter_h
23 
24 #include "vtkDataWriter.h" // Needs data because it calls methods on it
25 #include "vtkIOLegacyModule.h" // For export macro
26 #include "vtkStdString.h" // For string used in api
27 #include "vtkWriter.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class VTKIOLEGACY_EXPORT vtkDataObjectWriter : public vtkWriter
31 {
32 public:
33  static vtkDataObjectWriter* New();
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
38 
41  void SetFileName(VTK_FILEPATH const char* filename) { this->Writer->SetFileName(filename); }
42  VTK_FILEPATH VTK_FUTURE_CONST char* GetFileName() VTK_FUTURE_CONST
43  {
44  return this->Writer->GetFileName();
45  }
46  void SetHeader(const char* header) { this->Writer->SetHeader(header); }
47  char* GetHeader() { return this->Writer->GetHeader(); }
48  void SetFileType(int type) { this->Writer->SetFileType(type); }
49  int GetFileType() { return this->Writer->GetFileType(); }
50  void SetFileTypeToASCII() { this->Writer->SetFileType(VTK_ASCII); }
51  void SetFileTypeToBinary() { this->Writer->SetFileType(VTK_BINARY); }
52  void SetWriteToOutputString(int b) { this->Writer->SetWriteToOutputString(b); }
53  void WriteToOutputStringOn() { this->Writer->WriteToOutputStringOn(); }
54  void WriteToOutputStringOff() { this->Writer->WriteToOutputStringOff(); }
55  int GetWriteToOutputString() { return this->Writer->GetWriteToOutputString(); }
56  char* GetOutputString() { return this->Writer->GetOutputString(); }
57  vtkStdString GetOutputStdString() { return this->Writer->GetOutputStdString(); }
58  vtkIdType GetOutputStringLength() { return this->Writer->GetOutputStringLength(); }
59  unsigned char* GetBinaryOutputString() { return this->Writer->GetBinaryOutputString(); }
60  void SetFieldDataName(const char* fieldname) { this->Writer->SetFieldDataName(fieldname); }
61  char* GetFieldDataName() { return this->Writer->GetFieldDataName(); }
63 
64 protected:
66  ~vtkDataObjectWriter() override;
67 
68  bool WriteDataAndReturn() override;
70 
72 
73 private:
75  void operator=(const vtkDataObjectWriter&) = delete;
76 };
77 
78 VTK_ABI_NAMESPACE_END
79 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
void WriteToOutputStringOn()
Methods delegated to vtkDataWriter, see vtkDataWriter.
Store vtkAlgorithm input/output information.
char * GetHeader()
Methods delegated to vtkDataWriter, see vtkDataWriter.
helper class for objects that write VTK data files
Definition: vtkDataWriter.h:36
int vtkIdType
Definition: vtkType.h:363
#define VTK_ASCII
Definition: vtkWriter.h:32
void SetWriteToOutputString(int b)
Methods delegated to vtkDataWriter, see vtkDataWriter.
abstract class to write data to file(s)
Definition: vtkWriter.h:35
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetFileType(int type)
Methods delegated to vtkDataWriter, see vtkDataWriter.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIdType GetOutputStringLength()
Methods delegated to vtkDataWriter, see vtkDataWriter.
void SetFileTypeToBinary()
Methods delegated to vtkDataWriter, see vtkDataWriter.
void SetHeader(const char *header)
Methods delegated to vtkDataWriter, see vtkDataWriter.
#define VTK_BINARY
Definition: vtkWriter.h:33
void SetFieldDataName(const char *fieldname)
Methods delegated to vtkDataWriter, see vtkDataWriter.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
char * GetFieldDataName()
Methods delegated to vtkDataWriter, see vtkDataWriter.
vtkStdString GetOutputStdString()
Methods delegated to vtkDataWriter, see vtkDataWriter.
#define VTK_FILEPATH
void SetFileTypeToASCII()
Methods delegated to vtkDataWriter, see vtkDataWriter.
char * GetOutputString()
Methods delegated to vtkDataWriter, see vtkDataWriter.
write vtk field data
void SetFileName(const char *filename)
Methods delegated to vtkDataWriter, see vtkDataWriter.
VTK_FUTURE_CONST char * GetFileName() VTK_FUTURE_CONST
Methods delegated to vtkDataWriter, see vtkDataWriter.
vtkDataWriter * Writer
static vtkAlgorithm * New()
unsigned char * GetBinaryOutputString()
Methods delegated to vtkDataWriter, see vtkDataWriter.
virtual bool WriteDataAndReturn()
int GetFileType()
Methods delegated to vtkDataWriter, see vtkDataWriter.
void WriteToOutputStringOff()
Methods delegated to vtkDataWriter, see vtkDataWriter.
int GetWriteToOutputString()
Methods delegated to vtkDataWriter, see vtkDataWriter.