VTK
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 
34 #include "vtkIOGDALModule.h" // For export macro
35 
36 #include <map> // STL required.
37 
38 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
39 {
40 public:
41  static vtkGDALVectorReader* New();
42  void PrintSelf( ostream& os, vtkIndent indent ) override;
44 
45  vtkSetStringMacro(FileName);
46  vtkGetStringMacro(FileName);
47 
51  int GetNumberOfLayers();
52 
56  int GetLayerType(int layerIndex=0);
57 
61  int GetFeatureCount(int layerIndex=0);
62 
66  int GetActiveLayerType();
67 
71  int GetActiveLayerFeatureCount();
72 
74 
79  vtkSetMacro(ActiveLayer,int);
80  vtkGetMacro(ActiveLayer,int);
82 
84 
90  vtkSetMacro(AppendFeatures, int);
91  vtkGetMacro(AppendFeatures, int);
92  vtkBooleanMacro(AppendFeatures, int);
94 
98  std::map<int, std::string> GetLayersProjection();
99 
103  const char* GetLayerProjection(int layerIndex);
104 
106 
116  vtkSetMacro(AddFeatureIds,int);
117  vtkGetMacro(AddFeatureIds,int);
118  vtkBooleanMacro(AddFeatureIds,int);
120 
121 protected:
123  ~vtkGDALVectorReader() override;
124 
127 
128  int InitializeInternal();
129 
131  char* FileName;
132 
136 
137  class Internal;
138 
140  vtkGDALVectorReader::Internal* Implementation;
141 
143  static int OGRRegistered;
144 
146  std::map<int, std::string> LayersProjection;
147 
148 private:
149  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
150  void operator=(const vtkGDALVectorReader&) = delete;
151 };
152 
153 #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:33
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.