VTK
vtkDelimitedTextWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkDelimitedTextWriter.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2009 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
27 #ifndef vtkDelimitedTextWriter_h
28 #define vtkDelimitedTextWriter_h
29 
30 #include "vtkIOCoreModule.h" // For export macro
31 #include "vtkWriter.h"
32 
33 class vtkStdString;
34 class vtkTable;
35 
36 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
37 {
38 public:
39  static vtkDelimitedTextWriter* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  vtkSetStringMacro(FieldDelimiter);
48  vtkGetStringMacro(FieldDelimiter);
50 
52 
56  vtkSetStringMacro(StringDelimiter);
57  vtkGetStringMacro(StringDelimiter);
59 
61 
64  vtkSetStringMacro(FileName);
65  vtkGetStringMacro(FileName);
67 
69 
73  vtkSetMacro(UseStringDelimiter, bool);
74  vtkGetMacro(UseStringDelimiter, bool);
76 
78 
81  vtkSetMacro(WriteToOutputString,bool);
82  vtkGetMacro(WriteToOutputString,bool);
83  vtkBooleanMacro(WriteToOutputString,bool);
85 
90  char *RegisterAndGetOutputString();
91 
96  vtkStdString GetString(vtkStdString string);
97 
98 protected:
100  ~vtkDelimitedTextWriter() override;
101 
104 
105  bool OpenStream();
106 
107  void WriteData() override;
108  virtual void WriteTable(vtkTable* rectilinearGrid);
109 
110  // see algorithm for more info.
111  // This writer takes in vtkTable.
112  int FillInputPortInformation(int port, vtkInformation* info) override;
113 
114  char* FileName;
118 
119  ostream* Stream;
120 
121 private:
123  void operator=(const vtkDelimitedTextWriter&) = delete;
124 };
125 
126 
127 
128 #endif
129 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
Store vtkAlgorithm input/output information.
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.
Delimited text writer for vtkTable Writes a vtkTable as a delimited text file (such as CSV)...
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.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
static vtkAlgorithm * New()
virtual void WriteData()=0