VTK  9.4.20241218
vtkJavaScriptDataWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
10#ifndef vtkJavaScriptDataWriter_h
11#define vtkJavaScriptDataWriter_h
12
13#include "vtkIOCoreModule.h" // For export macro
14#include "vtkWriter.h"
15
16VTK_ABI_NAMESPACE_BEGIN
17class vtkTable;
18
19class VTKIOCORE_EXPORT vtkJavaScriptDataWriter : public vtkWriter
20{
21public:
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
27
33 vtkSetStringMacro(VariableName);
34 vtkGetStringMacro(VariableName);
36
38
44
46
61 vtkSetMacro(IncludeFieldNames, bool);
62 vtkGetMacro(IncludeFieldNames, bool);
64
65 // Get/Set the OutputStream for writing output.
66 void SetOutputStream(ostream* my_stream);
67 ostream* GetOutputStream();
68
69protected:
72
73 bool OpenFile();
74 void CloseFile();
75
76 void WriteData() override;
77 virtual void WriteTable(vtkTable* table, ostream* stream_ptr);
78
79 // see algorithm for more info.
80 // This writer takes in vtkTable.
81 int FillInputPortInformation(int port, vtkInformation* info) override;
82
84 char* FileName;
86 ostream* OutputStream;
87
88private:
90 void operator=(const vtkJavaScriptDataWriter&) = delete;
91
92 ostream* OutputFile;
93};
94
95VTK_ABI_NAMESPACE_END
96#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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.
A table, which contains similar-typed columns of data.
Definition vtkTable.h:169
abstract class to write data to file(s)
Definition vtkWriter.h:35