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 
30 #ifndef vtkDelimitedTextWriter_h
31 #define vtkDelimitedTextWriter_h
32 
33 #include "vtkIOCoreModule.h" // For export macro
34 #include "vtkWriter.h"
35 
36 class vtkStdString;
37 class vtkTable;
38 
39 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
40 {
41 public:
42  static vtkDelimitedTextWriter* New();
44  void PrintSelf(ostream& os, vtkIndent indent);
45 
47 
50  vtkSetStringMacro(FieldDelimiter);
51  vtkGetStringMacro(FieldDelimiter);
53 
55 
59  vtkSetStringMacro(StringDelimiter);
60  vtkGetStringMacro(StringDelimiter);
62 
64 
67  vtkSetStringMacro(FileName);
68  vtkGetStringMacro(FileName);
70 
72 
76  vtkSetMacro(UseStringDelimiter, bool);
77  vtkGetMacro(UseStringDelimiter, bool);
79 
81 
84  vtkSetMacro(WriteToOutputString,bool);
85  vtkGetMacro(WriteToOutputString,bool);
86  vtkBooleanMacro(WriteToOutputString,bool);
88 
93  char *RegisterAndGetOutputString();
94 
99  vtkStdString GetString(vtkStdString string);
100 
101 protected:
104 
107 
108  bool OpenStream();
109 
110  virtual void WriteData();
111  virtual void WriteTable(vtkTable* rectilinearGrid);
112 
113  // see algorithm for more info.
114  // This writer takes in vtkTable.
116 
117  char* FileName;
121 
122  ostream* Stream;
123 
124 private:
125  vtkDelimitedTextWriter(const vtkDelimitedTextWriter&) VTK_DELETE_FUNCTION;
126  void operator=(const vtkDelimitedTextWriter&) VTK_DELETE_FUNCTION;
127 };
128 
129 
130 
131 #endif
132 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
Store vtkAlgorithm input/output information.
abstract class to write data to file(s)
Definition: vtkWriter.h:42
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
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
static vtkAlgorithm * New()
virtual void WriteData()=0
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.