VTK
|
00001 /*========================================================================= 00002 00003 Program: ParaView 00004 Module: vtkDelimitedTextWriter.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 00029 #ifndef __vtkDelimitedTextWriter_h 00030 #define __vtkDelimitedTextWriter_h 00031 00032 #include "vtkIOCoreModule.h" // For export macro 00033 #include "vtkWriter.h" 00034 00035 class vtkStdString; 00036 class vtkTable; 00037 00038 class VTKIOCORE_EXPORT vtkDelimitedTextWriter : public vtkWriter 00039 { 00040 public: 00041 static vtkDelimitedTextWriter* New(); 00042 vtkTypeMacro(vtkDelimitedTextWriter, vtkWriter); 00043 void PrintSelf(ostream& os, vtkIndent indent); 00044 00046 00047 vtkSetStringMacro(FieldDelimiter); 00048 vtkGetStringMacro(FieldDelimiter); 00050 00052 00054 vtkSetStringMacro(StringDelimiter); 00055 vtkGetStringMacro(StringDelimiter); 00057 00059 00060 vtkSetStringMacro(FileName); 00061 vtkGetStringMacro(FileName); 00063 00065 00067 vtkSetMacro(UseStringDelimiter, bool); 00068 vtkGetMacro(UseStringDelimiter, bool); 00070 00072 00073 vtkSetMacro(WriteToOutputString,bool); 00074 vtkGetMacro(WriteToOutputString,bool); 00075 vtkBooleanMacro(WriteToOutputString,bool); 00077 00080 char *RegisterAndGetOutputString(); 00081 00083 00085 vtkStdString GetString(vtkStdString string); 00086 protected: 00087 vtkDelimitedTextWriter(); 00088 ~vtkDelimitedTextWriter(); 00090 00091 bool WriteToOutputString; 00092 char* OutputString; 00093 00094 bool OpenStream(); 00095 00096 virtual void WriteData(); 00097 virtual void WriteTable(vtkTable* rectilinearGrid); 00098 00099 // see algorithm for more info. 00100 // This writer takes in vtkTable. 00101 virtual int FillInputPortInformation(int port, vtkInformation* info); 00102 00103 char* FileName; 00104 char* FieldDelimiter; 00105 char* StringDelimiter; 00106 bool UseStringDelimiter; 00107 //BTX 00108 ostream* Stream; 00109 //ETX 00110 private: 00111 vtkDelimitedTextWriter(const vtkDelimitedTextWriter&); // Not implemented. 00112 void operator=(const vtkDelimitedTextWriter&); // Not implemented. 00113 }; 00114 00115 00116 00117 #endif 00118