VTK  9.1.0
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 
46 #ifndef vtkDelimitedTextWriter_h
47 #define vtkDelimitedTextWriter_h
48 
49 #include "vtkIOCoreModule.h" // For export macro
50 #include "vtkWriter.h"
51 
52 class vtkStdString;
53 class vtkTable;
54 
55 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
56 {
57 public:
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
66  vtkSetStringMacro(FieldDelimiter);
67  vtkGetStringMacro(FieldDelimiter);
69 
71 
75  vtkSetStringMacro(StringDelimiter);
76  vtkGetStringMacro(StringDelimiter);
78 
80 
86 
88 
92  vtkSetMacro(UseStringDelimiter, bool);
93  vtkGetMacro(UseStringDelimiter, bool);
95 
97 
100  vtkSetMacro(WriteToOutputString, bool);
101  vtkGetMacro(WriteToOutputString, bool);
102  vtkBooleanMacro(WriteToOutputString, bool);
104 
110 
116 
117 protected:
120 
123 
124  bool OpenStream();
125 
126  void WriteData() override;
127  virtual void WriteTable(vtkTable* table);
128 
129  // see algorithm for more info.
130  // This writer takes in vtkTable.
132 
133  char* FileName;
137 
138  ostream* Stream;
139 
140 private:
142  void operator=(const vtkDelimitedTextWriter&) = delete;
143 };
144 
145 #endif
vtkDelimitedTextWriter::GetString
vtkStdString GetString(vtkStdString string)
Internal method: Returns the "string" with the "StringDelimiter" if UseStringDelimiter is true.
vtkDelimitedTextWriter::UseStringDelimiter
bool UseStringDelimiter
Definition: vtkDelimitedTextWriter.h:136
vtkDelimitedTextWriter::New
static vtkDelimitedTextWriter * New()
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
vtkDelimitedTextWriter::OutputString
char * OutputString
Definition: vtkDelimitedTextWriter.h:122
vtkDelimitedTextWriter::WriteToOutputString
bool WriteToOutputString
Definition: vtkDelimitedTextWriter.h:121
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkDelimitedTextWriter::FieldDelimiter
char * FieldDelimiter
Definition: vtkDelimitedTextWriter.h:134
vtkDelimitedTextWriter::vtkDelimitedTextWriter
vtkDelimitedTextWriter()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:46
vtkDelimitedTextWriter::FileName
char * FileName
Definition: vtkDelimitedTextWriter.h:133
vtkDelimitedTextWriter
Delimited text writer for vtkTable Writes a vtkTable as a delimited text file (such as CSV).
Definition: vtkDelimitedTextWriter.h:56
vtkDelimitedTextWriter::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
vtkDelimitedTextWriter::~vtkDelimitedTextWriter
~vtkDelimitedTextWriter() override
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkDelimitedTextWriter::RegisterAndGetOutputString
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkDelimitedTextWriter::StringDelimiter
char * StringDelimiter
Definition: vtkDelimitedTextWriter.h:135
vtkWriter.h
vtkDelimitedTextWriter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkDelimitedTextWriter::WriteTable
virtual void WriteTable(vtkTable *table)
vtkDelimitedTextWriter::Stream
ostream * Stream
Definition: vtkDelimitedTextWriter.h:138
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
vtkDelimitedTextWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDelimitedTextWriter::OpenStream
bool OpenStream()
vtkDelimitedTextWriter::WriteData
void WriteData() override
vtkDelimitedTextWriter::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Get/Set the filename for the file.