VTK  9.1.0
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
29struct vtkSimpleReaderInternal;
30
31class VTKCOMMONEXECUTIONMODEL_EXPORT vtkSimpleReader : public vtkReaderAlgorithm
32{
33public:
35 void PrintSelf(ostream& os, vtkIndent indent) override;
36
43 void AddFileName(VTK_FILEPATH const char* fname);
44
49
54
58 VTK_FILEPATH const char* GetFileName(int i) const;
59
64 VTK_FILEPATH const char* GetCurrentFileName() const;
65
67
72 int ReadTimeDependentMetaData(int timestep, vtkInformation* metadata) override;
73 int ReadMetaData(vtkInformation* metadata) override;
74 int ReadMesh(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
75 int ReadPoints(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
76 int ReadArrays(int piece, int npieces, int nghosts, int timestep, vtkDataObject* output) override;
78
87 virtual double GetTimeValue(VTK_FILEPATH const std::string& fname);
88
94 virtual int ReadMetaDataSimple(
95 VTK_FILEPATH const std::string& /*fname*/, vtkInformation* /*metadata*/)
96 {
97 return 1;
98 }
99
106 virtual int ReadMeshSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
107
114 virtual int ReadPointsSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
115
122 virtual int ReadArraysSimple(VTK_FILEPATH const std::string& fname, vtkDataObject* output) = 0;
123
124protected:
127
130
131private:
132 vtkSimpleReader(const vtkSimpleReader&) = delete;
133 void operator=(const vtkSimpleReader&) = delete;
134
135 vtkSimpleReaderInternal* Internal;
136};
137
138#endif
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:113
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.
VTK_FILEPATH const char * GetFileName(int i) const
Returns a particular filename stored by the reader.
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 ...
VTK_FILEPATH const char * GetCurrentFileName() const
Returns the filename that was last loaded by the reader.
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.
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:496
#define VTK_FILEPATH