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 "vtkWriter.h"
30 
31 class vtkStdString;
32 class vtkTable;
33 
35 {
36 public:
37  static vtkJavaScriptDataWriter* New();
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42 
47  vtkSetStringMacro(VariableName);
48  vtkGetStringMacro(VariableName);
50 
52 
53  vtkSetStringMacro(FileName);
54  vtkGetStringMacro(FileName);
56 
58 
64  vtkSetMacro(IncludeFieldNames, bool);
65  vtkGetMacro(IncludeFieldNames, bool);
67 
68  // Get/Set the OutputStream for writing output.
69  void SetOutputStream(ostream *my_stream);
70  ostream* GetOutputStream();
71 
72 protected:
75 
76  ofstream* OpenFile();
77 
78  virtual void WriteData();
79  virtual void WriteTable(vtkTable* table, ostream *stream_ptr);
80 
81  // see algorithm for more info.
82  // This writer takes in vtkTable.
84 
85  char* VariableName;
86  char* FileName;
88  ostream* OutputStream;
89 private:
90  vtkJavaScriptDataWriter(const vtkJavaScriptDataWriter&); // Not implemented.
91  void operator=(const vtkJavaScriptDataWriter&); // Not implemented.
92 //ETX
93 };
94 
95 
96 
97 #endif
98