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
45class vtkXdmfDocument;
46class vtkGraph;
47
48class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataReader
49{
50public:
51 static vtkXdmfReader* New();
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
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
107 const char* GetCellArrayName(int index);
108 void SetCellArrayStatus(const char* name, int status);
109 int GetCellArrayStatus(const char* name);
111
113
119 const char* GetGridName(int index);
120 void SetGridStatus(const char* gridname, int status);
121 int GetGridStatus(const char* gridname);
123
125
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
188
189protected:
192
193 virtual int ProcessRequest(vtkInformation *request,
194 vtkInformationVector **inputVector,
195 vtkInformationVector *outputVector);
196 virtual int RequestDataObject(vtkInformationVector *outputVector);
202
208
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
233
234private:
238 bool PrepareDocument();
239
240 void ClearDataSetCache();
241
246 int ChooseTimeStep(vtkInformation* outInfo);
247
248private:
249 vtkXdmfReader(const vtkXdmfReader&) VTK_DELETE_FUNCTION;
250 void operator=(const vtkXdmfReader&) VTK_DELETE_FUNCTION;
251
252};
253
254#endif
helper superclass for objects that read vtk data files
Definition: vtkDataReader.h:50
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
Base class for graph data types.
Definition: vtkGraph.h:288
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Reads eXtensible Data Model and Format files.
Definition: vtkXdmfReader.h:49
XdmfReaderCachedData & GetDataSetCache()
Get the data set cache.
vtkXdmfDocument * XdmfDocument
vtkXdmfArraySelection * GridsCache
vtkXdmfArraySelection * GetSetsSelection()
const char * GetSetName(int index)
int GetNumberOfPointArrays()
Get information about point-based arrays.
unsigned int LastTimeIndex
std::map< int, XdmfDataSetTopoGeoPath > XdmfReaderCachedData
int GetSetStatus(const char *gridname)
void SetGridStatus(const char *gridname, int status)
vtkXdmfArraySelection * GetCellArraySelection()
int GetCellArrayStatus(const char *name)
vtkXdmfArraySelection * SetsCache
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetPointArrayStatus(const char *name, int status)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkXdmfReader * New()
virtual int RequestDataObject(vtkInformationVector *outputVector)
virtual vtkGraph * GetSIL()
SIL describes organization of/relationships between classifications eg.
vtkXdmfArraySelection * GetGridSelection()
virtual int CanReadFile(const char *filename)
Determine if the file can be read with this reader.
const char * GetPointArrayName(int index)
Returns the name of point array at the give index.
int GetNumberOfSets()
Get/Set information about sets.
vtkXdmfArraySelection * GetPointArraySelection()
vtkXdmfArraySelection * CellArraysCache
void PassCachedSelections()
void SetCellArrayStatus(const char *name, int status)
XdmfReaderCachedData DataSetCache
int GetSetArrayStatus(const char *name)
const char * GetGridName(int index)
const char * GetSetArrayName(int index)
int GetNumberOfSetArrays()
These methods are provided to make it easier to use the Sets in ParaView.
int GetPointArrayStatus(const char *name)
Get/Set the point array status.
const char * GetCellArrayName(int index)
int GetGridStatus(const char *gridname)
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
int GetNumberOfGrids()
Get/Set information about grids.
vtkXdmfArraySelection * PointArraysCache
void SetSetStatus(const char *gridname, int status)
int GetNumberOfCellArrays()
Get information about cell-based arrays.
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
@ string
Definition: vtkX3D.h:490
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.