VTK  9.3.1
vtkParallelReader.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
14 #ifndef vtkParallelReader_h
15 #define vtkParallelReader_h
16 
17 #include "vtkCommonExecutionModelModule.h" // For export macro
18 #include "vtkReaderAlgorithm.h"
19 
20 #include <string> // needed for std::string in the interface
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 struct vtkParallelReaderInternal;
24 
25 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkParallelReader : public vtkReaderAlgorithm
26 {
27 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
37  void AddFileName(VTK_FILEPATH const char* fname);
38 
42  void ClearFileNames();
43 
47  int GetNumberOfFileNames() const;
48 
52  VTK_FILEPATH const char* GetFileName(int i) const;
53 
58  VTK_FILEPATH const char* GetCurrentFileName() const;
59 
61 
66  int ReadMetaData(vtkInformation* metadata) override;
67  int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
68  int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
69  int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
71 
72 protected:
74  ~vtkParallelReader() override;
75 
82  virtual double GetTimeValue(const std::string& fname);
83 
90  virtual int ReadMesh(
91  const std::string& fname, int piece, int npieces, int nghosts, vtkDataObject* output) = 0;
92 
99  virtual int ReadPoints(
100  const std::string& fname, int piece, int npieces, int nghosts, vtkDataObject* output) = 0;
101 
108  virtual int ReadArrays(
109  const std::string& fname, int piece, int npieces, int nghosts, vtkDataObject* output) = 0;
110 
112 
113 private:
114  vtkParallelReader(const vtkParallelReader&) = delete;
115  void operator=(const vtkParallelReader&) = delete;
116 
117  vtkParallelReaderInternal* Internal;
118 };
119 
120 VTK_ABI_NAMESPACE_END
121 #endif
virtual int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output)=0
Read the points.
std::string GetFileName(const std::string &fileName) noexcept
Set the appropriate file name based on recognized user input.
Store vtkAlgorithm input/output information.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output)=0
Read all the arrays (point, cell, field etc.).
Superclass for algorithms that are parallel aware.
#define VTK_FILEPATH
virtual int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output)=0
Read the mesh (connectivity) for a given set of data partitioning, number of ghost levels and time st...
virtual int ReadMetaData(vtkInformation *metadata)=0
Provide meta-data for the pipeline.
general representation of visualization data
Definition: vtkDataObject.h:54
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Superclass for readers that implement a simplified API.