78 lines
1.8 KiB
C#
78 lines
1.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using TriangleNet.Data;
|
|
|
|
namespace TriangleNet.Tools
|
|
{
|
|
// Token: 0x02000019 RID: 25
|
|
public class RegionIterator
|
|
{
|
|
// Token: 0x060000D9 RID: 217 RVA: 0x00013CE0 File Offset: 0x00011EE0
|
|
public RegionIterator(Mesh mesh)
|
|
{
|
|
this.mesh = mesh;
|
|
this.viri = new List<Triangle>();
|
|
}
|
|
|
|
// Token: 0x060000DA RID: 218 RVA: 0x00013CFC File Offset: 0x00011EFC
|
|
private void ProcessRegion(Action<Triangle> func)
|
|
{
|
|
Otri otri = default(Otri);
|
|
Otri otri2 = default(Otri);
|
|
Osub osub = default(Osub);
|
|
Behavior behavior = this.mesh.behavior;
|
|
for (int i = 0; i < this.viri.Count; i++)
|
|
{
|
|
otri.triangle = this.viri[i];
|
|
otri.Uninfect();
|
|
func(otri.triangle);
|
|
otri.orient = 0;
|
|
while (otri.orient < 3)
|
|
{
|
|
otri.Sym(ref otri2);
|
|
otri.SegPivot(ref osub);
|
|
if (otri2.triangle != Mesh.dummytri && !otri2.IsInfected() && osub.seg == Mesh.dummysub)
|
|
{
|
|
otri2.Infect();
|
|
this.viri.Add(otri2.triangle);
|
|
}
|
|
otri.orient++;
|
|
}
|
|
otri.Infect();
|
|
}
|
|
foreach (Triangle triangle in this.viri)
|
|
{
|
|
triangle.infected = false;
|
|
}
|
|
this.viri.Clear();
|
|
}
|
|
|
|
// Token: 0x060000DB RID: 219 RVA: 0x00013E34 File Offset: 0x00012034
|
|
public void Process(Triangle triangle)
|
|
{
|
|
this.Process(triangle, delegate(Triangle tri)
|
|
{
|
|
tri.region = triangle.region;
|
|
});
|
|
}
|
|
|
|
// Token: 0x060000DC RID: 220 RVA: 0x00013E66 File Offset: 0x00012066
|
|
public void Process(Triangle triangle, Action<Triangle> func)
|
|
{
|
|
if (triangle != Mesh.dummytri && !Otri.IsDead(triangle))
|
|
{
|
|
triangle.infected = true;
|
|
this.viri.Add(triangle);
|
|
this.ProcessRegion(func);
|
|
}
|
|
this.viri.Clear();
|
|
}
|
|
|
|
// Token: 0x040000A7 RID: 167
|
|
private Mesh mesh;
|
|
|
|
// Token: 0x040000A8 RID: 168
|
|
private List<Triangle> viri;
|
|
}
|
|
}
|