GEOS: SingleInteriorIntersectionFinder.h Source File

GEOS 3.5.0

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

- File List

SingleInteriorIntersectionFinder.h
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_SINGLEINTERIORINTERSECTIONFINDER_H
16 #define GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
17
18 #include <geos/noding/SegmentIntersector.h> // for inheritance
19 #include <geos/geom/Coordinate.h> // for composition
20
21 #include <vector>
22
23 // Forward declarations
24 namespace geos {
25 namespace algorithm {
26 class LineIntersector;
27 }
28 namespace noding {
29 class SegmentString;
30 }
31 }
32
33 namespace geos {
34 namespace noding { // geos.noding
35
43 class SingleInteriorIntersectionFinder: public SegmentIntersector
44 {
45
46 public:
47
54 SingleInteriorIntersectionFinder(algorithm::LineIntersector& newLi)
55 :
56 li(newLi),
57 interiorIntersection(geom::Coordinate::getNull())
58 {
59 }
60
66 bool hasIntersection() const
67 {
68 return !interiorIntersection.isNull();
69 }
70
77 const geom::Coordinate& getInteriorIntersection() const
78 {
79 return interiorIntersection;
80 }
81
87 const std::vector<geom::Coordinate>& getIntersectionSegments() const
88 {
89 return intSegments;
90 }
91
101 void processIntersections(
102 SegmentString* e0, int segIndex0,
103 SegmentString* e1, int segIndex1);
104
105 bool isDone() const
106 {
107 return !interiorIntersection.isNull();
108 }
109
110 private:
111 algorithm::LineIntersector& li;
112 geom::Coordinate interiorIntersection;
113 std::vector<geom::Coordinate> intSegments;
114
115 // Declare type as noncopyable
116 SingleInteriorIntersectionFinder(const SingleInteriorIntersectionFinder& other);
117 SingleInteriorIntersectionFinder& operator=(const SingleInteriorIntersectionFinder& rhs);
118 };
119
120 } // namespace geos.noding
121 } // namespace geos
122
123 #endif // GEOS_NODING_SINGLEINTERIORINTERSECTIONFINDER_H
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::noding::SingleInteriorIntersectionFinder::isDone
bool isDone() const
Reports whether the client of this class needs to continue testing all intersections in an arrangemen...
Definition: SingleInteriorIntersectionFinder.h:105
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
geos::noding::SingleInteriorIntersectionFinder::hasIntersection
bool hasIntersection() const
Tests whether an intersection was found.
Definition: SingleInteriorIntersectionFinder.h:66
geos::algorithm::LineIntersector
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::noding::SegmentIntersector
Processes possible intersections detected by a Noder.
Definition: noding/SegmentIntersector.h:47
geos::noding::SingleInteriorIntersectionFinder::getInteriorIntersection
const geom::Coordinate & getInteriorIntersection() const
Gets the computed location of the intersection. Due to round-off, the location may not be exact...
Definition: SingleInteriorIntersectionFinder.h:77
geos::noding::SingleInteriorIntersectionFinder::getIntersectionSegments
const std::vector< geom::Coordinate > & getIntersectionSegments() const
Gets the endpoints of the intersecting segments.
Definition: SingleInteriorIntersectionFinder.h:87
geos::noding::SingleInteriorIntersectionFinder
Finds an interior intersection in a set of SegmentString, if one exists. Only the first intersection ...
Definition: SingleInteriorIntersectionFinder.h:43
geos::noding::SingleInteriorIntersectionFinder::SingleInteriorIntersectionFinder
SingleInteriorIntersectionFinder(algorithm::LineIntersector &newLi)
Creates an intersection finder which finds an interior intersection if one exists.
Definition: SingleInteriorIntersectionFinder.h:54