GEOS  3.13.0dev
HullTriangulation.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2021 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/algorithm/hull/HullTri.h>
18 #include <geos/triangulate/tri/Tri.h>
19 #include <geos/triangulate/tri/TriList.h>
20 #include <geos/triangulate/quadedge/TriangleVisitor.h>
21 
22 
23 namespace geos {
24 namespace geom {
25 class Geometry;
26 class GeometryFactory;
27 class Coordinate;
28 }
29 namespace triangulate {
30 namespace quadedge {
31 class QuadEdge;
33 }
34 }
35 }
36 
45 
46 
47 namespace geos {
48 namespace algorithm { // geos::algorithm
49 namespace hull { // geos::algorithm::hull
50 
51 
52 class HullTriangulation
53 {
54 
55 private:
56 
57  static void toTris(
58  QuadEdgeSubdivision& subdiv,
59  TriList<HullTri>& triList);
60 
71  static geom::CoordinateSequence traceBoundary(
72  TriList<HullTri>& triList);
73 
74  static HullTri* findBorderTri(
75  TriList<HullTri>& triList);
76 
77 
78 
79 public:
80 
81  HullTriangulation() {};
82 
83  static void createDelaunayTriangulation(
84  const Geometry* geom,
85  TriList<HullTri>& triList);
86 
95  static std::unique_ptr<Geometry> traceBoundaryPolygon(
96  TriList<HullTri>& triList,
97  const GeometryFactory* factory);
98 
99  static HullTri* nextBorderTri(HullTri* triStart);
100 
109  static std::unique_ptr<Geometry> geomunion(
110  TriList<HullTri>& triList,
111  const GeometryFactory* factory);
112 
113 
114  class HullTriVisitor : public TriangleVisitor
115  {
116 
117  private:
118 
119  TriList<HullTri>& triList;
120 
121  public:
122 
123  HullTriVisitor(TriList<HullTri>& p_triList)
124  : triList(p_triList)
125  {};
126 
127  void visit(std::array<QuadEdge*, 3>& triEdges);
128 
129  }; // HullTriVisitor
130 
131 
132 }; // HullTriangulation
133 
134 
135 
136 } // geos::algorithm::hull
137 } // geos::algorithm
138 } // geos
139 
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:216
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:65
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
A class that contains the QuadEdges representing a planar subdivision that models a triangulation.
Definition: QuadEdgeSubdivision.h:78
A class that represents the edge data structure which implements the quadedge algebra.
Definition: QuadEdge.h:53
An interface for algorithms which process the triangles in a QuadEdgeSubdivision.
Definition: TriangleVisitor.h:33
Definition: TriList.h:54
Definition: Tri.h:49
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25