OGS
EarClippingTriangulation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <list>
7#include <vector>
8
10
11namespace GeoLib
12{
13class Polygon;
14class Triangle;
15
17{
18public:
20 std::list<GeoLib::Triangle>& triangles,
21 bool rot = true);
23
24private:
28 inline void copyPolygonPoints(GeoLib::Polygon const& polygon);
29 inline void ensureCWOrientation();
30
31 inline bool isEar(std::size_t v0, std::size_t v1, std::size_t v2) const;
32
33 inline void initVertexList();
34 inline void initLists();
35 inline void clipEars();
36 void addLastTriangle();
37
41 std::vector<GeoLib::Point*> _pnts;
42 std::list<std::size_t> _vertex_list;
43 std::list<std::size_t> _convex_vertex_list;
44 std::list<std::size_t> _ear_list;
45
49 std::list<GeoLib::Triangle> _triangles;
50
52};
53} // end namespace GeoLib
bool isEar(std::size_t v0, std::size_t v1, std::size_t v2) const
std::vector< GeoLib::Point * > _pnts
EarClippingTriangulation(GeoLib::Polygon const &polygon, std::list< GeoLib::Triangle > &triangles, bool rot=true)
std::list< std::size_t > _convex_vertex_list
void copyPolygonPoints(GeoLib::Polygon const &polygon)
std::list< GeoLib::Triangle > _triangles
Class Triangle consists of a reference to a point vector and a vector that stores the indices in the ...
Definition Triangle.h:21