VTK: IO/Core/vtkJavaScriptDataWriter.h Source File

| VTK 9.3.1

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
16 VTK_ABI_NAMESPACE_BEGIN
17 class vtkTable;
18
19 class VTKIOCORE_EXPORT vtkJavaScriptDataWriter : public vtkWriter
20 {
21 public:
22 static vtkJavaScriptDataWriter* New();
23 vtkTypeMacro(vtkJavaScriptDataWriter, vtkWriter);
24 void PrintSelf(ostream& os, vtkIndent indent) override;
25
27
33 vtkSetStringMacro(VariableName);
34 vtkGetStringMacro(VariableName);
36
38
41 vtkSetFilePathMacro(FileName);
42 vtkGetFilePathMacro(FileName);
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
69 protected:
70 vtkJavaScriptDataWriter();
71 ~vtkJavaScriptDataWriter() override;
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
83 char* VariableName;
84 char* FileName;
85 bool IncludeFieldNames;
86 ostream* OutputStream;
87
88 private:
89 vtkJavaScriptDataWriter(const vtkJavaScriptDataWriter&) = delete;
90 void operator=(const vtkJavaScriptDataWriter&) = delete;
91
92 ostream* OutputFile;
93 };
94
95 VTK_ABI_NAMESPACE_END
96 #endif
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkJavaScriptDataWriter
A Javascript data writer for vtkTable Writes a vtkTable into a Javascript data format.
Definition: vtkJavaScriptDataWriter.h:20
vtkJavaScriptDataWriter::VariableName
char * VariableName
Definition: vtkJavaScriptDataWriter.h:83
vtkJavaScriptDataWriter::WriteData
void WriteData() override
vtkJavaScriptDataWriter::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Get/Set the filename for the file.
vtkJavaScriptDataWriter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkJavaScriptDataWriter::SetOutputStream
void SetOutputStream(ostream *my_stream)
vtkJavaScriptDataWriter::FileName
char * FileName
Definition: vtkJavaScriptDataWriter.h:84
vtkJavaScriptDataWriter::vtkJavaScriptDataWriter
vtkJavaScriptDataWriter()
vtkJavaScriptDataWriter::New
static vtkJavaScriptDataWriter * New()
vtkJavaScriptDataWriter::OpenFile
bool OpenFile()
vtkJavaScriptDataWriter::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Get/Set the filename for the file.
vtkJavaScriptDataWriter::~vtkJavaScriptDataWriter
~vtkJavaScriptDataWriter() override
vtkJavaScriptDataWriter::CloseFile
void CloseFile()
vtkJavaScriptDataWriter::WriteTable
virtual void WriteTable(vtkTable *table, ostream *stream_ptr)
vtkJavaScriptDataWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkJavaScriptDataWriter::OutputStream
ostream * OutputStream
Definition: vtkJavaScriptDataWriter.h:86
vtkJavaScriptDataWriter::GetOutputStream
ostream * GetOutputStream()
vtkJavaScriptDataWriter::IncludeFieldNames
bool IncludeFieldNames
Definition: vtkJavaScriptDataWriter.h:85
vtkTable
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:35
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkWriter.h