VTK  9.0.3
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 
51 #ifndef vtkArrayDataWriter_h
52 #define vtkArrayDataWriter_h
53 
54 #include "vtkIOCoreModule.h" // For export macro
55 #include "vtkStdString.h" // For string API
56 #include "vtkWriter.h"
57 
58 class vtkArrayData;
59 
60 class VTKIOCORE_EXPORT vtkArrayDataWriter : public vtkWriter
61 {
62 public:
64  vtkTypeMacro(vtkArrayDataWriter, vtkWriter);
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  vtkSetStringMacro(FileName);
72  vtkGetStringMacro(FileName);
74 
76 
79  vtkSetMacro(Binary, vtkTypeBool);
80  vtkGetMacro(Binary, vtkTypeBool);
81  vtkBooleanMacro(Binary, vtkTypeBool);
83 
87  virtual vtkStdString GetOutputString() { return this->OutputString; }
88 
90 
93  vtkSetMacro(WriteToOutputString, bool);
94  vtkGetMacro(WriteToOutputString, bool);
95  vtkBooleanMacro(WriteToOutputString, bool);
97 
98  int Write() override; // This is necessary to get Write() wrapped for scripting languages.
99 
103  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
104 
108  static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false);
109 
114  bool Write(ostream& stream, bool WriteBinary = false);
115 
120  static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false);
121 
126  vtkStdString Write(bool WriteBinary);
127 
131  static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false);
132 
133 protected:
136 
138  void WriteData() override;
139 
140  char* FileName;
144 
145 private:
146  vtkArrayDataWriter(const vtkArrayDataWriter&) = delete;
147  void operator=(const vtkArrayDataWriter&) = delete;
148 };
149 
150 #endif
Serialize vtkArrayData to a file or stream.
static bool Write(vtkArrayData *array, ostream &stream, bool WriteBinary=false)
Write arbitrary data to a stream without using the pipeline.
int Write() override
Write data to output.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkArrayDataWriter() override
static vtkArrayDataWriter * New()
void WriteData() override
virtual vtkStdString GetOutputString()
The output string.
bool Write(const vtkStdString &FileName, bool WriteBinary=false)
Writes input port 0 data to a file, using an arbitrary filename and binary flag.
static vtkStdString Write(vtkArrayData *array, bool WriteBinary=false)
Write arbitrary data to a string without using the pipeline.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static bool Write(vtkArrayData *array, const vtkStdString &file_name, bool WriteBinary=false)
Write an arbitrary array to a file, without using the pipeline.
vtkStdString Write(bool WriteBinary)
Write input port 0 data to a string.
bool Write(ostream &stream, bool WriteBinary=false)
Write input port 0 data to an arbitrary stream.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:50
a simple class to control print indentation
Definition: vtkIndent.h:34
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:35
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkTypeBool
Definition: vtkABI.h:69