VTK
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 "vtkWriter.h"
56 #include "vtkStdString.h" // For string API
57 
58 class vtkArrayData;
59 
60 class VTKIOCORE_EXPORT vtkArrayDataWriter :
61  public vtkWriter
62 {
63 public:
64  static vtkArrayDataWriter *New();
65  vtkTypeMacro(vtkArrayDataWriter, vtkWriter);
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
69 
72  vtkSetStringMacro(FileName);
73  vtkGetStringMacro(FileName);
75 
77 
80  vtkSetMacro(Binary, vtkTypeBool);
81  vtkGetMacro(Binary, vtkTypeBool);
82  vtkBooleanMacro(Binary, vtkTypeBool);
84 
89  { return this->OutputString; }
90 
92 
95  vtkSetMacro(WriteToOutputString, bool);
96  vtkGetMacro(WriteToOutputString, bool);
97  vtkBooleanMacro(WriteToOutputString, bool);
99 
100  int Write() override; // This is necessary to get Write() wrapped for scripting languages.
101 
105  bool Write(const vtkStdString& FileName, bool WriteBinary = false);
106 
110  static bool Write(vtkArrayData* array, const vtkStdString& file_name, bool WriteBinary = false);
111 
116  bool Write(ostream& stream, bool WriteBinary = false);
117 
122  static bool Write(vtkArrayData* array, ostream& stream, bool WriteBinary = false);
123 
128  vtkStdString Write(bool WriteBinary);
129 
133  static vtkStdString Write(vtkArrayData* array, bool WriteBinary = false);
134 
135 protected:
137  ~vtkArrayDataWriter() override;
138 
139  int FillInputPortInformation(int port, vtkInformation* info) override;
140  void WriteData() override;
141 
142  char* FileName;
146 
147 private:
148  vtkArrayDataWriter(const vtkArrayDataWriter&) = delete;
149  void operator=(const vtkArrayDataWriter&) = delete;
150 };
151 
152 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:34
Store vtkAlgorithm input/output information.
Serialize vtkArrayData to a file or stream.
Pipeline data object that contains multiple vtkArray objects.
Definition: vtkArrayData.h:49
int vtkTypeBool
Definition: vtkABI.h:69
abstract class to write data to file(s)
Definition: vtkWriter.h:42
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:33
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