VTK  9.7.20260709
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 "vtkIOFidesModule.h" // For export macro
30#include <memory> // for std::unique_ptr
31#include <string> // for std::string
32
33#ifdef __VTK_WRAP__
34#define vtkPyObjectFwd PyObject
35#else
36struct _object;
37#define vtkPyObjectFwd _object
38#endif
39
40// Forward declare the Conduit C-API opaque pointer type exactly as
41// Conduit does to avoid struct vs typedef collisions in C++.
42struct conduit_node_impl;
43typedef struct conduit_node_impl conduit_node;
44
45VTK_ABI_NAMESPACE_BEGIN
48
49class VTKIOFIDES_EXPORT vtkFidesReader : public vtkAlgorithm
50{
51public:
62
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
70
75 int CanReadFile(VTK_FILEPATH const std::string& name);
76
80 void SetFileName(VTK_FILEPATH const std::string& fname);
81
83
88 void ParseDataModel(VTK_FILEPATH const std::string& fname);
91
97 void SetDataSourcePath(const std::string& name, VTK_FILEPATH const std::string& path);
98
102 void SetDataSourceEngine(const std::string& name, const std::string& engine);
103
110 void SetDataSourceIO(const std::string& name, const std::string& ioAddress);
111
126 bool SetDataSourceNode(const std::string& name, conduit_node* node);
127
144 bool SetDataSourceNode(const std::string& name, vtkPyObjectFwd* conduitNode);
145
155 void RemoveDataSourceNode(const std::string& name);
156
168
173
182
190
196
198
201 vtkBooleanMacro(StreamSteps, bool);
202 vtkSetMacro(StreamSteps, bool);
203 vtkGetMacro(StreamSteps, bool);
205
207
211 vtkBooleanMacro(CreateSharedPoints, bool);
212 vtkSetMacro(CreateSharedPoints, bool);
213 vtkGetMacro(CreateSharedPoints, bool);
215
220
225
230
232
239
241
245 const char* GetPointArrayName(int index);
246 const char* GetCellArrayName(int index);
247 const char* GetFieldArrayName(int index);
249
251
255 int GetPointArrayStatus(const char* name);
256 int GetCellArrayStatus(const char* name);
257 int GetFieldArrayStatus(const char* name);
258 void SetPointArrayStatus(const char* name, int status);
259 void SetCellArrayStatus(const char* name, int status);
260 void SetFieldArrayStatus(const char* name, int status);
262
267
269
273 virtual void SetController(vtkMultiProcessController* controller);
276
277protected:
279 ~vtkFidesReader() override;
280
281 struct vtkFidesReaderImpl;
282 std::unique_ptr<vtkFidesReaderImpl> Impl;
283
284 std::string FileName;
288
289 virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
290 vtkInformationVector* outputVector);
291 virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
292 vtkInformationVector* outputVector);
293 virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
294 vtkInformationVector* outputVector);
295
296 int FillOutputPortInformation(int port, vtkInformation* info) override;
297
301
303
304 int ADIOSAttributeCheck(const std::string& name);
305
306private:
307 vtkFidesReader(const vtkFidesReader&) = delete;
308 void operator=(const vtkFidesReader&) = delete;
309};
310
311VTK_ABI_NAMESPACE_END
312#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.
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.
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
vtkDataArraySelection * FieldDataArraySelection
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 vtkPyObjectFwd
struct conduit_node_impl conduit_node
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_FILEPATH