GEOS 3.15.0beta1
LineMergeGraph.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7 * Copyright (C) 2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: operation/linemerge/LineMergeGraph.java r378 (JTS-1.12)
18 *
19 **********************************************************************/
20
21#pragma once
22
23#include <geos/export.h>
24#include <geos/planargraph/PlanarGraph.h> // for inheritance
25
26#include <memory>
27#include <vector>
28
29#ifdef _MSC_VER
30#pragma warning(push)
31#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32#endif
33
34// Forward declarations
35namespace geos {
36namespace geom {
37class Curve;
38class Coordinate;
39}
40namespace planargraph {
41class Node;
42class Edge;
43class DirectedEdge;
44}
45}
46
47
48namespace geos {
49namespace operation { // geos::operation
50namespace linemerge { // geos::operation::linemerge
51
59class GEOS_DLL LineMergeGraph: public planargraph::PlanarGraph {
60
61private:
62
63 planargraph::Node* getNode(const geom::CoordinateXY& coordinate);
64
65 std::vector<std::unique_ptr<planargraph::Node>> newNodes;
66
67 std::vector<std::unique_ptr<planargraph::Edge>> newEdges;
68
69 std::vector<std::unique_ptr<planargraph::DirectedEdge>> newDirEdges;
70
71public:
72
73 LineMergeGraph();
74
83 void addEdge(const geom::Curve* curve);
84
85 ~LineMergeGraph() override;
86
87private:
88 // Declared as non-copyable
89 LineMergeGraph(const LineMergeGraph& other) = delete;
90 LineMergeGraph& operator=(const LineMergeGraph& rhs) = delete;
91
92};
93} // namespace geos::operation::linemerge
94} // namespace geos::operation
95} // namespace geos
96
97#ifdef _MSC_VER
98#pragma warning(pop)
99#endif
100
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:220
void addEdge(const geom::Curve *curve)
Adds an Edge, DirectedEdges, and Nodes for the given LineString/CircularString/CompoundCurve represen...
Represents a directed edge in a PlanarGraph.
Definition planargraph/DirectedEdge.h:45
Represents an undirected edge of a PlanarGraph.
Definition planargraph/Edge.h:55
A node in a PlanarGraph is a location where 0 or more Edge meet.
Definition planargraph/Node.h:44
Represents a directed graph which is embeddable in a planar surface.
Definition planargraph/PlanarGraph.h:59
Definition Angle.h:26
Line merging package.
Definition namespaces.h:192
Provides classes for implementing operations on geometries.
Definition CleanCoverage.h:34
Contains classes to implement a planar graph data structure.
Definition namespaces.h:293
Basic namespace for all GEOS functionalities.
Definition geos.h:38