OGS
EarClippingTriangulation.h
Go to the documentation of this file.
1
15#pragma once
16
17#include <list>
18#include <vector>
19
20#include "AnalyticalGeometry.h"
21
22namespace GeoLib
23{
24class Polygon;
25class Triangle;
26
28{
29public:
31 std::list<GeoLib::Triangle>& triangles,
32 bool rot = true);
34
35private:
39 inline void copyPolygonPoints(GeoLib::Polygon const& polygon);
40 inline void ensureCWOrientation();
41
42 inline bool isEar(std::size_t v0, std::size_t v1, std::size_t v2) const;
43
44 inline void initVertexList();
45 inline void initLists();
46 inline void clipEars();
47 void addLastTriangle();
48
52 std::vector<GeoLib::Point*> _pnts;
53 std::list<std::size_t> _vertex_list;
54 std::list<std::size_t> _convex_vertex_list;
55 std::list<std::size_t> _ear_list;
56
60 std::list<GeoLib::Triangle> _triangles;
61
63};
64} // end namespace GeoLib
Definition of analytical geometry functions.
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