GEOS 3.9.1
overlay/LineBuilder.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 * Last port: operation/overlay/LineBuilder.java rev. 1.15 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_OP_OVERLAY_LINEBUILDER_H
20#define GEOS_OP_OVERLAY_LINEBUILDER_H
21
22#include <geos/export.h>
23
24#include <geos/operation/overlay/OverlayOp.h> // for OverlayOp::OpCode enum
25
26#include <vector>
27
28#ifdef _MSC_VER
29#pragma warning(push)
30#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
31#endif
32
33// Forward declarations
34namespace geos {
35namespace geom {
36class GeometryFactory;
37class CoordinateSequence;
38class LineString;
39}
40namespace geomgraph {
41class DirectedEdge;
42class Edge;
43}
44namespace algorithm {
45class PointLocator;
46}
47namespace operation {
48namespace overlay {
49class OverlayOp;
50}
51}
52}
53
54namespace geos {
55namespace operation { // geos::operation
56namespace overlay { // geos::operation::overlay
57
63class GEOS_DLL LineBuilder {
64
65public:
66
68 const geom::GeometryFactory* newGeometryFactory,
69 algorithm::PointLocator* newPtLocator);
70
71 ~LineBuilder() = default;
72
76 std::vector<geom::LineString*>* build(OverlayOp::OpCode opCode);
77
90 OverlayOp::OpCode opCode,
91 std::vector<geomgraph::Edge*>* edges);
92
93private:
94 OverlayOp* op;
95 const geom::GeometryFactory* geometryFactory;
96 algorithm::PointLocator* ptLocator;
97 std::vector<geomgraph::Edge*> lineEdgesList;
98 std::vector<geom::LineString*>* resultLineList;
99 void findCoveredLineEdges();
100 void collectLines(OverlayOp::OpCode opCode);
101 void buildLines(OverlayOp::OpCode opCode);
102 void labelIsolatedLines(std::vector<geomgraph::Edge*>* edgesList);
103
114 void collectBoundaryTouchEdge(geomgraph::DirectedEdge* de,
115 OverlayOp::OpCode opCode,
116 std::vector<geomgraph::Edge*>* edges);
117
121 void labelIsolatedLine(geomgraph::Edge* e, int targetIndex);
122
123 /*
124 * If the given CoordinateSequence has mixed 3d/2d vertexes
125 * set Z for all vertexes missing it.
126 * The Z value is interpolated between 3d vertexes and copied
127 * from a 3d vertex to the end.
128 */
129 void propagateZ(geom::CoordinateSequence* cs);
130};
131
132} // namespace geos::operation::overlay
133} // namespace geos::operation
134} // namespace geos
135
136#ifdef _MSC_VER
137#pragma warning(pop)
138#endif
139
140#endif // ndef GEOS_OP_OVERLAY_LINEBUILDER_H
Computes the topological relationship (Location) of a single point to a Geometry.
Definition PointLocator.h:57
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:58
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition GeometryFactory.h:68
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:45
Definition geomgraph/Edge.h:66
Forms JTS LineStrings out of a the graph of geomgraph::DirectedEdge created by an OverlayOp.
Definition overlay/LineBuilder.h:63
std::vector< geom::LineString * > * build(OverlayOp::OpCode opCode)
void collectLineEdge(geomgraph::DirectedEdge *de, OverlayOp::OpCode opCode, std::vector< geomgraph::Edge * > *edges)
Computes the geometric overlay of two Geometry.
Definition OverlayOp.h:70
OpCode
The spatial functions supported by this class.
Definition OverlayOp.h:79
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26