VTK  9.5.20251013
vtkFidesReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
25#ifndef vtkFidesReader_h
26#define vtkFidesReader_h
27
28#include "vtkAlgorithm.h"
29#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0
30#include "vtkIOFidesModule.h" // For export macro
31#include <memory> // for std::unique_ptr
32#include <string> // for std::string
33
34VTK_ABI_NAMESPACE_BEGIN
36
37class VTKIOFIDES_EXPORT vtkFidesReader : public vtkAlgorithm
38{
39public:
45 {
49 };
50
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
58
63 int CanReadFile(VTK_FILEPATH const std::string& name);
64
68 void SetFileName(VTK_FILEPATH const std::string& fname);
69
71
76 void ParseDataModel(VTK_FILEPATH const std::string& fname);
79
85 void SetDataSourcePath(const std::string& name, VTK_FILEPATH const std::string& path);
86
90 void SetDataSourceEngine(const std::string& name, const std::string& engine);
91
98 void SetDataSourceIO(const std::string& name, const std::string& ioAddress);
99
104
113
121
127
129
135 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
136 virtual void SetConvertToVTK(bool){};
137 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
138 virtual bool GetConvertToVTK() { return true; };
139 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
140 virtual void ConvertToVTKOn() {}
141 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
142 virtual void ConvertToVTKOff() {}
144
146
149 vtkBooleanMacro(StreamSteps, bool);
150 vtkSetMacro(StreamSteps, bool);
151 vtkGetMacro(StreamSteps, bool);
153
155
159 vtkBooleanMacro(CreateSharedPoints, bool);
160 vtkSetMacro(CreateSharedPoints, bool);
161 vtkGetMacro(CreateSharedPoints, bool);
163
167 vtkGetObjectMacro(PointDataArraySelection, vtkDataArraySelection);
168
172 vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
173
177 vtkGetObjectMacro(FieldDataArraySelection, vtkDataArraySelection);
178
180
187
189
193 const char* GetPointArrayName(int index);
194 const char* GetCellArrayName(int index);
195 const char* GetFieldArrayName(int index);
197
199
203 int GetPointArrayStatus(const char* name);
204 int GetCellArrayStatus(const char* name);
205 int GetFieldArrayStatus(const char* name);
206 void SetPointArrayStatus(const char* name, int status);
207 void SetCellArrayStatus(const char* name, int status);
208 void SetFieldArrayStatus(const char* name, int status);
210
215
216protected:
218 ~vtkFidesReader() override;
219
220 struct vtkFidesReaderImpl;
221 std::unique_ptr<vtkFidesReaderImpl> Impl;
222
223 std::string FileName;
227
228 virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
229 vtkInformationVector* outputVector);
230 virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
231 vtkInformationVector* outputVector);
232 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
233 vtkInformationVector* outputVector);
234
235 int FillOutputPortInformation(int port, vtkInformation* info) override;
236
240
241 int ADIOSAttributeCheck(const std::string& name);
242
243private:
244 vtkFidesReader(const vtkFidesReader&) = delete;
245 void operator=(const vtkFidesReader&) = delete;
246};
247
248VTK_ABI_NAMESPACE_END
249#endif
Superclass for all sources, filters, and sinks in VTK.
Store on/off settings for data arrays, etc.
Read ADIOS2 streams using Fides data model.
void ParseDataModel()
Given a json filename, parse and internally store a data model.
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Implements various pipeline passes.
const char * GetCellArrayName(int index)
Get the name of the point or cell array with the given index in the input.
void SetFieldArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
const char * GetPointArrayName(int index)
Get the name of the point or cell array with the given index in the input.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetFieldArrayName(int index)
Get the name of the point or cell array with the given index in the input.
int GetCellArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
vtkMTimeType GetMTime() override
Overridden to take into account mtimes for vtkDataArraySelection instances.
void SetFileName(const std::string &fname)
Set the filename to be read.
void PrepareNextStep()
This method has to be called before each step when streaming.
void ParseDataModel(const std::string &fname)
Given a json filename, parse and internally store a data model.
static vtkFidesReader * New()
Construct a new reader instance.
void SetPointArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the point or cell array with the given name is to be read.
int GetPointArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
StepStatus NextStepStatus
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkDataArraySelection * CellDataArraySelection
vtkDataArraySelection * FieldDataArraySelection
std::string FileName
int CanReadFile(const std::string &name)
Test whether or not a given file should even be attempted for use with this reader.
std::unique_ptr< vtkFidesReaderImpl > Impl
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
StepStatus
When using streaming mode instead of random access, PrepareNextStep receives a step status from Fides...
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int GetFieldArrayStatus(const char *name)
Get/Set whether the point or cell array with the given name is to be read.
int GetNextStepStatus()
Get the StepStatus of the next step reported by Fides.
int GetNumberOfPointArrays()
Get the number of point or cell arrays available in the input.
void SetDataSourcePath(const std::string &name, const std::string &path)
Set the path for a Fides data source.
double GetTimeOfCurrentStep()
Gets the time (from the specified ADIOS variable) of the current step.
void SetDataSourceIO(const std::string &name, const std::string &ioAddress)
Set the ADIOS2::IO object to be used for setting up the Inline engine reader.
void SetDataSourceEngine(const std::string &name, const std::string &engine)
Set the engine for a Fides data source.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
int GetNumberOfCellArrays()
Get the number of point or cell arrays available in the input.
int GetNumberOfFieldArrays()
Get the number of point or cell arrays available in the input.
int ADIOSAttributeCheck(const std::string &name)
~vtkFidesReader() override
vtkDataArraySelection * PointDataArraySelection
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
#define VTK_DEPRECATED_IN_9_6_0(reason)
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_FILEPATH