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 =========================================================================*/
33 #ifndef vtkGDALVectorReader_h
34 #define vtkGDALVectorReader_h
35 
37 #include "vtkIOGDALModule.h" // For export macro
38 
39 #include <map> // STL required.
40 
41 class VTKIOGDAL_EXPORT vtkGDALVectorReader : public vtkMultiBlockDataSetAlgorithm
42 {
43 public:
44  static vtkGDALVectorReader* New();
45  void PrintSelf( ostream& os, vtkIndent indent ) override;
47 
48  vtkSetStringMacro(FileName);
49  vtkGetStringMacro(FileName);
50 
54  int GetNumberOfLayers();
55 
59  int GetLayerType(int layerIndex=0);
60 
64  int GetFeatureCount(int layerIndex=0);
65 
69  int GetActiveLayerType();
70 
74  int GetActiveLayerFeatureCount();
75 
77 
82  vtkSetMacro(ActiveLayer,int);
83  vtkGetMacro(ActiveLayer,int);
85 
87 
93  vtkSetMacro(AppendFeatures, int);
94  vtkGetMacro(AppendFeatures, int);
95  vtkBooleanMacro(AppendFeatures, int);
97 
101  std::map<int, std::string> GetLayersProjection();
102 
106  const char* GetLayerProjection(int layerIndex);
107 
114  const char* GetLayerProjectionAsProj4(int layerIndex);
115 
117 
127  vtkSetMacro(AddFeatureIds,int);
128  vtkGetMacro(AddFeatureIds,int);
129  vtkBooleanMacro(AddFeatureIds,int);
131 
132 protected:
134  ~vtkGDALVectorReader() override;
135 
138 
139  int InitializeInternal();
140 
142  char* FileName;
143 
147 
148  class Internal;
149 
151  vtkGDALVectorReader::Internal* Implementation;
152 
154  static int OGRRegistered;
155 
157  std::map<int, std::string> LayersProjection;
158 
159 private:
160  vtkGDALVectorReader(const vtkGDALVectorReader&) = delete;
161  void operator=(const vtkGDALVectorReader&) = delete;
162 };
163 
164 #endif // vtkGDALVectorReader_h
vtkGDALVectorReader::AddFeatureIds
int AddFeatureIds
Definition: vtkGDALVectorReader.h:146
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkGDALVectorReader::OGRRegistered
static int OGRRegistered
Global variable indicating whether the OGR library has been registered yet or not.
Definition: vtkGDALVectorReader.h:154
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkGDALVectorReader::Implementation
vtkGDALVectorReader::Internal * Implementation
Private per-file metadata.
Definition: vtkGDALVectorReader.h:148
vtkGDALVectorReader::AppendFeatures
int AppendFeatures
Definition: vtkGDALVectorReader.h:145
vtkGDALVectorReader::FileName
char * FileName
The name of the file that will be opened on the next call to RequestData()
Definition: vtkGDALVectorReader.h:142
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:91
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMultiBlockDataSetAlgorithm.h
vtkGDALVectorReader::LayersProjection
std::map< int, std::string > LayersProjection
Mapping of layer to projection.
Definition: vtkGDALVectorReader.h:157
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:86
vtkGDALVectorReader::ActiveLayer
int ActiveLayer
Definition: vtkGDALVectorReader.h:144
vtkGDALVectorReader
Read vector file formats using GDAL.
Definition: vtkGDALVectorReader.h:41
vtkMultiBlockDataSetAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Definition: vtkMultiBlockDataSetAlgorithm.h:83
vtkMultiBlockDataSetAlgorithm
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Definition: vtkMultiBlockDataSetAlgorithm.h:35