VTK  9.3.20240419
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 "vtkIOFidesModule.h" // For export macro
30 #include <memory> // for std::unique_ptr
31 #include <string> // for std::string
32 
33 VTK_ABI_NAMESPACE_BEGIN
35 
36 class VTKIOFIDES_EXPORT vtkFidesReader : public vtkAlgorithm
37 {
38 public:
44  {
45  OK,
48  };
49 
50  vtkTypeMacro(vtkFidesReader, vtkAlgorithm);
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  static vtkFidesReader* New();
57 
63 
67  void SetFileName(VTK_FILEPATH const std::string& fname);
68 
70 
78 
85 
89  void SetDataSourceEngine(const std::string& name, const std::string& engine);
90 
97  void SetDataSourceIO(const std::string& name, const std::string& ioAddress);
98 
103 
112 
120 
126 
128 
134  vtkBooleanMacro(ConvertToVTK, bool);
135  vtkSetMacro(ConvertToVTK, bool);
136  vtkGetMacro(ConvertToVTK, bool);
138 
140 
143  vtkBooleanMacro(StreamSteps, bool);
144  vtkSetMacro(StreamSteps, bool);
145  vtkGetMacro(StreamSteps, bool);
147 
149 
153  vtkBooleanMacro(CreateSharedPoints, bool);
154  vtkSetMacro(CreateSharedPoints, bool);
155  vtkGetMacro(CreateSharedPoints, bool);
157 
161  vtkGetObjectMacro(PointDataArraySelection, vtkDataArraySelection);
162 
166  vtkGetObjectMacro(CellDataArraySelection, vtkDataArraySelection);
167 
171  vtkGetObjectMacro(FieldDataArraySelection, vtkDataArraySelection);
172 
174 
181 
183 
187  const char* GetPointArrayName(int index);
188  const char* GetCellArrayName(int index);
189  const char* GetFieldArrayName(int index);
191 
193 
197  int GetPointArrayStatus(const char* name);
198  int GetCellArrayStatus(const char* name);
199  int GetFieldArrayStatus(const char* name);
200  void SetPointArrayStatus(const char* name, int status);
201  void SetCellArrayStatus(const char* name, int status);
202  void SetFieldArrayStatus(const char* name, int status);
204 
208  vtkMTimeType GetMTime() override;
209 
210 protected:
212  ~vtkFidesReader() override;
213 
214  struct vtkFidesReaderImpl;
215  std::unique_ptr<vtkFidesReaderImpl> Impl;
216 
222 
223  virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
224  vtkInformationVector* outputVector);
225  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
226  vtkInformationVector* outputVector);
227  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
228  vtkInformationVector* outputVector);
229 
231 
235 
237 
238 private:
239  vtkFidesReader(const vtkFidesReader&) = delete;
240  void operator=(const vtkFidesReader&) = delete;
241 };
242 
243 VTK_ABI_NAMESPACE_END
244 #endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:162
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 * GetFieldArrayName(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.
static vtkFidesReader * New()
Construct a new reader instance.
void ParseDataModel(VTK_FILEPATH const std::string &fname)
Given a json filename, parse and internally store a data model.
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.
int CanReadFile(VTK_FILEPATH const std::string &name)
Test whether or not a given file should even be attempted for use with this reader.
void PrepareNextStep()
This method has to be called before each step when streaming.
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.
void SetFileName(VTK_FILEPATH const std::string &fname)
Set the filename 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
const char * GetPointArrayName(int index)
Get the name of the point or cell array with the given index in the input.
vtkDataArraySelection * FieldDataArraySelection
std::string FileName
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.
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.
void SetDataSourcePath(const std::string &name, VTK_FILEPATH const std::string &path)
Set the path for a Fides data source.
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.
@ 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
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_FILEPATH