VTK  9.7.1
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
24
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
34#ifdef __VTK_WRAP__
35#define vtkPyObjectFwd PyObject
36#else
37struct _object;
38#define vtkPyObjectFwd _object
39#endif
40
41// Forward declare the Conduit C-API opaque pointer type exactly as
42// Conduit does to avoid struct vs typedef collisions in C++.
43struct conduit_node_impl;
44typedef struct conduit_node_impl conduit_node;
45
46VTK_ABI_NAMESPACE_BEGIN
49
50class VTKIOFIDES_EXPORT vtkFidesReader : public vtkAlgorithm
51{
52public:
63
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
71
76 int CanReadFile(VTK_FILEPATH const std::string& name);
77
81 void SetFileName(VTK_FILEPATH const std::string& fname);
82
84
89 void ParseDataModel(VTK_FILEPATH const std::string& fname);
92
98 void SetDataSourcePath(const std::string& name, VTK_FILEPATH const std::string& path);
99
103 void SetDataSourceEngine(const std::string& name, const std::string& engine);
104
111 void SetDataSourceIO(const std::string& name, const std::string& ioAddress);
112
127 bool SetDataSourceNode(const std::string& name, conduit_node* node);
128
145 bool SetDataSourceNode(const std::string& name, vtkPyObjectFwd* conduitNode);
146
156 void RemoveDataSourceNode(const std::string& name);
157
169
174
183
191
197
199
205 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
206 virtual void SetConvertToVTK(bool) {};
207 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
208 virtual bool GetConvertToVTK() { return true; };
209 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
210 virtual void ConvertToVTKOn() {}
211 VTK_DEPRECATED_IN_9_6_0("ConvertToVTK is deprecated since vtkmDataSet was deprecated.")
212 virtual void ConvertToVTKOff() {}
214
216
219 vtkBooleanMacro(StreamSteps, bool);
220 vtkSetMacro(StreamSteps, bool);
221 vtkGetMacro(StreamSteps, bool);
223
225
229 vtkBooleanMacro(CreateSharedPoints, bool);
230 vtkSetMacro(CreateSharedPoints, bool);
231 vtkGetMacro(CreateSharedPoints, bool);
233
238
243
248
250
257
259
263 const char* GetPointArrayName(int index);
264 const char* GetCellArrayName(int index);
265 const char* GetFieldArrayName(int index);
267
269
273 int GetPointArrayStatus(const char* name);
274 int GetCellArrayStatus(const char* name);
275 int GetFieldArrayStatus(const char* name);
276 void SetPointArrayStatus(const char* name, int status);
277 void SetCellArrayStatus(const char* name, int status);
278 void SetFieldArrayStatus(const char* name, int status);
280
285
287
291 virtual void SetController(vtkMultiProcessController* controller);
294
295protected:
297 ~vtkFidesReader() override;
298
299 struct vtkFidesReaderImpl;
300 std::unique_ptr<vtkFidesReaderImpl> Impl;
301
302 std::string FileName;
306
307 virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
308 vtkInformationVector* outputVector);
309 virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
310 vtkInformationVector* outputVector);
311 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
312 vtkInformationVector* outputVector);
313
314 int FillOutputPortInformation(int port, vtkInformation* info) override;
315
319
321
322 int ADIOSAttributeCheck(const std::string& name);
323
324private:
325 vtkFidesReader(const vtkFidesReader&) = delete;
326 void operator=(const vtkFidesReader&) = delete;
327};
328
329VTK_ABI_NAMESPACE_END
330#endif
Store on/off settings for data arrays, etc.
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.
virtual void SetConvertToVTK(bool)
Methods to determine whether to output a set of vtkmDataSets or native VTK datasets.
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.
virtual bool GetConvertToVTK()
Methods to determine whether to output a set of vtkmDataSets or native VTK datasets.
void RemoveAllDataSourceNodes()
Remove all associated Conduit nodes from the reader.
void RemoveDataSourceNode(const std::string &name)
Remove a specific Conduit node associated with the named datasource.
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.
virtual void SetController(vtkMultiProcessController *controller)
Set/Get the multiprocess controller.
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
virtual void ConvertToVTKOff()
Methods to determine whether to output a set of vtkmDataSets or native VTK datasets.
vtkDataArraySelection * FieldDataArraySelection
virtual void ConvertToVTKOn()
Methods to determine whether to output a set of vtkmDataSets or native VTK datasets.
std::string FileName
bool SetDataSourceNode(const std::string &name, conduit_node *node)
Set the Conduit node to be associated with the named datasource.
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.
bool SetDataSourceNode(const std::string &name, vtkPyObjectFwd *conduitNode)
Set the Conduit node to be associated with the named datasource.
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)
vtkMultiProcessController * Controller
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.
Multiprocessing communication superclass.
#define VTK_DEPRECATED_IN_9_6_0(reason)
#define vtkPyObjectFwd
struct conduit_node_impl conduit_node
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_FILEPATH