VTK
vtkGDALRasterReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGDALRasterReader.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 =========================================================================*/
29 #ifndef vtkGDALRasterReader_h
30 #define vtkGDALRasterReader_h
31 
32 #include <vtkImageReader2.h>
33 #include <vtkIOGDALModule.h> // For export macro
34 
35 // C++ includes
36 #include <string> // string is required
37 #include <vector> // vector is required
38 
39 class VTKIOGDAL_EXPORT vtkGDALRasterReader : public vtkImageReader2
40 {
41 public:
42  static vtkGDALRasterReader* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47  ~vtkGDALRasterReader() override;
48 
52  int CanReadFile(const char* fname) override;
53 
57  const char* GetProjectionString() const;
58 
63  const double* GetGeoCornerPoints();
64 
66 
69  vtkSetVector2Macro(TargetDimensions, int);
70  vtkGetVector2Macro(TargetDimensions, int);
72 
74 
77  vtkGetVector2Macro(RasterDimensions, int);
79 
83  const std::vector<std::string>& GetMetaData();
84 
88  double GetInvalidValue();
89 
93  std::vector<std::string> GetDomainMetaData(const std::string& domain);
94 
96 
99  const std::string& GetDriverShortName();
100  const std::string& GetDriverLongName();
102 
106  vtkIdType GetNumberOfCells();
107 
108 protected:
109 
110  int RequestData(vtkInformation* request,
111  vtkInformationVector** inputVector,
112  vtkInformationVector* outputVector) override;
113 
114  int RequestInformation(vtkInformation* request,
115  vtkInformationVector** inputVector,
116  vtkInformationVector* outputVector) override;
117 
119  vtkInformation* info) override;
120 
121 protected:
122  int TargetDimensions[2];
123  int RasterDimensions[2];
128  std::vector<std::string> Domains;
129  std::vector<std::string> MetaData;
130 
131  class vtkGDALRasterReaderInternal;
132  vtkGDALRasterReaderInternal* Implementation;
133 
134 private:
135  vtkGDALRasterReader(const vtkGDALRasterReader&) = delete;
136  void operator=(const vtkGDALRasterReader&) = delete;
137 };
138 
139 #endif // vtkGDALRasterReader_h
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
vtkGDALRasterReaderInternal * Implementation
int vtkIdType
Definition: vtkType.h:347
std::vector< std::string > Domains
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
a simple class to control print indentation
Definition: vtkIndent.h:33
Superclass of binary file readers.
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
int FillOutputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
Store zero or more vtkInformation instances.
std::vector< std::string > MetaData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Read raster file formats using GDAL.