GEOS 3.14.0dev
TriDelaunayImprover.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#include <geos/triangulate/tri/Tri.h>
19#include <geos/triangulate/tri/TriList.h>
20
21
22// Forward declarations
23namespace geos {
24namespace geom {
25class Coordinate;
26}
27}
28
29namespace geos {
30namespace triangulate {
31namespace polygon {
32
33
43class GEOS_DLL TriDelaunayImprover {
46 template<typename TriType>
48
49private:
50
51 // Members
52 static constexpr std::size_t MAX_ITERATION = 200;
53 TriList<Tri>& triList;
54
63 std::size_t improveScan(TriList<Tri>& triList);
64
72 bool improveNonDelaunay(Tri* tri, TriIndex index);
73
87 static bool isConvex(const Coordinate& adj0, const Coordinate& adj1,
88 const Coordinate& opp0, const Coordinate& opp1);
89
102 static bool isDelaunay(const Coordinate& adj0, const Coordinate& adj1,
103 const Coordinate& opp0, const Coordinate& opp1);
104
115 static bool
116 isInCircle(const Coordinate& a, const Coordinate& b,
117 const Coordinate& c, const Coordinate& p);
118
119 void improve();
120
121
122public:
123
125 : triList(p_triList)
126 {};
127
136 static void improve(TriList<Tri>& triList);
137
138
139};
140
141
142
143} // namespace geos.triangulate.polygon
144} // namespace geos.triangulate
145} // namespace geos
146
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Definition TriDelaunayImprover.h:43
static void improve(TriList< Tri > &triList)
Definition TriList.h:50
Definition Tri.h:45
Basic namespace for all GEOS functionalities.
Definition geos.h:39