GEOS  3.9.1
EdgeGraph.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 
16 #pragma once
17 
18 #include <geos/edgegraph/HalfEdge.h>
19 
20 #include <geos/export.h>
21 #include <string>
22 #include <cassert>
23 #include <map>
24 #include <array>
25 #include <memory>
26 #include <vector>
27 
28 // Forward declarations
29 namespace geos {
30 namespace geom {
31 class Coordinate;
32 }
33 }
34 
35 #undef EDGEGRAPH_HEAPHACK
36 
37 namespace geos {
38 namespace edgegraph { // geos.edgegraph
39 
40 
58 class GEOS_DLL EdgeGraph {
59 
60 private:
61 
62  std::deque<HalfEdge> edges;
63  std::map<geom::Coordinate, HalfEdge*> vertexMap;
64 
65  HalfEdge* create(const geom::Coordinate& p0, const geom::Coordinate& p1);
66 
67 
68 protected:
69 
78 
87  HalfEdge* insert(const geom::Coordinate& orig, const geom::Coordinate& dest, HalfEdge* eAdj);
88 
89 
90 public:
91 
95  EdgeGraph() {};
96 
109  HalfEdge* addEdge(const geom::Coordinate& orig, const geom::Coordinate& dest);
110 
118  static bool isValidEdge(const geom::Coordinate& orig, const geom::Coordinate& dest);
119 
120  void getVertexEdges(std::vector<const HalfEdge*>& edgesOut);
121 
131 
132 
133 
134 
135 
136 
137 };
138 
139 
140 } // namespace geos.edgegraph
141 } // namespace geos
142 
143 
144 
Definition: EdgeGraph.h:58
HalfEdge * createEdge(const geom::Coordinate &orig)
HalfEdge * insert(const geom::Coordinate &orig, const geom::Coordinate &dest, HalfEdge *eAdj)
static bool isValidEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
HalfEdge * addEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
HalfEdge * findEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
EdgeGraph()
Definition: EdgeGraph.h:95
Definition: HalfEdge.h:63
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26