VTK
vtkParallelReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkParallelReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkParallelReader_h
27 #define vtkParallelReader_h
28 
29 #include "vtkCommonExecutionModelModule.h" // For export macro
30 #include "vtkReaderAlgorithm.h"
31 
32 #include <string> // needed for std::string in the interface
33 
34 struct vtkParallelReaderInternal;
35 
36 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkParallelReader : public vtkReaderAlgorithm
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
48  void AddFileName(const char* fname);
49 
54 
58  int GetNumberOfFileNames() const;
59 
63  const char* GetFileName(int i) const;
64 
69  const char* GetCurrentFileName() const;
70 
72 
77  int ReadMetaData(vtkInformation* metadata) override;
78  int ReadMesh(
79  int piece, int npieces, int nghosts, int timestep,
80  vtkDataObject* output) override;
82  int piece, int npieces, int nghosts, int timestep,
83  vtkDataObject* output) override;
85  int piece, int npieces, int nghosts, int timestep,
86  vtkDataObject* output) override;
88 
89 protected:
91  ~vtkParallelReader() override;
92 
94 
101  virtual double GetTimeValue(const std::string& fname);
102 
109  virtual int ReadMesh(const std::string& fname,
110  int piece,
111  int npieces,
112  int nghosts,
113  vtkDataObject* output) = 0;
114 
121  virtual int ReadPoints(const std::string& fname,
122  int piece,
123  int npieces,
124  int nghosts,
125  vtkDataObject* output) = 0;
126 
133  virtual int ReadArrays(const std::string& fname,
134  int piece,
135  int npieces,
136  int nghosts,
137  vtkDataObject* output) = 0;
138 
140 
141 private:
142  vtkParallelReader(const vtkParallelReader&) = delete;
143  void operator=(const vtkParallelReader&) = delete;
144 
145  vtkParallelReaderInternal* Internal;
146 };
147 
148 #endif
vtkParallelReader::ReadMesh
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).
vtkReaderAlgorithm.h
vtkReaderAlgorithm
Superclass for readers that implement a simplified API.
Definition: vtkReaderAlgorithm.h:38
vtkParallelReader::ReadMesh
int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Read the mesh (connectivity) for a given set of data partitioning, number of ghost levels and time st...
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:50
vtkParallelReader::CreateDefaultExecutive
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
vtkParallelReader::ClearFileNames
void ClearFileNames()
Removes all filenames stored by the reader.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkParallelReader::ReadPoints
int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Read the points.
vtkParallelReader::GetFileName
const char * GetFileName(int i) const
Returns a particular filename stored by the reader.
vtkParallelReader::GetNumberOfFileNames
int GetNumberOfFileNames() const
Returns the number of filenames stored by the reader.
vtkParallelReader::vtkParallelReader
vtkParallelReader()
vtkParallelReader::AddFileName
void AddFileName(const char *fname)
Add a filename to be read.
vtkParallelReader::~vtkParallelReader
~vtkParallelReader() override
vtkParallelReader::ReadPoints
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.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkParallelReader::ReadArrays
int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Read all the arrays (point, cell, field etc.).
vtkParallelReader
Superclass for algorithms that are parallel aware.
Definition: vtkParallelReader.h:37
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkParallelReader::GetCurrentFileName
const char * GetCurrentFileName() const
Returns the filename that was last loaded by the reader.
vtkParallelReader::ReadArrays
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.
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkParallelReader::CurrentFileIndex
int CurrentFileIndex
Definition: vtkParallelReader.h:139
vtkParallelReader::GetTimeValue
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 ...
vtkParallelReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkParallelReader::ReadMetaData
int ReadMetaData(vtkInformation *metadata) override
This is the superclass API overridden by this class to provide time support internally.