public bool CheckDelaunay()
{
Otri otri = new Otri();
Otri otri1 = new Otri();
Osub osub = new Osub();
bool noExact = Behavior.NoExact;
Behavior.NoExact = false;
int num = 0;
foreach (Triangle value in this.mesh.triangles.Values)
{
otri.triangle = value;
otri.orient = 0;
while (otri.orient < 3)
{
Vertex vertex = otri.Org();
Vertex vertex1 = otri.Dest();
Vertex vertex2 = otri.Apex();
otri.Sym(ref otri1);
Vertex vertex3 = otri1.Apex();
bool flag = (otri1.triangle == Mesh.dummytri || Otri.IsDead(otri1.triangle) || otri.triangle.id >= otri1.triangle.id || !(vertex != this.mesh.infvertex1) || !(vertex != this.mesh.infvertex2) || !(vertex != this.mesh.infvertex3) || !(vertex1 != this.mesh.infvertex1) || !(vertex1 != this.mesh.infvertex2) || !(vertex1 != this.mesh.infvertex3) || !(vertex2 != this.mesh.infvertex1) || !(vertex2 != this.mesh.infvertex2) || !(vertex2 != this.mesh.infvertex3) || !(vertex3 != this.mesh.infvertex1) || !(vertex3 != this.mesh.infvertex2) ? false : vertex3 != this.mesh.infvertex3);
if (this.mesh.checksegments & flag)
{
otri.SegPivot(ref osub);
if (osub.seg != Mesh.dummysub)
{
flag = false;
}
}
if (flag && Primitives.NonRegular(vertex, vertex1, vertex2, vertex3) > 0)
{
this.logger.Warning(string.Format("Non-regular pair of triangles found (IDs {0}/{1}).", otri.triangle.id, otri1.triangle.id), "Quality.CheckDelaunay()");
num++;
}
otri.orient = otri.orient + 1;
}
}
if (num == 0)
{
this.logger.Info("Mesh is Delaunay.");
}
Behavior.NoExact = noExact;
return(num == 0);
}