VTK  9.3.0
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 
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
general representation of visualization data
Definition: vtkDataObject.h:55
a simple class to control print indentation
Definition: vtkIndent.h:29
Store vtkAlgorithm input/output information.
Superclass for algorithms that are parallel aware.
virtual int ReadPoints(const std::string &fname, int piece, int npieces, int nghosts, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide the point coordinates.
VTK_FILEPATH const char * GetFileName(int i) const
Returns a particular filename stored by the reader.
virtual double GetTimeValue(const std::string &fname)
A subclass can override this method to provide an actual time value for a given file (this method is ...
void ClearFileNames()
Removes all filenames stored by the reader.
~vtkParallelReader() override
int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
This is the superclass API overridden by this class to provide time support internally.
void AddFileName(VTK_FILEPATH const char *fname)
Add a filename to be read.
VTK_FILEPATH const char * GetCurrentFileName() const
Returns the filename that was last loaded by the reader.
int GetNumberOfFileNames() const
Returns the number of filenames stored by the reader.
virtual int ReadMesh(const std::string &fname, int piece, int npieces, int nghosts, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide the mesh (topology).
virtual int ReadArrays(const std::string &fname, int piece, int npieces, int nghosts, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide data arrays.
int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
This is the superclass API overridden by this class to provide time support internally.
int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
This is the superclass API overridden by this class to provide time support internally.
int ReadMetaData(vtkInformation *metadata) override
This is the superclass API overridden by this class to provide time support internally.
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.
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH