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 =========================================================================*/
36 #ifndef vtkXdmfReader_h
37 #define vtkXdmfReader_h
38 
39 #include "vtkIOXdmf2Module.h" // For export macro
40 #include "vtkDataReader.h"
41 #include <map> // for caching
42 
44 class vtkXdmfDocument;
45 class vtkGraph;
46 
47 class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader
48 {
49 public:
50  static vtkXdmfReader* New();
51  vtkTypeMacro(vtkXdmfReader, vtkDataReader);
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
54  // Until needed, multiple domains are not supported.
59  //unsigned int GetNumberOfDomains();
60 
62 
68  vtkSetStringMacro(DomainName);
69  vtkGetStringMacro(DomainName);
71 
75  // vtkGetStringMacro(ActiveDomainName);
76 
80  int GetNumberOfPointArrays();
81 
84  const char* GetPointArrayName(int index);
85 
87 
88  int GetPointArrayStatus(const char* name);
89  void SetPointArrayStatus(const char* name, int status);
91 
93 
96  int GetNumberOfCellArrays();
97  const char* GetCellArrayName(int index);
98  void SetCellArrayStatus(const char* name, int status);
99  int GetCellArrayStatus(const char* name);
101 
103 
106  int GetNumberOfGrids();
107  const char* GetGridName(int index);
108  void SetGridStatus(const char* gridname, int status);
109  int GetGridStatus(const char* gridname);
111 
113 
117  int GetNumberOfSets();
118  const char* GetSetName(int index);
119  void SetSetStatus(const char* gridname, int status);
120  int GetSetStatus(const char* gridname);
122 
124 
126  int GetNumberOfSetArrays() { return this->GetNumberOfSets(); }
127  const char* GetSetArrayName(int index)
128  { return this->GetSetName(index); }
129  int GetSetArrayStatus(const char* name)
130  { return this->GetSetStatus(name); }
132 
134 
136  vtkSetVector3Macro(Stride, int);
137  vtkGetVector3Macro(Stride, int);
139 
141  virtual int CanReadFile(const char* filename);
142 
144 
145  vtkGetMacro(SILUpdateStamp, int);
147 
150  virtual vtkGraph* GetSIL();
151 
152 //BTX
154  {
155  public:
156  XdmfDataSetTopoGeoPath() : dataset(0), topologyPath(), geometryPath() {}
160  };
161 
162  typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
163 
165  XdmfReaderCachedData& GetDataSetCache();
166 
167 protected:
168  vtkXdmfReader();
169  ~vtkXdmfReader();
170 
171  virtual int ProcessRequest(vtkInformation *request,
172  vtkInformationVector **inputVector,
173  vtkInformationVector *outputVector);
174  virtual int RequestDataObject(vtkInformationVector *outputVector);
180 
181  vtkXdmfArraySelection* GetPointArraySelection();
182  vtkXdmfArraySelection* GetCellArraySelection();
183  vtkXdmfArraySelection* GetGridSelection();
184  vtkXdmfArraySelection* GetSetsSelection();
185  void PassCachedSelections();
186 
187  char* DomainName;
188  // char* ActiveDomainName;
189  int Stride[3];
190  unsigned int LastTimeIndex;
191 
193 
194  // Until RequestInformation() is called, the active domain is not set
195  // correctly. If SetGridStatus() etc. are called before that happens, then we
196  // have no place to save the user choices. So we cache them in these temporary
197  // caches. These are passed on to the actual vtkXdmfArraySelection instances
198  // used by the active vtkXdmfDomain in RequestInformation().
199  // Note that these are only used until the first domain is setup, once that
200  // happens, the information set in these is passed to the domain and these
201  // are cleared an no longer used, until the active domain becomes invalid
202  // again.
207 
209 
210  XdmfReaderCachedData DataSetCache;
211 
212 private:
214  bool PrepareDocument();
215 
216  void ClearDataSetCache();
217 
220  int ChooseTimeStep(vtkInformation* outInfo);
221 
222 private:
223  vtkXdmfReader(const vtkXdmfReader&); // Not implemented
224  void operator=(const vtkXdmfReader&); // Not implemented
225 //ETX
226 };
227 
228 #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:47
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)