38 #ifndef __CU_SIMPLE_TRIANGULATOR_H__
39 #define __CU_SIMPLE_TRIANGULATOR_H__
41 #include <cugl/math/CUPoly2.h>
42 #include <cugl/math/CUVec2.h>
86 std::vector<Vec2> _input;
88 std::vector<VertexType> _types;
90 std::vector<unsigned short> _naive;
92 std::vector<unsigned short> _output;
98 #pragma mark Constructors
134 #pragma mark Initialization
151 _input = poly._vertices;
165 void set(
const std::vector<Vec2>& points) {
174 _output.clear(); _naive.clear(); _types.clear();
185 _input.clear(); _output.clear(); _naive.clear(); _types.clear();
189 #pragma mark Calculation
196 #pragma mark Materialization
259 #pragma mark Internal Data Generation
273 VertexType computeSpannedAreaType(
const Vec2& p1,
const Vec2& p2,
const Vec2& p3);
282 bool areVerticesClockwise (
const std::vector<Vec2>& vertices);
293 void cutEarTip(
int earTipIndex);
305 bool isEarTip (
int earTipIndex);
327 VertexType classifyVertex (
int index);
339 void computeTriangulation();