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 
111  const char* GetLayerProjectionAsProj4(int layerIndex);
112 
114 
124  vtkSetMacro(AddFeatureIds,int);
125  vtkGetMacro(AddFeatureIds,int);
126  vtkBooleanMacro(AddFeatureIds,int);
128 
129 protected:
131  ~vtkGDALVectorReader() override;
132 
135 
136  int InitializeInternal();
137 
139  char* FileName;
140 
144 
145  class Internal;
146 
148  vtkGDALVectorReader::Internal* Implementation;
149 
151  static int OGRRegistered;
152 
154  std::map<int, std::string> LayersProjection;
155 
156 private:
157  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
158  void operator=(const vtkGDALVectorReader&) = delete;
159 };
160 
161 #endif // vtkGDALVectorReader_h
vtkGDALVectorReader::AddFeatureIds
int AddFeatureIds
Definition: vtkGDALVectorReader.h:143
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:151
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkGDALVectorReader::Implementation
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
Definition: vtkGDALVectorReader.h:145
vtkGDALVectorReader::AppendFeatures
int AppendFeatures
Definition: vtkGDALVectorReader.h:142
vtkGDALVectorReader::FileName
char * FileName
The name of the file that will be opened on the next call to RequestData()
Definition: vtkGDALVectorReader.h:139
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:88
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:154
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:80
vtkGDALVectorReader::ActiveLayer
int ActiveLayer
Definition: vtkGDALVectorReader.h:141
vtkGDALVectorReader
Read vector file formats using GDAL.
Definition: vtkGDALVectorReader.h:38
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