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
vtkImageAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
vtkGDALRasterReader::Domains
std::vector< std::string > Domains
Definition: vtkGDALRasterReader.h:128
vtkImageReader2::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGDALRasterReader::Implementation
vtkGDALRasterReaderInternal * Implementation
Definition: vtkGDALRasterReader.h:131
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkGDALRasterReader::DriverShortName
std::string DriverShortName
Definition: vtkGDALRasterReader.h:126
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkGDALRasterReader
Read raster file formats using GDAL.
Definition: vtkGDALRasterReader.h:39
vtkGDALRasterReader::DomainMetaData
std::string DomainMetaData
Definition: vtkGDALRasterReader.h:125
vtkImageReader2::RequestInformation
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkX3D::port
Definition: vtkX3D.h:447
vtkImageReader2::New
static vtkImageReader2 * New()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:52
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkX3D::info
Definition: vtkX3D.h:376
vtkX3D::string
Definition: vtkX3D.h:490
vtkImageAlgorithm::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
These method should be reimplemented by subclasses that have more than a single input or single outpu...
vtkGDALRasterReader::MetaData
std::vector< std::string > MetaData
Definition: vtkGDALRasterReader.h:129
vtkGDALRasterReader::DriverLongName
std::string DriverLongName
Definition: vtkGDALRasterReader.h:127
vtkImageReader2::CanReadFile
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
Definition: vtkImageReader2.h:279
vtkGDALRasterReader::Projection
std::string Projection
Definition: vtkGDALRasterReader.h:124
vtkImageReader2.h