VTK
vtkSimpleReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSimpleReader.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 =========================================================================*/
21 #ifndef vtkSimpleReader_h
22 #define vtkSimpleReader_h
23 
24 #include "vtkCommonExecutionModelModule.h" // For export macro
25 #include "vtkReaderAlgorithm.h"
26 
27 #include <string> // needed for std::string in the interface
28 
29 struct vtkSimpleReaderInternal;
30 
31 class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleReader : public vtkReaderAlgorithm
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
43  void AddFileName(const char* fname);
44 
49 
53  int GetNumberOfFileNames() const;
54 
58  const char* GetFileName(int i) const;
59 
64  const char* GetCurrentFileName() const;
65 
67 
73  int timestep, vtkInformation* metadata) override;
74  int ReadMetaData(vtkInformation* metadata) override;
75  int ReadMesh(
76  int piece, int npieces, int nghosts, int timestep,
77  vtkDataObject* output) override;
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 
94  virtual double GetTimeValue(const std::string& fname);
95 
101  virtual int ReadMetaDataSimple(const std::string& /*fname*/,
102  vtkInformation* /*metadata*/)
103  {
104  return 1;
105  }
106 
113  virtual int ReadMeshSimple(const std::string& fname,
114  vtkDataObject* output) = 0;
115 
122  virtual int ReadPointsSimple(const std::string& fname,
123  vtkDataObject* output) = 0;
124 
131  virtual int ReadArraysSimple(const std::string& fname,
132  vtkDataObject* output) = 0;
133 
134 protected:
136  ~vtkSimpleReader() override;
137 
139 
140 
143 
144 private:
145  vtkSimpleReader(const vtkSimpleReader&) = delete;
146  void operator=(const vtkSimpleReader&) = delete;
147 
148  vtkSimpleReaderInternal* Internal;
149 };
150 
151 #endif
vtkSimpleReader::ReadArraysSimple
virtual int ReadArraysSimple(const std::string &fname, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide data arrays.
vtkReaderAlgorithm.h
vtkReaderAlgorithm
Superclass for readers that implement a simplified API.
Definition: vtkReaderAlgorithm.h:38
vtkSimpleReader::HasTemporalMetaData
bool HasTemporalMetaData
Definition: vtkSimpleReader.h:142
vtkSimpleReader::ClearFileNames
void ClearFileNames()
Removes all filenames stored by the reader.
vtkSimpleReader::CurrentFileIndex
int CurrentFileIndex
Definition: vtkSimpleReader.h:141
vtkSimpleReader::CreateDefaultExecutive
vtkExecutive * CreateDefaultExecutive() override
Create a default executive.
vtkSimpleReader::~vtkSimpleReader
~vtkSimpleReader() override
vtkSimpleReader::AddFileName
void AddFileName(const char *fname)
Add a filename to be read.
vtkSimpleReader::ReadMetaDataSimple
virtual int ReadMetaDataSimple(const std::string &, vtkInformation *)
A subclass can override this method to provide meta data specific to a particular file.
Definition: vtkSimpleReader.h:101
vtkSimpleReader::GetNumberOfFileNames
int GetNumberOfFileNames() const
Returns the number of filenames stored by the reader.
vtkSimpleReader::GetFileName
const char * GetFileName(int i) const
Returns a particular filename stored by the reader.
vtkSimpleReader::ReadTimeDependentMetaData
int ReadTimeDependentMetaData(int timestep, vtkInformation *metadata) override
This is the superclass API overridden by this class to provide time support internally.
vtkExecutive
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:50
vtkSimpleReader::ReadPoints
int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Read the points.
vtkSimpleReader::ReadMeshSimple
virtual int ReadMeshSimple(const std::string &fname, vtkDataObject *output)=0
A method that needs to be override by the subclass to provide the mesh (topology).
vtkSimpleReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSimpleReader
Superclass for algorithms that are not time or parallel aware.
Definition: vtkSimpleReader.h:32
vtkSimpleReader::ReadPointsSimple
virtual int ReadPointsSimple(const std::string &fname, 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
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkSimpleReader::vtkSimpleReader
vtkSimpleReader()
vtkSimpleReader::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...
vtkSimpleReader::GetCurrentFileName
const char * GetCurrentFileName() const
Returns the filename that was last loaded by the reader.
vtkSimpleReader::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 ...
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkSimpleReader::ReadArrays
int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject *output) override
Read all the arrays (point, cell, field etc.).
vtkSimpleReader::ReadMetaData
int ReadMetaData(vtkInformation *metadata) override
Provide meta-data for the pipeline.