forked from gradientspace/geometry3Sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MeshOps.cs
42 lines (34 loc) · 1.02 KB
/
MeshOps.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
namespace g3
{
public struct SetGroupBehavior
{
public enum Modes
{
Ignore = 0,
AutoGenerate = 1,
UseConstant = 2
};
Modes Mode;
int SetGroupID;
public SetGroupBehavior(Modes mode, int id = 0) {
Mode = mode;
SetGroupID = id;
}
public int GetGroupID(DMesh3 mesh)
{
if (Mode == Modes.Ignore)
return -1;
else if (Mode == Modes.AutoGenerate)
return mesh.AllocateTriangleGroup();
else
return SetGroupID;
}
public static SetGroupBehavior Ignore { get { return new SetGroupBehavior(Modes.Ignore, 0); } }
public static SetGroupBehavior AutoGenerate { get { return new SetGroupBehavior(Modes.AutoGenerate, 0); } }
public static SetGroupBehavior SetTo(int groupID) { return new SetGroupBehavior(Modes.UseConstant, groupID); }
}
public static class MeshOps
{
}
}