VTK  9.2.6
vtkArrayDataWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkArrayDataWriter.h
5 
6 -------------------------------------------------------------------------
7  Copyright 2008 Sandia Corporation.
8  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9  the U.S. Government retains certain rights in this software.
10 -------------------------------------------------------------------------
11 
12  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
13  All rights reserved.
14  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notice for more information.
19 
20 =========================================================================*/
21 
54 #ifndef vtkArrayDataWriter_h
55 #define vtkArrayDataWriter_h
56 
57 #include "vtkIOCoreModule.h" // For export macro
58 #include "vtkStdString.h" // For string API
59 #include "vtkWriter.h"
60 
61 class vtkArrayData;
62 
63 class VTKIOCORE_EXPORT vtkArrayDataWriter : public vtkWriter
64 {
65 public:
66  static vtkArrayDataWriter* New();
67  vtkTypeMacro(vtkArrayDataWriter, vtkWriter);
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
71 
74  vtkSetFilePathMacro(FileName);
75  vtkGetFilePathMacro(FileName);
77 
79 
82  vtkSetMacro(Binary, vtkTypeBool);
83  vtkGetMacro(Binary, vtkTypeBool);
84  vtkBooleanMacro(Binary, vtkTypeBool);
86 
90  virtual vtkStdString GetOutputString() { return this->OutputString; }
91 
93 
96  vtkSetMacro(WriteToOutputString, bool);
97  vtkGetMacro(WriteToOutputString, bool);
98  vtkBooleanMacro(WriteToOutputString, bool);
100 
101  int Write() override; // This is necessary to get Write() wrapped for scripting languages.
102 
106  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
107 
111  static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false);
112 
117  bool Write(ostream& stream, bool WriteBinary = false);
118 
123  static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false);
124 
129  vtkStdString Write(bool WriteBinary);
130 
134  static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false);
135 
136 protected:
138  ~vtkArrayDataWriter() override;
139 
140  int FillInputPortInformation(int port, vtkInformation* info) override;
141  void WriteData() override;
142 
143  char* FileName;
147 
148 private:
149  vtkArrayDataWriter(const vtkArrayDataWriter&) = delete;
150  void operator=(const vtkArrayDataWriter&) = delete;
151 };
152 
153 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
Store vtkAlgorithm input/output information.
Serialize vtkArrayData to a file or stream.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:51
int vtkTypeBool
Definition: vtkABI.h:69
abstract class to write data to file(s)
Definition: vtkWriter.h:45
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
virtual vtkStdString GetOutputString()
The output string.
virtual int Write()
Write data to output.
static vtkAlgorithm * New()
virtual void WriteData()=0