GEOS  3.14.0dev
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 <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
34 namespace geos {
35 namespace geom {
36 class LineString;
37 class Coordinate;
38 }
39 namespace planargraph {
40 class Node;
41 class Edge;
42 class DirectedEdge;
43 }
44 }
45 
46 
47 namespace geos {
48 namespace operation { // geos::operation
49 namespace linemerge { // geos::operation::linemerge
50 
58 class GEOS_DLL LineMergeGraph: public planargraph::PlanarGraph {
59 
60 private:
61 
62  planargraph::Node* getNode(const geom::Coordinate& coordinate);
63 
64  std::vector<planargraph::Node*> newNodes;
65 
66  std::vector<planargraph::Edge*> newEdges;
67 
68  std::vector<planargraph::DirectedEdge*> newDirEdges;
69 
70 public:
71 
80  void addEdge(const geom::LineString* lineString);
81 
82  ~LineMergeGraph() override;
83 };
84 } // namespace geos::operation::linemerge
85 } // namespace geos::operation
86 } // namespace geos
87 
88 #ifdef _MSC_VER
89 #pragma warning(pop)
90 #endif
91 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
Definition: LineString.h:66
A planar graph of edges that is analyzed to sew the edges together.
Definition: LineMergeGraph.h:58
void addEdge(const geom::LineString *lineString)
Adds an Edge, DirectedEdges, and Nodes for the given LineString representation of an edge.
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
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25