line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/********************************************************************** |
2
|
|
|
|
|
|
|
* |
3
|
|
|
|
|
|
|
* GEOS - Geometry Engine Open Source |
4
|
|
|
|
|
|
|
* http://geos.osgeo.org |
5
|
|
|
|
|
|
|
* |
6
|
|
|
|
|
|
|
* Copyright (C) 2011 Sandro Santilli |
7
|
|
|
|
|
|
|
* Copyright (C) 2005-2006 Refractions Research Inc. |
8
|
|
|
|
|
|
|
* Copyright (C) 2001-2002 Vivid Solutions Inc. |
9
|
|
|
|
|
|
|
* |
10
|
|
|
|
|
|
|
* This is free software; you can redistribute and/or modify it under |
11
|
|
|
|
|
|
|
* the terms of the GNU Lesser General Public Licence as published |
12
|
|
|
|
|
|
|
* by the Free Software Foundation. |
13
|
|
|
|
|
|
|
* See the COPYING file for more information. |
14
|
|
|
|
|
|
|
* |
15
|
|
|
|
|
|
|
********************************************************************** |
16
|
|
|
|
|
|
|
* |
17
|
|
|
|
|
|
|
* Last port: noding/SegmentString.java r430 (JTS-1.12+) |
18
|
|
|
|
|
|
|
* |
19
|
|
|
|
|
|
|
**********************************************************************/ |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#ifndef GEOS_NODING_SEGMENTSTRING_H |
22
|
|
|
|
|
|
|
#define GEOS_NODING_SEGMENTSTRING_H |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#include |
25
|
|
|
|
|
|
|
#include |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#include |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
// Forward declarations |
30
|
|
|
|
|
|
|
namespace geos { |
31
|
|
|
|
|
|
|
namespace algorithm { |
32
|
|
|
|
|
|
|
class LineIntersector; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
namespace geos { |
37
|
|
|
|
|
|
|
namespace noding { // geos.noding |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
/** \brief |
40
|
|
|
|
|
|
|
* An interface for classes which represent a sequence of contiguous |
41
|
|
|
|
|
|
|
* line segments. |
42
|
|
|
|
|
|
|
* |
43
|
|
|
|
|
|
|
* SegmentStrings can carry a context object, which is useful |
44
|
|
|
|
|
|
|
* for preserving topological or parentage information. |
45
|
|
|
|
|
|
|
*/ |
46
|
|
|
|
|
|
|
class GEOS_DLL SegmentString { |
47
|
|
|
|
|
|
|
public: |
48
|
|
|
|
|
|
|
typedef std::vector ConstVect; |
49
|
|
|
|
|
|
|
typedef std::vector NonConstVect; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
friend std::ostream& operator<< (std::ostream& os, |
52
|
|
|
|
|
|
|
const SegmentString& ss); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
/// Construct a SegmentString. |
55
|
|
|
|
|
|
|
// |
56
|
|
|
|
|
|
|
/// @param newContext the context associated to this SegmentString |
57
|
|
|
|
|
|
|
/// |
58
|
21
|
|
|
|
|
|
SegmentString(const void* newContext) |
59
|
|
|
|
|
|
|
: |
60
|
21
|
|
|
|
|
|
context(newContext) |
61
|
21
|
|
|
|
|
|
{} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
virtual ~SegmentString() {} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
/** |
66
|
|
|
|
|
|
|
* Gets the user-defined data for this segment string. |
67
|
|
|
|
|
|
|
* |
68
|
|
|
|
|
|
|
* @return the user-defined data |
69
|
|
|
|
|
|
|
*/ |
70
|
|
|
|
|
|
|
const void* getData() const { return context; } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
/** |
73
|
|
|
|
|
|
|
* Sets the user-defined data for this segment string. |
74
|
|
|
|
|
|
|
* |
75
|
|
|
|
|
|
|
* @param data an Object containing user-defined data |
76
|
|
|
|
|
|
|
*/ |
77
|
|
|
|
|
|
|
void setData(const void* data) { context=data; } |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
virtual unsigned int size() const=0; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
virtual const geom::Coordinate& getCoordinate(unsigned int i) const=0; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
/// \brief |
85
|
|
|
|
|
|
|
/// Return a pointer to the CoordinateSequence associated |
86
|
|
|
|
|
|
|
/// with this SegmentString. |
87
|
|
|
|
|
|
|
// |
88
|
|
|
|
|
|
|
/// Note that the CoordinateSequence is owned by this SegmentString! |
89
|
|
|
|
|
|
|
/// |
90
|
|
|
|
|
|
|
virtual geom::CoordinateSequence* getCoordinates() const=0; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
virtual bool isClosed() const=0; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
virtual std::ostream& print(std::ostream& os) const; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
private: |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
const void* context; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
// Declare type as noncopyable |
101
|
|
|
|
|
|
|
SegmentString(const SegmentString& other) = delete; |
102
|
|
|
|
|
|
|
SegmentString& operator=(const SegmentString& rhs) = delete; |
103
|
|
|
|
|
|
|
}; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
std::ostream& operator<< (std::ostream& os, const SegmentString& ss); |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} // namespace geos.noding |
108
|
|
|
|
|
|
|
} // namespace geos |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
#endif |
111
|
|
|
|
|
|
|
|