GEOS 3.3.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

SegmentIntersectionTester.h
1 /**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.refractions.net
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: operation/predicate/SegmentIntersectionTester.java r378 (JTS-1.12)
17 *
18 **********************************************************************/
19
20 #ifndef GEOS_OP_PREDICATE_SEGMENTINTERSECTIONTESTER_H
21 #define GEOS_OP_PREDICATE_SEGMENTINTERSECTIONTESTER_H
22
23 #include <geos/export.h>
24
25 #include <geos/algorithm/LineIntersector.h> // for composition
26 #include <geos/geom/Coordinate.h> // for composition
27
28 // Forward declarations
29 namespace geos {
30 namespace geom {
31 class LineString;
32 class CoordinateSequence;
33 }
34 }
35
36 namespace geos {
37 namespace operation { // geos::operation
38 namespace predicate { // geos::operation::predicate
39
48 class GEOS_DLL SegmentIntersectionTester {
49
50 private:
51
56 algorithm::LineIntersector li; // Robust
57
58 bool hasIntersectionVar;
59
60 geom::Coordinate pt10;
61 geom::Coordinate pt11;
62 geom::Coordinate pt00;
63 geom::Coordinate pt01;
64
65
66 public:
67
68 SegmentIntersectionTester(): hasIntersectionVar(false) {}
69
70 bool hasIntersectionWithLineStrings(const geom::LineString &line,
71 const std::vector<const geom::LineString *>& lines);
72
73 bool hasIntersection(const geom::LineString &line,
74 const geom::LineString &testLine);
75
90 bool hasIntersectionWithEnvelopeFilter(const geom::LineString &line,
91 const geom::LineString &testLine);
92
93
94 };
95
96 } // namespace geos::operation::predicate
97 } // namespace geos::operation
98 } // namespace geos
99
100 #endif // ifndef GEOS_OP_PREDICATE_SEGMENTINTERSECTIONTESTER_H