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 =========================================================================*/
32 #ifndef vtkGDALRasterReader_h
33 #define vtkGDALRasterReader_h
34 
35 #include <vtkImageReader2.h>
36 #include <vtkIOGDALModule.h> // For export macro
37 
38 // C++ includes
39 #include <string> // string is required
40 #include <vector> // vector is required
41 
42 class VTKIOGDAL_EXPORT vtkGDALRasterReader : public vtkImageReader2
43 {
44 public:
45  static vtkGDALRasterReader* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50  ~vtkGDALRasterReader() override;
51 
55  int CanReadFile(const char* fname) override;
56 
60  const char* GetProjectionString() const;
61 
66  const double* GetGeoCornerPoints();
67 
69 
72  vtkSetVector2Macro(TargetDimensions, int);
73  vtkGetVector2Macro(TargetDimensions, int);
75 
77 
80  vtkGetVector2Macro(RasterDimensions, int);
82 
86  const std::vector<std::string>& GetMetaData();
87 
91  double GetInvalidValue();
92 
96  std::vector<std::string> GetDomainMetaData(const std::string& domain);
97 
99 
102  const std::string& GetDriverShortName();
103  const std::string& GetDriverLongName();
105 
109  vtkIdType GetNumberOfCells();
110 
111 protected:
112 
113  int RequestData(vtkInformation* request,
114  vtkInformationVector** inputVector,
115  vtkInformationVector* outputVector) override;
116 
117  int RequestInformation(vtkInformation* request,
118  vtkInformationVector** inputVector,
119  vtkInformationVector* outputVector) override;
120 
122  vtkInformation* info) override;
123 
124 protected:
125  int TargetDimensions[2];
126  int RasterDimensions[2];
131  std::vector<std::string> Domains;
132  std::vector<std::string> MetaData;
133 
134  class vtkGDALRasterReaderInternal;
135  vtkGDALRasterReaderInternal* Implementation;
136 
137 private:
138  vtkGDALRasterReader(const vtkGDALRasterReader&) = delete;
139  void operator=(const vtkGDALRasterReader&) = delete;
140 };
141 
142 #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:131
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:134
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkGDALRasterReader::DriverShortName
std::string DriverShortName
Definition: vtkGDALRasterReader.h:129
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkGDALRasterReader
Read raster file formats using GDAL.
Definition: vtkGDALRasterReader.h:42
vtkGDALRasterReader::DomainMetaData
std::string DomainMetaData
Definition: vtkGDALRasterReader.h:128
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:39
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:58
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
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:132
vtkGDALRasterReader::DriverLongName
std::string DriverLongName
Definition: vtkGDALRasterReader.h:130
vtkImageReader2::CanReadFile
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
Definition: vtkImageReader2.h:285
vtkGDALRasterReader::Projection
std::string Projection
Definition: vtkGDALRasterReader.h:127
vtkImageReader2.h