Salome HOME
Update copyrights 2014.
[modules/paravis.git] / src / Plugins / TableReader / Reader / vtkVisuTableReader.h
1 // Copyright (C) 2010-2014  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __vtkVisuTableReader_h_
21 #define __vtkVisuTableReader_h_
22
23 #include "vtkTableAlgorithm.h"
24
25 class vtkStringArray;
26
27 class VTK_EXPORT vtkVisuTableReader: public vtkTableAlgorithm
28 {
29 public:
30   static vtkVisuTableReader* New();
31   vtkTypeMacro(vtkVisuTableReader, vtkTableAlgorithm)
32   void PrintSelf(ostream& os, vtkIndent indent);
33
34   // Description:
35   // Specifies the name of the file
36   vtkGetStringMacro(FileName);
37   vtkSetStringMacro(FileName);
38
39   // Description:
40   // When set to true, the reader will detect numeric columns and create
41   // vtkDoubleArray or vtkIntArray for those instead of vtkStringArray.
42   vtkSetMacro(DetectNumericColumns, bool);
43   vtkGetMacro(DetectNumericColumns, bool);
44   vtkBooleanMacro(DetectNumericColumns, bool);
45
46   // Description:
47   // When set to true, the reader will interpret the first string as
48   // column titles.
49   vtkSetMacro(FirstStringAsTitles, bool);
50   vtkGetMacro(FirstStringAsTitles, bool);
51   vtkBooleanMacro(FirstStringAsTitles, bool);
52
53   // Description:
54   // Specifies the number of the table
55   vtkSetMacro(TableNumber, int);
56   vtkGetMacro(TableNumber, int);
57
58   // Description:
59   // Specifies string that will be used to separate values
60   vtkSetStringMacro(ValueDelimiter);
61   vtkGetStringMacro(ValueDelimiter);
62
63   // Description:
64   // Determine whether the given file can be read
65   virtual int CanReadFile(const char* fname);
66   
67   // Description:
68   // Returns the available table names.
69   virtual vtkStringArray* GetAvailableTables();
70
71 protected:
72   vtkVisuTableReader();
73   ~vtkVisuTableReader();
74   
75   // Description:
76   // This is called by the superclass.
77   virtual int RequestData(vtkInformation*, vtkInformationVector**,
78       vtkInformationVector*);
79   
80   // name of the file to read from
81   char* FileName;
82
83   // defines whether to detect numeric columns
84   bool DetectNumericColumns;
85
86   // defines whether to treat first string as column titles
87   bool FirstStringAsTitles;
88
89   // number of the table to read
90   int TableNumber;
91
92   // string that will be used to separate values
93   char* ValueDelimiter;
94   
95   // Available table names
96   vtkStringArray* AvailableTables;
97
98 private:
99   vtkVisuTableReader(const vtkVisuTableReader&); // Not implemented.
100   void operator=(const vtkVisuTableReader&); // Not implemented.
101 };
102
103 #endif //__vtkVisuTableReader_h_