GEOS  3.14.0dev
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 #undef EDGEGRAPH_HEAPHACK
29 
30 namespace geos {
31 namespace edgegraph { // geos.edgegraph
32 
33 
51 class GEOS_DLL EdgeGraph {
52 
53 private:
54 
55  std::deque<HalfEdge> edges;
56  std::map<geom::CoordinateXY, HalfEdge*> vertexMap;
57 
58  HalfEdge* create(const geom::CoordinateXYZM& p0, const geom::CoordinateXYZM& p1);
59 
60 
61 protected:
62 
70  HalfEdge* createEdge(const geom::CoordinateXYZM& orig);
71 
80  HalfEdge* insert(const geom::CoordinateXYZM& orig, const geom::CoordinateXYZM& dest, HalfEdge* eAdj);
81 
82 
83 public:
84 
88  EdgeGraph() {};
89 
102  HalfEdge* addEdge(const geom::CoordinateXYZM& orig, const geom::CoordinateXYZM& dest);
103 
111  static bool isValidEdge(const geom::CoordinateXY& orig, const geom::CoordinateXY& dest);
112 
113  void getVertexEdges(std::vector<const HalfEdge*>& edgesOut);
114 
123  HalfEdge* findEdge(const geom::CoordinateXY& orig, const geom::CoordinateXY& dest);
124 
125 
126 
127 
128 
129 
130 };
131 
132 
133 } // namespace geos.edgegraph
134 } // namespace geos
135 
136 
137 
Definition: EdgeGraph.h:51
HalfEdge * insert(const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest, HalfEdge *eAdj)
static bool isValidEdge(const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
HalfEdge * createEdge(const geom::CoordinateXYZM &orig)
HalfEdge * addEdge(const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest)
HalfEdge * findEdge(const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
EdgeGraph()
Definition: EdgeGraph.h:88
Definition: HalfEdge.h:56
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25