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 =========================================================================*/
37 #ifndef vtkXdmfReader_h
38 #define vtkXdmfReader_h
39 
40 #include "vtkIOXdmf2Module.h" // For export macro
41 #include "vtkDataReader.h"
42 #include <map> // for caching
43 
45 class vtkXdmfDocument;
46 class vtkGraph;
47 
48 class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader
49 {
50 public:
51  static vtkXdmfReader* New();
52  vtkTypeMacro(vtkXdmfReader, vtkDataReader);
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
55  // Until needed, multiple domains are not supported.
60  //unsigned int GetNumberOfDomains();
61 
63 
70  vtkSetStringMacro(DomainName);
71  vtkGetStringMacro(DomainName);
73 
77  // vtkGetStringMacro(ActiveDomainName);
78 
84  int GetNumberOfPointArrays();
85 
90  const char* GetPointArrayName(int index);
91 
93 
96  int GetPointArrayStatus(const char* name);
97  void SetPointArrayStatus(const char* name, int status);
99 
101 
106  int GetNumberOfCellArrays();
107  const char* GetCellArrayName(int index);
108  void SetCellArrayStatus(const char* name, int status);
109  int GetCellArrayStatus(const char* name);
111 
113 
118  int GetNumberOfGrids();
119  const char* GetGridName(int index);
120  void SetGridStatus(const char* gridname, int status);
121  int GetGridStatus(const char* gridname);
123 
125 
131  int GetNumberOfSets();
132  const char* GetSetName(int index);
133  void SetSetStatus(const char* gridname, int status);
134  int GetSetStatus(const char* gridname);
136 
140  int GetNumberOfSetArrays() { return this->GetNumberOfSets(); }
141  const char* GetSetArrayName(int index)
142  { return this->GetSetName(index); }
143  int GetSetArrayStatus(const char* name)
144  { return this->GetSetStatus(name); }
145 
147 
151  vtkSetVector3Macro(Stride, int);
152  vtkGetVector3Macro(Stride, int);
154 
158  virtual int CanReadFile(const char* filename);
159 
161 
164  vtkGetMacro(SILUpdateStamp, int);
166 
171  virtual vtkGraph* GetSIL();
172 
174  {
175  public:
176  XdmfDataSetTopoGeoPath() : dataset(0), topologyPath(), geometryPath() {}
180  };
181 
182  typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
183 
187  XdmfReaderCachedData& GetDataSetCache();
188 
189 protected:
190  vtkXdmfReader();
191  ~vtkXdmfReader();
192 
193  virtual int ProcessRequest(vtkInformation *request,
194  vtkInformationVector **inputVector,
195  vtkInformationVector *outputVector);
196  virtual int RequestDataObject(vtkInformationVector *outputVector);
202 
203  vtkXdmfArraySelection* GetPointArraySelection();
204  vtkXdmfArraySelection* GetCellArraySelection();
205  vtkXdmfArraySelection* GetGridSelection();
206  vtkXdmfArraySelection* GetSetsSelection();
207  void PassCachedSelections();
208 
209  char* DomainName;
210  // char* ActiveDomainName;
211  int Stride[3];
212  unsigned int LastTimeIndex;
213 
215 
216  // Until RequestInformation() is called, the active domain is not set
217  // correctly. If SetGridStatus() etc. are called before that happens, then we
218  // have no place to save the user choices. So we cache them in these temporary
219  // caches. These are passed on to the actual vtkXdmfArraySelection instances
220  // used by the active vtkXdmfDomain in RequestInformation().
221  // Note that these are only used until the first domain is setup, once that
222  // happens, the information set in these is passed to the domain and these
223  // are cleared an no longer used, until the active domain becomes invalid
224  // again.
229 
231 
232  XdmfReaderCachedData DataSetCache;
233 
234 private:
238  bool PrepareDocument();
239 
240  void ClearDataSetCache();
241 
246  int ChooseTimeStep(vtkInformation* outInfo);
247 
248 private:
249  vtkXdmfReader(const vtkXdmfReader&) VTK_DELETE_FUNCTION;
250  void operator=(const vtkXdmfReader&) VTK_DELETE_FUNCTION;
251 
252 };
253 
254 #endif
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkXdmfArraySelection * CellArraysCache
Reads eXtensible Data Model and Format files.
Definition: vtkXdmfReader.h:48
std::map< int, XdmfDataSetTopoGeoPath > XdmfReaderCachedData
Base class for graph data types.
Definition: vtkGraph.h:287
static vtkDataReader * New()
vtkXdmfArraySelection * PointArraysCache
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:49
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
const char * GetSetArrayName(int index)
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkXdmfDocument * XdmfDocument
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkXdmfArraySelection * GridsCache
int GetNumberOfSetArrays()
These methods are provided to make it easier to use the Sets in ParaView.
Store zero or more vtkInformation instances.
XdmfReaderCachedData DataSetCache
unsigned int LastTimeIndex
vtkXdmfArraySelection * SetsCache
int GetSetArrayStatus(const char *name)