VTK
vtkXdmfReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXdmfReader.h
5  Language: C++
6 
7  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
8  All rights reserved.
9  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notice for more information.
14 
15 =========================================================================*/
39 #ifndef vtkXdmfReader_h
40 #define vtkXdmfReader_h
41 
42 #include "vtkIOXdmf2Module.h" // For export macro
43 #include "vtkDataReader.h"
44 #include <map> // for caching
45 
47 class vtkXdmfDocument;
48 class vtkGraph;
49 
50 class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader
51 {
52 public:
53  static vtkXdmfReader* New();
54  vtkTypeMacro(vtkXdmfReader, vtkDataReader);
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
57  // Until needed, multiple domains are not supported.
62  //unsigned int GetNumberOfDomains();
63 
65 
71  vtkSetStringMacro(DomainName);
72  vtkGetStringMacro(DomainName);
74 
78  // vtkGetStringMacro(ActiveDomainName);
79 
83  int GetNumberOfPointArrays();
84 
87  const char* GetPointArrayName(int index);
88 
90 
91  int GetPointArrayStatus(const char* name);
92  void SetPointArrayStatus(const char* name, int status);
94 
96 
99  int GetNumberOfCellArrays();
100  const char* GetCellArrayName(int index);
101  void SetCellArrayStatus(const char* name, int status);
102  int GetCellArrayStatus(const char* name);
104 
106 
109  int GetNumberOfGrids();
110  const char* GetGridName(int index);
111  void SetGridStatus(const char* gridname, int status);
112  int GetGridStatus(const char* gridname);
114 
116 
120  int GetNumberOfSets();
121  const char* GetSetName(int index);
122  void SetSetStatus(const char* gridname, int status);
123  int GetSetStatus(const char* gridname);
125 
127 
129  int GetNumberOfSetArrays() { return this->GetNumberOfSets(); }
130  const char* GetSetArrayName(int index)
131  { return this->GetSetName(index); }
132  int GetSetArrayStatus(const char* name)
133  { return this->GetSetStatus(name); }
135 
137 
139  vtkSetVector3Macro(Stride, int);
140  vtkGetVector3Macro(Stride, int);
142 
144  virtual int CanReadFile(const char* filename);
145 
147 
148  vtkGetMacro(SILUpdateStamp, int);
150 
153  virtual vtkGraph* GetSIL();
154 
155 //BTX
157  {
158  public:
159  XdmfDataSetTopoGeoPath() : dataset(0), topologyPath(), geometryPath() {}
163  };
164 
165  typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
166 
168  XdmfReaderCachedData& GetDataSetCache();
169 
170 protected:
171  vtkXdmfReader();
172  ~vtkXdmfReader();
173 
174  virtual int ProcessRequest(vtkInformation *request,
175  vtkInformationVector **inputVector,
176  vtkInformationVector *outputVector);
177  virtual int RequestDataObject(vtkInformationVector *outputVector);
183 
184  vtkXdmfArraySelection* GetPointArraySelection();
185  vtkXdmfArraySelection* GetCellArraySelection();
186  vtkXdmfArraySelection* GetGridSelection();
187  vtkXdmfArraySelection* GetSetsSelection();
188  void PassCachedSelections();
189 
190  char* DomainName;
191  // char* ActiveDomainName;
192  int Stride[3];
193  unsigned int LastTimeIndex;
194 
196 
197  // Until RequestInformation() is called, the active domain is not set
198  // correctly. If SetGridStatus() etc. are called before that happens, then we
199  // have no place to save the user choices. So we cache them in these temporary
200  // caches. These are passed on to the actual vtkXdmfArraySelection instances
201  // used by the active vtkXdmfDomain in RequestInformation().
202  // Note that these are only used until the first domain is setup, once that
203  // happens, the information set in these is passed to the domain and these
204  // are cleared an no longer used, until the active domain becomes invalid
205  // again.
210 
212 
213  XdmfReaderCachedData DataSetCache;
214 
215 private:
217  bool PrepareDocument();
218 
219  void ClearDataSetCache();
220 
223  int ChooseTimeStep(vtkInformation* outInfo);
224 
225 private:
226  vtkXdmfReader(const vtkXdmfReader&); // Not implemented
227  void operator=(const vtkXdmfReader&); // Not implemented
228 //ETX
229 };
230 
231 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkXdmfArraySelection * CellArraysCache
Reads eXtensible Data Model and Format files.
Definition: vtkXdmfReader.h:50
std::map< int, XdmfDataSetTopoGeoPath > XdmfReaderCachedData
Base class for graph data types.
Definition: vtkGraph.h:288
static vtkDataReader * New()
vtkXdmfArraySelection * PointArraysCache
void PrintSelf(ostream &os, vtkIndent indent)
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:48
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
const char * GetSetArrayName(int index)
vtkXdmfDocument * XdmfDocument
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkXdmfArraySelection * GridsCache
int GetNumberOfSetArrays()
Store zero or more vtkInformation instances.
XdmfReaderCachedData DataSetCache
unsigned int LastTimeIndex
vtkXdmfArraySelection * SetsCache
int GetSetArrayStatus(const char *name)