ParaView
vtkCSVWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCSVWriter.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 =========================================================================*/
21 #ifndef vtkCSVWriter_h
22 #define vtkCSVWriter_h
23 
24 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
25 #include "vtkWriter.h"
26 
27 class vtkStdString;
28 class vtkTable;
29 
30 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkCSVWriter : public vtkWriter
31 {
32 public:
33  static vtkCSVWriter* New();
34  vtkTypeMacro(vtkCSVWriter, vtkWriter);
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
38 
41  vtkSetStringMacro(FieldDelimiter);
42  vtkGetStringMacro(FieldDelimiter);
44 
46 
50  vtkSetStringMacro(StringDelimiter);
51  vtkGetStringMacro(StringDelimiter);
53 
55 
58  vtkSetStringMacro(FileName);
59  vtkGetStringMacro(FileName);
61 
63 
67  vtkSetMacro(UseStringDelimiter, bool);
68  vtkGetMacro(UseStringDelimiter, bool);
70 
72 
76  vtkSetClampMacro(Precision, int, 0, VTK_INT_MAX);
77  vtkGetMacro(Precision, int);
79 
81 
84  vtkSetMacro(UseScientificNotation, bool);
85  vtkGetMacro(UseScientificNotation, bool);
86  vtkBooleanMacro(UseScientificNotation, bool);
88 
90 
94  vtkStdString GetString(vtkStdString string);
95 
96 protected:
97  vtkCSVWriter();
98  ~vtkCSVWriter();
100 
101  bool OpenFile();
102 
103  virtual void WriteData();
104  virtual void WriteTable(vtkTable* rectilinearGrid);
105 
106  // see algorithm for more info.
107  // This writer takes in vtkTable.
108  virtual int FillInputPortInformation(int port, vtkInformation* info);
109 
110  char* FileName;
116 
117  ofstream* Stream;
118 
119 private:
120  vtkCSVWriter(const vtkCSVWriter&) VTK_DELETE_FUNCTION;
121  void operator=(const vtkCSVWriter&) VTK_DELETE_FUNCTION;
122 };
123 
124 #endif
char * StringDelimiter
Definition: vtkCSVWriter.h:112
bool UseStringDelimiter
Definition: vtkCSVWriter.h:113
char * FieldDelimiter
Definition: vtkCSVWriter.h:111
CSV writer for vtkTable Writes a vtkTable as a delimited text file (such as CSV). ...
Definition: vtkCSVWriter.h:30
char * FileName
Definition: vtkCSVWriter.h:110
bool UseScientificNotation
Definition: vtkCSVWriter.h:115
ofstream * Stream
Definition: vtkCSVWriter.h:117