VTK  9.2.6
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 
33 class vtkStdString;
34 class vtkTable;
35 
36 class VTKIOCORE_EXPORT vtkJavaScriptDataWriter : public vtkWriter
37 {
38 public:
39  static vtkJavaScriptDataWriter* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
50  vtkSetStringMacro(VariableName);
51  vtkGetStringMacro(VariableName);
53 
55 
58  vtkSetFilePathMacro(FileName);
59  vtkGetFilePathMacro(FileName);
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 
86 protected:
88  ~vtkJavaScriptDataWriter() override;
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 
105 private:
107  void operator=(const vtkJavaScriptDataWriter&) = delete;
108 
109  ostream* OutputFile;
110 };
111 
112 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:38
A Javascript data writer for vtkTable Writes a vtkTable into a Javascript data format.
Store vtkAlgorithm input/output information.
abstract class to write data to file(s)
Definition: vtkWriter.h:45
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:73
static vtkAlgorithm * New()
virtual void WriteData()=0