VTK
|
00001 /*========================================================================= 00002 00003 Program: ParaView 00004 Module: vtkJavaScriptDataWriter.h 00005 00006 Copyright (c) Kitware, Inc. 00007 All rights reserved. 00008 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2009 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00020 00026 #ifndef __vtkJavaScriptDataWriter_h 00027 #define __vtkJavaScriptDataWriter_h 00028 00029 #include "vtkIOCoreModule.h" // For export macro 00030 #include "vtkWriter.h" 00031 00032 class vtkStdString; 00033 class vtkTable; 00034 00035 class VTKIOCORE_EXPORT vtkJavaScriptDataWriter : public vtkWriter 00036 { 00037 public: 00038 static vtkJavaScriptDataWriter* New(); 00039 vtkTypeMacro(vtkJavaScriptDataWriter, vtkWriter); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 00048 vtkSetStringMacro(VariableName); 00049 vtkGetStringMacro(VariableName); 00051 00053 00054 vtkSetStringMacro(FileName); 00055 vtkGetStringMacro(FileName); 00057 00059 00065 vtkSetMacro(IncludeFieldNames, bool); 00066 vtkGetMacro(IncludeFieldNames, bool); 00068 00069 // Get/Set the OutputStream for writing output. 00070 void SetOutputStream(ostream *my_stream); 00071 ostream* GetOutputStream(); 00072 00073 protected: 00074 vtkJavaScriptDataWriter(); 00075 ~vtkJavaScriptDataWriter(); 00076 00077 ofstream* OpenFile(); 00078 00079 virtual void WriteData(); 00080 virtual void WriteTable(vtkTable* table, ostream *stream_ptr); 00081 00082 // see algorithm for more info. 00083 // This writer takes in vtkTable. 00084 virtual int FillInputPortInformation(int port, vtkInformation* info); 00085 00086 char* VariableName; 00087 char* FileName; 00088 bool IncludeFieldNames; 00089 ostream* OutputStream; 00090 private: 00091 vtkJavaScriptDataWriter(const vtkJavaScriptDataWriter&); // Not implemented. 00092 void operator=(const vtkJavaScriptDataWriter&); // Not implemented. 00093 //ETX 00094 }; 00095 00096 00097 00098 #endif 00099