forked from jatin3893/vtkDataSetReaders
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvtkGeoJSONReader.h
More file actions
66 lines (50 loc) · 2.03 KB
/
vtkGeoJSONReader.h
File metadata and controls
66 lines (50 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*=========================================================================
Program: Visualization Toolkit
Module: vtkGeoJSONReader.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkGeoJSONReader - Convert Geo JSON format to vtkPolyData
// .SECTION Description
// Outputs a vtkPolyData from the input
// Geo JSON Data (http://www.geojson.org)
#ifndef __vtkGeoJSONReader_h
#define __vtkGeoJSONReader_h
// VTK Includes
#include "vtkPolyDataAlgorithm.h"
#include "vtk_jsoncpp.h" // For json parser
class vtkPolyData;
class vtkGeoJSONReader: public vtkPolyDataAlgorithm
{
public:
static vtkGeoJSONReader* New();
vtkTypeMacro(vtkGeoJSONReader,vtkPolyDataAlgorithm);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Decription:
// Accessor for name of the file that will be opened on WriteData
vtkSetStringMacro(FileName);
vtkGetStringMacro(FileName);
protected:
vtkGeoJSONReader();
virtual ~vtkGeoJSONReader();
// Decription:
// Core implementation of the
int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Decription:
// Parse the Json Value corresponding to the root of the geoJSON data from the file
void ParseRoot(Json::Value root, vtkPolyData *output);
// Decription:
// Verify if file exists and can be read by the parser
// If exists, parse into Jsoncpp data structure
int CanParse(const char *filename, Json::Value &root);
char *FileName;
private:
vtkGeoJSONReader(const vtkGeoJSONReader&); // Not implemented
void operator=(const vtkGeoJSONReader&); // Not implemented
};
#endif // __vtkGeoJSONReader_h