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) 2006 Refractions Research Inc. |
7
|
|
|
|
|
|
|
* |
8
|
|
|
|
|
|
|
* This is free software; you can redistribute and/or modify it under |
9
|
|
|
|
|
|
|
* the terms of the GNU Lesser General Public Licence as published |
10
|
|
|
|
|
|
|
* by the Free Software Foundation. |
11
|
|
|
|
|
|
|
* See the COPYING file for more information. |
12
|
|
|
|
|
|
|
* |
13
|
|
|
|
|
|
|
**********************************************************************/ |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#ifndef GEOS_NODING_SEGMENTINTERSECTOR_H |
16
|
|
|
|
|
|
|
#define GEOS_NODING_SEGMENTINTERSECTOR_H |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#include |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#include |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
// Forward declarations |
23
|
|
|
|
|
|
|
namespace geos { |
24
|
|
|
|
|
|
|
namespace noding { |
25
|
|
|
|
|
|
|
class SegmentString; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
namespace geos { |
30
|
|
|
|
|
|
|
namespace noding { // geos.noding |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
/** |
33
|
|
|
|
|
|
|
* \brief |
34
|
|
|
|
|
|
|
* Processes possible intersections detected by a Noder. |
35
|
|
|
|
|
|
|
* |
36
|
|
|
|
|
|
|
* The SegmentIntersector is passed to a Noder. |
37
|
|
|
|
|
|
|
* The addIntersections method is called whenever the Noder |
38
|
|
|
|
|
|
|
* detects that two SegmentStrings might intersect. |
39
|
|
|
|
|
|
|
* This class may be used either to find all intersections, or |
40
|
|
|
|
|
|
|
* to detect the presence of an intersection. In the latter case, |
41
|
|
|
|
|
|
|
* Noders may choose to short-circuit their computation by calling the |
42
|
|
|
|
|
|
|
* isDone method. |
43
|
|
|
|
|
|
|
* This class is an example of the Strategy pattern. |
44
|
|
|
|
|
|
|
* |
45
|
|
|
|
|
|
|
* @version 1.7 |
46
|
|
|
|
|
|
|
*/ |
47
|
|
|
|
|
|
|
class GEOS_DLL SegmentIntersector { |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
public: |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
/** |
52
|
|
|
|
|
|
|
* This method is called by clients |
53
|
|
|
|
|
|
|
* of the SegmentIntersector interface to process |
54
|
|
|
|
|
|
|
* intersections for two segments of the SegmentStrings |
55
|
|
|
|
|
|
|
* being intersected. |
56
|
|
|
|
|
|
|
*/ |
57
|
|
|
|
|
|
|
virtual void processIntersections( |
58
|
|
|
|
|
|
|
SegmentString* e0, int segIndex0, |
59
|
|
|
|
|
|
|
SegmentString* e1, int segIndex1)=0; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
/** |
62
|
|
|
|
|
|
|
* \brief |
63
|
|
|
|
|
|
|
* Reports whether the client of this class |
64
|
|
|
|
|
|
|
* needs to continue testing all intersections in an arrangement. |
65
|
|
|
|
|
|
|
* |
66
|
|
|
|
|
|
|
* @return true if there is not need to continue testing segments |
67
|
|
|
|
|
|
|
* |
68
|
|
|
|
|
|
|
* The default implementation always return false (process all intersections). |
69
|
|
|
|
|
|
|
*/ |
70
|
0
|
|
|
|
|
|
virtual bool isDone() const { |
71
|
0
|
|
|
|
|
|
return false; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
virtual ~SegmentIntersector() |
75
|
0
|
0
|
|
|
|
|
{ } |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
protected: |
78
|
|
|
|
|
|
|
|
79
|
6
|
|
|
|
|
|
SegmentIntersector() {} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
/// Temporary typedef for namespace transition |
84
|
|
|
|
|
|
|
typedef SegmentIntersector nodingSegmentIntersector; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
} // namespace geos.noding |
87
|
|
|
|
|
|
|
} // namespace geos |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
#endif // GEOS_NODING_SEGMENTINTERSECTOR_H |