VTK
dox/IO/vtkDelimitedTextWriter.h
Go to the documentation of this file.
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 "vtkWriter.h"
00033 
00034 class vtkStdString;
00035 class vtkTable;
00036 
00037 class VTK_IO_EXPORT vtkDelimitedTextWriter : public vtkWriter
00038 {
00039 public:
00040   static vtkDelimitedTextWriter* New();
00041   vtkTypeMacro(vtkDelimitedTextWriter, vtkWriter);
00042   void PrintSelf(ostream& os, vtkIndent indent);
00043 
00045 
00046   vtkSetStringMacro(FieldDelimiter);
00047   vtkGetStringMacro(FieldDelimiter);
00049 
00051 
00053   vtkSetStringMacro(StringDelimiter);
00054   vtkGetStringMacro(StringDelimiter);
00056 
00058 
00059   vtkSetStringMacro(FileName);
00060   vtkGetStringMacro(FileName);
00062 
00064 
00066   vtkSetMacro(UseStringDelimiter, bool);
00067   vtkGetMacro(UseStringDelimiter, bool);
00069 
00070 //BTX
00073   vtkStdString GetString(vtkStdString string);
00074 protected:
00075   vtkDelimitedTextWriter();
00076   ~vtkDelimitedTextWriter();
00077 
00078   bool OpenFile();
00079 
00080   virtual void WriteData();
00081   virtual void WriteTable(vtkTable* rectilinearGrid);
00082 
00083   // see algorithm for more info.
00084   // This writer takes in vtkTable.
00085   virtual int FillInputPortInformation(int port, vtkInformation* info);
00086 
00087   char* FileName;
00088   char* FieldDelimiter;
00089   char* StringDelimiter;
00090   bool UseStringDelimiter;
00091   ofstream* Stream;
00092 private:
00093   vtkDelimitedTextWriter(const vtkDelimitedTextWriter&); // Not implemented.
00094   void operator=(const vtkDelimitedTextWriter&); // Not implemented.
00095 //ETX
00096 };
00097 
00098 
00099 
00100 #endif
00101