GEOS  3.13.0dev
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
25 namespace geos {
26 namespace geom {
27 class GeometryFactory;
28 }
29 namespace operation {
30 namespace overlayng {
31 class OverlayEdge;
32 class OverlayGraph;
33 class OverlayLabel;
34 }
35 }
36 }
37 
38 namespace geos { // geos.
39 namespace operation { // geos.operation
40 namespace overlayng { // geos.operation.overlayng
41 
60 class GEOS_DLL IntersectionPointBuilder {
61 
62 private:
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 
87 public:
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:65
Definition: IntersectionPointBuilder.h:60
Definition: OverlayEdge.h:52
Definition: OverlayGraph.h:54
Definition: OverlayLabel.h:89
static constexpr bool STRICT_MODE_DEFAULT
Definition: OverlayNG.h:170
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25