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 =========================================================================*/
34 #ifndef vtkXdmfReader_h
35 #define vtkXdmfReader_h
36 
37 #include "vtkIOXdmf2Module.h" // For export macro
38 #include "vtkDataReader.h"
39 #include <map> // for caching
40 
42 class vtkXdmfDocument;
43 class vtkGraph;
44 
45 class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader
46 {
47 public:
48  static vtkXdmfReader* New();
49  vtkTypeMacro(vtkXdmfReader, vtkDataReader);
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
52  // Until needed, multiple domains are not supported.
57  //unsigned int GetNumberOfDomains();
58 
60 
67  vtkSetStringMacro(DomainName);
68  vtkGetStringMacro(DomainName);
70 
74  // vtkGetStringMacro(ActiveDomainName);
75 
81  int GetNumberOfPointArrays();
82 
87  const char* GetPointArrayName(int index);
88 
90 
93  int GetPointArrayStatus(const char* name);
94  void SetPointArrayStatus(const char* name, int status);
96 
98 
103  int GetNumberOfCellArrays();
104  const char* GetCellArrayName(int index);
105  void SetCellArrayStatus(const char* name, int status);
106  int GetCellArrayStatus(const char* name);
108 
110 
115  int GetNumberOfGrids();
116  const char* GetGridName(int index);
117  void SetGridStatus(const char* gridname, int status);
118  int GetGridStatus(const char* gridname);
120 
122 
128  int GetNumberOfSets();
129  const char* GetSetName(int index);
130  void SetSetStatus(const char* gridname, int status);
131  int GetSetStatus(const char* gridname);
133 
137  int GetNumberOfSetArrays() { return this->GetNumberOfSets(); }
138  const char* GetSetArrayName(int index)
139  { return this->GetSetName(index); }
140  int GetSetArrayStatus(const char* name)
141  { return this->GetSetStatus(name); }
142 
144 
148  vtkSetVector3Macro(Stride, int);
149  vtkGetVector3Macro(Stride, int);
151 
155  virtual int CanReadFile(const char* filename);
156 
158 
161  vtkGetMacro(SILUpdateStamp, int);
163 
168  virtual vtkGraph* GetSIL();
169 
171  {
172  public:
173  XdmfDataSetTopoGeoPath() : dataset(0), topologyPath(), geometryPath() {}
177  };
178 
179  typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
180 
184  XdmfReaderCachedData& GetDataSetCache();
185 
186 protected:
187  vtkXdmfReader();
188  ~vtkXdmfReader() override;
189 
190  int ProcessRequest(vtkInformation *request,
191  vtkInformationVector **inputVector,
192  vtkInformationVector *outputVector) override;
193  virtual int RequestDataObject(vtkInformationVector *outputVector);
195  vtkInformationVector *) override;
197  vtkInformationVector *) override;
199 
200  vtkXdmfArraySelection* GetPointArraySelection();
201  vtkXdmfArraySelection* GetCellArraySelection();
202  vtkXdmfArraySelection* GetGridSelection();
203  vtkXdmfArraySelection* GetSetsSelection();
204  void PassCachedSelections();
205 
206  char* DomainName;
207  // char* ActiveDomainName;
208  int Stride[3];
209  unsigned int LastTimeIndex;
210 
212 
213  // Until RequestInformation() is called, the active domain is not set
214  // correctly. If SetGridStatus() etc. are called before that happens, then we
215  // have no place to save the user choices. So we cache them in these temporary
216  // caches. These are passed on to the actual vtkXdmfArraySelection instances
217  // used by the active vtkXdmfDomain in RequestInformation().
218  // Note that these are only used until the first domain is setup, once that
219  // happens, the information set in these is passed to the domain and these
220  // are cleared an no longer used, until the active domain becomes invalid
221  // again.
226 
228 
230 
231 private:
235  bool PrepareDocument();
236 
237  void ClearDataSetCache();
238 
243  int ChooseTimeStep(vtkInformation* outInfo);
244 
245 private:
246  vtkXdmfReader(const vtkXdmfReader&) = delete;
247  void operator=(const vtkXdmfReader&) = delete;
248 
249 };
250 
251 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkXdmfArraySelection * CellArraysCache
Reads eXtensible Data Model and Format files.
Definition: vtkXdmfReader.h:45
std::map< int, XdmfDataSetTopoGeoPath > XdmfReaderCachedData
Base class for graph data types.
Definition: vtkGraph.h:281
static vtkDataReader * New()
vtkXdmfArraySelection * PointArraysCache
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:33
const char * GetSetArrayName(int index)
vtkXdmfDocument * XdmfDocument
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkXdmfArraySelection * GridsCache
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
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)