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
30namespace geos {
31namespace edgegraph { // geos.edgegraph
32
33
51class GEOS_DLL EdgeGraph {
52
53private:
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
61protected:
62
70 HalfEdge* createEdge(const geom::CoordinateXYZM& orig);
71
80 HalfEdge* insert(const geom::CoordinateXYZM& orig, const geom::CoordinateXYZM& dest, HalfEdge* eAdj);
81
82
83public:
84
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
static bool isValidEdge(const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
HalfEdge * insert(const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest, HalfEdge *eAdj)
HalfEdge * addEdge(const geom::CoordinateXYZM &orig, const geom::CoordinateXYZM &dest)
HalfEdge * findEdge(const geom::CoordinateXY &orig, const geom::CoordinateXY &dest)
HalfEdge * createEdge(const geom::CoordinateXYZM &orig)
EdgeGraph()
Definition EdgeGraph.h:88
Definition HalfEdge.h:56
Basic namespace for all GEOS functionalities.
Definition geos.h:39