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 
32 #ifndef __vtkDelimitedTextWriter_h
33 #define __vtkDelimitedTextWriter_h
34 
35 #include "vtkWriter.h"
36 
37 class vtkStdString;
38 class vtkTable;
39 
41 {
42 public:
43  static vtkDelimitedTextWriter* New();
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48 
49  vtkSetStringMacro(FieldDelimiter);
50  vtkGetStringMacro(FieldDelimiter);
52 
54 
56  vtkSetStringMacro(StringDelimiter);
57  vtkGetStringMacro(StringDelimiter);
59 
61 
62  vtkSetStringMacro(FileName);
63  vtkGetStringMacro(FileName);
65 
67 
69  vtkSetMacro(UseStringDelimiter, bool);
70  vtkGetMacro(UseStringDelimiter, bool);
72 
74 
75  vtkSetMacro(WriteToOutputString,bool);
76  vtkGetMacro(WriteToOutputString,bool);
77  vtkBooleanMacro(WriteToOutputString,bool);
79 
82  char *RegisterAndGetOutputString();
83 
85 
87  vtkStdString GetString(vtkStdString string);
88 protected:
92 
94  char* OutputString;
95 
96  bool OpenStream();
97 
98  virtual void WriteData();
99  virtual void WriteTable(vtkTable* rectilinearGrid);
100 
101  // see algorithm for more info.
102  // This writer takes in vtkTable.
104 
105  char* FileName;
109 //BTX
110  ostream* Stream;
111 //ETX
112 private:
113  vtkDelimitedTextWriter(const vtkDelimitedTextWriter&); // Not implemented.
114  void operator=(const vtkDelimitedTextWriter&); // Not implemented.
115 };
116 
117 
118 
119 #endif
120 
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
Store vtkAlgorithm input/output information.
abstract class to write data to file(s)
Definition: vtkWriter.h:43
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:37
virtual int FillInputPortInformation(int port, vtkInformation *info)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:66
static vtkAlgorithm * New()
virtual void WriteData()=0
#define VTK_IO_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)