VTK  9.2.6
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 =========================================================================*/
33 #ifndef vtkGDALVectorReader_h
34 #define vtkGDALVectorReader_h
35 
36 #include "vtkIOGDALModule.h" // For export macro
38 
39 #include <map> // STL required.
40 #include <string> // for ivars
41 
42 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
43 {
44 public:
45  static vtkGDALVectorReader* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  vtkSetFilePathMacro(FileName);
50  vtkGetFilePathMacro(FileName);
51 
55  int GetNumberOfLayers();
56 
60  int GetLayerType(int layerIndex = 0);
61 
65  int GetFeatureCount(int layerIndex = 0);
66 
70  int GetActiveLayerType();
71 
75  int GetActiveLayerFeatureCount();
76 
78 
83  vtkSetMacro(ActiveLayer, int);
84  vtkGetMacro(ActiveLayer, int);
86 
88 
94  vtkSetMacro(AppendFeatures, int);
95  vtkGetMacro(AppendFeatures, int);
96  vtkBooleanMacro(AppendFeatures, int);
98 
102  std::map<int, std::string> GetLayersProjection();
103 
107  const char* GetLayerProjection(int layerIndex);
108 
115  const char* GetLayerProjectionAsProj4(int layerIndex);
116 
118 
128  vtkSetMacro(AddFeatureIds, int);
129  vtkGetMacro(AddFeatureIds, int);
130  vtkBooleanMacro(AddFeatureIds, int);
132 
133 protected:
135  ~vtkGDALVectorReader() override;
136 
139 
140  int InitializeInternal();
141 
143  char* FileName;
144 
148 
149  class Internal;
150 
152  vtkGDALVectorReader::Internal* Implementation;
153 
155  static int OGRRegistered;
156 
158  std::map<int, std::string> LayersProjection;
159 
160 private:
161  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
162  void operator=(const vtkGDALVectorReader&) = delete;
163 };
164 
165 #endif // vtkGDALVectorReader_h
char * FileName
The name of the file that will be opened on the next call to RequestData()
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
static vtkMultiBlockDataSetAlgorithm * New()
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
a simple class to control print indentation
Definition: vtkIndent.h:39
Read vector file formats using GDAL.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static int OGRRegistered
Global variable indicating whether the OGR library has been registered yet or not.
Store zero or more vtkInformation instances.
std::map< int, std::string > LayersProjection
Mapping of layer to projection.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.