GEOS
3.14.0dev
include
geos
triangulate
polygon
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
23
namespace
geos
{
24
namespace
geom {
25
class
Coordinate;
26
}
27
}
28
29
namespace
geos
{
30
namespace
triangulate {
31
namespace
polygon {
32
33
43
class
GEOS_DLL
TriDelaunayImprover
{
44
using
Coordinate
=
geos::geom::Coordinate
;
45
using
Tri
=
geos::triangulate::tri::Tri
;
46
template
<
typename
TriType>
47
using
TriList
=
geos::triangulate::tri::TriList<TriType>
;
48
49
private
:
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
122
public
:
123
124
TriDelaunayImprover
(
TriList<Tri>
& p_triList)
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
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition
Coordinate.h:217
geos::triangulate::polygon::TriDelaunayImprover
Definition
TriDelaunayImprover.h:43
geos::triangulate::polygon::TriDelaunayImprover::improve
static void improve(TriList< Tri > &triList)
geos::triangulate::tri::TriList
Definition
TriList.h:50
geos::triangulate::tri::Tri
Definition
Tri.h:45
geos
Basic namespace for all GEOS functionalities.
Definition
geos.h:39
Generated by
1.9.8