GEOS 3.11.1
IntersectionPointBuilder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
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#pragma once
16
17#include <geos/geom/Point.h>
18#include <geos/operation/overlayng/OverlayNG.h>
19
20#include <geos/export.h>
21#include <vector>
22#include <memory>
23
24// Forward declarations
25namespace geos {
26namespace geom {
27class GeometryFactory;
28}
29namespace operation {
30namespace overlayng {
31class OverlayEdge;
32class OverlayGraph;
33class OverlayLabel;
34}
35}
36}
37
38namespace geos { // geos.
39namespace operation { // geos.operation
40namespace overlayng { // geos.operation.overlayng
41
61
62private:
63
64 // Members
65 OverlayGraph* graph;
66 const geom::GeometryFactory* geometryFactory;
67 std::vector<std::unique_ptr<geom::Point>> points;
73 bool isAllowCollapseLines;
74
75 // Methods
76 void addResultPoints();
77
83 bool isResultPoint(OverlayEdge* nodeEdge) const;
84 bool isEdgeOf(const OverlayLabel* label, uint8_t i) const;
85
86
87public:
88
89
91 : graph(p_graph)
92 , geometryFactory(geomFact)
93 , isAllowCollapseLines(!OverlayNG::STRICT_MODE_DEFAULT)
94 {}
95
96 std::vector<std::unique_ptr<geom::Point>> getPoints();
97
99 IntersectionPointBuilder& operator=(const IntersectionPointBuilder&) = delete;
100
101 void setStrictMode(bool p_isStrictMode)
102 {
103 isAllowCollapseLines = ! p_isStrictMode;
104 }
105
106
107};
108
109
110} // namespace geos.operation.overlayng
111} // namespace geos.operation
112} // namespace geos
113
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Definition: IntersectionPointBuilder.h:60
Definition: OverlayEdge.h:52
Definition: OverlayGraph.h:54
Definition: OverlayLabel.h:87
static constexpr bool STRICT_MODE_DEFAULT
Definition: OverlayNG.h:171
Basic namespace for all GEOS functionalities.
Definition: geos.h:39