-
Notifications
You must be signed in to change notification settings - Fork 0
/
DgInShapefile.h
89 lines (64 loc) · 2.39 KB
/
DgInShapefile.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
////////////////////////////////////////////////////////////////////////////////
//
// DgInShapefile.h: DgInShapefile class definitions
//
// Version 6.1 - Kevin Sahr, 5/23/13
//
////////////////////////////////////////////////////////////////////////////////
#ifndef DGINSHAPEFILE_H
#define DGINSHAPEFILE_H
#include <string>
#include <fstream>
#include "shapefil.h"
#include "DgInLocFile.h"
using namespace std;
class DgLocList;
class DgLocVector;
class DgPolygon;
class DgLocation;
class DgCell;
class DgRFBase;
class DgGeoSphRF;
////////////////////////////////////////////////////////////////////////////////
class DgInShapefile : public DgInLocFile {
public:
DgInShapefile (const DgGeoSphRF& geoRFIn,
const string* fileNameIn = NULL,
DgReportLevel failLevel = DgBase::Fatal);
virtual bool open (const string* fileName = NULL,
DgReportLevel failLevel = DgBase::Fatal);
virtual void close (void);
virtual void rewind (void);
int numEntities (void) { return numEntities_; }
bool isEOF (void) { return isEOF_; }
// pure virtual methods
virtual DgInLocFile& extract (DgLocList& list);
virtual DgInLocFile& extract (DgLocVector& vec);
virtual DgInLocFile& extract (DgPolygon& poly);
virtual DgInLocFile& extract (DgLocation& loc);
virtual DgInLocFile& extract (DgCell& cell);
const DgGeoSphRF& geoRF (void) const { return geoRF_; }
protected:
const DgGeoSphRF& geoRF_;
virtual void getNextEntity (void);
SHPHandle shpFile_;
int numEntities_;
int nextRecNum_;
SHPObject* curShpObj_;
int curRecNum_;
int curPart_;
int nextPart_;
bool isEOF_;
};
inline DgInLocFile& operator>> (DgInShapefile& input, DgLocList& list)
{ return input.extract(list); }
inline DgInLocFile& operator>> (DgInShapefile& input, DgLocVector& vec)
{ return input.extract(vec); }
inline DgInLocFile& operator>> (DgInShapefile& input, DgPolygon& poly)
{ return input.extract(poly); }
inline DgInLocFile& operator>> (DgInShapefile& input, DgLocation& loc)
{ return input.extract(loc); }
inline DgInLocFile& operator>> (DgInShapefile& input, DgCell& cell)
{ return input.extract(cell); }
////////////////////////////////////////////////////////////////////////////////
#endif