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
36#ifndef vtkDelimitedTextWriter_h
37#define vtkDelimitedTextWriter_h
38
39#include "vtkIOCoreModule.h" // For export macro
40#include "vtkWriter.h"
41
42class vtkStdString;
43class vtkTable;
44
45class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter
46{
47public:
50 void PrintSelf(ostream& os, vtkIndent indent) override;
51
53
56 vtkSetStringMacro(FieldDelimiter);
57 vtkGetStringMacro(FieldDelimiter);
59
61
65 vtkSetStringMacro(StringDelimiter);
66 vtkGetStringMacro(StringDelimiter);
68
70
76
78
82 vtkSetMacro(UseStringDelimiter, bool);
83 vtkGetMacro(UseStringDelimiter, bool);
85
87
90 vtkSetMacro(WriteToOutputString, bool);
91 vtkGetMacro(WriteToOutputString, bool);
92 vtkBooleanMacro(WriteToOutputString, bool);
94
100
106
107protected:
110
113
115
116 void WriteData() override;
117 virtual void WriteTable(vtkTable* table);
118
119 // see algorithm for more info.
120 // This writer takes in vtkTable.
122
123 char* FileName;
127
128 ostream* Stream;
129
130private:
132 void operator=(const vtkDelimitedTextWriter&) = delete;
133};
134
135#endif
Delimited text writer for vtkTable Writes a vtkTable as a delimited text file (such as CSV).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void WriteTable(vtkTable *table)
void WriteData() override
vtkGetFilePathMacro(FileName)
Get/Set the filename for the file.
static vtkDelimitedTextWriter * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
~vtkDelimitedTextWriter() override
vtkStdString GetString(vtkStdString string)
Internal method: Returns the "string" with the "StringDelimiter" if UseStringDelimiter is true.
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
char * RegisterAndGetOutputString()
This convenience method returns the string, sets the IVAR to nullptr, so that the user is responsible...
a simple class to control print indentation
Definition: vtkIndent.h:43
Store vtkAlgorithm input/output information.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:45
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:72
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453