10 static const float EPSILON = 0.0000000001f;
33 int n = (int)contour.size();
41 if (0.0
f <
Area(contour))
42 for (
int v = 0;
v <
n;
v++)
45 for (
int v = 0;
v <
n;
v++)
53 for (
int m = 0,
v = nv - 1; nv > 2;)
73 if (
Snip(contour, u,
v, w, nv, V))
83 result.push_back(contour[a].
index);
84 result.push_back(contour[b].index);
85 result.push_back(contour[c].index);
90 for (s =
v, t =
v + 1; t < nv; s++, t++)
108 int n = (int)contour.size();
112 for (
int p = n - 1,
q = 0;
q <
n;
p =
q++)
114 A += contour[
p].x * contour[
q].y - contour[
q].x * contour[
p].y;
126 float ax, ay, bx,
by, cx, cy, apx, apy, bpx, bpy, cpx, cpy;
127 float cCROSSap, bCROSScp, aCROSSbp;
142 aCROSSbp = ax * bpy - ay * bpx;
143 cCROSSap = cx * apy - cy * apx;
144 bCROSScp = bx * cpy - by * cpx;
146 return ((aCROSSbp >= 0.0
f) && (bCROSScp >= 0.0
f) && (cCROSSap >= 0.0
f));
153 float Ax, Ay, Bx, By, Cx, Cy, Px, Py;
155 Ax = contour[V[u]].x;
156 Ay = contour[V[u]].y;
158 Bx = contour[V[
v]].x;
159 By = contour[V[
v]].y;
161 Cx = contour[V[
w]].x;
162 Cy = contour[V[
w]].y;
164 if (
EPSILON > (((Bx - Ax) * (Cy - Ay)) - ((By - Ay) * (Cx - Ax))))
167 for (p = 0; p <
n; p++)
169 if ((p == u) || (p == v) || (p == w))
171 Px = contour[V[
p]].x;
172 Py = contour[V[
p]].y;
static bool Process(const tr_vertexVector &contour, tr_intVector &result)
Definition: Triangulate.h:28
GLubyte GLubyte GLubyte GLubyte w
Definition: khronos-glext.h:6793
static const float EPSILON
Definition: Triangulate.h:10
static float Area(const tr_vertexVector &contour)
Definition: Triangulate.h:105
std::vector< int > tr_intVector
Definition: Triangulate.h:21
GLuint GLuint GLsizei count
Definition: khronos-glext.h:6343
GLboolean GLboolean GLboolean GLboolean a
Definition: khronos-glext.h:6895
GLuint index
Definition: khronos-glext.h:6722
GLbyte by
Definition: khronos-glext.h:9725
float x
Definition: Triangulate.h:14
static bool Snip(const tr_vertexVector &contour, int u, int v, int w, int n, int *V)
Definition: Triangulate.h:150
GLfloat f
Definition: khronos-glext.h:8258
const GLubyte * c
Definition: khronos-glext.h:9864
GLfloat GLfloat p
Definition: khronos-glext.h:9861
static bool InsideTriangle(float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py)
Definition: Triangulate.h:121
float y
Definition: Triangulate.h:15
GLdouble GLdouble t
Definition: khronos-glext.h:6449
const GLfloat * m
Definition: khronos-glext.h:12117
int index
Definition: Triangulate.h:16
std::vector< tr_vertex > tr_vertexVector
Definition: Triangulate.h:19
GLuint64EXT * result
Definition: khronos-glext.h:12573
Definition: Triangulate.h:12
Definition: Triangulate.h:23
GLdouble s
Definition: khronos-glext.h:6441
GLdouble n
Definition: khronos-glext.h:8447
GLboolean GLboolean GLboolean b
Definition: khronos-glext.h:6895
GLdouble GLdouble GLdouble GLdouble q
Definition: khronos-glext.h:6465
const GLdouble * v
Definition: khronos-glext.h:6442