Back to index

salome-paravis  6.5.0
vtkVisuTableReader.h
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __vtkVisuTableReader_h_
00021 #define __vtkVisuTableReader_h_
00022 
00023 #include "vtkTableAlgorithm.h"
00024 
00025 class vtkStringArray;
00026 
00027 class VTK_EXPORT vtkVisuTableReader: public vtkTableAlgorithm
00028 {
00029 public:
00030   static vtkVisuTableReader* New();
00031   vtkTypeRevisionMacro(vtkVisuTableReader, vtkTableAlgorithm)
00032   void PrintSelf(ostream& os, vtkIndent indent);
00033 
00034   // Description:
00035   // Specifies the name of the file
00036   vtkGetStringMacro(FileName);
00037   vtkSetStringMacro(FileName);
00038 
00039   // Description:
00040   // When set to true, the reader will detect numeric columns and create
00041   // vtkDoubleArray or vtkIntArray for those instead of vtkStringArray.
00042   vtkSetMacro(DetectNumericColumns, bool);
00043   vtkGetMacro(DetectNumericColumns, bool);
00044   vtkBooleanMacro(DetectNumericColumns, bool);
00045 
00046   // Description:
00047   // When set to true, the reader will interpret the first string as
00048   // column titles.
00049   vtkSetMacro(FirstStringAsTitles, bool);
00050   vtkGetMacro(FirstStringAsTitles, bool);
00051   vtkBooleanMacro(FirstStringAsTitles, bool);
00052 
00053   // Description:
00054   // Specifies the number of the table
00055   vtkSetMacro(TableNumber, int);
00056   vtkGetMacro(TableNumber, int);
00057 
00058   // Description:
00059   // Specifies string that will be used to separate values
00060   vtkSetStringMacro(ValueDelimiter);
00061   vtkGetStringMacro(ValueDelimiter);
00062 
00063   // Description:
00064   // Determine whether the given file can be read
00065   virtual int CanReadFile(const char* fname);
00066   
00067   // Description:
00068   // Returns the available table names.
00069   virtual vtkStringArray* GetAvailableTables();
00070 
00071 protected:
00072   vtkVisuTableReader();
00073   ~vtkVisuTableReader();
00074   
00075   // Description:
00076   // This is called by the superclass.
00077   virtual int RequestData(vtkInformation*, vtkInformationVector**,
00078       vtkInformationVector*);
00079   
00080   // name of the file to read from
00081   char* FileName;
00082 
00083   // defines whether to detect numeric columns
00084   bool DetectNumericColumns;
00085 
00086   // defines whether to treat first string as column titles
00087   bool FirstStringAsTitles;
00088 
00089   // number of the table to read
00090   int TableNumber;
00091 
00092   // string that will be used to separate values
00093   char* ValueDelimiter;
00094   
00095   // Available table names
00096   vtkStringArray* AvailableTables;
00097 
00098 private:
00099   vtkVisuTableReader(const vtkVisuTableReader&); // Not implemented.
00100   void operator=(const vtkVisuTableReader&); // Not implemented.
00101 };
00102 
00103 #endif //__vtkVisuTableReader_h_