TriangulationBuilder.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/TriList.h>
#include <memory>
#include <unordered_map>
// Forward declarations
namespace geos {
namespace geom {
class Coordinate;
}
namespace triangulate {
namespace tri {
class Tri;
}
}
}
namespace geos { // geos.
namespace triangulate { // geos.triangulate
namespace tri { // geos.triangulate.tri
class GEOS_DLL TriangulationBuilder {
using Coordinate = geos::geom::Coordinate;
private:
// Members
std::unordered_map<TriEdge, Tri*, TriEdge::HashCode> triMap;
// Methods
Tri* find(const Coordinate& p0, const Coordinate& p1) const;
void addAdjacent(Tri* tri, Tri* adj, const Coordinate& p0, const Coordinate& p1);
public:
TriangulationBuilder(TriList<Tri>& triList);
TriangulationBuilder() {};
void add(Tri* tri);
static void build(TriList<Tri>& triList);
};
} // namespace geos.triangulate.tri
} // namespace geos.triangulate
} // namespace geos
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
geos::triangulate::tri::TriList
Definition TriList.h:50
geos::triangulate::tri::Tri
Definition Tri.h:45
geos::triangulate::tri::TriangulationBuilder::build
static void build(TriList< Tri > &triList)
geos::geom
Definition Angle.h:26
geos::triangulate
Classes to compute Delaunay triangulations.
Definition ConcaveHull.h:32
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38