File Coverage

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux/CPP/geos.x/i/geos/noding/IntersectionFinderAdder.h
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 3 3 100.0


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             * Last port: noding/IntersectionFinderAdder.java rev. 1.5 (JTS-1.9)
16             *
17             **********************************************************************/
18              
19             #ifndef GEOS_NODING_INTERSECTIONFINDERADDER_H
20             #define GEOS_NODING_INTERSECTIONFINDERADDER_H
21              
22             #include
23              
24             #include
25             #include
26              
27             #include
28              
29             #include // for use in vector
30             #include // for inheritance
31              
32             // Forward declarations
33             namespace geos {
34             namespace geom {
35             class Coordinate;
36             }
37             namespace noding {
38             class SegmentString;
39             }
40             namespace algorithm {
41             class LineIntersector;
42             }
43             }
44              
45             namespace geos {
46             namespace noding { // geos.noding
47              
48             /** \brief
49             * Finds proper and interior intersections in a set of SegmentStrings,
50             * and adds them as nodes.
51             *
52             */
53             class GEOS_DLL IntersectionFinderAdder: public SegmentIntersector {
54              
55             public:
56              
57             /**
58             * Creates an intersection finder which finds all proper intersections
59             * and stores them in the provided Coordinate array
60             *
61             * @param li the LineIntersector to use
62             * @param v the Vector to push interior intersections to
63             */
64 1           IntersectionFinderAdder(algorithm::LineIntersector& newLi,
65             std::vector& v)
66             :
67             li(newLi),
68 1           interiorIntersections(v)
69 1           {}
70              
71             /**
72             * This method is called by clients
73             * of the {@link SegmentIntersector} class to process
74             * intersections for two segments of the {@link SegmentStrings}
75             * being intersected.
76             * Note that some clients (such as {@link MonotoneChain}s) may
77             * optimize away this call for segment pairs which they have
78             * determined do not intersect
79             * (e.g. by an disjoint envelope test).
80             */
81             void processIntersections(
82             SegmentString* e0, int segIndex0,
83             SegmentString* e1, int segIndex1) override;
84              
85             std::vector& getInteriorIntersections() {
86             return interiorIntersections;
87             }
88              
89             /**
90             * Always process all intersections
91             *
92             * @return false always
93             */
94             bool isDone() const override {
95             return false;
96             }
97              
98             private:
99             algorithm::LineIntersector& li;
100             std::vector& interiorIntersections;
101              
102             // Declare type as noncopyable
103             IntersectionFinderAdder(const IntersectionFinderAdder& other) = delete;
104             IntersectionFinderAdder& operator=(const IntersectionFinderAdder& rhs) = delete;
105             };
106              
107             } // namespace geos.noding
108             } // namespace geos
109              
110             #endif // GEOS_NODING_INTERSECTIONFINDERADDER_H