TriDelaunayImprover.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************/
#pragma once
#include <geos/triangulate/tri/TriEdge.h>
#include <geos/triangulate/tri/Tri.h>
#include <geos/triangulate/tri/TriList.h>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
}
namespace geos {
namespace triangulate {
namespace polygon {
class GEOS_DLL TriDelaunayImprover {
using Coordinate = geos::geom::Coordinate;
using Tri = geos::triangulate::tri::Tri;
template<typename TriType>
using TriList = geos::triangulate::tri::TriList<TriType>;
private:
// Members
static constexpr std::size_t MAX_ITERATION = 200;
TriList<Tri>& triList;
std::size_t improveScan(TriList<Tri>& triList);
bool improveNonDelaunay(Tri* tri, TriIndex index);
static bool isConvex(const Coordinate& adj0, const Coordinate& adj1,
const Coordinate& opp0, const Coordinate& opp1);
static bool isDelaunay(const Coordinate& adj0, const Coordinate& adj1,
const Coordinate& opp0, const Coordinate& opp1);
static bool
isInCircle(const Coordinate& a, const Coordinate& b,
const Coordinate& c, const Coordinate& p);
void improve();
public:
TriDelaunayImprover(TriList<Tri>& p_triList)
: triList(p_triList)
{};
static void improve(TriList<Tri>& triList);
};
} // namespace geos.triangulate.polygon
} // namespace geos.triangulate
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
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::geom
Definition Angle.h:26
geos::index
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
geos::triangulate
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38