GEOS 3.11.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
29namespace geos {
30namespace geom {
31class Coordinate;
32}
33}
34
35#undef EDGEGRAPH_HEAPHACK
36
37namespace geos {
38namespace edgegraph { // geos.edgegraph
39
40
58class GEOS_DLL EdgeGraph {
59
60private:
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
68protected:
69
78
87 HalfEdge* insert(const geom::Coordinate& orig, const geom::Coordinate& dest, HalfEdge* eAdj);
88
89
90public:
91
96
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 * addEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
HalfEdge * findEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
static bool isValidEdge(const geom::Coordinate &orig, const geom::Coordinate &dest)
HalfEdge * createEdge(const geom::Coordinate &orig)
HalfEdge * insert(const geom::Coordinate &orig, const geom::Coordinate &dest, HalfEdge *eAdj)
EdgeGraph()
Definition: EdgeGraph.h:95
Definition: HalfEdge.h:63
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic namespace for all GEOS functionalities.
Definition: geos.h:39