VTK  9.1.0
vtkJavaScriptDataWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ParaView
4 Module: vtkJavaScriptDataWriter.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
27#ifndef vtkJavaScriptDataWriter_h
28#define vtkJavaScriptDataWriter_h
29
30#include "vtkIOCoreModule.h" // For export macro
31#include "vtkWriter.h"
32
33class vtkStdString;
34class vtkTable;
35
36class VTKIOCORE_EXPORT vtkJavaScriptDataWriter : public vtkWriter
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
50 vtkSetStringMacro(VariableName);
51 vtkGetStringMacro(VariableName);
53
55
61
63
78 vtkSetMacro(IncludeFieldNames, bool);
79 vtkGetMacro(IncludeFieldNames, bool);
81
82 // Get/Set the OutputStream for writing output.
83 void SetOutputStream(ostream* my_stream);
84 ostream* GetOutputStream();
85
86protected:
89
90 bool OpenFile();
91 void CloseFile();
92
93 void WriteData() override;
94 virtual void WriteTable(vtkTable* table, ostream* stream_ptr);
95
96 // see algorithm for more info.
97 // This writer takes in vtkTable.
99
101 char* FileName;
103 ostream* OutputStream;
104
105private:
107 void operator=(const vtkJavaScriptDataWriter&) = delete;
108
109 ostream* OutputFile;
110};
111
112#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
A Javascript data writer for vtkTable Writes a vtkTable into a Javascript data format.
void WriteData() override
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetOutputStream(ostream *my_stream)
static vtkJavaScriptDataWriter * New()
ostream * GetOutputStream()
vtkGetFilePathMacro(FileName)
Get/Set the filename for the file.
~vtkJavaScriptDataWriter() override
virtual void WriteTable(vtkTable *table, ostream *stream_ptr)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:172
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453