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 
26 #ifndef vtkJavaScriptDataWriter_h
27 #define vtkJavaScriptDataWriter_h
28 
29 #include "vtkIOCoreModule.h" // For export macro
30 #include "vtkWriter.h"
31 
32 class vtkStdString;
33 class vtkTable;
34 
36 {
37 public:
38  static vtkJavaScriptDataWriter* New();
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43 
48  vtkSetStringMacro(VariableName);
49  vtkGetStringMacro(VariableName);
51 
53 
54  vtkSetStringMacro(FileName);
55  vtkGetStringMacro(FileName);
57 
59 
65  vtkSetMacro(IncludeFieldNames, bool);
66  vtkGetMacro(IncludeFieldNames, bool);
68 
69  // Get/Set the OutputStream for writing output.
70  void SetOutputStream(ostream *my_stream);
71  ostream* GetOutputStream();
72 
73 protected:
76 
77  ofstream* OpenFile();
78 
79  virtual void WriteData();
80  virtual void WriteTable(vtkTable* table, ostream *stream_ptr);
81 
82  // see algorithm for more info.
83  // This writer takes in vtkTable.
85 
86  char* VariableName;
87  char* FileName;
89  ostream* OutputStream;
90 private:
91  vtkJavaScriptDataWriter(const vtkJavaScriptDataWriter&); // Not implemented.
92  void operator=(const vtkJavaScriptDataWriter&); // Not implemented.
93 //ETX
94 };
95 
96 
97 
98 #endif
99 
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
A Javascript data writer for vtkTable Writes a vtkTable into a Javascript data format.
Store vtkAlgorithm input/output information.
#define VTKIOCORE_EXPORT
abstract class to write data to file(s)
Definition: vtkWriter.h:44
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int FillInputPortInformation(int port, vtkInformation *info)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
static vtkAlgorithm * New()
virtual void WriteData()=0
void PrintSelf(ostream &os, vtkIndent indent)