GEOS  3.10.0
TriangulationBuilder.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 #pragma once
16 
17 #include <geos/triangulate/tri/TriEdge.h>
18 
19 #include <memory>
20 #include <unordered_map>
21 
22 // Forward declarations
23 namespace geos {
24 namespace geom {
25 class Coordinate;
26 }
27 namespace triangulate {
28 namespace tri {
29 class Tri;
30 class TriList;
31 }
32 }
33 }
34 
36 
37 namespace geos { // geos.
38 namespace triangulate { // geos.triangulate
39 namespace tri { // geos.triangulate.tri
40 
41 
49 class GEOS_DLL TriangulationBuilder {
50 
51 private:
52 
53  // Members
54  std::unordered_map<TriEdge, Tri*, TriEdge::HashCode> triMap;
55 
56  Tri* find(const Coordinate& p0, const Coordinate& p1) const;
57 
58  void add(Tri* tri);
59 
60  void addAdjacent(Tri* tri, Tri* adj, const Coordinate& p0, const Coordinate& p1);
61 
62 
63 public:
64 
65  TriangulationBuilder(TriList& triList);
66 
72  static void build(TriList& triList);
73 
74 
75 };
76 
77 
78 
79 
80 
81 
82 
83 } // namespace geos.triangulate.tri
84 } // namespace geos.triangulate
85 } // namespace geos
86 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Definition: TriList.h:48
Definition: Tri.h:50
Definition: TriangulationBuilder.h:49
static void build(TriList &triList)
Basic namespace for all GEOS functionalities.
Definition: Angle.h:26