VTK
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  vtkSetStringMacro(FileName);
59  vtkGetStringMacro(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  ofstream* OpenFile();
91 
92  void WriteData() override;
93  virtual void WriteTable(vtkTable* table, ostream *stream_ptr);
94 
95  // see algorithm for more info.
96  // This writer takes in vtkTable.
98 
99  char* VariableName;
100  char* FileName;
102  ostream* OutputStream;
103 private:
105  void operator=(const vtkJavaScriptDataWriter&) = delete;
106 
107 };
108 
109 
110 
111 #endif
112 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:40
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:42
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:68
static vtkAlgorithm * New()
virtual void WriteData()=0