GEOS  3.9.1dev
EdgeGraph.h
Go to the documentation of this file.
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 
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 
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 
77  HalfEdge* createEdge(const geom::Coordinate& orig);
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 
130  HalfEdge* findEdge(const geom::Coordinate& orig, const geom::Coordinate& dest);
131 
132 
133 
134 
135 
136 
137 };
138 
139 
140 } // namespace geos.edgegraph
141 } // namespace geos
142 
143 
144 
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
std::map< geom::Coordinate, HalfEdge * > vertexMap
Definition: EdgeGraph.h:63
Basic namespace for all GEOS functionalities.
std::deque< HalfEdge > edges
Definition: EdgeGraph.h:62