VTK  9.3.20240329
vtkSimpleReader.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
9 #ifndef vtkSimpleReader_h
10 #define vtkSimpleReader_h
11 
12 #include "vtkCommonExecutionModelModule.h" // For export macro
13 #include "vtkReaderAlgorithm.h"
14 
15 #include <string> // needed for std::string in the interface
16 
17 VTK_ABI_NAMESPACE_BEGIN
18 struct vtkSimpleReaderInternal;
19 
20 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleReader : public vtkReaderAlgorithm
21 {
22 public:
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25 
32  void AddFileName(VTK_FILEPATH const char* fname);
33 
38 
42  int GetNumberOfFileNames() const;
43 
47  VTK_FILEPATH const char* GetFileName(int i) const;
48 
53  VTK_FILEPATH const char* GetCurrentFileName() const;
54 
56 
61  int ReadTimeDependentMetaData(int timestep, vtkInformation* metadata) override;
62  int ReadMetaData(vtkInformation* metadata) override;
63  int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
64  int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
65  int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
67 
76  virtual double GetTimeValue(VTK_FILEPATH const std::string& fname);
77 
83  virtual int ReadMetaDataSimple(
84  VTK_FILEPATH const std::string& /*fname*/, vtkInformation* /*metadata*/)
85  {
86  return 1;
87  }
88 
95  virtual int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
96 
103  virtual int ReadPointsSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
104 
111  virtual int ReadArraysSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
112 
113 protected:
115  ~vtkSimpleReader() override;
116 
119 
120 private:
121  vtkSimpleReader(const vtkSimpleReader&) = delete;
122  void operator=(const vtkSimpleReader&) = delete;
123 
124  vtkSimpleReaderInternal* Internal;
125 };
126 
127 VTK_ABI_NAMESPACE_END
128 #endif
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:108
Store vtkAlgorithm input/output information.
Superclass for readers that implement a simplified API.
Superclass for algorithms that are not time or parallel aware.
virtual int ReadMetaDataSimple(VTK_FILEPATH const std::string &, vtkInformation *)
A subclass can override this method to provide meta data specific to a particular file.
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.
void ClearFileNames()
Removes all filenames stored by the reader.
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.
virtual int ReadPointsSimple(VTK_FILEPATH const std::string &fname, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide the point coordinates.
void AddFileName(VTK_FILEPATH const char *fname)
Add a filename to be read.
virtual double GetTimeValue(VTK_FILEPATH const std::string &fname)
A subclass can override this method to provide an actual time value for a given file (this method is ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ReadTimeDependentMetaData(int timestep, vtkInformation *metadata) override
This is the superclass API overridden by this class to provide time support internally.
VTK_FILEPATH const char * GetFileName(int i) const
Returns a particular filename stored by the reader.
VTK_FILEPATH const char * GetCurrentFileName() const
Returns the filename that was last loaded by the reader.
virtual int ReadMeshSimple(VTK_FILEPATH const std::string &fname, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide the mesh (topology).
int GetNumberOfFileNames() const
Returns the number of filenames stored by the reader.
int ReadMetaData(vtkInformation *metadata) override
This is the superclass API overridden by this class to provide time support internally.
~vtkSimpleReader() 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.
virtual int ReadArraysSimple(VTK_FILEPATH const std::string &fname, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide data arrays.
@ string
Definition: vtkX3D.h:490
#define VTK_FILEPATH