static void CallCombine(Tesselator tess, ContourVertex intersectionVertex, int[] vertexIndexArray, double[] vertexWeights, bool needed)
{
/* Copy coord data in case the callback changes it. */
double c0 = intersectionVertex.C_0;
double c1 = intersectionVertex.C_1;
double c2 = intersectionVertex.C_2;
intersectionVertex.clientIndex = 0;
tess.CallCombine(c0, c1, c2, vertexIndexArray, vertexWeights, out intersectionVertex.clientIndex);
if (intersectionVertex.clientIndex == 0)
{
if (!needed)
{
intersectionVertex.clientIndex = vertexIndexArray[0];
}
else
{
/* The only fatal error is when two edges are found to intersect,
* but the user has not provided the callback necessary to handle
* generated intersection points.
*/
throw new Exception("You need to provided a callback to handle generated intersection points.");
}
}
}