VTK  9.0.1
vtkGDALVectorReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGDALVectorReader.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 =========================================================================*/
30 #ifndef vtkGDALVectorReader_h
31 #define vtkGDALVectorReader_h
32 
33 #include "vtkIOGDALModule.h" // For export macro
35 
36 #include <map> // STL required.
37 #include <string> // for ivars
38 
39 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
40 {
41 public:
42  static vtkGDALVectorReader* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  vtkSetStringMacro(FileName);
47  vtkGetStringMacro(FileName);
48 
52  int GetNumberOfLayers();
53 
57  int GetLayerType(int layerIndex = 0);
58 
62  int GetFeatureCount(int layerIndex = 0);
63 
67  int GetActiveLayerType();
68 
72  int GetActiveLayerFeatureCount();
73 
75 
80  vtkSetMacro(ActiveLayer, int);
81  vtkGetMacro(ActiveLayer, int);
83 
85 
91  vtkSetMacro(AppendFeatures, int);
92  vtkGetMacro(AppendFeatures, int);
93  vtkBooleanMacro(AppendFeatures, int);
95 
99  std::map<int, std::string> GetLayersProjection();
100 
104  const char* GetLayerProjection(int layerIndex);
105 
112  const char* GetLayerProjectionAsProj4(int layerIndex);
113 
115 
125  vtkSetMacro(AddFeatureIds, int);
126  vtkGetMacro(AddFeatureIds, int);
127  vtkBooleanMacro(AddFeatureIds, int);
129 
130 protected:
132  ~vtkGDALVectorReader() override;
133 
136 
137  int InitializeInternal();
138 
140  char* FileName;
141 
145 
146  class Internal;
147 
149  vtkGDALVectorReader::Internal* Implementation;
150 
152  static int OGRRegistered;
153 
155  std::map<int, std::string> LayersProjection;
156 
157 private:
158  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
159  void operator=(const vtkGDALVectorReader&) = delete;
160 };
161 
162 #endif // vtkGDALVectorReader_h
vtkGDALVectorReader::AddFeatureIds
int AddFeatureIds
Definition: vtkGDALVectorReader.h:144
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkGDALVectorReader::OGRRegistered
static int OGRRegistered
Global variable indicating whether the OGR library has been registered yet or not.
Definition: vtkGDALVectorReader.h:152
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkGDALVectorReader::Implementation
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
Definition: vtkGDALVectorReader.h:146
vtkGDALVectorReader::AppendFeatures
int AppendFeatures
Definition: vtkGDALVectorReader.h:143
vtkGDALVectorReader::FileName
char * FileName
The name of the file that will be opened on the next call to RequestData()
Definition: vtkGDALVectorReader.h:140
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:89
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMultiBlockDataSetAlgorithm.h
vtkGDALVectorReader::LayersProjection
std::map< int, std::string > LayersProjection
Mapping of layer to projection.
Definition: vtkGDALVectorReader.h:155
vtkMultiBlockDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkGDALVectorReader::ActiveLayer
int ActiveLayer
Definition: vtkGDALVectorReader.h:142
vtkGDALVectorReader
Read vector file formats using GDAL.
Definition: vtkGDALVectorReader.h:39
vtkMultiBlockDataSetAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:80
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:32