VTK  9.2.6
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
41#include "vtkIOXdmf2Module.h" // For export macro
42#include <map> // for caching
43#include <string> // needed for string API
44
46class vtkXdmfDocument;
47class vtkGraph;
48class vtkCharArray;
49
50class VTKIOXDMF2_EXPORT vtkXdmfReader : public vtkDataObjectAlgorithm
51{
52public:
53 static vtkXdmfReader* New();
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
57 // Until needed, multiple domains are not supported.
62 // unsigned int GetNumberOfDomains();
63
65
72 vtkSetStringMacro(DomainName);
73 vtkGetStringMacro(DomainName);
75
79 // vtkGetStringMacro(ActiveDomainName);
80
82
88
95
100 const char* GetPointArrayName(int index);
101
103
106 int GetPointArrayStatus(const char* name);
107 void SetPointArrayStatus(const char* name, int status);
109
111
117 const char* GetCellArrayName(int index);
118 void SetCellArrayStatus(const char* name, int status);
119 int GetCellArrayStatus(const char* name);
121
123
129 const char* GetGridName(int index);
130 void SetGridStatus(const char* gridname, int status);
131 int GetGridStatus(const char* gridname);
133
135
142 const char* GetSetName(int index);
143 void SetSetStatus(const char* gridname, int status);
144 int GetSetStatus(const char* gridname);
146
148
151 int GetNumberOfSetArrays() { return this->GetNumberOfSets(); }
152 const char* GetSetArrayName(int index) { return this->GetSetName(index); }
153 int GetSetArrayStatus(const char* name) { return this->GetSetStatus(name); }
154 int GetNumberOfGridArrays() { return this->GetNumberOfGrids(); }
155 const char* GetGridArrayName(int index) { return this->GetGridName(index); }
156 int GetGridArrayStatus(const char* name) { return this->GetGridStatus(name); }
158
160
164 vtkSetVector3Macro(Stride, int);
165 vtkGetVector3Macro(Stride, int);
167
171 virtual int CanReadFile(VTK_FILEPATH const char* filename);
172
174
177 vtkGetMacro(SILUpdateStamp, int);
179
184 virtual vtkGraph* GetSIL();
185
187 {
188 public:
190 : dataset(nullptr)
191 , topologyPath()
192 , geometryPath()
193 {
194 }
196 std::string topologyPath;
197 std::string geometryPath;
198 };
199
200 typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
201
206
208
212 vtkSetMacro(ReadFromInputString, bool);
213 vtkGetMacro(ReadFromInputString, bool);
214 vtkBooleanMacro(ReadFromInputString, bool);
216
218
227 vtkGetObjectMacro(InputArray, vtkCharArray);
229
231
237 void SetInputString(const char* in);
238 vtkGetStringMacro(InputString);
239 void SetInputString(const char* in, int len);
240 vtkGetMacro(InputStringLength, int);
241 void SetBinaryInputString(const char*, int len);
242 void SetInputString(const std::string& input)
243 {
244 this->SetBinaryInputString(input.c_str(), static_cast<int>(input.length()));
245 }
247
248protected:
250 ~vtkXdmfReader() override;
251
252 char* FileName;
253
255
257
260
262 vtkInformationVector* outputVector) override;
266 int FillOutputPortInformation(int port, vtkInformation* info) override;
267
273
275 // char* ActiveDomainName;
276 int Stride[3];
277 unsigned int LastTimeIndex;
278
280
281 // Until RequestInformation() is called, the active domain is not set
282 // correctly. If SetGridStatus() etc. are called before that happens, then we
283 // have no place to save the user choices. So we cache them in these temporary
284 // caches. These are passed on to the actual vtkXdmfArraySelection instances
285 // used by the active vtkXdmfDomain in RequestInformation().
286 // Note that these are only used until the first domain is setup, once that
287 // happens, the information set in these is passed to the domain and these
288 // are cleared and no longer used, until the active domain becomes invalid
289 // again.
294
296
298
299private:
303 bool PrepareDocument();
304
305 void ClearDataSetCache();
306
311 int ChooseTimeStep(vtkInformation* outInfo);
312
313private:
314 vtkXdmfReader(const vtkXdmfReader&) = delete;
315 void operator=(const vtkXdmfReader&) = delete;
316};
317
318#endif
dynamic, self-adjusting array of char
Superclass for algorithms that produce only data object as output.
abstract class to specify dataset behavior
Definition vtkDataSet.h:63
Base class for graph data types.
Definition vtkGraph.h:296
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.
XdmfReaderCachedData & GetDataSetCache()
Get the data set cache.
vtkXdmfDocument * XdmfDocument
void SetBinaryInputString(const char *, int len)
Specify the InputString for use when reading from a character array.
vtkXdmfArraySelection * GridsCache
vtkXdmfArraySelection * GetSetsSelection()
const char * GetSetName(int index)
Get/Set information about sets.
int GetNumberOfPointArrays()
Get information about point-based arrays.
unsigned int LastTimeIndex
std::map< int, XdmfDataSetTopoGeoPath > XdmfReaderCachedData
vtkCharArray * InputArray
int GetSetStatus(const char *gridname)
Get/Set information about sets.
void SetGridStatus(const char *gridname, int status)
Get/Set information about grids.
vtkXdmfArraySelection * GetCellArraySelection()
int GetCellArrayStatus(const char *name)
Get information about cell-based arrays.
const char * GetGridArrayName(int index)
These methods are provided to make it easier to use the Sets/Grids in ParaView.
vtkXdmfArraySelection * SetsCache
int GetGridArrayStatus(const char *name)
These methods are provided to make it easier to use the Sets/Grids in ParaView.
int GetNumberOfGridArrays()
These methods are provided to make it easier to use the Sets/Grids in ParaView.
void SetInputString(const char *in, int len)
Specify the InputString for use when reading from a character array.
void SetPointArrayStatus(const char *name, int status)
Get/Set the point array status.
static vtkXdmfReader * New()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
see vtkAlgorithm for details
virtual vtkGraph * GetSIL()
SIL describes organization of/relationships between classifications eg.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXdmfArraySelection * GetGridSelection()
vtkGetFilePathMacro(FileName)
Name of the file to read.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
virtual int CanReadFile(VTK_FILEPATH 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)
Get information about cell-based arrays.
XdmfReaderCachedData DataSetCache
void SetInputString(const char *in)
Specify the InputString for use when reading from a character array.
int GetSetArrayStatus(const char *name)
These methods are provided to make it easier to use the Sets/Grids in ParaView.
~vtkXdmfReader() override
const char * GetGridName(int index)
Get/Set information about grids.
const char * GetSetArrayName(int index)
These methods are provided to make it easier to use the Sets/Grids in ParaView.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int GetNumberOfSetArrays()
These methods are provided to make it easier to use the Sets/Grids in ParaView.
virtual void SetInputArray(vtkCharArray *)
Specify the vtkCharArray to be used when reading from a string.
int GetPointArrayStatus(const char *name)
Get/Set the point array status.
const char * GetCellArrayName(int index)
Get information about cell-based arrays.
int GetGridStatus(const char *gridname)
Get/Set information about grids.
void SetInputString(const std::string &input)
Specify the InputString for use when reading from a character array.
vtkSetFilePathMacro(FileName)
Name of the file to read.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
int GetNumberOfGrids()
Get/Set information about grids.
virtual int RequestDataObjectInternal(vtkInformationVector *outputVector)
vtkXdmfArraySelection * PointArraysCache
void SetSetStatus(const char *gridname, int status)
Get/Set information about sets.
int GetNumberOfCellArrays()
Get information about cell-based arrays.
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_FILEPATH